diff options
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 31 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.h | 18 |
2 files changed, 25 insertions, 24 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 83cd85e1f847..49afd20d2c30 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -413,12 +413,12 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
413 | last_addr = range->end_addr; | 413 | last_addr = range->end_addr; |
414 | __skb_unlink(entry, &priv->tx_queue); | 414 | __skb_unlink(entry, &priv->tx_queue); |
415 | memset(&info->status, 0, sizeof(info->status)); | 415 | memset(&info->status, 0, sizeof(info->status)); |
416 | priv->tx_stats[skb_get_queue_mapping(skb)].len--; | ||
417 | entry_hdr = (struct p54_control_hdr *) entry->data; | 416 | entry_hdr = (struct p54_control_hdr *) entry->data; |
418 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; | 417 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; |
419 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) | 418 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) |
420 | pad = entry_data->align[0]; | 419 | pad = entry_data->align[0]; |
421 | 420 | ||
421 | priv->tx_stats[entry_data->hw_queue - 4].len--; | ||
422 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 422 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
423 | if (!(payload->status & 0x01)) | 423 | if (!(payload->status & 0x01)) |
424 | info->flags |= IEEE80211_TX_STAT_ACK; | 424 | info->flags |= IEEE80211_TX_STAT_ACK; |
@@ -557,6 +557,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
557 | struct p54_tx_control_allocdata *txhdr; | 557 | struct p54_tx_control_allocdata *txhdr; |
558 | size_t padding, len; | 558 | size_t padding, len; |
559 | u8 rate; | 559 | u8 rate; |
560 | u8 cts_rate = 0x20; | ||
560 | 561 | ||
561 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)]; | 562 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)]; |
562 | if (unlikely(current_queue->len > current_queue->limit)) | 563 | if (unlikely(current_queue->len > current_queue->limit)) |
@@ -581,28 +582,28 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
581 | hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1); | 582 | hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1); |
582 | hdr->retry1 = hdr->retry2 = info->control.retry_limit; | 583 | hdr->retry1 = hdr->retry2 = info->control.retry_limit; |
583 | 584 | ||
584 | memset(txhdr->wep_key, 0x0, 16); | ||
585 | txhdr->padding = 0; | ||
586 | txhdr->padding2 = 0; | ||
587 | |||
588 | /* TODO: add support for alternate retry TX rates */ | 585 | /* TODO: add support for alternate retry TX rates */ |
589 | rate = ieee80211_get_tx_rate(dev, info)->hw_value; | 586 | rate = ieee80211_get_tx_rate(dev, info)->hw_value; |
590 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) | 587 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) { |
591 | rate |= 0x10; | 588 | rate |= 0x10; |
592 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) | 589 | cts_rate |= 0x10; |
590 | } | ||
591 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { | ||
593 | rate |= 0x40; | 592 | rate |= 0x40; |
594 | else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) | 593 | cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value; |
594 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { | ||
595 | rate |= 0x20; | 595 | rate |= 0x20; |
596 | cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value; | ||
597 | } | ||
596 | memset(txhdr->rateset, rate, 8); | 598 | memset(txhdr->rateset, rate, 8); |
597 | txhdr->wep_key_present = 0; | 599 | txhdr->key_type = 0; |
598 | txhdr->wep_key_len = 0; | 600 | txhdr->key_len = 0; |
599 | txhdr->frame_type = cpu_to_le32(skb_get_queue_mapping(skb) + 4); | 601 | txhdr->hw_queue = skb_get_queue_mapping(skb) + 4; |
600 | txhdr->magic4 = 0; | 602 | txhdr->tx_antenna = (info->antenna_sel_tx == 0) ? |
601 | txhdr->antenna = (info->antenna_sel_tx == 0) ? | ||
602 | 2 : info->antenna_sel_tx - 1; | 603 | 2 : info->antenna_sel_tx - 1; |
603 | txhdr->output_power = 0x7f; // HW Maximum | 604 | txhdr->output_power = 0x7f; // HW Maximum |
604 | txhdr->magic5 = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? | 605 | txhdr->cts_rate = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? |
605 | 0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23)); | 606 | 0 : cts_rate; |
606 | if (padding) | 607 | if (padding) |
607 | txhdr->align[0] = padding; | 608 | txhdr->align[0] = padding; |
608 | 609 | ||
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h index 2245fcce92dc..8db6c0e8e540 100644 --- a/drivers/net/wireless/p54/p54common.h +++ b/drivers/net/wireless/p54/p54common.h | |||
@@ -183,16 +183,16 @@ struct p54_frame_sent_hdr { | |||
183 | 183 | ||
184 | struct p54_tx_control_allocdata { | 184 | struct p54_tx_control_allocdata { |
185 | u8 rateset[8]; | 185 | u8 rateset[8]; |
186 | u16 padding; | 186 | u8 unalloc0[2]; |
187 | u8 wep_key_present; | 187 | u8 key_type; |
188 | u8 wep_key_len; | 188 | u8 key_len; |
189 | u8 wep_key[16]; | 189 | u8 key[16]; |
190 | __le32 frame_type; | 190 | u8 hw_queue; |
191 | u32 padding2; | 191 | u8 unalloc1[9]; |
192 | __le16 magic4; | 192 | u8 tx_antenna; |
193 | u8 antenna; | ||
194 | u8 output_power; | 193 | u8 output_power; |
195 | __le32 magic5; | 194 | u8 cts_rate; |
195 | u8 unalloc2[3]; | ||
196 | u8 align[0]; | 196 | u8 align[0]; |
197 | } __attribute__ ((packed)); | 197 | } __attribute__ ((packed)); |
198 | 198 | ||