ixgbe: Fix 82599 multispeed fiber link issues due to Tx laser flapping
[safe/jmp/linux-2.6] / drivers / net / fealnx.c
index e173515..9d5ad08 100644 (file)
@@ -1629,8 +1629,8 @@ static int netdev_rx(struct net_device *dev)
                if (debug)
                        printk(KERN_DEBUG "  netdev_rx() status was %8.8x.\n", rx_status);
 
-               if ((!((rx_status & RXFSD) && (rx_status & RXLSD)))
-                   || (rx_status & ErrorSummary)) {
+               if ((!((rx_status & RXFSD) && (rx_status & RXLSD))) ||
+                   (rx_status & ErrorSummary)) {
                        if (rx_status & ErrorSummary) { /* there was a fatal error */
                                if (debug)
                                        printk(KERN_DEBUG
@@ -1655,8 +1655,8 @@ static int netdev_rx(struct net_device *dev)
                                        cur = np->cur_rx;
                                        while (desno <= np->really_rx_count) {
                                                ++desno;
-                                               if ((!(cur->status & RXOWN))
-                                                   && (cur->status & RXLSD))
+                                               if ((!(cur->status & RXOWN)) &&
+                                                   (cur->status & RXLSD))
                                                        break;
                                                /* goto next rx descriptor */
                                                cur = cur->next_desc_logical;
@@ -1786,18 +1786,16 @@ static void __set_rx_mode(struct net_device *dev)
        if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
                memset(mc_filter, 0xff, sizeof(mc_filter));
                rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
-       } else if ((dev->mc_count > multicast_filter_limit)
-                  || (dev->flags & IFF_ALLMULTI)) {
+       } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
+                  (dev->flags & IFF_ALLMULTI)) {
                /* Too many to match, or accept all multicasts. */
                memset(mc_filter, 0xff, sizeof(mc_filter));
                rx_mode = CR_W_AB | CR_W_AM;
        } else {
                struct dev_mc_list *mclist;
-               int i;
 
                memset(mc_filter, 0, sizeof(mc_filter));
-               for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
-                    i++, mclist = mclist->next) {
+               netdev_for_each_mc_addr(mclist, dev) {
                        unsigned int bit;
                        bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
                        mc_filter[bit >> 5] |= (1 << bit);
@@ -1941,7 +1939,7 @@ static int netdev_close(struct net_device *dev)
        return 0;
 }
 
-static struct pci_device_id fealnx_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(fealnx_pci_tbl) = {
        {0x1516, 0x0800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
        {0x1516, 0x0803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1},
        {0x1516, 0x0891, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2},