aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54
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/p54
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/p54')
-rw-r--r--drivers/net/wireless/p54/lmac.h2
-rw-r--r--drivers/net/wireless/p54/main.c2
-rw-r--r--drivers/net/wireless/p54/txrx.c11
3 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/wireless/p54/lmac.h b/drivers/net/wireless/p54/lmac.h
index 5ca117e6f95b..eb581abc1079 100644
--- a/drivers/net/wireless/p54/lmac.h
+++ b/drivers/net/wireless/p54/lmac.h
@@ -526,7 +526,7 @@ int p54_init_leds(struct p54_common *priv);
526void p54_unregister_leds(struct p54_common *priv); 526void p54_unregister_leds(struct p54_common *priv);
527 527
528/* xmit functions */ 528/* xmit functions */
529int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb); 529void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb);
530int p54_tx_cancel(struct p54_common *priv, __le32 req_id); 530int p54_tx_cancel(struct p54_common *priv, __le32 req_id);
531void p54_tx(struct p54_common *priv, struct sk_buff *skb); 531void p54_tx(struct p54_common *priv, struct sk_buff *skb);
532 532
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index d7a92af24dd5..356e6bb443a6 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -157,7 +157,7 @@ static int p54_beacon_update(struct p54_common *priv,
157 * to cancel the old beacon template by hand, instead the firmware 157 * to cancel the old beacon template by hand, instead the firmware
158 * will release the previous one through the feedback mechanism. 158 * will release the previous one through the feedback mechanism.
159 */ 159 */
160 WARN_ON(p54_tx_80211(priv->hw, beacon)); 160 p54_tx_80211(priv->hw, beacon);
161 priv->tsf_high32 = 0; 161 priv->tsf_high32 = 0;
162 priv->tsf_low32 = 0; 162 priv->tsf_low32 = 0;
163 163
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index a408ff333920..7834c26c2954 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -696,7 +696,7 @@ static u8 p54_convert_algo(u32 cipher)
696 } 696 }
697} 697}
698 698
699int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb) 699void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
700{ 700{
701 struct p54_common *priv = dev->priv; 701 struct p54_common *priv = dev->priv;
702 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 702 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -717,12 +717,8 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
717 &hdr_flags, &aid, &burst_allowed); 717 &hdr_flags, &aid, &burst_allowed);
718 718
719 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) { 719 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) {
720 if (!IS_QOS_QUEUE(queue)) { 720 dev_kfree_skb_any(skb);
721 dev_kfree_skb_any(skb); 721 return;
722 return NETDEV_TX_OK;
723 } else {
724 return NETDEV_TX_BUSY;
725 }
726 } 722 }
727 723
728 padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3; 724 padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3;
@@ -865,5 +861,4 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
865 p54info->extra_len = extra_len; 861 p54info->extra_len = extra_len;
866 862
867 p54_tx(priv, skb); 863 p54_tx(priv, skb);
868 return NETDEV_TX_OK;
869} 864}