linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "John W. Linville" <linville@tuxdriver.com>,
	Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Pavel Roskin <proski@gnu.org>,
	Herton Ronaldo Krzesinski <herton@mandriva.com.br>,
	Hin-Tak Leung <hintak.leung@gmail.com>
Subject: [PATCH] rtl8187: Fix for TX sequence number problem that resulted from commit 741b4fbc44
Date: Mon, 28 Jul 2008 22:08:18 -0500	[thread overview]
Message-ID: <488E89A2.9010308@lwfinger.net> (raw)

Commit 741b4fbc441dba885cc8f97a10e87f2acd04c5f2 broke rtl8187. This
patch makes the same kind of fix that was done for rt2x00. Note that
this code will have to be reworked for proper sequence numbers on beacons.
In addition, the sequence number has been placed in the hardware state,
not the vif state.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John and Johnannes,

This is a bug fix for 2.6.27.

Larry
---

  rtl8187.h     |    1 +
  rtl8187_dev.c |   13 +++++++++++++
  2 files changed, 14 insertions(+)

Index: wireless-testing/drivers/net/wireless/rtl8187.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl8187.h
+++ wireless-testing/drivers/net/wireless/rtl8187.h
@@ -100,6 +100,7 @@ struct rtl8187_priv {
  	struct usb_device *udev;
  	u32 rx_conf;
  	u16 txpwr_base;
+	u16 seqno;
  	u8 asic_rev;
  	u8 is_rtl8187b;
  	enum {
Index: wireless-testing/drivers/net/wireless/rtl8187_dev.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/rtl8187_dev.c
+++ wireless-testing/drivers/net/wireless/rtl8187_dev.c
@@ -169,6 +169,7 @@ static int rtl8187_tx(struct ieee80211_h
  {
  	struct rtl8187_priv *priv = dev->priv;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+	struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data;
  	unsigned int ep;
  	void *buf;
  	struct urb *urb;
@@ -234,6 +235,20 @@ static int rtl8187_tx(struct ieee80211_h
  			ep = epmap[skb_get_queue_mapping(skb)];
  	}

+	/* XXX: The sequence that follows is needed for this driver to work
+	 * with mac80211 since commit 741b4fbc44 (mac80211: fix TX sequence
+	 * numbers). As with the temporary code in rt2x00, changes will be
+	 * needed to get proper sequence numbers on beacons. In addition,
+	 * this patch places the sequence number in the hardware state, which
+	 * limits us to a single virtual state.
+	 */
+	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+			priv->seqno += 0x10;
+		ieee80211hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+		ieee80211hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
+	}
+
  	info->driver_data[0] = dev;
  	info->driver_data[1] = urb;



                 reply	other threads:[~2008-07-29  3:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=488E89A2.9010308@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=herton@mandriva.com.br \
    --cc=hintak.leung@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=proski@gnu.org \
    /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).