Thread (8 messages) flat view 8 messages, 2 authors, 2021-10-14

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

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.
+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.
+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;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help