aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.c')
-rw-r--r--drivers/net/wireless/mwifiex/main.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 245b7329e0c9..be0f0e583f75 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -58,8 +58,9 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
58 memmove(&adapter->if_ops, if_ops, sizeof(struct mwifiex_if_ops)); 58 memmove(&adapter->if_ops, if_ops, sizeof(struct mwifiex_if_ops));
59 59
60 /* card specific initialization has been deferred until now .. */ 60 /* card specific initialization has been deferred until now .. */
61 if (adapter->if_ops.init_if(adapter)) 61 if (adapter->if_ops.init_if)
62 goto error; 62 if (adapter->if_ops.init_if(adapter))
63 goto error;
63 64
64 adapter->priv_num = 0; 65 adapter->priv_num = 0;
65 66
@@ -140,6 +141,7 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
140{ 141{
141 int ret = 0; 142 int ret = 0;
142 unsigned long flags; 143 unsigned long flags;
144 struct sk_buff *skb;
143 145
144 spin_lock_irqsave(&adapter->main_proc_lock, flags); 146 spin_lock_irqsave(&adapter->main_proc_lock, flags);
145 147
@@ -161,7 +163,8 @@ process_start:
161 if (adapter->int_status) { 163 if (adapter->int_status) {
162 if (adapter->hs_activated) 164 if (adapter->hs_activated)
163 mwifiex_process_hs_config(adapter); 165 mwifiex_process_hs_config(adapter);
164 adapter->if_ops.process_int_status(adapter); 166 if (adapter->if_ops.process_int_status)
167 adapter->if_ops.process_int_status(adapter);
165 } 168 }
166 169
167 /* Need to wake up the card ? */ 170 /* Need to wake up the card ? */
@@ -174,6 +177,7 @@ process_start:
174 adapter->if_ops.wakeup(adapter); 177 adapter->if_ops.wakeup(adapter);
175 continue; 178 continue;
176 } 179 }
180
177 if (IS_CARD_RX_RCVD(adapter)) { 181 if (IS_CARD_RX_RCVD(adapter)) {
178 adapter->pm_wakeup_fw_try = false; 182 adapter->pm_wakeup_fw_try = false;
179 if (adapter->ps_state == PS_STATE_SLEEP) 183 if (adapter->ps_state == PS_STATE_SLEEP)
@@ -194,6 +198,11 @@ process_start:
194 } 198 }
195 } 199 }
196 200
201 /* Check Rx data for USB */
202 if (adapter->iface_type == MWIFIEX_USB)
203 while ((skb = skb_dequeue(&adapter->usb_rx_data_q)))
204 mwifiex_handle_rx_packet(adapter, skb);
205
197 /* Check for Cmd Resp */ 206 /* Check for Cmd Resp */
198 if (adapter->cmd_resp_received) { 207 if (adapter->cmd_resp_received) {
199 adapter->cmd_resp_received = false; 208 adapter->cmd_resp_received = false;
@@ -317,7 +326,10 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
317 fw.fw_buf = (u8 *) adapter->firmware->data; 326 fw.fw_buf = (u8 *) adapter->firmware->data;
318 fw.fw_len = adapter->firmware->size; 327 fw.fw_len = adapter->firmware->size;
319 328
320 ret = mwifiex_dnld_fw(adapter, &fw); 329 if (adapter->if_ops.dnld_fw)
330 ret = adapter->if_ops.dnld_fw(adapter, &fw);
331 else
332 ret = mwifiex_dnld_fw(adapter, &fw);
321 if (ret == -1) 333 if (ret == -1)
322 goto done; 334 goto done;
323 335
@@ -731,7 +743,8 @@ mwifiex_add_card(void *card, struct semaphore *sem,
731 743
732err_init_fw: 744err_init_fw:
733 pr_debug("info: %s: unregister device\n", __func__); 745 pr_debug("info: %s: unregister device\n", __func__);
734 adapter->if_ops.unregister_dev(adapter); 746 if (adapter->if_ops.unregister_dev)
747 adapter->if_ops.unregister_dev(adapter);
735err_registerdev: 748err_registerdev:
736 adapter->surprise_removed = true; 749 adapter->surprise_removed = true;
737 mwifiex_terminate_workqueue(adapter); 750 mwifiex_terminate_workqueue(adapter);
@@ -836,7 +849,8 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
836 849
837 /* Unregister device */ 850 /* Unregister device */
838 dev_dbg(adapter->dev, "info: unregister device\n"); 851 dev_dbg(adapter->dev, "info: unregister device\n");
839 adapter->if_ops.unregister_dev(adapter); 852 if (adapter->if_ops.unregister_dev)
853 adapter->if_ops.unregister_dev(adapter);
840 /* Free adapter structure */ 854 /* Free adapter structure */
841 dev_dbg(adapter->dev, "info: free adapter\n"); 855 dev_dbg(adapter->dev, "info: free adapter\n");
842 mwifiex_free_adapter(adapter); 856 mwifiex_free_adapter(adapter);