]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
iwmc3200wifi: Support unexpected reboot barker
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 16 Oct 2009 05:18:58 +0000 (13:18 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:48:27 +0000 (16:48 -0400)
We can receive unexpected reboot barker at any time, and we're supposed to
reset the whole device then.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/rx.c

index 5fa0a63ef0bf0182ffe43d4d1837fb2806593a6d..bca3bb2d2decef792a03944b99dc026688dd56b9 100644 (file)
@@ -1321,6 +1321,14 @@ int iwm_rx_handle(struct iwm_priv *iwm, u8 *buf, unsigned long buf_size)
 
        switch (le32_to_cpu(hdr->cmd)) {
        case UMAC_REBOOT_BARKER:
+               if (test_bit(IWM_STATUS_READY, &iwm->status)) {
+                       IWM_ERR(iwm, "Unexpected BARKER\n");
+
+                       schedule_work(&iwm->reset_worker);
+
+                       return 0;
+               }
+
                return iwm_notif_send(iwm, NULL, IWM_BARKER_REBOOT_NOTIFICATION,
                                      IWM_SRC_UDMA, buf, buf_size);
        case UMAC_ACK_BARKER: