mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 23:15:10 +03:00
Add "name" field to struct device to allow human-readable hardware device
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
This commit is contained in:
@@ -457,7 +457,7 @@ static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
|
||||
BASE = pci->ioaddr;
|
||||
printf("dmfe.c: Found %s Vendor=0x%hX Device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
/* Read Chip revision */
|
||||
pci_read_config_dword(pci, PCI_REVISION_ID, &dev_rev);
|
||||
@@ -488,7 +488,7 @@ static int dmfe_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
nic->node_addr[i] = db->srom[20 + i];
|
||||
|
||||
/* Print out some hardware info */
|
||||
DBG ( "%s: %s at ioaddr %4.4lx\n", pci->name, eth_ntoa ( nic->node_addr ), BASE );
|
||||
DBG ( "%s: %s at ioaddr %4.4lx\n", pci->driver_name, eth_ntoa ( nic->node_addr ), BASE );
|
||||
|
||||
/* Set the card as PCI Bus Master */
|
||||
adjust_pci_device(pci);
|
||||
|
||||
@@ -1246,7 +1246,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
return 0;
|
||||
|
||||
printf("forcedeth.c: Found %s, vendor=0x%hX, device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
pci_fill_nic ( nic, pci );
|
||||
|
||||
@@ -1306,7 +1306,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
}
|
||||
#endif
|
||||
|
||||
DBG ( "%s: MAC Address %s\n", pci->name, eth_ntoa ( nic->node_addr ) );
|
||||
DBG ( "%s: MAC Address %s\n", pci->driver_name, eth_ntoa ( nic->node_addr ) );
|
||||
|
||||
/* disable WOL */
|
||||
writel(0, base + NvRegWakeUpFlags);
|
||||
@@ -1381,7 +1381,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
|
||||
dprintf
|
||||
(("%s: open: Found PHY %hX:%hX at address %d.\n",
|
||||
pci->name, id1, id2, i));
|
||||
pci->driver_name, id1, id2, i));
|
||||
np->phyaddr = i;
|
||||
np->phy_oui = id1 | id2;
|
||||
break;
|
||||
@@ -1391,7 +1391,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
* test loopback? Very odd, but can be correct.
|
||||
*/
|
||||
printf
|
||||
("%s: open: Could not find a valid PHY.\n", pci->name);
|
||||
("%s: open: Could not find a valid PHY.\n", pci->driver_name);
|
||||
}
|
||||
|
||||
if (i != 32) {
|
||||
@@ -1400,7 +1400,7 @@ static int forcedeth_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
}
|
||||
|
||||
dprintf(("%s: forcedeth.c: subsystem: %hX:%hX bound to %s\n",
|
||||
pci->name, pci->vendor, pci->dev_id, pci->name));
|
||||
pci->driver_name, pci->vendor, pci->dev_id, pci->driver_name));
|
||||
if(!forcedeth_reset(nic)) return 0; // no valid link
|
||||
|
||||
/* point to NIC specific routines */
|
||||
|
||||
@@ -84,6 +84,7 @@ int legacy_probe ( struct pci_device *pci,
|
||||
netdev->priv = &nic;
|
||||
memset ( &nic, 0, sizeof ( nic ) );
|
||||
pci_set_drvdata ( pci, netdev );
|
||||
netdev->dev = &pci->dev;
|
||||
|
||||
netdev->open = legacy_open;
|
||||
netdev->close = legacy_close;
|
||||
|
||||
@@ -677,7 +677,7 @@ static int mtd_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
pci_fill_nic ( nic, pci );
|
||||
adjust_pci_device(pci);
|
||||
|
||||
mtdx.nic_name = pci->name;
|
||||
mtdx.nic_name = pci->driver_name;
|
||||
mtdx.dev_id = pci->device;
|
||||
mtdx.ioaddr = nic->ioaddr;
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ natsemi_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
ioaddr = pci->ioaddr;
|
||||
vendor = pci->vendor;
|
||||
dev_id = pci->device;
|
||||
nic_name = pci->name;
|
||||
nic_name = pci->driver_name;
|
||||
|
||||
/* natsemi has a non-standard PM control register
|
||||
* in PCI config space. Some boards apparently need
|
||||
|
||||
@@ -821,7 +821,7 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
return 0;
|
||||
|
||||
printf("ns83820.c: Found %s, vendor=0x%hX, device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
/* point to private storage */
|
||||
ns = &nsx;
|
||||
@@ -860,12 +860,12 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
ns->CFG_cache = readl(ns->base + CFG);
|
||||
|
||||
if ((ns->CFG_cache & CFG_PCI64_DET)) {
|
||||
printf("%s: detected 64 bit PCI data bus.\n", pci->name);
|
||||
printf("%s: detected 64 bit PCI data bus.\n", pci->driver_name);
|
||||
/*dev->CFG_cache |= CFG_DATA64_EN; */
|
||||
if (!(ns->CFG_cache & CFG_DATA64_EN))
|
||||
printf
|
||||
("%s: EEPROM did not enable 64 bit bus. Disabled.\n",
|
||||
pci->name);
|
||||
pci->driver_name);
|
||||
} else
|
||||
ns->CFG_cache &= ~(CFG_DATA64_EN);
|
||||
|
||||
@@ -895,7 +895,7 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
|
||||
/* setup optical transceiver if we have one */
|
||||
if (ns->CFG_cache & CFG_TBI_EN) {
|
||||
dprintf(("%s: enabling optical transceiver\n", pci->name));
|
||||
dprintf(("%s: enabling optical transceiver\n", pci->driver_name));
|
||||
writel(readl(ns->base + GPIOR) | 0x3e8, ns->base + GPIOR);
|
||||
|
||||
/* setup auto negotiation feature advertisement */
|
||||
@@ -916,7 +916,7 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
|
||||
/* FIXME: reset_phy is defaulted to 0, should we reset anyway? */
|
||||
if (reset_phy) {
|
||||
dprintf(("%s: resetting phy\n", pci->name));
|
||||
dprintf(("%s: resetting phy\n", pci->driver_name));
|
||||
writel(ns->CFG_cache | CFG_PHY_RST, ns->base + CFG);
|
||||
writel(ns->CFG_cache, ns->base + CFG);
|
||||
}
|
||||
@@ -981,11 +981,11 @@ static int ns83820_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
ns83820_getmac(nic, nic->node_addr);
|
||||
|
||||
if (using_dac) {
|
||||
dprintf(("%s: using 64 bit addressing.\n", pci->name));
|
||||
dprintf(("%s: using 64 bit addressing.\n", pci->driver_name));
|
||||
}
|
||||
|
||||
dprintf(("%s: DP83820 %d.%d: %! io=0x%hX\n",
|
||||
pci->name,
|
||||
pci->driver_name,
|
||||
(unsigned) readl(ns->base + SRR) >> 8,
|
||||
(unsigned) readl(ns->base + SRR) & 0xff,
|
||||
nic->node_addr, pci->ioaddr));
|
||||
|
||||
@@ -678,7 +678,7 @@ static int pcnet32_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
/* BASE is used throughout to address the card */
|
||||
ioaddr = pci->ioaddr;
|
||||
printf("pcnet32.c: Found %s, Vendor=0x%hX Device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
nic->irqno = 0;
|
||||
pci_fill_nic ( nic, pci );
|
||||
|
||||
@@ -234,6 +234,7 @@ static int pnic_probe ( struct pci_device *pci,
|
||||
}
|
||||
pnic = netdev->priv;
|
||||
pci_set_drvdata ( pci, netdev );
|
||||
netdev->dev = &pci->dev;
|
||||
pnic->ioaddr = pci->ioaddr;
|
||||
|
||||
/* API version check */
|
||||
|
||||
@@ -884,7 +884,7 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
int option = -1, Cap10_100 = 0, Cap1000 = 0;
|
||||
|
||||
printf ( "r8169.c: Found %s, Vendor=%hX Device=%hX\n",
|
||||
pci->name, pci->vendor, pci->device );
|
||||
pci->driver_name, pci->vendor, pci->device );
|
||||
|
||||
board_idx++;
|
||||
|
||||
@@ -899,11 +899,11 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
for (i = 0; i < MAC_ADDR_LEN; i++)
|
||||
nic->node_addr[i] = RTL_R8(MAC0 + i);
|
||||
|
||||
DBG ( "%s: Identified chip type is '%s'.\n", pci->name,
|
||||
DBG ( "%s: Identified chip type is '%s'.\n", pci->driver_name,
|
||||
rtl_chip_info[tpc->chipset].name );
|
||||
|
||||
/* Print out some hardware info */
|
||||
DBG ( "%s: %s at IOAddr %#hX, ", pci->name, eth_ntoa ( nic->node_addr ),
|
||||
DBG ( "%s: %s at IOAddr %#hX, ", pci->driver_name, eth_ntoa ( nic->node_addr ),
|
||||
ioaddr );
|
||||
|
||||
/* Config PHY */
|
||||
@@ -965,7 +965,7 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
RTL8169_WRITE_GMII_REG(ioaddr, PHY_1000_CTRL_REG,
|
||||
Cap1000);
|
||||
} else {
|
||||
DBG ( "%s: Auto-negotiation Enabled.\n", pci->name );
|
||||
DBG ( "%s: Auto-negotiation Enabled.\n", pci->driver_name );
|
||||
|
||||
// enable 10/100 Full/Half Mode, leave PHY_AUTO_NEGO_REG bit4:0 unchanged
|
||||
RTL8169_WRITE_GMII_REG(ioaddr, PHY_AUTO_NEGO_REG,
|
||||
@@ -1016,7 +1016,7 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
udelay(100);
|
||||
printf
|
||||
("%s: 1000Mbps Full-duplex operation, TBI Link %s!\n",
|
||||
pci->name,
|
||||
pci->driver_name,
|
||||
(RTL_R32(TBICSR) & TBILinkOK) ? "OK" : "Failed");
|
||||
|
||||
}
|
||||
|
||||
@@ -532,6 +532,7 @@ static int rtl_probe ( struct pci_device *pci,
|
||||
}
|
||||
rtl = netdev->priv;
|
||||
pci_set_drvdata ( pci, netdev );
|
||||
netdev->dev = &pci->dev;
|
||||
memset ( rtl, 0, sizeof ( *rtl ) );
|
||||
rtl->ioaddr = pci->ioaddr;
|
||||
|
||||
|
||||
@@ -581,7 +581,7 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
/* BASE is used throughout to address the card */
|
||||
BASE = pci->ioaddr;
|
||||
printf(" sundance.c: Found %s Vendor=0x%hX Device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
/* Get the MAC Address by reading the EEPROM */
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -603,7 +603,7 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
/* point to private storage */
|
||||
sdc = &sdx;
|
||||
|
||||
sdc->nic_name = pci->name;
|
||||
sdc->nic_name = pci->driver_name;
|
||||
sdc->mtu = mtu;
|
||||
|
||||
pci_read_config_byte(pci, PCI_REVISION_ID, &sdc->pci_rev_id);
|
||||
@@ -611,7 +611,7 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
DBG ( "Device revision id: %hx\n", sdc->pci_rev_id );
|
||||
|
||||
/* Print out some hardware info */
|
||||
DBG ( "%s: %s at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
|
||||
DBG ( "%s: %s at ioaddr %hX, ", pci->driver_name, nic->node_addr, BASE);
|
||||
|
||||
sdc->mii_preamble_required = 0;
|
||||
if (1) {
|
||||
|
||||
@@ -809,7 +809,7 @@ static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
|
||||
priv->vendor_id = pci->vendor;
|
||||
priv->dev_id = pci->device;
|
||||
priv->nic_name = pci->name;
|
||||
priv->nic_name = pci->driver_name;
|
||||
priv->eoc = 0;
|
||||
|
||||
err = 0;
|
||||
@@ -820,10 +820,10 @@ static int tlan_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
(u8 *) & nic->node_addr[i]);
|
||||
if (err) {
|
||||
printf ( "TLAN: %s: Error reading MAC from eeprom: %d\n",
|
||||
pci->name, err);
|
||||
pci->driver_name, err);
|
||||
} else {
|
||||
DBG ( "%s: %s at ioaddr %#lX, ",
|
||||
pci->name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
|
||||
pci->driver_name, eth_ntoa ( nic->node_addr ), pci->ioaddr );
|
||||
}
|
||||
|
||||
priv->tlanRev = TLan_DioRead8(BASE, TLAN_DEF_REVISION);
|
||||
|
||||
@@ -1252,7 +1252,7 @@ static int tulip_probe ( struct nic *nic, struct pci_device *pci ) {
|
||||
|
||||
tp->vendor_id = pci->vendor;
|
||||
tp->dev_id = pci->device;
|
||||
tp->nic_name = pci->name;
|
||||
tp->nic_name = pci->driver_name;
|
||||
|
||||
tp->if_port = 0;
|
||||
tp->default_port = 0;
|
||||
|
||||
@@ -673,7 +673,7 @@ static int velocity_probe(struct pci_device *dev, struct pci_device *pci)
|
||||
struct mac_regs *regs;
|
||||
|
||||
printf("via-velocity.c: Found %s Vendor=0x%hX Device=0x%hX\n",
|
||||
pci->name, pci->vendor, pci->device);
|
||||
pci->driver_name, pci->vendor, pci->device);
|
||||
|
||||
/* point to private storage */
|
||||
vptr = &vptx;
|
||||
@@ -705,9 +705,9 @@ static int velocity_probe(struct pci_device *dev, struct pci_device *pci)
|
||||
for (i = 0; i < 6; i++)
|
||||
nic->node_addr[i] = readb(®s->PAR[i]);
|
||||
|
||||
DBG ( "%s: %s at ioaddr %#hX\n", pci->name, eth_ntoa ( nic->node_addr ), BASE );
|
||||
DBG ( "%s: %s at ioaddr %#hX\n", pci->driver_name, eth_ntoa ( nic->node_addr ), BASE );
|
||||
|
||||
velocity_get_options(&vptr->options, 0, pci->name);
|
||||
velocity_get_options(&vptr->options, 0, pci->driver_name);
|
||||
|
||||
/*
|
||||
* Mask out the options cannot be set to the chip
|
||||
|
||||
Reference in New Issue
Block a user