diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-02-27 13:07:15 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-02 03:15:04 -0800 |
commit | 3f39a5e9bff000025c2679101b4f83e4fc21dbba (patch) | |
tree | b5a9632720383e3309e170da6c38f6468dbfd5ee /drivers/net/sfc/mdio_10g.h | |
parent | f794fd440066ccd7d601f405f80aa514b95f15d1 (diff) | |
download | blackbird-op-linux-3f39a5e9bff000025c2679101b4f83e4fc21dbba.tar.gz blackbird-op-linux-3f39a5e9bff000025c2679101b4f83e4fc21dbba.zip |
sfc: Fix reporting of PHY id
Shuffle bits of the OUI into the conventional written order.
Replace PHY id component macros with functions.
Zero-pad PHY id components in log messages.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/mdio_10g.h')
-rw-r--r-- | drivers/net/sfc/mdio_10g.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/sfc/mdio_10g.h b/drivers/net/sfc/mdio_10g.h index 8ba49773ce7e..7014d2279c20 100644 --- a/drivers/net/sfc/mdio_10g.h +++ b/drivers/net/sfc/mdio_10g.h @@ -70,10 +70,10 @@ #define MDIO_MMDREG_STAT1_LPABLE_LBN (1) #define MDIO_MMDREG_STAT1_LPABLE_WIDTH (1) -/* Bits in ID reg */ -#define MDIO_ID_REV(_id32) (_id32 & 0xf) -#define MDIO_ID_MODEL(_id32) ((_id32 >> 4) & 0x3f) -#define MDIO_ID_OUI(_id32) (_id32 >> 10) +/* Bits in combined ID regs */ +static inline unsigned mdio_id_rev(u32 id) { return id & 0xf; } +static inline unsigned mdio_id_model(u32 id) { return (id >> 4) & 0x3f; } +extern unsigned mdio_id_oui(u32 id); /* Bits in MMDREG_DEVS0/1. Someone thoughtfully layed things out * so the 'bit present' bit number of an MMD is the number of |