Re: [PATCH net-next 3/4] ice: Add support for SMA control multiplexer

From
Jakub Kicinski <kuba@kernel.org>
Date
2021-10-13 23:19:11
Reply to
Tony Nguyen, 2021-10-12
On Tue, 12 Oct 2021 09:31:52 -0700 Tony Nguyen wrote:
From: Maciej Machnikowski <redacted>

E810-T adapters have two external bidirectional SMA connectors and two
internal unidirectional U.FL connectors. Multiplexing between U.FL and
SMA and SMA direction is controlled using the PCA9575 expander.

Add support for the PCA9575 detection and control of the respective pins
of the SMA/U.FL multiplexer using the GPIO AQ API.
quoted hunk ↗ jump to hunk
+static int
+ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle)
+{
+	struct ice_aqc_get_link_topo *cmd;
+	struct ice_aq_desc desc;
+	int status;
+	u8 idx;
+
+	if (!hw || !pca9575_handle)
+		return -EINVAL;
Looks like purest form of defensive programming, please drop this.
quoted hunk ↗ jump to hunk
+bool ice_is_pca9575_present(struct ice_hw *hw)
+{
+	u16 handle = 0;
+	int status;
+
+	if (!ice_is_e810t(hw))
+		return false;
+
+	status = ice_get_pca9575_handle(hw, &handle);
+	if (!status && handle)
+		return true;
+
+	return false;
+}
	return !status && handle;
Thread (8 messages) 8 messages, 2 authors, last reply 2021-10-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help