mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-30 14:34:51 +08:00
p54: Fix regression due to "net: Delete NETDEVICES_MULTIQUEUE kconfig option"
Commit b19fa1f
, entitled "net: Delete NETDEVICES_MULTIQUEUE kconfig
option" breaks p54pci and p54usb.
Additionally, the old logic always tx'ed cts frames (if enabled)
with a short preamble when [rate > 3]. (i.e. with any 802.11g rate).
Of course this isn't that bad, but it's still wrong!
(This patch also clarifies the meanings of some of the fields in the tx
header for the hardware. -- JWL)
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: <stable@kernel.org> [2.6.25.x, 2.6.26.x]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
88b9e2bef3
commit
aaa1553512
@ -413,12 +413,12 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
|
|||||||
last_addr = range->end_addr;
|
last_addr = range->end_addr;
|
||||||
__skb_unlink(entry, &priv->tx_queue);
|
__skb_unlink(entry, &priv->tx_queue);
|
||||||
memset(&info->status, 0, sizeof(info->status));
|
memset(&info->status, 0, sizeof(info->status));
|
||||||
priv->tx_stats[skb_get_queue_mapping(skb)].len--;
|
|
||||||
entry_hdr = (struct p54_control_hdr *) entry->data;
|
entry_hdr = (struct p54_control_hdr *) entry->data;
|
||||||
entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
|
entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
|
||||||
if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0)
|
if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0)
|
||||||
pad = entry_data->align[0];
|
pad = entry_data->align[0];
|
||||||
|
|
||||||
|
priv->tx_stats[entry_data->hw_queue - 4].len--;
|
||||||
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
||||||
if (!(payload->status & 0x01))
|
if (!(payload->status & 0x01))
|
||||||
info->flags |= IEEE80211_TX_STAT_ACK;
|
info->flags |= IEEE80211_TX_STAT_ACK;
|
||||||
@ -557,6 +557,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
|
|||||||
struct p54_tx_control_allocdata *txhdr;
|
struct p54_tx_control_allocdata *txhdr;
|
||||||
size_t padding, len;
|
size_t padding, len;
|
||||||
u8 rate;
|
u8 rate;
|
||||||
|
u8 cts_rate = 0x20;
|
||||||
|
|
||||||
current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)];
|
current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)];
|
||||||
if (unlikely(current_queue->len > current_queue->limit))
|
if (unlikely(current_queue->len > current_queue->limit))
|
||||||
@ -581,28 +582,28 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
|
|||||||
hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1);
|
hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1);
|
||||||
hdr->retry1 = hdr->retry2 = info->control.retry_limit;
|
hdr->retry1 = hdr->retry2 = info->control.retry_limit;
|
||||||
|
|
||||||
memset(txhdr->wep_key, 0x0, 16);
|
|
||||||
txhdr->padding = 0;
|
|
||||||
txhdr->padding2 = 0;
|
|
||||||
|
|
||||||
/* TODO: add support for alternate retry TX rates */
|
/* TODO: add support for alternate retry TX rates */
|
||||||
rate = ieee80211_get_tx_rate(dev, info)->hw_value;
|
rate = ieee80211_get_tx_rate(dev, info)->hw_value;
|
||||||
if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE)
|
if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) {
|
||||||
rate |= 0x10;
|
rate |= 0x10;
|
||||||
if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS)
|
cts_rate |= 0x10;
|
||||||
|
}
|
||||||
|
if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
|
||||||
rate |= 0x40;
|
rate |= 0x40;
|
||||||
else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT)
|
cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value;
|
||||||
|
} else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
|
||||||
rate |= 0x20;
|
rate |= 0x20;
|
||||||
|
cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value;
|
||||||
|
}
|
||||||
memset(txhdr->rateset, rate, 8);
|
memset(txhdr->rateset, rate, 8);
|
||||||
txhdr->wep_key_present = 0;
|
txhdr->key_type = 0;
|
||||||
txhdr->wep_key_len = 0;
|
txhdr->key_len = 0;
|
||||||
txhdr->frame_type = cpu_to_le32(skb_get_queue_mapping(skb) + 4);
|
txhdr->hw_queue = skb_get_queue_mapping(skb) + 4;
|
||||||
txhdr->magic4 = 0;
|
txhdr->tx_antenna = (info->antenna_sel_tx == 0) ?
|
||||||
txhdr->antenna = (info->antenna_sel_tx == 0) ?
|
|
||||||
2 : info->antenna_sel_tx - 1;
|
2 : info->antenna_sel_tx - 1;
|
||||||
txhdr->output_power = 0x7f; // HW Maximum
|
txhdr->output_power = 0x7f; // HW Maximum
|
||||||
txhdr->magic5 = (info->flags & IEEE80211_TX_CTL_NO_ACK) ?
|
txhdr->cts_rate = (info->flags & IEEE80211_TX_CTL_NO_ACK) ?
|
||||||
0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23));
|
0 : cts_rate;
|
||||||
if (padding)
|
if (padding)
|
||||||
txhdr->align[0] = padding;
|
txhdr->align[0] = padding;
|
||||||
|
|
||||||
|
@ -183,16 +183,16 @@ struct p54_frame_sent_hdr {
|
|||||||
|
|
||||||
struct p54_tx_control_allocdata {
|
struct p54_tx_control_allocdata {
|
||||||
u8 rateset[8];
|
u8 rateset[8];
|
||||||
u16 padding;
|
u8 unalloc0[2];
|
||||||
u8 wep_key_present;
|
u8 key_type;
|
||||||
u8 wep_key_len;
|
u8 key_len;
|
||||||
u8 wep_key[16];
|
u8 key[16];
|
||||||
__le32 frame_type;
|
u8 hw_queue;
|
||||||
u32 padding2;
|
u8 unalloc1[9];
|
||||||
__le16 magic4;
|
u8 tx_antenna;
|
||||||
u8 antenna;
|
|
||||||
u8 output_power;
|
u8 output_power;
|
||||||
__le32 magic5;
|
u8 cts_rate;
|
||||||
|
u8 unalloc2[3];
|
||||||
u8 align[0];
|
u8 align[0];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user