net: use eth_hw_addr_random() and reset addr_assign_type
[deliverable/linux.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_main.c
index fea96150539199c67d7306efbcb286d3b1d22606..8e809c1408b48780a4f71153fbb5017246f9fc65 100644 (file)
@@ -7125,6 +7125,11 @@ int bnx2x_alloc_mem(struct bnx2x *bp)
        BNX2X_PCI_ALLOC(bp->slowpath, &bp->slowpath_mapping,
                        sizeof(struct bnx2x_slowpath));
 
+#ifdef BCM_CNIC
+       /* write address to which L5 should insert its values */
+       bp->cnic_eth_dev.addr_drv_info_to_mcp = &bp->slowpath->drv_info_to_mcp;
+#endif
+
        /* Allocated memory for FW statistics  */
        if (bnx2x_alloc_fw_stats_mem(bp))
                goto alloc_mem_err;
@@ -9293,6 +9298,11 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp)
                                        SPEED_AUTO_NEG;
                                bp->port.advertising[idx] |=
                                        bp->port.supported[idx];
+                               if (bp->link_params.phy[EXT_PHY1].type ==
+                                   PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833)
+                                       bp->port.advertising[idx] |=
+                                       (SUPPORTED_100baseT_Half |
+                                        SUPPORTED_100baseT_Full);
                        } else {
                                /* force 10G, no AN */
                                bp->link_params.req_line_speed[idx] =
@@ -9673,7 +9683,7 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
 
        if (BP_NOMCP(bp)) {
                BNX2X_ERROR("warning: random MAC workaround active\n");
-               random_ether_addr(bp->dev->dev_addr);
+               eth_hw_addr_random(bp->dev);
        } else if (IS_MF(bp)) {
                val2 = MF_CFG_RD(bp, func_mf_config[func].mac_upper);
                val = MF_CFG_RD(bp, func_mf_config[func].mac_lower);
@@ -10235,6 +10245,8 @@ static int bnx2x_open(struct net_device *dev)
        int other_engine = BP_PATH(bp) ? 0 : 1;
        bool other_load_status, load_status;
 
+       bp->stats_init = true;
+
        netif_carrier_off(dev);
 
        bnx2x_set_power_state(bp, PCI_D0);
@@ -10894,10 +10906,8 @@ static inline void be16_to_cpu_n(const u8 *_source, u8 *_target, u32 n)
 do {                                                                   \
        u32 len = be32_to_cpu(fw_hdr->arr.len);                         \
        bp->arr = kmalloc(len, GFP_KERNEL);                             \
-       if (!bp->arr) {                                                 \
-               pr_err("Failed to allocate %d bytes for "#arr"\n", len); \
+       if (!bp->arr)                                                   \
                goto lbl;                                               \
-       }                                                               \
        func(bp->firmware->data + be32_to_cpu(fw_hdr->arr.offset),      \
             (u8 *)bp->arr, len);                                       \
 } while (0)
@@ -11135,10 +11145,8 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
 
        /* dev zeroed in init_etherdev */
        dev = alloc_etherdev_mqs(sizeof(*bp), tx_count, rx_count);
-       if (!dev) {
-               dev_err(&pdev->dev, "Cannot allocate net device\n");
+       if (!dev)
                return -ENOMEM;
-       }
 
        bp = netdev_priv(dev);
 
@@ -11344,17 +11352,6 @@ static void bnx2x_eeh_recover(struct bnx2x *bp)
 
        mutex_init(&bp->port.phy_mutex);
 
-       bp->common.shmem_base = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR);
-       bp->link_params.shmem_base = bp->common.shmem_base;
-       BNX2X_DEV_INFO("shmem offset is 0x%x\n", bp->common.shmem_base);
-
-       if (!bp->common.shmem_base ||
-           (bp->common.shmem_base < 0xA0000) ||
-           (bp->common.shmem_base >= 0xC0000)) {
-               BNX2X_DEV_INFO("MCP not active\n");
-               bp->flags |= NO_MCP_FLAG;
-               return;
-       }
 
        val = SHMEM_RD(bp, validity_map[BP_PORT(bp)]);
        if ((val & (SHR_MEM_VALIDITY_DEV_INFO | SHR_MEM_VALIDITY_MB))
This page took 0.026734 seconds and 5 git commands to generate.