diff options
Diffstat (limited to 'drivers/net/sfc/mdio_10g.c')
-rw-r--r-- | drivers/net/sfc/mdio_10g.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index 4462fb58a3a9..9f5ec3eb3418 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -17,6 +17,21 @@ | |||
17 | #include "boards.h" | 17 | #include "boards.h" |
18 | #include "workarounds.h" | 18 | #include "workarounds.h" |
19 | 19 | ||
20 | unsigned mdio_id_oui(u32 id) | ||
21 | { | ||
22 | unsigned oui = 0; | ||
23 | int i; | ||
24 | |||
25 | /* The bits of the OUI are designated a..x, with a=0 and b variable. | ||
26 | * In the id register c is the MSB but the OUI is conventionally | ||
27 | * written as bytes h..a, p..i, x..q. Reorder the bits accordingly. */ | ||
28 | for (i = 0; i < 22; ++i) | ||
29 | if (id & (1 << (i + 10))) | ||
30 | oui |= 1 << (i ^ 7); | ||
31 | |||
32 | return oui; | ||
33 | } | ||
34 | |||
20 | int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd, | 35 | int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd, |
21 | int spins, int spintime) | 36 | int spins, int spintime) |
22 | { | 37 | { |