]> Pileus Git - ~andy/linux/blobdiff - drivers/net/b44.c
ath5k: Use high bitrates for ACK/CTS
[~andy/linux] / drivers / net / b44.c
index 180510ed92a510f0de692457bd6d28030a289444..332c60356285688fe7807b0f692fcce9a9c153ff 100644 (file)
@@ -338,7 +338,7 @@ static int b44_phy_reset(struct b44 *bp)
                }
        }
 
-       return 0;
+       return err;
 }
 
 static void __b44_set_flow_ctrl(struct b44 *bp, u32 pause_flags)
@@ -809,7 +809,7 @@ static int b44_rx(struct b44 *bp, int budget)
                        struct sk_buff *copy_skb;
 
                        b44_recycle_rx(bp, cons, bp->rx_prod);
-                       copy_skb = dev_alloc_skb(len + 2);
+                       copy_skb = netdev_alloc_skb(bp->dev, len + 2);
                        if (copy_skb == NULL)
                                goto drop_it_no_recycle;
 
@@ -1684,9 +1684,11 @@ static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
        int i, num_ents;
 
        num_ents = min_t(int, netdev_mc_count(dev), B44_MCAST_TABLE_SIZE);
-       mclist = dev->mc_list;
-       for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) {
-               __b44_cam_write(bp, mclist->dmi_addr, i + 1);
+       i = 0;
+       netdev_for_each_mc_addr(mclist, dev) {
+               if (i == num_ents)
+                       break;
+               __b44_cam_write(bp, mclist->dmi_addr, i++ + 1);
        }
        return i+1;
 }
@@ -2215,6 +2217,10 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
         */
        b44_chip_reset(bp, B44_CHIP_RESET_FULL);
 
+       /* do a phy reset to test if there is an active phy */
+       if (b44_phy_reset(bp) < 0)
+               bp->phy_addr = B44_PHY_ADDR_NO_PHY;
+
        netdev_info(dev, "Broadcom 44xx/47xx 10/100BaseT Ethernet %pM\n",
                    dev->dev_addr);