ice: introduce hw->phy_model for handling PTP PHY differences
authorJacob Keller <jacob.e.keller@intel.com>
Mon, 17 Jul 2023 22:17:13 +0000 (15:17 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 18 Sep 2023 17:39:10 +0000 (10:39 -0700)
commitbe16574609f14c67efd89d5d8f9f19ab7724bfc9
tree2029339e660e74ee3466545705738b026dcc972a
parent88c360e49f512ad50d77444e454331a38c9ba393
ice: introduce hw->phy_model for handling PTP PHY differences

The ice driver has PTP support which works across a couple of different
device families. The device families each have different PHY hardware which
have unique requirements for programming.

Today, there is E810-based hardware, and E822-based hardware. To handle
this, the driver checks the ice_is_e810() function to separate between the
two existing families of hardware.

Future development is going to add new hardware designs which have further
unique requirements. To make this easier, introduce a phy_model field to
the HW structure. This field represents what PHY model the current device
has, and is used to allow distinguishing which logic a particular device
needs.

This will make supporting future upcoming hardware easier, by providing an
obvious place to initialize the PHY model, and by already using switch/case
statements instead of the previous if statements.

Astute reviewers may notice that there are a handful of remaining checks
for ice_is_e810() left in ice_ptp.c  These conflict with some other
cleanup patches in development, and will be fixed in the near future.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp_hw.c
drivers/net/ethernet/intel/ice/ice_ptp_hw.h
drivers/net/ethernet/intel/ice/ice_type.h