Skip to content

Commit 89776a6

Browse files
jacob-kelleranguy11
authored andcommitted
ice: check netlist before enabling ICE_F_GNSS
Similar to the change made for ICE_F_SMA_CTRL, check the netlist before enabling support for ICE_F_GNSS. This ensures that the driver only enables the GNSS feature on devices which actually have the feature enabled in the firmware device configuration. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 42d40bb commit 89776a6

4 files changed

Lines changed: 21 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,7 @@ struct ice_aqc_link_topo_params {
13931393
#define ICE_AQC_LINK_TOPO_NODE_TYPE_ID_EEPROM 8
13941394
#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_CTRL 9
13951395
#define ICE_AQC_LINK_TOPO_NODE_TYPE_CLK_MUX 10
1396+
#define ICE_AQC_LINK_TOPO_NODE_TYPE_GPS 11
13961397
#define ICE_AQC_LINK_TOPO_NODE_CTX_S 4
13971398
#define ICE_AQC_LINK_TOPO_NODE_CTX_M \
13981399
(0xF << ICE_AQC_LINK_TOPO_NODE_CTX_S)
@@ -1435,6 +1436,7 @@ struct ice_aqc_get_link_topo {
14351436
#define ICE_AQC_GET_LINK_TOPO_NODE_NR_E822_PHY 0x30
14361437
#define ICE_AQC_GET_LINK_TOPO_NODE_NR_C827 0x31
14371438
#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_CLK_MUX 0x47
1439+
#define ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS 0x48
14381440
u8 rsvd[9];
14391441
};
14401442

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,21 @@ bool ice_is_pf_c827(struct ice_hw *hw)
27642764
return false;
27652765
}
27662766

2767+
/**
2768+
* ice_is_gps_in_netlist
2769+
* @hw: pointer to the hw struct
2770+
*
2771+
* Check if the GPS generic device is present in the netlist
2772+
*/
2773+
bool ice_is_gps_in_netlist(struct ice_hw *hw)
2774+
{
2775+
if (ice_find_netlist_node(hw, ICE_AQC_LINK_TOPO_NODE_TYPE_GPS,
2776+
ICE_AQC_GET_LINK_TOPO_NODE_NR_GEN_GPS, NULL))
2777+
return false;
2778+
2779+
return true;
2780+
}
2781+
27672782
/**
27682783
* ice_aq_list_caps - query function/device capabilities
27692784
* @hw: pointer to the HW struct

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qual_mods, u8 report_mode,
9393
struct ice_aqc_get_phy_caps_data *caps,
9494
struct ice_sq_cd *cd);
9595
bool ice_is_pf_c827(struct ice_hw *hw);
96+
bool ice_is_gps_in_netlist(struct ice_hw *hw);
9697
int
9798
ice_find_netlist_node(struct ice_hw *hw, u8 node_type_ctx, u8 node_part_number,
9899
u16 *node_handle);

drivers/net/ethernet/intel/ice/ice_gnss.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ bool ice_gnss_is_gps_present(struct ice_hw *hw)
389389
if (!hw->func_caps.ts_func_info.src_tmr_owned)
390390
return false;
391391

392+
if (!ice_is_gps_in_netlist(hw))
393+
return false;
394+
392395
#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
393396
if (ice_is_e810t(hw)) {
394397
int err;

0 commit comments

Comments
 (0)