staging: w35und: Use NETDEV_TX_BUSY if MLMESendFrame fails
authorPekka Enberg <penberg@kernel.org>
Sun, 19 Sep 2010 10:01:02 +0000 (13:01 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 21 Sep 2010 17:46:03 +0000 (10:46 -0700)
This patch changes MLMESendFrame to return NETDEV_TX_BUSY if MLME frame is in
use so that wbsoft_tx() doesn't blindly return NETDEV_TX_OK in that case.

Cc: Sandro Bonazzola <sandro.bonazzola@gmail.com>
Cc: Lars Lindley <lindley@coyote.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Ruslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/winbond/mlmetxrx.c
drivers/staging/winbond/mlmetxrx_f.h
drivers/staging/winbond/wbusb.c

index 74488c2f8c959516047aa9b7803c27afe4abf859..6b28898485d6099301cb5f6360afe5ad7778163e 100644 (file)
 
 #include "mds_f.h"
 
-/* ============================================================================= */
-u8 MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType)
-/*     DataType : FRAME_TYPE_802_11_MANAGEMENT, FRAME_TYPE_802_11_MANAGEMENT_CHALLENGE,
-                               FRAME_TYPE_802_11_DATA */
+#include <linux/netdevice.h>
+
+int MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType)
 {
        if (adapter->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) {
                adapter->sMlmeFrame.wNumTxMMPDUDiscarded++;
-               return false;
+               return NETDEV_TX_BUSY;
        }
        adapter->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME;
 
@@ -40,9 +39,9 @@ u8 MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType)
        /* H/W will enter power save by set the register. S/W don't send null frame
        with PWRMgt bit enbled to enter power save now. */
 
-       /* Transmit NDIS packet */
        Mds_Tx(adapter);
-       return true;
+
+       return NETDEV_TX_OK;
 }
 
 void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *desc)
index d1aa2617d24b0de88a84aaa95587468adb016f45..ddccbc2e1cd28654ecfc056f8dcfa18226abc93d 100644 (file)
@@ -11,8 +11,7 @@
 #include "core.h"
 
 void MLME_GetNextPacket(struct wbsoft_priv *adapter, struct wb35_descriptor *pDes);
-u8 MLMESendFrame(struct wbsoft_priv *adapter,
-                u8 *pMMPDU, u16 len, u8 DataType);
+int MLMESendFrame(struct wbsoft_priv *adapter, u8 *pMMPDU, u16 len, u8 DataType);
 
 void
 MLME_SendComplete(struct wbsoft_priv *adapter, u8 PacketID,
index 5419f4fd198f35e9ee95a8d21521a833994d2e1b..157c05bf2578afae8694bd2eb84246f1012bfd85 100644 (file)
@@ -121,9 +121,7 @@ static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
 {
        struct wbsoft_priv *priv = dev->priv;
 
-       MLMESendFrame(priv, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
-
-       return NETDEV_TX_OK;
+       return MLMESendFrame(priv, skb->data, skb->len, FRAME_TYPE_802_11_MANAGEMENT);
 }
 
 static int wbsoft_start(struct ieee80211_hw *dev)