diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-05-28 11:04:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-03 14:05:15 -0400 |
commit | 66d008139c61d610f3ade9b46ad610e2cd277fb9 (patch) | |
tree | 1822fc3179e3f0478c544621ca4bf53207e2e8b6 /drivers/net/wireless/ath/ar9170 | |
parent | b55d6bcf9b7082ae613e5d532608abcd409164ca (diff) |
ar9170usb: more minor fixes
This patch contains a few more mostly random fixes for the USB front-end.
1. handle irq command response, instead of printing it to the console.
2. remove fixed FIXME.
(real fix: "ar9170usb: reset device on resume". )
3. some more one-liner.
- get rid of a useless "return;"
- add a few branch prediction hints in hot-paths
etc.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ar9170')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/ar9170.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/usb.c | 22 |
3 files changed, 10 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h index 396b24016f5e..4c4b08fc0f7d 100644 --- a/drivers/net/wireless/ath/ar9170/ar9170.h +++ b/drivers/net/wireless/ath/ar9170/ar9170.h | |||
@@ -207,6 +207,7 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb); | |||
207 | void ar9170_unregister(struct ar9170 *ar); | 207 | void ar9170_unregister(struct ar9170 *ar); |
208 | void ar9170_handle_tx_status(struct ar9170 *ar, struct sk_buff *skb, | 208 | void ar9170_handle_tx_status(struct ar9170 *ar, struct sk_buff *skb, |
209 | bool update_statistics, u16 tx_status); | 209 | bool update_statistics, u16 tx_status); |
210 | void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len); | ||
210 | 211 | ||
211 | /* MAC */ | 212 | /* MAC */ |
212 | int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); | 213 | int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); |
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c index 63528f1b8d0e..b889fda10b9a 100644 --- a/drivers/net/wireless/ath/ar9170/main.c +++ b/drivers/net/wireless/ath/ar9170/main.c | |||
@@ -370,8 +370,7 @@ static void ar9170_tx_status_janitor(struct work_struct *work) | |||
370 | msecs_to_jiffies(100)); | 370 | msecs_to_jiffies(100)); |
371 | } | 371 | } |
372 | 372 | ||
373 | static void ar9170_handle_command_response(struct ar9170 *ar, | 373 | void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len) |
374 | void *buf, u32 len) | ||
375 | { | 374 | { |
376 | struct ar9170_cmd_response *cmd = (void *) buf; | 375 | struct ar9170_cmd_response *cmd = (void *) buf; |
377 | 376 | ||
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c index 71579e4d2fce..f752698669d2 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c | |||
@@ -102,7 +102,7 @@ static void ar9170_usb_tx_urb_complete_free(struct urb *urb) | |||
102 | struct ar9170_usb *aru = (struct ar9170_usb *) | 102 | struct ar9170_usb *aru = (struct ar9170_usb *) |
103 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); | 103 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); |
104 | 104 | ||
105 | if (!aru) { | 105 | if (unlikely(!aru)) { |
106 | dev_kfree_skb_irq(skb); | 106 | dev_kfree_skb_irq(skb); |
107 | return ; | 107 | return ; |
108 | } | 108 | } |
@@ -135,8 +135,8 @@ static void ar9170_usb_irq_completed(struct urb *urb) | |||
135 | goto resubmit; | 135 | goto resubmit; |
136 | } | 136 | } |
137 | 137 | ||
138 | print_hex_dump_bytes("ar9170 irq: ", DUMP_PREFIX_OFFSET, | 138 | ar9170_handle_command_response(&aru->common, urb->transfer_buffer, |
139 | urb->transfer_buffer, urb->actual_length); | 139 | urb->actual_length); |
140 | 140 | ||
141 | resubmit: | 141 | resubmit: |
142 | usb_anchor_urb(urb, &aru->rx_submitted); | 142 | usb_anchor_urb(urb, &aru->rx_submitted); |
@@ -186,16 +186,15 @@ resubmit: | |||
186 | 186 | ||
187 | usb_anchor_urb(urb, &aru->rx_submitted); | 187 | usb_anchor_urb(urb, &aru->rx_submitted); |
188 | err = usb_submit_urb(urb, GFP_ATOMIC); | 188 | err = usb_submit_urb(urb, GFP_ATOMIC); |
189 | if (err) { | 189 | if (unlikely(err)) { |
190 | usb_unanchor_urb(urb); | 190 | usb_unanchor_urb(urb); |
191 | dev_kfree_skb_irq(skb); | 191 | goto free; |
192 | } | 192 | } |
193 | 193 | ||
194 | return ; | 194 | return ; |
195 | 195 | ||
196 | free: | 196 | free: |
197 | dev_kfree_skb_irq(skb); | 197 | dev_kfree_skb_irq(skb); |
198 | return; | ||
199 | } | 198 | } |
200 | 199 | ||
201 | static int ar9170_usb_prep_rx_urb(struct ar9170_usb *aru, | 200 | static int ar9170_usb_prep_rx_urb(struct ar9170_usb *aru, |
@@ -346,7 +345,7 @@ static int ar9170_usb_exec_cmd(struct ar9170 *ar, enum ar9170_cmd cmd, | |||
346 | 345 | ||
347 | usb_anchor_urb(urb, &aru->tx_submitted); | 346 | usb_anchor_urb(urb, &aru->tx_submitted); |
348 | err = usb_submit_urb(urb, GFP_ATOMIC); | 347 | err = usb_submit_urb(urb, GFP_ATOMIC); |
349 | if (err) { | 348 | if (unlikely(err)) { |
350 | usb_unanchor_urb(urb); | 349 | usb_unanchor_urb(urb); |
351 | usb_free_urb(urb); | 350 | usb_free_urb(urb); |
352 | goto err_unbuf; | 351 | goto err_unbuf; |
@@ -427,7 +426,7 @@ static void ar9170_usb_callback_cmd(struct ar9170 *ar, u32 len , void *buffer) | |||
427 | unsigned long flags; | 426 | unsigned long flags; |
428 | u32 in, out; | 427 | u32 in, out; |
429 | 428 | ||
430 | if (!buffer) | 429 | if (unlikely(!buffer)) |
431 | return ; | 430 | return ; |
432 | 431 | ||
433 | in = le32_to_cpup((__le32 *)buffer); | 432 | in = le32_to_cpup((__le32 *)buffer); |
@@ -728,7 +727,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
728 | 727 | ||
729 | #ifdef CONFIG_PM | 728 | #ifdef CONFIG_PM |
730 | udev->reset_resume = 1; | 729 | udev->reset_resume = 1; |
731 | #endif | 730 | #endif /* CONFIG_PM */ |
732 | err = ar9170_usb_reset(aru); | 731 | err = ar9170_usb_reset(aru); |
733 | if (err) | 732 | if (err) |
734 | goto err_freehw; | 733 | goto err_freehw; |
@@ -813,11 +812,6 @@ static int ar9170_resume(struct usb_interface *intf) | |||
813 | usb_unpoison_anchored_urbs(&aru->rx_submitted); | 812 | usb_unpoison_anchored_urbs(&aru->rx_submitted); |
814 | usb_unpoison_anchored_urbs(&aru->tx_submitted); | 813 | usb_unpoison_anchored_urbs(&aru->tx_submitted); |
815 | 814 | ||
816 | /* | ||
817 | * FIXME: firmware upload will fail on resume. | ||
818 | * but this is better than a hang! | ||
819 | */ | ||
820 | |||
821 | err = ar9170_usb_init_device(aru); | 815 | err = ar9170_usb_init_device(aru); |
822 | if (err) | 816 | if (err) |
823 | goto err_unrx; | 817 | goto err_unrx; |