1 diff -ur linux-2.6.15-rc5/drivers/net/b44.c linux-2.6.15-rc5-openwrt/drivers/net/b44.c
2 --- linux-2.6.15-rc5/drivers/net/b44.c 2005-12-04 06:10:42.000000000 +0100
3 +++ linux-2.6.15-rc5-openwrt/drivers/net/b44.c 2005-08-15 02:20:18.000000000 +0200
6 #include <linux/delay.h>
7 #include <linux/init.h>
8 -#include <linux/dma-mapping.h>
9 +#include <linux/version.h>
11 #include <asm/uaccess.h>
15 #define DRV_MODULE_NAME "b44"
16 #define PFX DRV_MODULE_NAME ": "
17 -#define DRV_MODULE_VERSION "0.97"
18 -#define DRV_MODULE_RELDATE "Nov 30, 2005"
19 +#define DRV_MODULE_VERSION "0.95"
20 +#define DRV_MODULE_RELDATE "Aug 3, 2004"
22 #define B44_DEF_MSG_ENABLE \
25 static void b44_halt(struct b44 *);
26 static void b44_init_rings(struct b44 *);
27 static void b44_init_hw(struct b44 *);
29 -static int dma_desc_align_mask;
30 -static int dma_desc_sync_size;
32 -static const char b44_gstrings[][ETH_GSTRING_LEN] = {
33 -#define _B44(x...) # x,
38 -static inline void b44_sync_dma_desc_for_device(struct pci_dev *pdev,
39 - dma_addr_t dma_base,
40 - unsigned long offset,
41 - enum dma_data_direction dir)
43 - dma_sync_single_range_for_device(&pdev->dev, dma_base,
44 - offset & dma_desc_align_mask,
45 - dma_desc_sync_size, dir);
48 -static inline void b44_sync_dma_desc_for_cpu(struct pci_dev *pdev,
49 - dma_addr_t dma_base,
50 - unsigned long offset,
51 - enum dma_data_direction dir)
53 - dma_sync_single_range_for_cpu(&pdev->dev, dma_base,
54 - offset & dma_desc_align_mask,
55 - dma_desc_sync_size, dir);
57 +static int b44_poll(struct net_device *dev, int *budget);
58 +#ifdef CONFIG_NET_POLL_CONTROLLER
59 +static void b44_poll_controller(struct net_device *dev);
62 static inline unsigned long br32(const struct b44 *bp, unsigned long reg)
65 for (reg = B44_TX_GOOD_O; reg <= B44_TX_PAUSE; reg += 4UL) {
66 *val++ += br32(bp, reg);
72 + val = &bp->hw_stats.rx_good_octets;
73 for (reg = B44_RX_GOOD_O; reg <= B44_RX_NPAUSE; reg += 4UL) {
74 *val++ += br32(bp, reg);
78 /* Hardware bug work-around, the chip is unable to do PCI DMA
79 to/from anything above 1GB :-( */
80 - if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
81 + if(mapping+RX_PKT_BUF_SZ > B44_DMA_MASK) {
83 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
84 dev_kfree_skb_any(skb);
86 mapping = pci_map_single(bp->pdev, skb->data,
89 - if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) {
90 + if(mapping+RX_PKT_BUF_SZ > B44_DMA_MASK) {
91 pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE);
92 dev_kfree_skb_any(skb);
95 dp->ctrl = cpu_to_le32(ctrl);
96 dp->addr = cpu_to_le32((u32) mapping + bp->rx_offset + bp->dma_offset);
98 - if (bp->flags & B44_FLAG_RX_RING_HACK)
99 - b44_sync_dma_desc_for_device(bp->pdev, bp->rx_ring_dma,
100 - dest_idx * sizeof(dp),
101 - DMA_BIDIRECTIONAL);
103 return RX_PKT_BUF_SZ;
107 pci_unmap_addr_set(dest_map, mapping,
108 pci_unmap_addr(src_map, mapping));
110 - if (bp->flags & B44_FLAG_RX_RING_HACK)
111 - b44_sync_dma_desc_for_cpu(bp->pdev, bp->rx_ring_dma,
112 - src_idx * sizeof(src_desc),
113 - DMA_BIDIRECTIONAL);
115 ctrl = src_desc->ctrl;
116 if (dest_idx == (B44_RX_RING_SIZE - 1))
117 ctrl |= cpu_to_le32(DESC_CTRL_EOT);
120 dest_desc->ctrl = ctrl;
121 dest_desc->addr = src_desc->addr;
125 - if (bp->flags & B44_FLAG_RX_RING_HACK)
126 - b44_sync_dma_desc_for_device(bp->pdev, bp->rx_ring_dma,
127 - dest_idx * sizeof(dest_desc),
128 - DMA_BIDIRECTIONAL);
130 pci_dma_sync_single_for_device(bp->pdev, src_desc->addr,
133 @@ -894,10 +850,11 @@
135 struct net_device *dev = dev_id;
136 struct b44 *bp = netdev_priv(dev);
137 + unsigned long flags;
141 - spin_lock(&bp->lock);
142 + spin_lock_irqsave(&bp->lock, flags);
144 istat = br32(bp, B44_ISTAT);
145 imask = br32(bp, B44_IMASK);
151 - if (unlikely(!netif_running(dev))) {
152 - printk(KERN_INFO "%s: late interrupt.\n", dev->name);
156 if (netif_rx_schedule_prep(dev)) {
157 /* NOTE: These writes are posted by the readback of
158 * the ISTAT register below.
159 @@ -926,11 +877,10 @@
164 bw32(bp, B44_ISTAT, istat);
167 - spin_unlock(&bp->lock);
168 + spin_unlock_irqrestore(&bp->lock, flags);
169 return IRQ_RETVAL(handled);
174 struct b44 *bp = netdev_priv(dev);
175 struct sk_buff *bounce_skb;
176 - int rc = NETDEV_TX_OK;
178 u32 len, entry, ctrl;
180 @@ -968,28 +917,29 @@
181 /* This is a hard error, log it. */
182 if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) {
183 netif_stop_queue(dev);
184 + spin_unlock_irq(&bp->lock);
185 printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
191 mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
192 - if (mapping + len > B44_DMA_MASK) {
193 + if(mapping+len > B44_DMA_MASK) {
194 /* Chip can't handle DMA to/from >1GB, use bounce buffer */
195 pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
197 bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ,
201 + return NETDEV_TX_BUSY;
203 mapping = pci_map_single(bp->pdev, bounce_skb->data,
204 len, PCI_DMA_TODEVICE);
205 - if (mapping + len > B44_DMA_MASK) {
206 + if(mapping+len > B44_DMA_MASK) {
207 pci_unmap_single(bp->pdev, mapping,
208 len, PCI_DMA_TODEVICE);
209 dev_kfree_skb_any(bounce_skb);
211 + return NETDEV_TX_BUSY;
214 memcpy(skb_put(bounce_skb, len), skb->data, skb->len);
215 @@ -1009,11 +959,6 @@
216 bp->tx_ring[entry].ctrl = cpu_to_le32(ctrl);
217 bp->tx_ring[entry].addr = cpu_to_le32((u32) mapping+bp->dma_offset);
219 - if (bp->flags & B44_FLAG_TX_RING_HACK)
220 - b44_sync_dma_desc_for_device(bp->pdev, bp->tx_ring_dma,
221 - entry * sizeof(bp->tx_ring[0]),
224 entry = NEXT_TX(entry);
227 @@ -1029,16 +974,11 @@
228 if (TX_BUFFS_AVAIL(bp) < 1)
229 netif_stop_queue(dev);
231 - dev->trans_start = jiffies;
234 spin_unlock_irq(&bp->lock);
237 + dev->trans_start = jiffies;
240 - rc = NETDEV_TX_BUSY;
245 static int b44_change_mtu(struct net_device *dev, int new_mtu)
246 @@ -1112,7 +1052,8 @@
248 * The chip has been shut down and the driver detached from
249 * the networking, so no interrupts or new tx packets will
250 - * end up in the driver.
251 + * end up in the driver. bp->lock is not held and we are not
252 + * in an interrupt context and thus may sleep.
254 static void b44_init_rings(struct b44 *bp)
256 @@ -1123,16 +1064,6 @@
257 memset(bp->rx_ring, 0, B44_RX_RING_BYTES);
258 memset(bp->tx_ring, 0, B44_TX_RING_BYTES);
260 - if (bp->flags & B44_FLAG_RX_RING_HACK)
261 - dma_sync_single_for_device(&bp->pdev->dev, bp->rx_ring_dma,
263 - PCI_DMA_BIDIRECTIONAL);
265 - if (bp->flags & B44_FLAG_TX_RING_HACK)
266 - dma_sync_single_for_device(&bp->pdev->dev, bp->tx_ring_dma,
270 for (i = 0; i < bp->rx_pending; i++) {
271 if (b44_alloc_rx_skb(bp, -1, i) < 0)
273 @@ -1145,33 +1076,23 @@
275 static void b44_free_consistent(struct b44 *bp)
277 - kfree(bp->rx_buffers);
278 - bp->rx_buffers = NULL;
279 - kfree(bp->tx_buffers);
280 - bp->tx_buffers = NULL;
281 + if (bp->rx_buffers) {
282 + kfree(bp->rx_buffers);
283 + bp->rx_buffers = NULL;
285 + if (bp->tx_buffers) {
286 + kfree(bp->tx_buffers);
287 + bp->tx_buffers = NULL;
290 - if (bp->flags & B44_FLAG_RX_RING_HACK) {
291 - dma_unmap_single(&bp->pdev->dev, bp->rx_ring_dma,
293 - DMA_BIDIRECTIONAL);
294 - kfree(bp->rx_ring);
296 - pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
297 - bp->rx_ring, bp->rx_ring_dma);
298 + pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
299 + bp->rx_ring, bp->rx_ring_dma);
301 - bp->flags &= ~B44_FLAG_RX_RING_HACK;
304 - if (bp->flags & B44_FLAG_TX_RING_HACK) {
305 - dma_unmap_single(&bp->pdev->dev, bp->tx_ring_dma,
308 - kfree(bp->tx_ring);
310 - pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
311 - bp->tx_ring, bp->tx_ring_dma);
312 + pci_free_consistent(bp->pdev, DMA_TABLE_BYTES,
313 + bp->tx_ring, bp->tx_ring_dma);
315 - bp->flags &= ~B44_FLAG_TX_RING_HACK;
319 @@ -1184,67 +1105,25 @@
322 size = B44_RX_RING_SIZE * sizeof(struct ring_info);
323 - bp->rx_buffers = kzalloc(size, GFP_KERNEL);
324 + bp->rx_buffers = kmalloc(size, GFP_KERNEL);
327 + memset(bp->rx_buffers, 0, size);
329 size = B44_TX_RING_SIZE * sizeof(struct ring_info);
330 - bp->tx_buffers = kzalloc(size, GFP_KERNEL);
331 + bp->tx_buffers = kmalloc(size, GFP_KERNEL);
334 + memset(bp->tx_buffers, 0, size);
336 size = DMA_TABLE_BYTES;
337 bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma);
338 - if (!bp->rx_ring) {
339 - /* Allocation may have failed due to pci_alloc_consistent
340 - insisting on use of GFP_DMA, which is more restrictive
341 - than necessary... */
342 - struct dma_desc *rx_ring;
343 - dma_addr_t rx_ring_dma;
345 - rx_ring = kzalloc(size, GFP_KERNEL);
349 - rx_ring_dma = dma_map_single(&bp->pdev->dev, rx_ring,
351 - DMA_BIDIRECTIONAL);
353 - if (rx_ring_dma + size > B44_DMA_MASK) {
358 - bp->rx_ring = rx_ring;
359 - bp->rx_ring_dma = rx_ring_dma;
360 - bp->flags |= B44_FLAG_RX_RING_HACK;
365 bp->tx_ring = pci_alloc_consistent(bp->pdev, size, &bp->tx_ring_dma);
366 - if (!bp->tx_ring) {
367 - /* Allocation may have failed due to pci_alloc_consistent
368 - insisting on use of GFP_DMA, which is more restrictive
369 - than necessary... */
370 - struct dma_desc *tx_ring;
371 - dma_addr_t tx_ring_dma;
373 - tx_ring = kzalloc(size, GFP_KERNEL);
377 - tx_ring_dma = dma_map_single(&bp->pdev->dev, tx_ring,
381 - if (tx_ring_dma + size > B44_DMA_MASK) {
386 - bp->tx_ring = tx_ring;
387 - bp->tx_ring_dma = tx_ring_dma;
388 - bp->flags |= B44_FLAG_TX_RING_HACK;
395 @@ -1394,21 +1273,19 @@
397 err = b44_alloc_consistent(bp);
402 + err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
406 + spin_lock_irq(&bp->lock);
410 + bp->flags |= B44_FLAG_INIT_COMPLETE;
412 - netif_carrier_off(dev);
415 - err = request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev);
416 - if (unlikely(err < 0)) {
417 - b44_chip_reset(bp);
418 - b44_free_rings(bp);
419 - b44_free_consistent(bp);
422 + spin_unlock_irq(&bp->lock);
424 init_timer(&bp->timer);
425 bp->timer.expires = jiffies + HZ;
426 @@ -1417,8 +1294,11 @@
427 add_timer(&bp->timer);
430 - netif_start_queue(dev);
436 + b44_free_consistent(bp);
440 @@ -1453,8 +1333,6 @@
442 netif_stop_queue(dev);
444 - netif_poll_disable(dev);
446 del_timer_sync(&bp->timer);
448 spin_lock_irq(&bp->lock);
449 @@ -1464,14 +1342,13 @@
453 + bp->flags &= ~B44_FLAG_INIT_COMPLETE;
454 netif_carrier_off(bp->dev);
456 spin_unlock_irq(&bp->lock);
458 free_irq(dev->irq, dev);
460 - netif_poll_enable(dev);
462 b44_free_consistent(bp);
465 @@ -1536,6 +1413,8 @@
467 struct b44 *bp = netdev_priv(dev);
470 + unsigned char zero[6] = {0,0,0,0,0,0};
472 val = br32(bp, B44_RXCONFIG);
473 val &= ~(RXCONFIG_PROMISC | RXCONFIG_ALLMULTI);
474 @@ -1543,17 +1422,14 @@
475 val |= RXCONFIG_PROMISC;
476 bw32(bp, B44_RXCONFIG, val);
478 - unsigned char zero[6] = {0, 0, 0, 0, 0, 0};
481 __b44_set_mac_addr(bp);
483 if (dev->flags & IFF_ALLMULTI)
484 val |= RXCONFIG_ALLMULTI;
486 - i = __b44_load_mcast(bp, dev);
487 + i=__b44_load_mcast(bp, dev);
489 - for (; i < 64; i++) {
491 __b44_cam_write(bp, zero, i);
493 bw32(bp, B44_RXCONFIG, val);
494 @@ -1617,7 +1493,7 @@
496 struct b44 *bp = netdev_priv(dev);
498 - if (!netif_running(dev))
499 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
501 cmd->supported = (SUPPORTED_Autoneg);
502 cmd->supported |= (SUPPORTED_100baseT_Half |
503 @@ -1628,14 +1504,14 @@
505 cmd->advertising = 0;
506 if (bp->flags & B44_FLAG_ADV_10HALF)
507 - cmd->advertising |= ADVERTISED_10baseT_Half;
508 + cmd->advertising |= ADVERTISE_10HALF;
509 if (bp->flags & B44_FLAG_ADV_10FULL)
510 - cmd->advertising |= ADVERTISED_10baseT_Full;
511 + cmd->advertising |= ADVERTISE_10FULL;
512 if (bp->flags & B44_FLAG_ADV_100HALF)
513 - cmd->advertising |= ADVERTISED_100baseT_Half;
514 + cmd->advertising |= ADVERTISE_100HALF;
515 if (bp->flags & B44_FLAG_ADV_100FULL)
516 - cmd->advertising |= ADVERTISED_100baseT_Full;
517 - cmd->advertising |= ADVERTISED_Pause | ADVERTISED_Asym_Pause;
518 + cmd->advertising |= ADVERTISE_100FULL;
519 + cmd->advertising |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
520 cmd->speed = (bp->flags & B44_FLAG_100_BASE_T) ?
521 SPEED_100 : SPEED_10;
522 cmd->duplex = (bp->flags & B44_FLAG_FULL_DUPLEX) ?
523 @@ -1655,7 +1531,7 @@
525 struct b44 *bp = netdev_priv(dev);
527 - if (!netif_running(dev))
528 + if (!(bp->flags & B44_FLAG_INIT_COMPLETE))
531 /* We do not support gigabit. */
532 @@ -1785,37 +1661,6 @@
536 -static void b44_get_strings(struct net_device *dev, u32 stringset, u8 *data)
538 - switch(stringset) {
540 - memcpy(data, *b44_gstrings, sizeof(b44_gstrings));
545 -static int b44_get_stats_count(struct net_device *dev)
547 - return ARRAY_SIZE(b44_gstrings);
550 -static void b44_get_ethtool_stats(struct net_device *dev,
551 - struct ethtool_stats *stats, u64 *data)
553 - struct b44 *bp = netdev_priv(dev);
554 - u32 *val = &bp->hw_stats.tx_good_octets;
557 - spin_lock_irq(&bp->lock);
559 - b44_stats_update(bp);
561 - for (i = 0; i < ARRAY_SIZE(b44_gstrings); i++)
564 - spin_unlock_irq(&bp->lock);
567 static struct ethtool_ops b44_ethtool_ops = {
568 .get_drvinfo = b44_get_drvinfo,
569 .get_settings = b44_get_settings,
570 @@ -1828,25 +1673,18 @@
571 .set_pauseparam = b44_set_pauseparam,
572 .get_msglevel = b44_get_msglevel,
573 .set_msglevel = b44_set_msglevel,
574 - .get_strings = b44_get_strings,
575 - .get_stats_count = b44_get_stats_count,
576 - .get_ethtool_stats = b44_get_ethtool_stats,
577 - .get_perm_addr = ethtool_op_get_perm_addr,
580 static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
582 struct mii_ioctl_data *data = if_mii(ifr);
583 struct b44 *bp = netdev_priv(dev);
586 - if (!netif_running(dev))
590 spin_lock_irq(&bp->lock);
591 err = generic_mii_ioctl(&bp->mii_if, data, cmd, NULL);
592 spin_unlock_irq(&bp->lock);
598 @@ -1877,7 +1715,6 @@
599 bp->dev->dev_addr[3] = eeprom[80];
600 bp->dev->dev_addr[4] = eeprom[83];
601 bp->dev->dev_addr[5] = eeprom[82];
602 - memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len);
604 bp->phy_addr = eeprom[90] & 0x1f;
606 @@ -1942,9 +1779,9 @@
608 err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
610 - printk(KERN_ERR PFX "No usable DMA configuration, "
612 - goto err_out_free_res;
613 + printk(KERN_ERR PFX "No usable DMA configuration, "
615 + goto err_out_free_res;
618 b44reg_base = pci_resource_start(pdev, 0);
619 @@ -1966,8 +1803,10 @@
620 bp = netdev_priv(dev);
624 - bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE);
625 + if (b44_debug >= 0)
626 + bp->msg_enable = (1 << b44_debug) - 1;
628 + bp->msg_enable = B44_DEF_MSG_ENABLE;
630 spin_lock_init(&bp->lock);
632 @@ -2057,14 +1896,17 @@
633 static void __devexit b44_remove_one(struct pci_dev *pdev)
635 struct net_device *dev = pci_get_drvdata(pdev);
636 - struct b44 *bp = netdev_priv(dev);
638 - unregister_netdev(dev);
641 - pci_release_regions(pdev);
642 - pci_disable_device(pdev);
643 - pci_set_drvdata(pdev, NULL);
645 + struct b44 *bp = netdev_priv(dev);
647 + unregister_netdev(dev);
650 + pci_release_regions(pdev);
651 + pci_disable_device(pdev);
652 + pci_set_drvdata(pdev, NULL);
656 static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
657 @@ -2085,9 +1927,6 @@
660 spin_unlock_irq(&bp->lock);
662 - free_irq(dev->irq, dev);
663 - pci_disable_device(pdev);
667 @@ -2097,15 +1936,10 @@
668 struct b44 *bp = netdev_priv(dev);
670 pci_restore_state(pdev);
671 - pci_enable_device(pdev);
672 - pci_set_master(pdev);
674 if (!netif_running(dev))
677 - if (request_irq(dev->irq, b44_interrupt, SA_SHIRQ, dev->name, dev))
678 - printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
680 spin_lock_irq(&bp->lock);
683 @@ -2117,7 +1951,6 @@
684 add_timer(&bp->timer);
687 - netif_wake_queue(dev);
691 @@ -2132,12 +1965,6 @@
693 static int __init b44_init(void)
695 - unsigned int dma_desc_align_size = dma_get_cache_alignment();
697 - /* Setup paramaters for syncing RX/TX DMA descriptors */
698 - dma_desc_align_mask = ~(dma_desc_align_size - 1);
699 - dma_desc_sync_size = max(dma_desc_align_size, sizeof(struct dma_desc));
701 return pci_module_init(&b44_driver);
704 diff -ur linux-2.6.15-rc5/drivers/net/b44.h linux-2.6.15-rc5-openwrt/drivers/net/b44.h
705 --- linux-2.6.15-rc5/drivers/net/b44.h 2005-12-04 06:10:42.000000000 +0100
706 +++ linux-2.6.15-rc5-openwrt/drivers/net/b44.h 2005-08-15 02:20:18.000000000 +0200
707 @@ -346,63 +346,29 @@
709 #define B44_MCAST_TABLE_SIZE 32
711 -#define B44_STAT_REG_DECLARE \
712 - _B44(tx_good_octets) \
713 - _B44(tx_good_pkts) \
716 - _B44(tx_broadcast_pkts) \
717 - _B44(tx_multicast_pkts) \
719 - _B44(tx_len_65_to_127) \
720 - _B44(tx_len_128_to_255) \
721 - _B44(tx_len_256_to_511) \
722 - _B44(tx_len_512_to_1023) \
723 - _B44(tx_len_1024_to_max) \
724 - _B44(tx_jabber_pkts) \
725 - _B44(tx_oversize_pkts) \
726 - _B44(tx_fragment_pkts) \
727 - _B44(tx_underruns) \
728 - _B44(tx_total_cols) \
729 - _B44(tx_single_cols) \
730 - _B44(tx_multiple_cols) \
731 - _B44(tx_excessive_cols) \
732 - _B44(tx_late_cols) \
734 - _B44(tx_carrier_lost) \
735 - _B44(tx_pause_pkts) \
736 - _B44(rx_good_octets) \
737 - _B44(rx_good_pkts) \
740 - _B44(rx_broadcast_pkts) \
741 - _B44(rx_multicast_pkts) \
743 - _B44(rx_len_65_to_127) \
744 - _B44(rx_len_128_to_255) \
745 - _B44(rx_len_256_to_511) \
746 - _B44(rx_len_512_to_1023) \
747 - _B44(rx_len_1024_to_max) \
748 - _B44(rx_jabber_pkts) \
749 - _B44(rx_oversize_pkts) \
750 - _B44(rx_fragment_pkts) \
751 - _B44(rx_missed_pkts) \
752 - _B44(rx_crc_align_errs) \
753 - _B44(rx_undersize) \
754 - _B44(rx_crc_errs) \
755 - _B44(rx_align_errs) \
756 - _B44(rx_symbol_errs) \
757 - _B44(rx_pause_pkts) \
758 - _B44(rx_nonpause_pkts)
760 /* SW copy of device statistics, kept up to date by periodic timer
761 - * which probes HW values. Check b44_stats_update if you mess with
763 + * which probes HW values. Must have same relative layout as HW
764 + * register above, because b44_stats_update depends upon this.
766 struct b44_hw_stats {
767 -#define _B44(x) u32 x;
768 -B44_STAT_REG_DECLARE
770 + u32 tx_good_octets, tx_good_pkts, tx_octets;
771 + u32 tx_pkts, tx_broadcast_pkts, tx_multicast_pkts;
772 + u32 tx_len_64, tx_len_65_to_127, tx_len_128_to_255;
773 + u32 tx_len_256_to_511, tx_len_512_to_1023, tx_len_1024_to_max;
774 + u32 tx_jabber_pkts, tx_oversize_pkts, tx_fragment_pkts;
775 + u32 tx_underruns, tx_total_cols, tx_single_cols;
776 + u32 tx_multiple_cols, tx_excessive_cols, tx_late_cols;
777 + u32 tx_defered, tx_carrier_lost, tx_pause_pkts;
780 + u32 rx_good_octets, rx_good_pkts, rx_octets;
781 + u32 rx_pkts, rx_broadcast_pkts, rx_multicast_pkts;
782 + u32 rx_len_64, rx_len_65_to_127, rx_len_128_to_255;
783 + u32 rx_len_256_to_511, rx_len_512_to_1023, rx_len_1024_to_max;
784 + u32 rx_jabber_pkts, rx_oversize_pkts, rx_fragment_pkts;
785 + u32 rx_missed_pkts, rx_crc_align_errs, rx_undersize;
786 + u32 rx_crc_errs, rx_align_errs, rx_symbol_errs;
787 + u32 rx_pause_pkts, rx_nonpause_pkts;
795 +#define B44_FLAG_INIT_COMPLETE 0x00000001
796 #define B44_FLAG_BUGGY_TXPTR 0x00000002
797 #define B44_FLAG_REORDER_BUG 0x00000004
798 #define B44_FLAG_PAUSE_AUTO 0x00008000
800 #define B44_FLAG_ADV_100HALF 0x04000000
801 #define B44_FLAG_ADV_100FULL 0x08000000
802 #define B44_FLAG_INTERNAL_PHY 0x10000000
803 -#define B44_FLAG_RX_RING_HACK 0x20000000
804 -#define B44_FLAG_TX_RING_HACK 0x40000000