Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135001
b: refs/heads/master
c: 3f39a5e
h: refs/heads/master
i:
  134999: e0bad8a
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Mar 2, 2009
1 parent 85b0839 commit 837f3c4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f794fd440066ccd7d601f405f80aa514b95f15d1
refs/heads/master: 3f39a5e9bff000025c2679101b4f83e4fc21dbba
15 changes: 15 additions & 0 deletions trunk/drivers/net/sfc/mdio_10g.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
#include "boards.h"
#include "workarounds.h"

unsigned mdio_id_oui(u32 id)
{
unsigned oui = 0;
int i;

/* The bits of the OUI are designated a..x, with a=0 and b variable.
* In the id register c is the MSB but the OUI is conventionally
* written as bytes h..a, p..i, x..q. Reorder the bits accordingly. */
for (i = 0; i < 22; ++i)
if (id & (1 << (i + 10)))
oui |= 1 << (i ^ 7);

return oui;
}

int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd,
int spins, int spintime)
{
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/sfc/mdio_10g.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/sfc/xfp_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ static int xfp_phy_init(struct efx_nic *efx)
return -ENOMEM;
efx->phy_data = phy_data;

EFX_INFO(efx, "PHY ID reg %x (OUI %x model %x revision %x)\n",
devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid),
MDIO_ID_REV(devid));
EFX_INFO(efx, "PHY ID reg %x (OUI %06x model %02x revision %x)\n",
devid, mdio_id_oui(devid), mdio_id_model(devid),
mdio_id_rev(devid));

phy_data->phy_mode = efx->phy_mode;

Expand Down

0 comments on commit 837f3c4

Please sign in to comment.