[PATCH] b44: increase version to 1.00
[deliverable/linux.git] / drivers / net / b44.c
index c3267e4e1bb02d6c7bf552b1fc818aa4308fa0c2..aa1ef74792c61075ec36a0fff36ed3d904f3f1f4 100644 (file)
@@ -2,6 +2,7 @@
  *
  * Copyright (C) 2002 David S. Miller (davem@redhat.com)
  * Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
+ * Copyright (C) 2006 Broadcom Corporation.
  *
  * Distribute under GPL.
  */
@@ -28,8 +29,8 @@
 
 #define DRV_MODULE_NAME                "b44"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "0.97"
-#define DRV_MODULE_RELDATE     "Nov 30, 2005"
+#define DRV_MODULE_VERSION     "1.00"
+#define DRV_MODULE_RELDATE     "Apr 7, 2006"
 
 #define B44_DEF_MSG_ENABLE       \
        (NETIF_MSG_DRV          | \
@@ -410,25 +411,18 @@ static void __b44_set_flow_ctrl(struct b44 *bp, u32 pause_flags)
 
 static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote)
 {
-       u32 pause_enab = bp->flags & (B44_FLAG_TX_PAUSE |
-                                     B44_FLAG_RX_PAUSE);
+       u32 pause_enab = 0; 
 
-       if (local & ADVERTISE_PAUSE_CAP) {
-               if (local & ADVERTISE_PAUSE_ASYM) {
-                       if (remote & LPA_PAUSE_CAP)
-                               pause_enab |= (B44_FLAG_TX_PAUSE |
-                                              B44_FLAG_RX_PAUSE);
-                       else if (remote & LPA_PAUSE_ASYM)
-                               pause_enab |= B44_FLAG_RX_PAUSE;
-               } else {
-                       if (remote & LPA_PAUSE_CAP)
-                               pause_enab |= (B44_FLAG_TX_PAUSE |
-                                              B44_FLAG_RX_PAUSE);
-               }
-       } else if (local & ADVERTISE_PAUSE_ASYM) {
-               if ((remote & LPA_PAUSE_CAP) &&
-                   (remote & LPA_PAUSE_ASYM))
-                       pause_enab |= B44_FLAG_TX_PAUSE;
+       /* The driver supports only rx pause by default because
+          the b44 mac tx pause mechanism generates excessive 
+          pause frames.           
+          Use ethtool to turn on b44 tx pause if necessary.
+        */
+       if ((local & ADVERTISE_PAUSE_CAP) &&
+           (local & ADVERTISE_PAUSE_ASYM)){ 
+               if ((remote & LPA_PAUSE_ASYM) &&
+                   !(remote & LPA_PAUSE_CAP))
+                       pause_enab |= B44_FLAG_RX_PAUSE;
        }
 
        __b44_set_flow_ctrl(bp, pause_enab);
@@ -608,8 +602,7 @@ static void b44_tx(struct b44 *bp)
                struct ring_info *rp = &bp->tx_buffers[cons];
                struct sk_buff *skb = rp->skb;
 
-               if (unlikely(skb == NULL))
-                       BUG();
+               BUG_ON(skb == NULL);
 
                pci_unmap_single(bp->pdev,
                                 pci_unmap_addr(rp, mapping),
@@ -1339,6 +1332,9 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
        if (netif_running(dev))
                return -EBUSY;
 
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EINVAL;
+
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
        spin_lock_irq(&bp->lock);
@@ -1876,6 +1872,12 @@ static int __devinit b44_get_invariants(struct b44 *bp)
        bp->dev->dev_addr[3] = eeprom[80];
        bp->dev->dev_addr[4] = eeprom[83];
        bp->dev->dev_addr[5] = eeprom[82];
+
+       if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
+               printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n");
+               return -EINVAL;
+       }
+
        memcpy(bp->dev->perm_addr, bp->dev->dev_addr, bp->dev->addr_len);
 
        bp->phy_addr = eeprom[90] & 0x1f;
@@ -2033,6 +2035,11 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
 
        pci_save_state(bp->pdev);
 
+       /* Chip reset provides power to the b44 MAC & PCI cores, which 
+        * is necessary for MAC register access.
+        */ 
+       b44_chip_reset(bp);
+
        printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
        for (i = 0; i < 6; i++)
                printk("%2.2x%c", dev->dev_addr[i],
This page took 0.027517 seconds and 5 git commands to generate.