Page MenuHomeFreeBSD

D8584.diff
No OneTemporary

D8584.diff

Index: head/sys/dev/etherswitch/ukswitch/ukswitch.c
===================================================================
--- head/sys/dev/etherswitch/ukswitch/ukswitch.c
+++ head/sys/dev/etherswitch/ukswitch/ukswitch.c
@@ -67,6 +67,7 @@
int media; /* cpu port media */
int cpuport; /* which PHY is connected to the CPU */
int phymask; /* PHYs we manage */
+ int phyoffset; /* PHYs register offset */
int numports; /* number of ports */
int ifpport[MII_NPHY];
int *portphy;
@@ -133,7 +134,7 @@
M_WAITOK | M_ZERO);
err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port],
ukswitch_ifmedia_upd, ukswitch_ifmedia_sts, \
- BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0);
+ BMSR_DEFCAPMASK, phy + sc->phyoffset, MII_OFFSET_ANY, 0);
DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n",
device_get_nameunit(*sc->miibus[port]),
sc->ifp[port]->if_xname);
@@ -166,6 +167,7 @@
/* XXX Defaults */
sc->numports = 6;
sc->phymask = 0x0f;
+ sc->phyoffset = 0;
sc->cpuport = -1;
sc->media = 100;
@@ -174,6 +176,8 @@
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"phymask", &sc->phymask);
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
+ "phyoffset", &sc->phyoffset);
+ (void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"cpuport", &sc->cpuport);
(void) resource_int_value(device_get_name(dev), device_get_unit(dev),
"media", &sc->media);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 12:10 PM (11 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15604587
Default Alt Text
D8584.diff (1 KB)

Event Timeline