aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2012-10-06 14:42:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-19 15:53:20 -0400
commitb4764c809a306ea37b6409494896e919bbb5ec5f (patch)
tree88e67274ab98bf590c11ba4357b4ab9657c6c912 /drivers/net
parentafe3840a1a07371cf1b8bbe01b9bb4c410e3bba1 (diff)
carl9170: handle traps from firmware loader
This patch changes the way the driver deals with command responses and traps which are sent through the special interrupt input endpoint 3. While the carl9170 firmware does not use this endpoint for command responses or traps, the firmware loader on the device does. It uses it to notify the host about 'watchdog triggered' in case the firmware/hardware has crashed. Note: Even without this patch, the driver is still able to detect the mishap and reset the device. But previously it did that because the trap event caused an out-of-order message sequence number error, which also triggered a reset. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/carl9170/rx.c6
-rw-r--r--drivers/net/wireless/ath/carl9170/usb.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index a0b72307854..9cd93f1d8be 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -164,9 +164,6 @@ void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)
164 struct carl9170_rsp *cmd = buf; 164 struct carl9170_rsp *cmd = buf;
165 struct ieee80211_vif *vif; 165 struct ieee80211_vif *vif;
166 166
167 if (carl9170_check_sequence(ar, cmd->hdr.seq))
168 return;
169
170 if ((cmd->hdr.cmd & CARL9170_RSP_FLAG) != CARL9170_RSP_FLAG) { 167 if ((cmd->hdr.cmd & CARL9170_RSP_FLAG) != CARL9170_RSP_FLAG) {
171 if (!(cmd->hdr.cmd & CARL9170_CMD_ASYNC_FLAG)) 168 if (!(cmd->hdr.cmd & CARL9170_CMD_ASYNC_FLAG))
172 carl9170_cmd_callback(ar, len, buf); 169 carl9170_cmd_callback(ar, len, buf);
@@ -820,6 +817,9 @@ static void carl9170_rx_untie_cmds(struct ar9170 *ar, const u8 *respbuf,
820 if (unlikely(i > resplen)) 817 if (unlikely(i > resplen))
821 break; 818 break;
822 819
820 if (carl9170_check_sequence(ar, cmd->hdr.seq))
821 break;
822
823 carl9170_handle_command_response(ar, cmd, cmd->hdr.len + 4); 823 carl9170_handle_command_response(ar, cmd, cmd->hdr.len + 4);
824 } 824 }
825 825
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index 888152ce3ec..307bc0ddff9 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -295,6 +295,13 @@ static void carl9170_usb_rx_irq_complete(struct urb *urb)
295 goto resubmit; 295 goto resubmit;
296 } 296 }
297 297
298 /*
299 * While the carl9170 firmware does not use this EP, the
300 * firmware loader in the EEPROM unfortunately does.
301 * Therefore we need to be ready to handle out-of-band
302 * responses and traps in case the firmware crashed and
303 * the loader took over again.
304 */
298 carl9170_handle_command_response(ar, urb->transfer_buffer, 305 carl9170_handle_command_response(ar, urb->transfer_buffer,
299 urb->actual_length); 306 urb->actual_length);
300 307