diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2008-08-05 12:23:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-07 09:49:04 -0400 |
commit | eda0c003d1ff14c99d8476b482377ccfaf967b6c (patch) | |
tree | ce914aa0db9bda9ebef0a21dbb24aebef989d5e8 | |
parent | f367422794315b7632f2a78c93e15b3c757d4be8 (diff) |
p54: Fix for TX sequence number problem
Following "mac80211: fix TX sequence numbers", if a packet
has the IEEE80211_TX_CTL_ASSIGN_SEQ assigned, a sequence number must be
supplied, either by hardware or software. AFAIK, no such hardware exists
for the p54, thus it must be done in software. With this patch, a connection
qith p54usb is stable, whereas the interface went off-line in 2-3 hours
without this change. 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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index cac9a515b82d..4801a363507b 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -52,6 +52,7 @@ struct p54_common { | |||
52 | int (*open)(struct ieee80211_hw *dev); | 52 | int (*open)(struct ieee80211_hw *dev); |
53 | void (*stop)(struct ieee80211_hw *dev); | 53 | void (*stop)(struct ieee80211_hw *dev); |
54 | int mode; | 54 | int mode; |
55 | u16 seqno; | ||
55 | struct mutex conf_mutex; | 56 | struct mutex conf_mutex; |
56 | u8 mac_addr[ETH_ALEN]; | 57 | u8 mac_addr[ETH_ALEN]; |
57 | u8 bssid[ETH_ALEN]; | 58 | u8 bssid[ETH_ALEN]; |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 4da89ea9b561..2d2d33612aef 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -553,6 +553,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
553 | struct ieee80211_tx_queue_stats *current_queue; | 553 | struct ieee80211_tx_queue_stats *current_queue; |
554 | struct p54_common *priv = dev->priv; | 554 | struct p54_common *priv = dev->priv; |
555 | struct p54_control_hdr *hdr; | 555 | struct p54_control_hdr *hdr; |
556 | struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; | ||
556 | struct p54_tx_control_allocdata *txhdr; | 557 | struct p54_tx_control_allocdata *txhdr; |
557 | size_t padding, len; | 558 | size_t padding, len; |
558 | u8 rate; | 559 | u8 rate; |
@@ -605,6 +606,19 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
605 | if (padding) | 606 | if (padding) |
606 | txhdr->align[0] = padding; | 607 | txhdr->align[0] = padding; |
607 | 608 | ||
609 | /* FIXME: The sequence that follows is needed for this driver to | ||
610 | * work with mac80211 since "mac80211: fix TX sequence numbers". | ||
611 | * As with the temporary code in rt2x00, changes will be needed | ||
612 | * to get proper sequence numbers on beacons. In addition, this | ||
613 | * patch places the sequence number in the hardware state, which | ||
614 | * limits us to a single virtual state. | ||
615 | */ | ||
616 | if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { | ||
617 | if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) | ||
618 | priv->seqno += 0x10; | ||
619 | ieee80211hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
620 | ieee80211hdr->seq_ctrl |= cpu_to_le16(priv->seqno); | ||
621 | } | ||
608 | /* modifies skb->cb and with it info, so must be last! */ | 622 | /* modifies skb->cb and with it info, so must be last! */ |
609 | p54_assign_address(dev, skb, hdr, skb->len); | 623 | p54_assign_address(dev, skb, hdr, skb->len); |
610 | 624 | ||