| .. | .. |
|---|
| 74 | 74 | |
|---|
| 75 | 75 | if (cmd->odata) { |
|---|
| 76 | 76 | if (cmd->olen < olen) { |
|---|
| 77 | | - ar5523_err(ar, "olen to small %d < %d\n", |
|---|
| 77 | + ar5523_err(ar, "olen too small %d < %d\n", |
|---|
| 78 | 78 | cmd->olen, olen); |
|---|
| 79 | 79 | cmd->olen = 0; |
|---|
| 80 | 80 | cmd->res = -EOVERFLOW; |
|---|
| .. | .. |
|---|
| 241 | 241 | } |
|---|
| 242 | 242 | } |
|---|
| 243 | 243 | |
|---|
| 244 | +static void ar5523_cancel_tx_cmd(struct ar5523 *ar) |
|---|
| 245 | +{ |
|---|
| 246 | + usb_kill_urb(ar->tx_cmd.urb_tx); |
|---|
| 247 | +} |
|---|
| 248 | + |
|---|
| 244 | 249 | static int ar5523_cmd(struct ar5523 *ar, u32 code, const void *idata, |
|---|
| 245 | 250 | int ilen, void *odata, int olen, int flags) |
|---|
| 246 | 251 | { |
|---|
| .. | .. |
|---|
| 280 | 285 | } |
|---|
| 281 | 286 | |
|---|
| 282 | 287 | if (!wait_for_completion_timeout(&cmd->done, 2 * HZ)) { |
|---|
| 288 | + ar5523_cancel_tx_cmd(ar); |
|---|
| 283 | 289 | cmd->odata = NULL; |
|---|
| 284 | 290 | ar5523_err(ar, "timeout waiting for command %02x reply\n", |
|---|
| 285 | 291 | code); |
|---|