Skip to content

Commit 64fd7de

Browse files
Karol Kolacinskianguy11
authored andcommitted
ice: PTP: Rename macros used for PHY/QUAD port definitions
The ice_fill_phy_msg_e822 function uses several macros to specify the correct address when sending a sideband message to the PHY block in hardware. The names of these macros are fairly generic and confusing. Future development is going to extend the driver to support new hardware families which have different relationships between PHY and QUAD. Rename the macros for clarity and to indicate that they are E822 specific. This also matches closer to the hardware specification in the data sheet. Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com> 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>
1 parent be65a1a commit 64fd7de

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ ice_fill_phy_msg_e822(struct ice_sbq_msg_input *msg, u8 port, u16 offset)
294294
{
295295
int phy_port, phy, quadtype;
296296

297-
phy_port = port % ICE_PORTS_PER_PHY;
298-
phy = port / ICE_PORTS_PER_PHY;
299-
quadtype = (port / ICE_PORTS_PER_QUAD) % ICE_NUM_QUAD_TYPE;
297+
phy_port = port % ICE_PORTS_PER_PHY_E822;
298+
phy = port / ICE_PORTS_PER_PHY_E822;
299+
quadtype = (port / ICE_PORTS_PER_QUAD) % ICE_QUADS_PER_PHY_E822;
300300

301301
if (quadtype == 0) {
302302
msg->msg_addr_low = P_Q0_L(P_0_BASE + offset, phy_port);
@@ -628,7 +628,7 @@ ice_fill_quad_msg_e822(struct ice_sbq_msg_input *msg, u8 quad, u16 offset)
628628

629629
msg->dest_dev = rmn_0;
630630

631-
if ((quad % ICE_NUM_QUAD_TYPE) == 0)
631+
if ((quad % ICE_QUADS_PER_PHY_E822) == 0)
632632
addr = Q_0_BASE + offset;
633633
else
634634
addr = Q_1_BASE + offset;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -909,13 +909,13 @@ struct ice_hw {
909909
/* INTRL granularity in 1 us */
910910
u8 intrl_gran;
911911

912-
#define ICE_PHY_PER_NAC 1
913-
#define ICE_MAX_QUAD 2
914-
#define ICE_NUM_QUAD_TYPE 2
915-
#define ICE_PORTS_PER_QUAD 4
916-
#define ICE_PHY_0_LAST_QUAD 1
917-
#define ICE_PORTS_PER_PHY 8
918-
#define ICE_NUM_EXTERNAL_PORTS ICE_PORTS_PER_PHY
912+
#define ICE_PHY_PER_NAC_E822 1
913+
#define ICE_MAX_QUAD 2
914+
#define ICE_QUADS_PER_PHY_E822 2
915+
#define ICE_PORTS_PER_PHY_E822 8
916+
#define ICE_PORTS_PER_QUAD 4
917+
#define ICE_PORTS_PER_PHY_E810 4
918+
#define ICE_NUM_EXTERNAL_PORTS (ICE_MAX_QUAD * ICE_PORTS_PER_QUAD)
919919

920920
/* Active package version (currently active) */
921921
struct ice_pkg_ver active_pkg_ver;

0 commit comments

Comments
 (0)