aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-02-24 08:42:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-25 15:32:34 -0500
commit7bb4568372856688bc070917265bce0b88bb7d4d (patch)
treee3ca3e7d233944bbc271c650c8b037c3a6652d98 /drivers/net/wireless/rtl818x
parent43f12d47f0580e04e26c14c03cb19cea9687854e (diff)
mac80211: make tx() operation return void
The return value of the tx operation is commonly misused by drivers, leading to errors. All drivers will drop frames if they fail to TX the frame, and they must also properly manage the queues (if they didn't, mac80211 would already warn). Removing the ability for drivers to return a BUSY value also allows significant cleanups of the TX TX handling code in mac80211. Note that this also fixes a bug in ath9k_htc, the old "return -1" there was wrong. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> [ath5k] Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> [rt2x00] Acked-by: Larry Finger <Larry.Finger@lwfinger.net> [b43, rtl8187, rtlwifi] Acked-by: Luciano Coelho <coelho@ti.com> [wl12xx] Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c8
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c6
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index b85debb4f7b1..80db5cabc9b9 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -240,7 +240,7 @@ static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
240 return IRQ_HANDLED; 240 return IRQ_HANDLED;
241} 241}
242 242
243static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 243static void rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
244{ 244{
245 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 245 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
246 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 246 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -321,8 +321,6 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
321 spin_unlock_irqrestore(&priv->lock, flags); 321 spin_unlock_irqrestore(&priv->lock, flags);
322 322
323 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4))); 323 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4)));
324
325 return 0;
326} 324}
327 325
328void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam) 326void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam)
@@ -687,7 +685,6 @@ static void rtl8180_beacon_work(struct work_struct *work)
687 struct ieee80211_hw *dev = vif_priv->dev; 685 struct ieee80211_hw *dev = vif_priv->dev;
688 struct ieee80211_mgmt *mgmt; 686 struct ieee80211_mgmt *mgmt;
689 struct sk_buff *skb; 687 struct sk_buff *skb;
690 int err = 0;
691 688
692 /* don't overflow the tx ring */ 689 /* don't overflow the tx ring */
693 if (ieee80211_queue_stopped(dev, 0)) 690 if (ieee80211_queue_stopped(dev, 0))
@@ -708,8 +705,7 @@ static void rtl8180_beacon_work(struct work_struct *work)
708 /* TODO: use actual beacon queue */ 705 /* TODO: use actual beacon queue */
709 skb_set_queue_mapping(skb, 0); 706 skb_set_queue_mapping(skb, 0);
710 707
711 err = rtl8180_tx(dev, skb); 708 rtl8180_tx(dev, skb);
712 WARN_ON(err);
713 709
714resched: 710resched:
715 /* 711 /*
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 1f5df12cb156..c5a5e788f25f 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -227,7 +227,7 @@ static void rtl8187_tx_cb(struct urb *urb)
227 } 227 }
228} 228}
229 229
230static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 230static void rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
231{ 231{
232 struct rtl8187_priv *priv = dev->priv; 232 struct rtl8187_priv *priv = dev->priv;
233 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 233 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -241,7 +241,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
241 urb = usb_alloc_urb(0, GFP_ATOMIC); 241 urb = usb_alloc_urb(0, GFP_ATOMIC);
242 if (!urb) { 242 if (!urb) {
243 kfree_skb(skb); 243 kfree_skb(skb);
244 return NETDEV_TX_OK; 244 return;
245 } 245 }
246 246
247 flags = skb->len; 247 flags = skb->len;
@@ -309,8 +309,6 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
309 kfree_skb(skb); 309 kfree_skb(skb);
310 } 310 }
311 usb_free_urb(urb); 311 usb_free_urb(urb);
312
313 return NETDEV_TX_OK;
314} 312}
315 313
316static void rtl8187_rx_cb(struct urb *urb) 314static void rtl8187_rx_cb(struct urb *urb)