]> Pileus Git - ~andy/linux/commitdiff
qlcnic: Issue INIT_NIC command only once.
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Tue, 17 Dec 2013 14:01:50 +0000 (09:01 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Dec 2013 22:09:43 +0000 (17:09 -0500)
o DCB AEN registration was reissuing INIT_NIC command. Instead, club
  all options of INIT NIC command and issue this command only once.

Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_dcb.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

index b1cb0ffb15c70d1970f3cbebab28ff7f8e8530ce..9edafa9c371edaa1155957f8d26c148e47a27159 100644 (file)
@@ -68,7 +68,7 @@ static const struct qlcnic_mailbox_metadata qlcnic_83xx_mbx_tbl[] = {
        {QLCNIC_CMD_CONFIG_VPORT, 4, 4},
        {QLCNIC_CMD_BC_EVENT_SETUP, 2, 1},
        {QLCNIC_CMD_DCB_QUERY_CAP, 1, 2},
-       {QLCNIC_CMD_DCB_QUERY_PARAM, 2, 50},
+       {QLCNIC_CMD_DCB_QUERY_PARAM, 1, 50},
 };
 
 const u32 qlcnic_83xx_ext_reg_tbl[] = {
@@ -1542,6 +1542,10 @@ void qlcnic_83xx_register_nic_idc_func(struct qlcnic_adapter *adapter,
 
                cmd.req.arg[1] = BIT_0 | BIT_31;
        }
+
+       if (adapter->dcb)
+               cmd.req.arg[1] |= QLC_REGISTER_DCB_AEN;
+
        status = qlcnic_issue_cmd(adapter, &cmd);
        if (status)
                dev_err(&adapter->pdev->dev,
index 4cae6caa6bfa42476ff79b881784dd2f42a36db6..ddc3b0ac516b2416dc31a0d92a54fea381e02d6f 100644 (file)
@@ -518,6 +518,9 @@ enum qlc_83xx_ext_regs {
        QLC_83XX_ASIC_TEMP,
 };
 
+/* Initialize/Stop NIC command bit definitions */
+#define QLC_REGISTER_DCB_AEN           BIT_1
+
 /* 83xx funcitons */
 int qlcnic_83xx_get_fw_version(struct qlcnic_adapter *);
 int qlcnic_83xx_issue_cmd(struct qlcnic_adapter *, struct qlcnic_cmd_args *);
index c23308483ceefbd8367577f9560ab34418bf9ceb..77f1bce432d2998b3d14b5b6f56c694a877a1ae6 100644 (file)
@@ -15,7 +15,6 @@
 
 #define QLC_DCB_GET_MAP(V)             (1 << V)
 
-#define QLC_DCB_AEN_BIT                        0x2
 #define QLC_DCB_FW_VER                 0x2
 #define QLC_DCB_MAX_TC                 0x8
 #define QLC_DCB_MAX_APP                        0x8
@@ -71,7 +70,6 @@ static void qlcnic_82xx_dcb_aen_handler(struct qlcnic_dcb *, void *);
 static int qlcnic_83xx_dcb_get_hw_capability(struct qlcnic_dcb *);
 static int qlcnic_83xx_dcb_query_cee_param(struct qlcnic_dcb *, char *, u8);
 static int qlcnic_83xx_dcb_get_cee_cfg(struct qlcnic_dcb *);
-static int qlcnic_83xx_dcb_register_aen(struct qlcnic_dcb *, bool);
 static void qlcnic_83xx_dcb_aen_handler(struct qlcnic_dcb *, void *);
 
 struct qlcnic_dcb_capability {
@@ -179,7 +177,6 @@ static struct qlcnic_dcb_ops qlcnic_83xx_dcb_ops = {
        .get_hw_capability      = qlcnic_83xx_dcb_get_hw_capability,
        .query_cee_param        = qlcnic_83xx_dcb_query_cee_param,
        .get_cee_cfg            = qlcnic_83xx_dcb_get_cee_cfg,
-       .register_aen           = qlcnic_83xx_dcb_register_aen,
        .aen_handler            = qlcnic_83xx_dcb_aen_handler,
 };
 
@@ -283,7 +280,6 @@ static void __qlcnic_dcb_free(struct qlcnic_dcb *dcb)
                return;
 
        adapter = dcb->adapter;
-       qlcnic_dcb_register_aen(dcb, 0);
 
        while (test_bit(QLCNIC_DCB_AEN_MODE, &dcb->state))
                usleep_range(10000, 11000);
@@ -307,7 +303,6 @@ static void __qlcnic_dcb_get_info(struct qlcnic_dcb *dcb)
 {
        qlcnic_dcb_get_hw_capability(dcb);
        qlcnic_dcb_get_cee_cfg(dcb);
-       qlcnic_dcb_register_aen(dcb, 1);
 }
 
 static int __qlcnic_dcb_attach(struct qlcnic_dcb *dcb)
@@ -645,29 +640,6 @@ static int qlcnic_83xx_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
        return err;
 }
 
-static int qlcnic_83xx_dcb_register_aen(struct qlcnic_dcb *dcb, bool flag)
-{
-       u8 val = (flag ? QLCNIC_CMD_INIT_NIC_FUNC : QLCNIC_CMD_STOP_NIC_FUNC);
-       struct qlcnic_adapter *adapter = dcb->adapter;
-       struct qlcnic_cmd_args cmd;
-       int err;
-
-       err = qlcnic_alloc_mbx_args(&cmd, adapter, val);
-       if (err)
-               return err;
-
-       cmd.req.arg[1] = QLC_DCB_AEN_BIT;
-
-       err = qlcnic_issue_cmd(adapter, &cmd);
-       if (err)
-               dev_err(&adapter->pdev->dev, "Failed to %s DCBX AEN, err %d\n",
-                       (flag ? "register" : "unregister"), err);
-
-       qlcnic_free_mbx_args(&cmd);
-
-       return err;
-}
-
 static void qlcnic_83xx_dcb_aen_handler(struct qlcnic_dcb *dcb, void *data)
 {
        u32 *val = data;
index 6b6144def5035df12eceec44b58821914ae44831..3cf4a10fbe1e07fd011729401247e19daacecb24 100644 (file)
@@ -25,7 +25,6 @@ struct qlcnic_dcb_ops {
        int (*get_hw_capability) (struct qlcnic_dcb *);
        int (*query_cee_param) (struct qlcnic_dcb *, char *, u8);
        void (*init_dcbnl_ops) (struct qlcnic_dcb *);
-       int (*register_aen) (struct qlcnic_dcb *, bool);
        void (*aen_handler) (struct qlcnic_dcb *, void *);
        int (*get_cee_cfg) (struct qlcnic_dcb *);
        void (*get_info) (struct qlcnic_dcb *);
@@ -103,13 +102,6 @@ static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
        return 0;
 }
 
-static inline void
-qlcnic_dcb_register_aen(struct qlcnic_dcb *dcb, u8 flag)
-{
-       if (dcb && dcb->ops->register_aen)
-               dcb->ops->register_aen(dcb, flag);
-}
-
 static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg)
 {
        if (dcb && dcb->ops->aen_handler)
index 083941c141582898e6bf62fad0ebdeb1f48f2222..484e0598620b55f3304da208cdaf0b4fec347b5f 100644 (file)
@@ -2497,8 +2497,6 @@ static void qlcnic_remove(struct pci_dev *pdev)
        qlcnic_cancel_idc_work(adapter);
        ahw = adapter->ahw;
 
-       qlcnic_dcb_free(adapter->dcb);
-
        unregister_netdev(netdev);
        qlcnic_sriov_cleanup(adapter);
 
@@ -2511,6 +2509,8 @@ static void qlcnic_remove(struct pci_dev *pdev)
                kfree(ahw->fw_info);
        }
 
+       qlcnic_dcb_free(adapter->dcb);
+
        qlcnic_detach(adapter);
 
        if (adapter->npars != NULL)