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>

authored by Larry Finger and committed by John W. Linville eda0c003 f3674227

+15
+1
drivers/net/wireless/p54/p54.h
··· 52 52 int (*open)(struct ieee80211_hw *dev); 53 53 void (*stop)(struct ieee80211_hw *dev); 54 54 int mode; 55 + u16 seqno; 55 56 struct mutex conf_mutex; 56 57 u8 mac_addr[ETH_ALEN]; 57 58 u8 bssid[ETH_ALEN];
+14
drivers/net/wireless/p54/p54common.c
··· 553 553 struct ieee80211_tx_queue_stats *current_queue; 554 554 struct p54_common *priv = dev->priv; 555 555 struct p54_control_hdr *hdr; 556 + struct ieee80211_hdr *ieee80211hdr = (struct ieee80211_hdr *)skb->data; 556 557 struct p54_tx_control_allocdata *txhdr; 557 558 size_t padding, len; 558 559 u8 rate; ··· 606 605 if (padding) 607 606 txhdr->align[0] = padding; 608 607 608 + /* FIXME: The sequence that follows is needed for this driver to 609 + * work with mac80211 since "mac80211: fix TX sequence numbers". 610 + * As with the temporary code in rt2x00, changes will be needed 611 + * to get proper sequence numbers on beacons. In addition, this 612 + * patch places the sequence number in the hardware state, which 613 + * limits us to a single virtual state. 614 + */ 615 + if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { 616 + if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) 617 + priv->seqno += 0x10; 618 + ieee80211hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); 619 + ieee80211hdr->seq_ctrl |= cpu_to_le16(priv->seqno); 620 + } 609 621 /* modifies skb->cb and with it info, so must be last! */ 610 622 p54_assign_address(dev, skb, hdr, skb->len); 611 623