lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1284890463-14048-1-git-send-email-penberg@kernel.org>
Date:	Sun, 19 Sep 2010 13:01:02 +0300
From:	Pekka Enberg <penberg@...nel.org>
To:	gregkh@...e.de
Cc:	linux-kernel@...r.kernel.org, Pekka Enberg <penberg@...nel.org>,
	Sandro Bonazzola <sandro.bonazzola@...il.com>,
	Lars Lindley <lindley@...ote.org>, Pavel Machek <pavel@....cz>,
	Ruslan Pisarev <ruslan@...sarev.org.ua>
Subject: [PATCH 1/2] w35und: Use NETDEV_TX_BUSY if MLMESendFrame fails

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@...il.com>
Cc: Lars Lindley <lindley@...ote.org>
Cc: Pavel Machek <pavel@....cz>
Cc: Ruslan Pisarev <ruslan@...sarev.org.ua>
Signed-off-by: Pekka Enberg <penberg@...nel.org>
---
 drivers/staging/winbond/mlmetxrx.c   |   13 ++++++-------
 drivers/staging/winbond/mlmetxrx_f.h |    3 +--
 drivers/staging/winbond/wbusb.c      |    4 +---
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/winbond/mlmetxrx.c b/drivers/staging/winbond/mlmetxrx.c
index 74488c2..6b28898 100644
--- a/drivers/staging/winbond/mlmetxrx.c
+++ b/drivers/staging/winbond/mlmetxrx.c
@@ -19,14 +19,13 @@
 
 #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)
diff --git a/drivers/staging/winbond/mlmetxrx_f.h b/drivers/staging/winbond/mlmetxrx_f.h
index d1aa261..ddccbc2 100644
--- a/drivers/staging/winbond/mlmetxrx_f.h
+++ b/drivers/staging/winbond/mlmetxrx_f.h
@@ -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,
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index 5419f4f..157c05b 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -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)
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ