diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2009-10-17 15:56:51 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:48:34 -0400 |
commit | 731d6bfc2d201958cfa3d08c7acff218497bbd50 (patch) | |
tree | 447fbafa00626e9a8be8d56d5a1c739c0e488b48 /drivers | |
parent | 02bdf5b48a2cd90a5d036eab68e6f65adb200140 (diff) |
ar9170usb: atomic pending urbs counter
This patch follows "ar9170: atomic pending A-MPDU counter"
idea and converts another critical counter to atomic_*.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ar9170/usb.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ar9170/usb.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c index e974e5829e1a..6bdcdf6d1cc0 100644 --- a/drivers/net/wireless/ath/ar9170/usb.c +++ b/drivers/net/wireless/ath/ar9170/usb.c | |||
@@ -108,15 +108,15 @@ static void ar9170_usb_submit_urb(struct ar9170_usb *aru) | |||
108 | return ; | 108 | return ; |
109 | 109 | ||
110 | spin_lock_irqsave(&aru->tx_urb_lock, flags); | 110 | spin_lock_irqsave(&aru->tx_urb_lock, flags); |
111 | if (aru->tx_submitted_urbs >= AR9170_NUM_TX_URBS) { | 111 | if (atomic_read(&aru->tx_submitted_urbs) >= AR9170_NUM_TX_URBS) { |
112 | spin_unlock_irqrestore(&aru->tx_urb_lock, flags); | 112 | spin_unlock_irqrestore(&aru->tx_urb_lock, flags); |
113 | return ; | 113 | return ; |
114 | } | 114 | } |
115 | aru->tx_submitted_urbs++; | 115 | atomic_inc(&aru->tx_submitted_urbs); |
116 | 116 | ||
117 | urb = usb_get_from_anchor(&aru->tx_pending); | 117 | urb = usb_get_from_anchor(&aru->tx_pending); |
118 | if (!urb) { | 118 | if (!urb) { |
119 | aru->tx_submitted_urbs--; | 119 | atomic_dec(&aru->tx_submitted_urbs); |
120 | spin_unlock_irqrestore(&aru->tx_urb_lock, flags); | 120 | spin_unlock_irqrestore(&aru->tx_urb_lock, flags); |
121 | 121 | ||
122 | return ; | 122 | return ; |
@@ -133,7 +133,7 @@ static void ar9170_usb_submit_urb(struct ar9170_usb *aru) | |||
133 | err); | 133 | err); |
134 | 134 | ||
135 | usb_unanchor_urb(urb); | 135 | usb_unanchor_urb(urb); |
136 | aru->tx_submitted_urbs--; | 136 | atomic_dec(&aru->tx_submitted_urbs); |
137 | ar9170_tx_callback(&aru->common, urb->context); | 137 | ar9170_tx_callback(&aru->common, urb->context); |
138 | } | 138 | } |
139 | 139 | ||
@@ -151,7 +151,7 @@ static void ar9170_usb_tx_urb_complete_frame(struct urb *urb) | |||
151 | return ; | 151 | return ; |
152 | } | 152 | } |
153 | 153 | ||
154 | aru->tx_submitted_urbs--; | 154 | atomic_dec(&aru->tx_submitted_urbs); |
155 | 155 | ||
156 | ar9170_tx_callback(&aru->common, skb); | 156 | ar9170_tx_callback(&aru->common, skb); |
157 | 157 | ||
@@ -794,7 +794,7 @@ static int ar9170_usb_probe(struct usb_interface *intf, | |||
794 | spin_lock_init(&aru->tx_urb_lock); | 794 | spin_lock_init(&aru->tx_urb_lock); |
795 | 795 | ||
796 | aru->tx_pending_urbs = 0; | 796 | aru->tx_pending_urbs = 0; |
797 | aru->tx_submitted_urbs = 0; | 797 | atomic_set(&aru->tx_submitted_urbs, 0); |
798 | 798 | ||
799 | aru->common.stop = ar9170_usb_stop; | 799 | aru->common.stop = ar9170_usb_stop; |
800 | aru->common.flush = ar9170_usb_flush; | 800 | aru->common.flush = ar9170_usb_flush; |
diff --git a/drivers/net/wireless/ath/ar9170/usb.h b/drivers/net/wireless/ath/ar9170/usb.h index d098f4d5d2f2..a2ce3b169ceb 100644 --- a/drivers/net/wireless/ath/ar9170/usb.h +++ b/drivers/net/wireless/ath/ar9170/usb.h | |||
@@ -67,7 +67,7 @@ struct ar9170_usb { | |||
67 | bool req_one_stage_fw; | 67 | bool req_one_stage_fw; |
68 | 68 | ||
69 | spinlock_t tx_urb_lock; | 69 | spinlock_t tx_urb_lock; |
70 | unsigned int tx_submitted_urbs; | 70 | atomic_t tx_submitted_urbs; |
71 | unsigned int tx_pending_urbs; | 71 | unsigned int tx_pending_urbs; |
72 | 72 | ||
73 | struct completion cmd_wait; | 73 | struct completion cmd_wait; |