From: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
To: linux-wireless@vger.kernel.org
Cc: Daniel Drake <dsd@gentoo.org>,
zd1211-devs@lists.sourceforge.net,
Ulrich Kunitz <kune@deine-taler.de>
Subject: [RFC PATCH 4/6] zd1211rw: implement seq_num for IEEE80211_TX_CTL_ASSIGN_SEQ
Date: Sun, 26 Dec 2010 13:24:42 +0200 [thread overview]
Message-ID: <20101226112442.31775.31512.stgit@fate.lan> (raw)
In-Reply-To: <20101226112404.31775.77854.stgit@fate.lan>
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
---
drivers/net/wireless/zd1211rw/zd_mac.c | 21 +++++++++++++++++++++
drivers/net/wireless/zd1211rw/zd_mac.h | 3 +++
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 71a7576..9f755fc 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -654,6 +654,24 @@ static int zd_mac_config_beacon(struct ieee80211_hw *hw, struct sk_buff *beacon)
(full_len << 19));
}
+static void create_tx_desc_seq(struct zd_mac *mac, struct ieee80211_hdr *hdr,
+ struct ieee80211_tx_info *info)
+{
+ unsigned long irqflags;
+
+ if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
+ return;
+
+ spin_lock_irqsave(&mac->seqlock, irqflags);
+
+ if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+ mac->seqno += 0x10;
+ hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
+ hdr->seq_ctrl |= cpu_to_le16(mac->seqno);
+
+ spin_unlock_irqrestore(&mac->seqlock, irqflags);
+}
+
static int fill_ctrlset(struct zd_mac *mac,
struct sk_buff *skb)
{
@@ -678,6 +696,8 @@ static int fill_ctrlset(struct zd_mac *mac,
cs_set_control(mac, cs, hdr, info);
+ create_tx_desc_seq(mac, hdr, info);
+
packet_length = frag_len + sizeof(struct zd_ctrlset) + 10;
ZD_ASSERT(packet_length <= 0xffff);
/* ZD1211B: Computing the length difference this way, gives us
@@ -1151,6 +1171,7 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
memset(mac, 0, sizeof(*mac));
spin_lock_init(&mac->lock);
+ spin_lock_init(&mac->seqlock);
mac->hw = hw;
mac->type = NL80211_IFTYPE_UNSPECIFIED;
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.h b/drivers/net/wireless/zd1211rw/zd_mac.h
index 92dd071..929bef9 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.h
+++ b/drivers/net/wireless/zd1211rw/zd_mac.h
@@ -189,6 +189,9 @@ struct zd_mac {
struct ieee80211_rate rates[12];
struct ieee80211_supported_band band;
+ spinlock_t seqlock;
+ u16 seqno;
+
/* Short preamble (used for RTS/CTS) */
unsigned int short_preamble:1;
next prev parent reply other threads:[~2010-12-26 11:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-26 11:24 [RFC PATCH 0/6] zd1211rw: add support for AP mode Jussi Kivilinna
2010-12-26 11:24 ` [RFC PATCH 1/6] zd1211rw: fix beacon interval setup Jussi Kivilinna
2010-12-26 11:56 ` Rafał Miłecki
2010-12-26 11:24 ` [RFC PATCH 2/6] zd1211rw: support setting BSSID for AP mode Jussi Kivilinna
2010-12-26 11:24 ` [RFC PATCH 3/6] zd1211rw: let zd_set_beacon_interval() set dtim_period and add AP-beacon flag Jussi Kivilinna
2010-12-26 12:14 ` Rafał Miłecki
2010-12-26 14:50 ` Jussi Kivilinna
2010-12-26 11:24 ` Jussi Kivilinna [this message]
2010-12-26 11:24 ` [RFC PATCH 5/6] zd1211rw: implement beacon fetching and handling ieee80211_get_buffered_bc() Jussi Kivilinna
2010-12-26 12:22 ` Rafał Miłecki
2010-12-26 14:51 ` Jussi Kivilinna
2010-12-26 11:25 ` [RFC PATCH 6/6] zd1211rw: enable NL80211_IFTYPE_AP Jussi Kivilinna
2010-12-26 12:24 ` [RFC PATCH 0/6] zd1211rw: add support for AP mode Johannes Berg
2010-12-26 12:37 ` Rafał Miłecki
2010-12-26 14:53 ` Jussi Kivilinna
2010-12-27 14:28 ` Jussi Kivilinna
2010-12-27 20:03 ` Jussi Kivilinna
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=20101226112442.31775.31512.stgit@fate.lan \
--to=jussi.kivilinna@mbnet.fi \
--cc=dsd@gentoo.org \
--cc=kune@deine-taler.de \
--cc=linux-wireless@vger.kernel.org \
--cc=zd1211-devs@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.