1 diff -Nur linux-2.6.17/drivers/net/b44.c linux-2.6.17-owrt/drivers/net/b44.c
2 --- linux-2.6.17/drivers/net/b44.c 2006-06-18 03:49:35.000000000 +0200
3 +++ linux-2.6.17-owrt/drivers/net/b44.c 2006-06-18 16:24:14.000000000 +0200
5 -/* b44.c: Broadcom 4400 device driver.
6 +/* b44.c: Broadcom 4400/47xx device driver.
8 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
9 - * Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
10 + * Copyright (C) 2004 Pekka Pietikainen (pp@ee.oulu.fi)
11 + * Copyright (C) 2004 Florian Schirmer (jolt@tuxbox.org)
12 + * Copyright (C) 2006 Felix Fietkau (nbd@openwrt.org)
13 * Copyright (C) 2006 Broadcom Corporation.
15 * Distribute under GPL.
17 #define DRV_MODULE_VERSION "1.00"
18 #define DRV_MODULE_RELDATE "Apr 7, 2006"
20 +#ifdef CONFIG_BCM947XX
21 +extern char *nvram_get(char *name);
22 +static inline void e_aton(char *str, char *dest)
32 + dest[i++] = (char) simple_strtoul(str, NULL, 16);
34 + if (!*str++ || i == 6)
39 +static int b44_4713_instance;
42 #define B44_DEF_MSG_ENABLE \
46 static char version[] __devinitdata =
47 DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
49 -MODULE_AUTHOR("Florian Schirmer, Pekka Pietikainen, David S. Miller");
50 -MODULE_DESCRIPTION("Broadcom 4400 10/100 PCI ethernet driver");
51 +MODULE_AUTHOR("Felix Fietkau, Florian Schirmer, Pekka Pietikainen, David S. Miller");
52 +MODULE_DESCRIPTION("Broadcom 4400/47xx 10/100 PCI ethernet driver");
53 MODULE_LICENSE("GPL");
54 MODULE_VERSION(DRV_MODULE_VERSION);
57 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
58 { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4401B1,
59 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
60 +#ifdef CONFIG_BCM947XX
61 + { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_BCM4713,
62 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
64 { } /* terminate list with empty entry */
68 dma_desc_sync_size, dir);
71 -static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
73 - return readl(bp->regs + reg);
76 -static inline void bw32(const struct b44 *bp,
77 - unsigned long reg, unsigned long val)
79 - writel(val, bp->regs + reg);
82 static int b44_wait_bit(struct b44 *bp, unsigned long reg,
83 u32 bit, unsigned long timeout, const int clear)
89 +#ifdef CONFIG_BCM947XX
90 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
91 + return b44_4713_instance++;
100 +#ifdef CONFIG_BCM947XX
101 +static inline void __b44_cam_read(struct b44 *bp, unsigned char *data, int index)
105 + bw32(bp, B44_CAM_CTRL, (CAM_CTRL_READ |
106 + (index << CAM_CTRL_INDEX_SHIFT)));
108 + b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
110 + val = br32(bp, B44_CAM_DATA_LO);
112 + data[2] = (val >> 24) & 0xFF;
113 + data[3] = (val >> 16) & 0xFF;
114 + data[4] = (val >> 8) & 0xFF;
115 + data[5] = (val >> 0) & 0xFF;
117 + val = br32(bp, B44_CAM_DATA_HI);
119 + data[0] = (val >> 8) & 0xFF;
120 + data[1] = (val >> 0) & 0xFF;
124 static void __b44_cam_write(struct b44 *bp, unsigned char *data, int index)
127 @@ -314,14 +359,14 @@
128 bw32(bp, B44_IMASK, bp->imask);
131 -static int b44_readphy(struct b44 *bp, int reg, u32 *val)
132 +static int __b44_readphy(struct b44 *bp, int phy_addr, int reg, u32 *val)
136 bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
137 bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
138 (MDIO_OP_READ << MDIO_DATA_OP_SHIFT) |
139 - (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
140 + (phy_addr << MDIO_DATA_PMD_SHIFT) |
141 (reg << MDIO_DATA_RA_SHIFT) |
142 (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT)));
143 err = b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
144 @@ -330,18 +375,34 @@
148 -static int b44_writephy(struct b44 *bp, int reg, u32 val)
149 +static int __b44_writephy(struct b44 *bp, int phy_addr, int reg, u32 val)
151 bw32(bp, B44_EMAC_ISTAT, EMAC_INT_MII);
152 bw32(bp, B44_MDIO_DATA, (MDIO_DATA_SB_START |
153 (MDIO_OP_WRITE << MDIO_DATA_OP_SHIFT) |
154 - (bp->phy_addr << MDIO_DATA_PMD_SHIFT) |
155 + (phy_addr << MDIO_DATA_PMD_SHIFT) |
156 (reg << MDIO_DATA_RA_SHIFT) |
157 (MDIO_TA_VALID << MDIO_DATA_TA_SHIFT) |
158 (val & MDIO_DATA_DATA)));
159 return b44_wait_bit(bp, B44_EMAC_ISTAT, EMAC_INT_MII, 100, 0);
162 +static inline int b44_readphy(struct b44 *bp, int reg, u32 *val)
164 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
167 + return __b44_readphy(bp, bp->phy_addr, reg, val);
170 +static inline int b44_writephy(struct b44 *bp, int reg, u32 val)
172 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
175 + return __b44_writephy(bp, bp->phy_addr, reg, val);
178 /* miilib interface */
179 /* FIXME FIXME: phy_id is ignored, bp->phy_addr use is unconditional
180 * due to code existing before miilib use was added to this driver.
185 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
187 err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
194 +#ifdef CONFIG_BCM947XX
196 + * workaround for bad hardware design in Linksys WAP54G v1.0
197 + * see https://dev.openwrt.org/ticket/146
198 + * check and reset bit "isolate"
200 + if ((bp->pdev->device == PCI_DEVICE_ID_BCM4713) &&
201 + (atoi(nvram_get("boardnum")) == 2) &&
202 + (__b44_readphy(bp, 0, MII_BMCR, &val) == 0) &&
203 + (val & BMCR_ISOLATE) &&
204 + (__b44_writephy(bp, 0, MII_BMCR, val & ~BMCR_ISOLATE) != 0)) {
205 + printk(KERN_WARNING PFX "PHY: cannot reset MII transceiver isolate bit.\n");
208 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
210 if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
212 if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
217 + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) {
218 + bp->flags |= B44_FLAG_100_BASE_T;
219 + bp->flags |= B44_FLAG_FULL_DUPLEX;
220 + if (!netif_carrier_ok(bp->dev)) {
221 + u32 val = br32(bp, B44_TX_CTRL);
222 + val |= TX_CTRL_DUPLEX;
223 + bw32(bp, B44_TX_CTRL, val);
224 + netif_carrier_on(bp->dev);
225 + b44_link_report(bp);
230 if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
231 !b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
233 @@ -1282,9 +1374,10 @@
234 bw32(bp, B44_DMARX_CTRL, 0);
235 bp->rx_prod = bp->rx_cons = 0;
237 - ssb_pci_setup(bp, (bp->core_unit == 0 ?
240 + if (bp->pdev->device != PCI_DEVICE_ID_BCM4713)
241 + ssb_pci_setup(bp, (bp->core_unit == 0 ?
247 @@ -1292,8 +1385,14 @@
250 /* Make PHY accessible. */
251 - bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
252 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713)
253 + bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
254 + (((100000000 + (B44_MDC_RATIO / 2)) / B44_MDC_RATIO)
255 + & MDIO_CTRL_MAXF_MASK)));
257 + bw32(bp, B44_MDIO_CTRL, (MDIO_CTRL_PREAMBLE |
258 (0x0d & MDIO_CTRL_MAXF_MASK)));
260 br32(bp, B44_MDIO_CTRL);
262 if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
263 @@ -1837,18 +1936,297 @@
264 .get_perm_addr = ethtool_op_get_perm_addr,
267 +static int b44_ethtool_ioctl (struct net_device *dev, void __user *useraddr)
269 + struct b44 *bp = dev->priv;
270 + struct pci_dev *pci_dev = bp->pdev;
273 + if (copy_from_user (ðcmd, useraddr, sizeof (ethcmd)))
277 + case ETHTOOL_GDRVINFO: {
278 + struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
279 + strcpy (info.driver, DRV_MODULE_NAME);
280 + strcpy (info.version, DRV_MODULE_VERSION);
281 + memset(&info.fw_version, 0, sizeof(info.fw_version));
282 + strcpy (info.bus_info, pci_name(pci_dev));
283 + info.eedump_len = 0;
284 + info.regdump_len = 0;
285 + if (copy_to_user (useraddr, &info, sizeof (info)))
290 + case ETHTOOL_GSET: {
291 + struct ethtool_cmd cmd = { ETHTOOL_GSET };
293 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
295 + cmd.supported = (SUPPORTED_Autoneg);
296 + cmd.supported |= (SUPPORTED_100baseT_Half |
297 + SUPPORTED_100baseT_Full |
298 + SUPPORTED_10baseT_Half |
299 + SUPPORTED_10baseT_Full |
302 + cmd.advertising = 0;
303 + if (bp->flags & B44_FLAG_ADV_10HALF)
304 + cmd.advertising |= ADVERTISE_10HALF;
305 + if (bp->flags & B44_FLAG_ADV_10FULL)
306 + cmd.advertising |= ADVERTISE_10FULL;
307 + if (bp->flags & B44_FLAG_ADV_100HALF)
308 + cmd.advertising |= ADVERTISE_100HALF;
309 + if (bp->flags & B44_FLAG_ADV_100FULL)
310 + cmd.advertising |= ADVERTISE_100FULL;
311 + cmd.advertising |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
312 + cmd.speed = (bp->flags & B44_FLAG_100_BASE_T) ?
313 + SPEED_100 : SPEED_10;
314 + cmd.duplex = (bp->flags & B44_FLAG_FULL_DUPLEX) ?
315 + DUPLEX_FULL : DUPLEX_HALF;
317 + cmd.phy_address = bp->phy_addr;
318 + cmd.transceiver = (bp->flags & B44_FLAG_INTERNAL_PHY) ?
319 + XCVR_INTERNAL : XCVR_EXTERNAL;
320 + cmd.autoneg = (bp->flags & B44_FLAG_FORCE_LINK) ?
321 + AUTONEG_DISABLE : AUTONEG_ENABLE;
324 + if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
328 + case ETHTOOL_SSET: {
329 + struct ethtool_cmd cmd;
331 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
334 + if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
337 + /* We do not support gigabit. */
338 + if (cmd.autoneg == AUTONEG_ENABLE) {
339 + if (cmd.advertising &
340 + (ADVERTISED_1000baseT_Half |
341 + ADVERTISED_1000baseT_Full))
343 + } else if ((cmd.speed != SPEED_100 &&
344 + cmd.speed != SPEED_10) ||
345 + (cmd.duplex != DUPLEX_HALF &&
346 + cmd.duplex != DUPLEX_FULL)) {
350 + spin_lock_irq(&bp->lock);
352 + if (cmd.autoneg == AUTONEG_ENABLE) {
353 + bp->flags &= ~B44_FLAG_FORCE_LINK;
354 + bp->flags &= ~(B44_FLAG_ADV_10HALF |
355 + B44_FLAG_ADV_10FULL |
356 + B44_FLAG_ADV_100HALF |
357 + B44_FLAG_ADV_100FULL);
358 + if (cmd.advertising & ADVERTISE_10HALF)
359 + bp->flags |= B44_FLAG_ADV_10HALF;
360 + if (cmd.advertising & ADVERTISE_10FULL)
361 + bp->flags |= B44_FLAG_ADV_10FULL;
362 + if (cmd.advertising & ADVERTISE_100HALF)
363 + bp->flags |= B44_FLAG_ADV_100HALF;
364 + if (cmd.advertising & ADVERTISE_100FULL)
365 + bp->flags |= B44_FLAG_ADV_100FULL;
367 + bp->flags |= B44_FLAG_FORCE_LINK;
368 + if (cmd.speed == SPEED_100)
369 + bp->flags |= B44_FLAG_100_BASE_T;
370 + if (cmd.duplex == DUPLEX_FULL)
371 + bp->flags |= B44_FLAG_FULL_DUPLEX;
376 + spin_unlock_irq(&bp->lock);
381 + case ETHTOOL_GMSGLVL: {
382 + struct ethtool_value edata = { ETHTOOL_GMSGLVL };
383 + edata.data = bp->msg_enable;
384 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
388 + case ETHTOOL_SMSGLVL: {
389 + struct ethtool_value edata;
390 + if (copy_from_user(&edata, useraddr, sizeof(edata)))
392 + bp->msg_enable = edata.data;
395 + case ETHTOOL_NWAY_RST: {
399 + spin_lock_irq(&bp->lock);
400 + b44_readphy(bp, MII_BMCR, &bmcr);
401 + b44_readphy(bp, MII_BMCR, &bmcr);
403 + if (bmcr & BMCR_ANENABLE) {
404 + b44_writephy(bp, MII_BMCR,
405 + bmcr | BMCR_ANRESTART);
408 + spin_unlock_irq(&bp->lock);
412 + case ETHTOOL_GLINK: {
413 + struct ethtool_value edata = { ETHTOOL_GLINK };
414 + edata.data = netif_carrier_ok(bp->dev) ? 1 : 0;
415 + if (copy_to_user(useraddr, &edata, sizeof(edata)))
419 + case ETHTOOL_GRINGPARAM: {
420 + struct ethtool_ringparam ering = { ETHTOOL_GRINGPARAM };
422 + ering.rx_max_pending = B44_RX_RING_SIZE - 1;
423 + ering.rx_pending = bp->rx_pending;
425 + /* XXX ethtool lacks a tx_max_pending, oops... */
427 + if (copy_to_user(useraddr, &ering, sizeof(ering)))
431 + case ETHTOOL_SRINGPARAM: {
432 + struct ethtool_ringparam ering;
434 + if (copy_from_user(&ering, useraddr, sizeof(ering)))
437 + if ((ering.rx_pending > B44_RX_RING_SIZE - 1) ||
438 + (ering.rx_mini_pending != 0) ||
439 + (ering.rx_jumbo_pending != 0) ||
440 + (ering.tx_pending > B44_TX_RING_SIZE - 1))
443 + spin_lock_irq(&bp->lock);
445 + bp->rx_pending = ering.rx_pending;
446 + bp->tx_pending = ering.tx_pending;
449 + b44_init_rings(bp);
451 + netif_wake_queue(bp->dev);
452 + spin_unlock_irq(&bp->lock);
454 + b44_enable_ints(bp);
458 + case ETHTOOL_GPAUSEPARAM: {
459 + struct ethtool_pauseparam epause = { ETHTOOL_GPAUSEPARAM };
462 + (bp->flags & B44_FLAG_PAUSE_AUTO) != 0;
464 + (bp->flags & B44_FLAG_RX_PAUSE) != 0;
466 + (bp->flags & B44_FLAG_TX_PAUSE) != 0;
467 + if (copy_to_user(useraddr, &epause, sizeof(epause)))
471 + case ETHTOOL_SPAUSEPARAM: {
472 + struct ethtool_pauseparam epause;
474 + if (copy_from_user(&epause, useraddr, sizeof(epause)))
477 + spin_lock_irq(&bp->lock);
478 + if (epause.autoneg)
479 + bp->flags |= B44_FLAG_PAUSE_AUTO;
481 + bp->flags &= ~B44_FLAG_PAUSE_AUTO;
482 + if (epause.rx_pause)
483 + bp->flags |= B44_FLAG_RX_PAUSE;
485 + bp->flags &= ~B44_FLAG_RX_PAUSE;
486 + if (epause.tx_pause)
487 + bp->flags |= B44_FLAG_TX_PAUSE;
489 + bp->flags &= ~B44_FLAG_TX_PAUSE;
490 + if (bp->flags & B44_FLAG_PAUSE_AUTO) {
492 + b44_init_rings(bp);
495 + __b44_set_flow_ctrl(bp, bp->flags);
497 + spin_unlock_irq(&bp->lock);
499 + b44_enable_ints(bp);
505 + return -EOPNOTSUPP;
508 static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
510 struct mii_ioctl_data *data = if_mii(ifr);
511 struct b44 *bp = netdev_priv(dev);
514 - if (!netif_running(dev))
515 + if (bp->pdev->device != PCI_DEVICE_ID_BCM4713) {
516 + if (!netif_running(dev))
519 + spin_lock_irq(&bp->lock);
520 + err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
521 + spin_unlock_irq(&bp->lock);
525 - spin_lock_irq(&bp->lock);
526 - err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
527 - spin_unlock_irq(&bp->lock);
530 + return b44_ethtool_ioctl(dev, (void __user*) ifr->ifr_data);
533 + data->phy_id = bp->phy_addr;
536 + case SIOCGMIIREG: {
538 + spin_lock_irq(&bp->lock);
539 + err = __b44_readphy(bp, data->phy_id & 0x1f, data->reg_num & 0x1f, &mii_regval);
540 + spin_unlock_irq(&bp->lock);
542 + data->val_out = mii_regval;
548 + if (!capable(CAP_NET_ADMIN))
551 + spin_lock_irq(&bp->lock);
552 + err = __b44_writephy(bp, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in);
553 + spin_unlock_irq(&bp->lock);
560 + return -EOPNOTSUPP;
565 @@ -1868,27 +2246,60 @@
566 static int __devinit b44_get_invariants(struct b44 *bp)
572 + unsigned long flags;
574 +#ifdef CONFIG_BCM947XX
575 + if (bp->pdev->device == PCI_DEVICE_ID_BCM4713) {
577 + * BCM47xx boards don't have a EEPROM. The MAC is stored in
578 + * a NVRAM area somewhere in the flash memory.
580 + sprintf(buf, "et%dmacaddr", b44_4713_instance);
581 + if (nvram_get(buf)) {
582 + e_aton(nvram_get(buf), bp->dev->dev_addr);
585 + * Getting the MAC out of NVRAM failed. To make it work
586 + * here, we simply rely on the bootloader to write the
587 + * MAC into the CAM.
589 + spin_lock_irqsave(&bp->lock, flags);
590 + __b44_cam_read(bp, bp->dev->dev_addr, 0);
591 + spin_unlock_irqrestore(&bp->lock, flags);
594 - err = b44_read_eeprom(bp, &eeprom[0]);
598 + * BCM47xx boards don't have a PHY. Usually there is a switch
599 + * chip with multiple PHYs connected to the PHY port.
601 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
602 + bp->dma_offset = 0;
606 + err = b44_read_eeprom(bp, &eeprom[0]);
610 - bp->dev->dev_addr[0] = eeprom[79];
611 - bp->dev->dev_addr[1] = eeprom[78];
612 - bp->dev->dev_addr[2] = eeprom[81];
613 - bp->dev->dev_addr[3] = eeprom[80];
614 - bp->dev->dev_addr[4] = eeprom[83];
615 - bp->dev->dev_addr[5] = eeprom[82];
616 + bp->dev->dev_addr[0] = eeprom[79];
617 + bp->dev->dev_addr[1] = eeprom[78];
618 + bp->dev->dev_addr[2] = eeprom[81];
619 + bp->dev->dev_addr[3] = eeprom[80];
620 + bp->dev->dev_addr[4] = eeprom[83];
621 + bp->dev->dev_addr[5] = eeprom[82];
623 - if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
624 - printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n");
627 + if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
628 + printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n");
632 - memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len);
633 + memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len);
635 - bp->phy_addr = eeprom[90] & 0x1f;
636 + bp->phy_addr = eeprom[90] & 0x1f;
637 + bp->dma_offset = SB_PCI_DMA;
640 /* With this, plus the rx_header prepended to the data by the
641 * hardware, we'll land the ethernet header on a 2-byte boundary.
642 @@ -1898,7 +2309,6 @@
643 bp->imask = IMASK_DEF;
645 bp->core_unit = ssb_core_unit(bp);
646 - bp->dma_offset = SB_PCI_DMA;
648 /* XXX - really required?
649 bp->flags |= B44_FLAG_BUGGY_TXPTR;
650 @@ -2048,11 +2458,17 @@
654 - printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
655 + printk(KERN_INFO "%s: Broadcom %s 10/100BaseT Ethernet ", dev->name,
656 + (pdev->device == PCI_DEVICE_ID_BCM4713) ? "47xx" : "4400");
657 for (i = 0; i < 6; i++)
658 printk("%2.2x%c", dev->dev_addr[i],
659 i == 5 ? '\n' : ':');
661 + /* Initialize phy */
662 + spin_lock_irq(&bp->lock);
663 + b44_chip_reset(bp);
664 + spin_unlock_irq(&bp->lock);
669 diff -Nur linux-2.6.17/drivers/net/b44.h linux-2.6.17-owrt/drivers/net/b44.h
670 --- linux-2.6.17/drivers/net/b44.h 2006-06-18 03:49:35.000000000 +0200
671 +++ linux-2.6.17-owrt/drivers/net/b44.h 2006-06-18 16:01:10.000000000 +0200
673 #define SSB_PCI_MASK1 0xfc000000
674 #define SSB_PCI_MASK2 0xc0000000
676 +#define br32(bp, REG) readl((void *)bp->regs + (REG))
677 +#define bw32(bp, REG,VAL) writel((VAL), (void *)bp->regs + (REG))
678 +#define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0)
680 /* 4400 PHY registers */
681 #define B44_MII_AUXCTRL 24 /* Auxiliary Control */
682 #define MII_AUXCTRL_DUPLEX 0x0001 /* Full Duplex */
686 #define B44_MCAST_TABLE_SIZE 32
687 +#define B44_PHY_ADDR_NO_PHY 30
688 +#define B44_MDC_RATIO 5000000
690 #define B44_STAT_REG_DECLARE \
691 _B44(tx_good_octets) \
696 +#define B44_FLAG_INIT_COMPLETE 0x00000001
697 #define B44_FLAG_BUGGY_TXPTR 0x00000002
698 #define B44_FLAG_REORDER_BUG 0x00000004
699 #define B44_FLAG_PAUSE_AUTO 0x00008000