ice: Refactor ice_aqc_link_topo_addr
Subsystems (2)
PATCH v3 1/1 ice: Refactor ice_aqc_link_topo_addr
Separate link topo parameters in struct ice_aqc_link_topo_addr into new struct ice_aqc_link_topo_params.
This keeps input parameters for the get_link_topo command in a separate structure and is required by future commands that operate only on link topo params without the node handle.
---
v2: Fix code style errors, Change pca9575_handle type returned by
ice_get_pca9575_handle to u16 v3: Clarified commit message --- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 6 +++++- drivers/net/ethernet/intel/ice/ice_common.c | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +5 -1
@@ -1283,7 +1283,7 @@ struct ice_aqc_set_mac_lb {u8 reserved[15 ]; }; -struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params {u8 lport_num;u8 lport_num_valid;#define ICE_AQC_LINK_TOPO_PORT_NUM_VALID BIT(0)
@@ -1309,6 +1309,10 @@ struct ice_aqc_link_topo_addr {#define ICE_AQC_LINK_TOPO_NODE_CTX_PROVIDED 4#define ICE_AQC_LINK_TOPO_NODE_CTX_OVERRIDE 5u8 index; +}; + +struct ice_aqc_link_topo_addr { +struct ice_aqc_link_topo_params topo_params;__le16 handle;#define ICE_AQC_LINK_TOPO_HANDLE_S 0#define ICE_AQC_LINK_TOPO_HANDLE_M (0x3FF << ICE_AQC_LINK_TOPO_HANDLE_S)
drivers/net/ethernet/intel/ice/ice_common.c +5 -3
@@ -240,11 +240,13 @@ ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type,ice_fill_dflt_direct_cmd_desc (&desc, ice_aqc_opc_get_link_topo); - cmd->addr.node_type_ctx = (ICE_AQC_LINK_TOPO_NODE_CTX_PORT << -ICE_AQC_LINK_TOPO_NODE_CTX_S ); + cmd->addr.topo_params.node_type_ctx = + (ICE_AQC_LINK_TOPO_NODE_CTX_PORT << +ICE_AQC_LINK_TOPO_NODE_CTX_S );/* set node type */ - cmd->addr.node_type_ctx |= (ICE_AQC_LINK_TOPO_NODE_TYPE_M & node_type); + cmd->addr.topo_params.node_type_ctx |= + (ICE_AQC_LINK_TOPO_NODE_TYPE_M & node_type);return ice_aq_send_cmd (pi->hw, &desc,NULL ,0 , cd); }
Signature · 1 line
2.26.3
Mekala
PATCH v3 1/1 ice: Refactor ice_aqc_link_topo_addr
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Maciej Machnikowski
Sent: Monday, August 30, 2021 5:26 AM
To: Machnikowski, Maciej <[email protected]>; intel-wired-lan at lists.osuosl.org
Cc: pmenzel at molgen.mpg.de
Subject: [Intel-wired-lan] [PATCH v3 intel-next] ice: Refactorice_aqc_link_topo_addrSeparate link topo parameters in struct
ice_aqc_link_topo_addrinto new structice_aqc_link_topo_params.
This keeps input parameters for theget_link_topocommand in a separate structure and is required by future commands that operate only on link topo params without the node handle.Signed-off-by Maciej Machnikowski <[email protected]>
Quoted 9 lines
---
v2: Fix code style errors, Changepca9575_handletype returned by
ice_get_pca9575_handleto u16
v3: Clarified commit message
---drivers/net/ethernet/intel/ice/ice_adminq_cmd.h| 6 +++++-drivers/net/ethernet/intel/ice/ice_common.c | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-)