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: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>
Date: 2021-10-14 15:45:39

On Wed, 2021-10-13 at 16:19 -0700, Jakub Kicinski wrote:
On Tue, 12 Oct 2021 09:31:52 -0700 Tony Nguyen wrote:
quoted
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
+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
+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;
Thanks for the review Jakub. Will make these adjustments as well as the
one from patch 4.

-Tony
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help