linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	<linux-wireless@vger.kernel.org>, <users@rt2x00.serialmonkey.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 9/9] rt2x00: Fix beaconing on rt2800.
Date: Sat,  8 May 2010 23:40:26 +0200	[thread overview]
Message-ID: <1273354826-4335-10-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1273354826-4335-1-git-send-email-gwingerde@gmail.com>

According to the Ralink vendor driver for rt2800 we don't need a full
TXD for a beacon but just a TXWI in front of the actual beacon.
Fix the rt2800pci and rt2800usb beaconing code accordingly.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |   17 +++++++++--------
 drivers/net/wireless/rt2x00/rt2800usb.c |   14 ++++++--------
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 80c6768..7d4778d 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -682,7 +682,6 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
 				   struct txentry_desc *txdesc)
 {
 	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
-	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
 	unsigned int beacon_base;
 	u32 reg;
 
@@ -695,15 +694,17 @@ static void rt2800pci_write_beacon(struct queue_entry *entry,
 	rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 
 	/*
-	 * Write entire beacon with descriptor to register.
+	 * Add the TXWI for the beacon to the skb.
+	 */
+	rt2800_write_txwi(entry->skb, txdesc);
+	skb_push(entry->skb, TXWI_DESC_SIZE);
+
+	/*
+	 * Write entire beacon with TXWI to register.
 	 */
 	beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
-	rt2800_register_multiwrite(rt2x00dev,
-				      beacon_base,
-				      skbdesc->desc, skbdesc->desc_len);
-	rt2800_register_multiwrite(rt2x00dev,
-				      beacon_base + skbdesc->desc_len,
-				      entry->skb->data, entry->skb->len);
+	rt2800_register_multiwrite(rt2x00dev, beacon_base,
+				   entry->skb->data, entry->skb->len);
 
 	/*
 	 * Enable beaconing again.
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index d992a93..00e7906 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -431,18 +431,10 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
 				   struct txentry_desc *txdesc)
 {
 	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
-	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
 	unsigned int beacon_base;
 	u32 reg;
 
 	/*
-	 * Add the descriptor in front of the skb.
-	 */
-	skb_push(entry->skb, entry->queue->desc_size);
-	memcpy(entry->skb->data, skbdesc->desc, skbdesc->desc_len);
-	skbdesc->desc = entry->skb->data;
-
-	/*
 	 * Disable beaconing while we are reloading the beacon data,
 	 * otherwise we might be sending out invalid data.
 	 */
@@ -451,6 +443,12 @@ static void rt2800usb_write_beacon(struct queue_entry *entry,
 	rt2800_register_write(rt2x00dev, BCN_TIME_CFG, reg);
 
 	/*
+	 * Add the TXWI for the beacon to the skb.
+	 */
+	rt2800_write_txwi(entry->skb, txdesc);
+	skb_push(entry->skb, TXWI_DESC_SIZE);
+
+	/*
 	 * Write entire beacon with descriptor to register.
 	 */
 	beacon_base = HW_BEACON_OFFSET(entry->entry_idx);
-- 
1.7.1


  parent reply	other threads:[~2010-05-08 21:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-08 21:40 [PATCH 0/9] rt2x00: Cleanups and fixes Gertjan van Wingerde
2010-05-08 21:40 ` [PATCH 1/9] rt2x00: Fix setting of txdesc->length field Gertjan van Wingerde
2010-05-09  9:03   ` Ivo Van Doorn
2010-05-09  9:18     ` Pavel Roskin
2010-05-08 21:40 ` [PATCH 2/9] rt2x00: Clean up rt2800usb.h Gertjan van Wingerde
2010-05-09  9:04   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 3/9] rt2x00: Don't check whether hardware crypto is enabled when reading RXD Gertjan van Wingerde
2010-05-09  9:08   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 4/9] rt2x00: Factor out TXWI writing to common rt2800 code Gertjan van Wingerde
2010-05-09  9:09   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 5/9] rt2x00: Factor out RXWI processing " Gertjan van Wingerde
2010-05-09  9:10   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 6/9] rt2x00: Clean up generic procedures on descriptor writing Gertjan van Wingerde
2010-05-09  9:11   ` Ivo Van Doorn
2010-05-09 18:54   ` Adam Baker
2010-05-09 19:23     ` Gertjan van Wingerde
2010-05-08 21:40 ` [PATCH 7/9] rt2x00: Clean up all driver's kick_tx_queue callback functions Gertjan van Wingerde
2010-05-09  9:16   ` Ivo Van Doorn
2010-05-08 21:40 ` [PATCH 8/9] rt2x00: provide beacon's txdesc to write_beacon callback function Gertjan van Wingerde
2010-05-09  9:17   ` Ivo Van Doorn
2010-05-08 21:40 ` Gertjan van Wingerde [this message]
2010-05-09  9:21   ` [PATCH 9/9] rt2x00: Fix beaconing on rt2800 Ivo Van Doorn
2010-05-09  9:41     ` Gertjan van Wingerde
2010-05-09  9:42       ` Ivo Van Doorn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273354826-4335-10-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).