diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-06-02 19:20:12 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-03 13:30:43 -0700 |
commit | a54a8b71f6faca9a794c285e2ecde74a0dbec65a (patch) | |
tree | b2abca806259f051e8345ab174b72da9c86ca20c /include/linux/pcs/pcs-xpcs.h | |
parent | b81017aeee4eb9159296cdb68889932649317b9b (diff) |
net: pcs: xpcs: there is only one PHY ID
The xpcs driver has an apparently inadequate structure for the actual
hardware it drives.
These defines and the xpcs_probe() function would suggest that there is
one PHY ID per supported PHY interface type, and the driver simply
validates whether the mode it should operate in (the argument of
xpcs_probe) matches what the hardware is capable of:
#define SYNOPSYS_XPCS_USXGMII_ID 0x7996ced0
#define SYNOPSYS_XPCS_10GKR_ID 0x7996ced0
#define SYNOPSYS_XPCS_XLGMII_ID 0x7996ced0
#define SYNOPSYS_XPCS_SGMII_ID 0x7996ced0
#define SYNOPSYS_XPCS_MASK 0xffffffff
but that is not the case, because upon closer inspection, all the above
4 PHY ID definitions are in fact equal.
So it is the same XPCS that is compatible with all 4 sets of PHY
interface types.
This change introduces an array of struct xpcs_compat which is populated
by the single struct xpcs_id instance. It also eliminates the bogus
defines for multiple Synopsys XPCS PHY IDs and replaces them with a
single XPCS_ID, which better reflects the way in which the hardware
operates.
Because we are touching this area of the code anyway, the new array of
struct xpcs_compat, as well as the array of xpcs_id, have been moved
towards the end of the file, since they are variable declarations not
definitions. If whichever of struct xpcs_compat or struct xpcs_id need
to gain a function pointer member in the future, it is easier to
reference functions (no forward declarations needed) if we have the
const variable declarations at the end of the file.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/pcs/pcs-xpcs.h')
0 files changed, 0 insertions, 0 deletions