mwl8k: use integral index instead of pointer for driver_data
[safe/jmp/linux-2.6] / drivers / net / bnx2x_main.c
index 7c5c300..59b58d8 100644 (file)
@@ -56,8 +56,8 @@
 #include "bnx2x_init_ops.h"
 #include "bnx2x_dump.h"
 
-#define DRV_MODULE_VERSION     "1.52.1"
-#define DRV_MODULE_RELDATE     "2009/08/12"
+#define DRV_MODULE_VERSION     "1.52.1-1"
+#define DRV_MODULE_RELDATE     "2009/10/13"
 #define BNX2X_BC_VER           0x040200
 
 #include <linux/firmware.h>
@@ -2163,11 +2163,23 @@ static void bnx2x_link_report(struct bnx2x *bp)
        }
 
        if (bp->link_vars.link_up) {
+               u16 line_speed;
+
                if (bp->state == BNX2X_STATE_OPEN)
                        netif_carrier_on(bp->dev);
                printk(KERN_INFO PFX "%s NIC Link is Up, ", bp->dev->name);
 
-               printk("%d Mbps ", bp->link_vars.line_speed);
+               line_speed = bp->link_vars.line_speed;
+               if (IS_E1HMF(bp)) {
+                       u16 vn_max_rate;
+
+                       vn_max_rate =
+                               ((bp->mf_config & FUNC_MF_CFG_MAX_BW_MASK) >>
+                                FUNC_MF_CFG_MAX_BW_SHIFT) * 100;
+                       if (vn_max_rate < line_speed)
+                               line_speed = vn_max_rate;
+               }
+               printk("%d Mbps ", line_speed);
 
                if (bp->link_vars.duplex == DUPLEX_FULL)
                        printk("full duplex");
@@ -2565,21 +2577,12 @@ static void bnx2x_set_rx_mode(struct net_device *dev);
 static void bnx2x_e1h_disable(struct bnx2x *bp)
 {
        int port = BP_PORT(bp);
-       int i;
-
-       bp->rx_mode = BNX2X_RX_MODE_NONE;
-       bnx2x_set_storm_rx_mode(bp);
 
        netif_tx_disable(bp->dev);
        bp->dev->trans_start = jiffies; /* prevent tx timeout */
 
        REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 0);
 
-       bnx2x_set_eth_mac_addr_e1h(bp, 0);
-
-       for (i = 0; i < MC_HASH_SIZE; i++)
-               REG_WR(bp, MC_HASH_OFFSET(bp, i), 0);
-
        netif_carrier_off(bp->dev);
 }
 
@@ -2589,13 +2592,13 @@ static void bnx2x_e1h_enable(struct bnx2x *bp)
 
        REG_WR(bp, NIG_REG_LLH0_FUNC_EN + port*8, 1);
 
-       bnx2x_set_eth_mac_addr_e1h(bp, 1);
-
        /* Tx queue should be only reenabled */
        netif_tx_wake_all_queues(bp->dev);
 
-       /* Initialize the receive filter. */
-       bnx2x_set_rx_mode(bp->dev);
+       /*
+        * Should not call netif_carrier_on since it will be called if the link
+        * is up when checking for link state
+        */
 }
 
 static void bnx2x_update_min_max(struct bnx2x *bp)
@@ -10538,7 +10541,7 @@ static void bnx2x_self_test(struct net_device *dev,
                /* disable input for TX port IF */
                REG_WR(bp, NIG_REG_EGRESS_UMP0_IN_EN + port*4, 0);
 
-               link_up = bp->link_vars.link_up;
+               link_up = (bnx2x_link_test(bp) == 0);
                bnx2x_nic_unload(bp, UNLOAD_NORMAL);
                bnx2x_nic_load(bp, LOAD_DIAG);
                /* wait until link state is restored */