aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 28ed28c1cbcc..06d2dfd646fe 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -83,6 +83,7 @@ static void qlcnic_schedule_work(struct qlcnic_adapter *adapter,
83 work_func_t func, int delay); 83 work_func_t func, int delay);
84static void qlcnic_cancel_fw_work(struct qlcnic_adapter *adapter); 84static void qlcnic_cancel_fw_work(struct qlcnic_adapter *adapter);
85static int qlcnic_poll(struct napi_struct *napi, int budget); 85static int qlcnic_poll(struct napi_struct *napi, int budget);
86static int qlcnic_rx_poll(struct napi_struct *napi, int budget);
86#ifdef CONFIG_NET_POLL_CONTROLLER 87#ifdef CONFIG_NET_POLL_CONTROLLER
87static void qlcnic_poll_controller(struct net_device *netdev); 88static void qlcnic_poll_controller(struct net_device *netdev);
88#endif 89#endif
@@ -195,8 +196,13 @@ qlcnic_napi_add(struct qlcnic_adapter *adapter, struct net_device *netdev)
195 196
196 for (ring = 0; ring < adapter->max_sds_rings; ring++) { 197 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
197 sds_ring = &recv_ctx->sds_rings[ring]; 198 sds_ring = &recv_ctx->sds_rings[ring];
198 netif_napi_add(netdev, &sds_ring->napi, 199
199 qlcnic_poll, QLCNIC_NETDEV_WEIGHT); 200 if (ring == adapter->max_sds_rings - 1)
201 netif_napi_add(netdev, &sds_ring->napi, qlcnic_poll,
202 QLCNIC_NETDEV_WEIGHT/adapter->max_sds_rings);
203 else
204 netif_napi_add(netdev, &sds_ring->napi,
205 qlcnic_rx_poll, QLCNIC_NETDEV_WEIGHT*2);
200 } 206 }
201 207
202 return 0; 208 return 0;
@@ -743,8 +749,12 @@ qlcnic_start_firmware(struct qlcnic_adapter *adapter)
743 749
744 if (load_fw_file) 750 if (load_fw_file)
745 qlcnic_request_firmware(adapter); 751 qlcnic_request_firmware(adapter);
746 else 752 else {
753 if (qlcnic_check_flash_fw_ver(adapter))
754 goto err_out;
755
747 adapter->fw_type = QLCNIC_FLASH_ROMIMAGE; 756 adapter->fw_type = QLCNIC_FLASH_ROMIMAGE;
757 }
748 758
749 err = qlcnic_need_fw_reset(adapter); 759 err = qlcnic_need_fw_reset(adapter);
750 if (err < 0) 760 if (err < 0)
@@ -2060,6 +2070,25 @@ static int qlcnic_poll(struct napi_struct *napi, int budget)
2060 return work_done; 2070 return work_done;
2061} 2071}
2062 2072
2073static int qlcnic_rx_poll(struct napi_struct *napi, int budget)
2074{
2075 struct qlcnic_host_sds_ring *sds_ring =
2076 container_of(napi, struct qlcnic_host_sds_ring, napi);
2077
2078 struct qlcnic_adapter *adapter = sds_ring->adapter;
2079 int work_done;
2080
2081 work_done = qlcnic_process_rcv_ring(sds_ring, budget);
2082
2083 if (work_done < budget) {
2084 napi_complete(&sds_ring->napi);
2085 if (test_bit(__QLCNIC_DEV_UP, &adapter->state))
2086 qlcnic_enable_int(sds_ring);
2087 }
2088
2089 return work_done;
2090}
2091
2063#ifdef CONFIG_NET_POLL_CONTROLLER 2092#ifdef CONFIG_NET_POLL_CONTROLLER
2064static void qlcnic_poll_controller(struct net_device *netdev) 2093static void qlcnic_poll_controller(struct net_device *netdev)
2065{ 2094{