Merge branch 'master' of github.com:davem330/net
[pandora-kernel.git] / drivers / net / ethernet / broadcom / bnx2x / bnx2x_main.c
similarity index 99%
rename from drivers/net/bnx2x/bnx2x_main.c
rename to drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index c027e93..621ab28 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -37,6 +39,7 @@
 #include <linux/time.h>
 #include <linux/ethtool.h>
 #include <linux/mii.h>
+#include <linux/if.h>
 #include <linux/if_vlan.h>
 #include <net/ip.h>
 #include <net/ipv6.h>
@@ -350,17 +353,15 @@ static void bnx2x_dp_dmae(struct bnx2x *bp, struct dmae_command *dmae,
        default:
                if (src_type == DMAE_CMD_SRC_PCI)
                        DP(msglvl, "DMAE: opcode 0x%08x\n"
-                          DP_LEVEL "src_addr [%x:%08x]  len [%d * 4]  "
-                                   "dst_addr [none]\n"
-                          DP_LEVEL "comp_addr [%x:%08x]  comp_val 0x%08x\n",
+                          "src_addr [%x:%08x]  len [%d * 4]  dst_addr [none]\n"
+                          "comp_addr [%x:%08x]  comp_val 0x%08x\n",
                           dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
                           dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo,
                           dmae->comp_val);
                else
                        DP(msglvl, "DMAE: opcode 0x%08x\n"
-                          DP_LEVEL "src_addr [%08x]  len [%d * 4]  "
-                                   "dst_addr [none]\n"
-                          DP_LEVEL "comp_addr [%x:%08x]  comp_val 0x%08x\n",
+                          "src_addr [%08x]  len [%d * 4]  dst_addr [none]\n"
+                          "comp_addr [%x:%08x]  comp_val 0x%08x\n",
                           dmae->opcode, dmae->src_addr_lo >> 2,
                           dmae->len, dmae->comp_addr_hi, dmae->comp_addr_lo,
                           dmae->comp_val);
@@ -789,18 +790,15 @@ void bnx2x_panic_dump(struct bnx2x *bp)
        BNX2X_ERR("     def (");
        for (i = 0; i < HC_SP_SB_MAX_INDICES; i++)
                pr_cont("0x%x%s",
-                      bp->def_status_blk->sp_sb.index_values[i],
-                      (i == HC_SP_SB_MAX_INDICES - 1) ? ")  " : " ");
+                       bp->def_status_blk->sp_sb.index_values[i],
+                       (i == HC_SP_SB_MAX_INDICES - 1) ? ")  " : " ");
 
        for (i = 0; i < sizeof(struct hc_sp_status_block_data)/sizeof(u32); i++)
                *((u32 *)&sp_sb_data + i) = REG_RD(bp, BAR_CSTRORM_INTMEM +
                        CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(func) +
                        i*sizeof(u32));
 
-       pr_cont("igu_sb_id(0x%x)  igu_seg_id(0x%x) "
-                        "pf_id(0x%x)  vnic_id(0x%x)  "
-                        "vf_id(0x%x)  vf_valid (0x%x) "
-                        "state(0x%x)\n",
+       pr_cont("igu_sb_id(0x%x)  igu_seg_id(0x%x) pf_id(0x%x)  vnic_id(0x%x)  vf_id(0x%x)  vf_valid (0x%x) state(0x%x)\n",
               sp_sb_data.igu_sb_id,
               sp_sb_data.igu_seg_id,
               sp_sb_data.p_func.pf_id,
@@ -3741,9 +3739,7 @@ static inline void bnx2x_clear_load_cnt(struct bnx2x *bp)
 
 static inline void _print_next_block(int idx, const char *blk)
 {
-       if (idx)
-               pr_cont(", ");
-       pr_cont("%s", blk);
+       pr_cont("%s%s", idx ? ", " : "", blk);
 }
 
 static inline int bnx2x_check_blocks_with_parity0(u32 sig, int par_num,
@@ -4408,7 +4404,7 @@ static inline void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp)
 static inline struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(
        struct bnx2x *bp, u32 cid)
 {
-       DP(BNX2X_MSG_SP, "retrieving fp from cid %d", cid);
+       DP(BNX2X_MSG_SP, "retrieving fp from cid %d\n", cid);
 #ifdef BCM_CNIC
        if (cid == BNX2X_FCOE_ETH_CID)
                return &bnx2x_fcoe(bp, q_obj);
@@ -7241,7 +7237,7 @@ static inline void bnx2x_pf_q_prep_init(struct bnx2x *bp,
        /* set maximum number of COSs supported by this queue */
        init_params->max_cos = fp->max_cos;
 
-       DP(BNX2X_MSG_SP, "fp: %d setting queue params max cos to: %d",
+       DP(BNX2X_MSG_SP, "fp: %d setting queue params max cos to: %d\n",
            fp->index, init_params->max_cos);
 
        /* set the context pointers queue object */
@@ -7274,7 +7270,7 @@ int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,
 
        DP(BNX2X_MSG_SP, "preparing to send tx-only ramrod for connection:"
                         "cos %d, primary cid %d, cid %d, "
-                        "client id %d, sp-client id %d, flags %lx",
+                        "client id %d, sp-client id %d, flags %lx\n",
           tx_index, q_params->q_obj->cids[FIRST_TX_COS_INDEX],
           q_params->q_obj->cids[tx_index], q_params->q_obj->cl_id,
           tx_only_params->gen_params.spcl_id, tx_only_params->flags);
@@ -7306,7 +7302,7 @@ int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp,
        int rc;
        u8 tx_index;
 
-       DP(BNX2X_MSG_SP, "setting up queue %d", fp->index);
+       DP(BNX2X_MSG_SP, "setting up queue %d\n", fp->index);
 
        /* reset IGU state skip FCoE L2 queue */
        if (!IS_FCOE_FP(fp))
@@ -7330,7 +7326,7 @@ int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp,
                return rc;
        }
 
-       DP(BNX2X_MSG_SP, "init complete");
+       DP(BNX2X_MSG_SP, "init complete\n");
 
 
        /* Now move the Queue to the SETUP state... */
@@ -7384,7 +7380,7 @@ static int bnx2x_stop_queue(struct bnx2x *bp, int index)
        struct bnx2x_queue_state_params q_params = {0};
        int rc, tx_index;
 
-       DP(BNX2X_MSG_SP, "stopping queue %d cid %d", index, fp->cid);
+       DP(BNX2X_MSG_SP, "stopping queue %d cid %d\n", index, fp->cid);
 
        q_params.q_obj = &fp->q_obj;
        /* We want to wait for completion in this context */
@@ -7399,7 +7395,7 @@ static int bnx2x_stop_queue(struct bnx2x *bp, int index)
                /* ascertain this is a normal queue*/
                txdata = &fp->txdata[tx_index];
 
-               DP(BNX2X_MSG_SP, "stopping tx-only queue %d",
+               DP(BNX2X_MSG_SP, "stopping tx-only queue %d\n",
                                                        txdata->txq_index);
 
                /* send halt terminate on tx-only connection */
@@ -9381,9 +9377,8 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
                                val = MF_CFG_RD(bp, func_ext_config[func].
                                                    iscsi_mac_addr_lower);
                                bnx2x_set_mac_buf(iscsi_mac, val, val2);
-                               BNX2X_DEV_INFO("Read iSCSI MAC: "
-                                              BNX2X_MAC_FMT"\n",
-                                              BNX2X_MAC_PRN_LIST(iscsi_mac));
+                               BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n",
+                                              iscsi_mac);
                        } else
                                bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
 
@@ -9393,9 +9388,8 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
                                val = MF_CFG_RD(bp, func_ext_config[func].
                                                    fcoe_mac_addr_lower);
                                bnx2x_set_mac_buf(fip_mac, val, val2);
-                               BNX2X_DEV_INFO("Read FCoE L2 MAC to "
-                                              BNX2X_MAC_FMT"\n",
-                                              BNX2X_MAC_PRN_LIST(fip_mac));
+                               BNX2X_DEV_INFO("Read FCoE L2 MAC to %pM\n",
+                                              fip_mac);
 
                        } else
                                bp->flags |= NO_FCOE_FLAG;
@@ -9450,9 +9444,9 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
        if (!is_valid_ether_addr(bp->dev->dev_addr))
                dev_err(&bp->pdev->dev,
                        "bad Ethernet MAC address configuration: "
-                       BNX2X_MAC_FMT", change it manually before bringing up "
+                       "%pM, change it manually before bringing up "
                        "the appropriate network interface\n",
-                       BNX2X_MAC_PRN_LIST(bp->dev->dev_addr));
+                       bp->dev->dev_addr);
 }
 
 static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
@@ -10356,9 +10350,11 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
        dev->netdev_ops = &bnx2x_netdev_ops;
        bnx2x_set_ethtool_ops(dev);
 
+       dev->priv_flags |= IFF_UNICAST_FLT;
+
        dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
-               NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
-               NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_HW_VLAN_TX;
+               NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_LRO |
+               NETIF_F_RXCSUM | NETIF_F_RXHASH | NETIF_F_HW_VLAN_TX;
 
        dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
                NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
@@ -10789,7 +10785,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
                return rc;
        }
 
-       DP(NETIF_MSG_DRV, "max_non_def_sbs %d", max_non_def_sbs);
+       DP(NETIF_MSG_DRV, "max_non_def_sbs %d\n", max_non_def_sbs);
 
        rc = bnx2x_init_bp(bp);
        if (rc)
@@ -10844,15 +10840,14 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
 
        bnx2x_get_pcie_width_speed(bp, &pcie_width, &pcie_speed);
 
-       netdev_info(dev, "%s (%c%d) PCI-E x%d %s found at mem %lx,"
-              " IRQ %d, ", board_info[ent->driver_data].name,
-              (CHIP_REV(bp) >> 12) + 'A', (CHIP_METAL(bp) >> 4),
-              pcie_width,
-              ((!CHIP_IS_E2(bp) && pcie_speed == 2) ||
-                (CHIP_IS_E2(bp) && pcie_speed == 1)) ?
-                                               "5GHz (Gen2)" : "2.5GHz",
-              dev->base_addr, bp->pdev->irq);
-       pr_cont("node addr %pM\n", dev->dev_addr);
+       netdev_info(dev, "%s (%c%d) PCI-E x%d %s found at mem %lx, IRQ %d, node addr %pM\n",
+                   board_info[ent->driver_data].name,
+                   (CHIP_REV(bp) >> 12) + 'A', (CHIP_METAL(bp) >> 4),
+                   pcie_width,
+                   ((!CHIP_IS_E2(bp) && pcie_speed == 2) ||
+                    (CHIP_IS_E2(bp) && pcie_speed == 1)) ?
+                   "5GHz (Gen2)" : "2.5GHz",
+                   dev->base_addr, bp->pdev->irq, dev->dev_addr);
 
        return 0;