Xircom cards store the MAC address in the CIS, so get it from the new
pci_get_ether accesor, which gets it from the CIS for cardbus cards (and from other pci-like buses via whatever mechanism is used there). Submitted by: sam Approved by: re (blanket)
This commit is contained in:
parent
fbe9cff112
commit
e7b01d0727
@ -1901,6 +1901,7 @@ dc_attach(dev)
|
|||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
u_int32_t revision;
|
u_int32_t revision;
|
||||||
int unit, error = 0, rid, mac_offset;
|
int unit, error = 0, rid, mac_offset;
|
||||||
|
u_int8_t *mac;
|
||||||
|
|
||||||
sc = device_get_softc(dev);
|
sc = device_get_softc(dev);
|
||||||
unit = device_get_unit(dev);
|
unit = device_get_unit(dev);
|
||||||
@ -2078,7 +2079,6 @@ dc_attach(dev)
|
|||||||
* The DC_TX_COALESCE flag is required.
|
* The DC_TX_COALESCE flag is required.
|
||||||
*/
|
*/
|
||||||
sc->dc_pmode = DC_PMODE_MII;
|
sc->dc_pmode = DC_PMODE_MII;
|
||||||
/* XXX Call the cardbus function to get nic from the CIS */
|
|
||||||
break;
|
break;
|
||||||
case DC_DEVICEID_RS7112:
|
case DC_DEVICEID_RS7112:
|
||||||
sc->dc_type = DC_TYPE_CONEXANT;
|
sc->dc_type = DC_TYPE_CONEXANT;
|
||||||
@ -2158,7 +2158,13 @@ dc_attach(dev)
|
|||||||
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr, 6);
|
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr, 6);
|
||||||
break;
|
break;
|
||||||
case DC_TYPE_XIRCOM:
|
case DC_TYPE_XIRCOM:
|
||||||
|
/* The MAC comes from the CIS */
|
||||||
|
mac = pci_get_ether(dev);
|
||||||
|
if (!mac) {
|
||||||
|
device_printf(dev, "No station address in CIS!\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
bcopy(mac, eaddr, ETHER_ADDR_LEN);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
|
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
|
||||||
|
@ -1901,6 +1901,7 @@ dc_attach(dev)
|
|||||||
struct ifnet *ifp;
|
struct ifnet *ifp;
|
||||||
u_int32_t revision;
|
u_int32_t revision;
|
||||||
int unit, error = 0, rid, mac_offset;
|
int unit, error = 0, rid, mac_offset;
|
||||||
|
u_int8_t *mac;
|
||||||
|
|
||||||
sc = device_get_softc(dev);
|
sc = device_get_softc(dev);
|
||||||
unit = device_get_unit(dev);
|
unit = device_get_unit(dev);
|
||||||
@ -2078,7 +2079,6 @@ dc_attach(dev)
|
|||||||
* The DC_TX_COALESCE flag is required.
|
* The DC_TX_COALESCE flag is required.
|
||||||
*/
|
*/
|
||||||
sc->dc_pmode = DC_PMODE_MII;
|
sc->dc_pmode = DC_PMODE_MII;
|
||||||
/* XXX Call the cardbus function to get nic from the CIS */
|
|
||||||
break;
|
break;
|
||||||
case DC_DEVICEID_RS7112:
|
case DC_DEVICEID_RS7112:
|
||||||
sc->dc_type = DC_TYPE_CONEXANT;
|
sc->dc_type = DC_TYPE_CONEXANT;
|
||||||
@ -2158,7 +2158,13 @@ dc_attach(dev)
|
|||||||
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr, 6);
|
bcopy(sc->dc_srom + DC_CONEXANT_EE_NODEADDR, &eaddr, 6);
|
||||||
break;
|
break;
|
||||||
case DC_TYPE_XIRCOM:
|
case DC_TYPE_XIRCOM:
|
||||||
|
/* The MAC comes from the CIS */
|
||||||
|
mac = pci_get_ether(dev);
|
||||||
|
if (!mac) {
|
||||||
|
device_printf(dev, "No station address in CIS!\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
bcopy(mac, eaddr, ETHER_ADDR_LEN);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
|
dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user