mac80211/drivers: rewrite the rate control API
So after the previous changes we were still unhappy with how convoluted the API is and decided to make things simpler for everybody. This completely changes the rate control API, now taking into account 802.11n with MCS rates and more control, most drivers don't support that though. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
cb121bad67
commit
e6a9854b05
@@ -341,15 +341,14 @@ static void adm8211_interrupt_tci(struct ieee80211_hw *dev)
|
||||
pci_unmap_single(priv->pdev, info->mapping,
|
||||
info->skb->len, PCI_DMA_TODEVICE);
|
||||
|
||||
memset(&txi->status, 0, sizeof(txi->status));
|
||||
ieee80211_tx_info_clear_status(txi);
|
||||
|
||||
skb_pull(skb, sizeof(struct adm8211_tx_hdr));
|
||||
memcpy(skb_push(skb, info->hdrlen), skb->cb, info->hdrlen);
|
||||
if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK)) {
|
||||
if (status & TDES0_STATUS_ES)
|
||||
txi->status.excessive_retries = 1;
|
||||
else
|
||||
txi->flags |= IEEE80211_TX_STAT_ACK;
|
||||
}
|
||||
if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK) &&
|
||||
!(status & TDES0_STATUS_ES))
|
||||
txi->flags |= IEEE80211_TX_STAT_ACK;
|
||||
|
||||
ieee80211_tx_status_irqsafe(dev, skb);
|
||||
|
||||
info->skb = NULL;
|
||||
@@ -1691,8 +1690,10 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
|
||||
struct ieee80211_hdr *hdr;
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_rate *txrate = ieee80211_get_tx_rate(dev, info);
|
||||
u8 rc_flags;
|
||||
|
||||
short_preamble = !!(txrate->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE);
|
||||
rc_flags = info->control.rates[0].flags;
|
||||
short_preamble = !!(rc_flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE);
|
||||
plcp_signal = txrate->bitrate;
|
||||
|
||||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
@@ -1724,10 +1725,10 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
|
||||
if (short_preamble)
|
||||
txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_SHORT_PREAMBLE);
|
||||
|
||||
if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS)
|
||||
if (rc_flags & IEEE80211_TX_RC_USE_RTS_CTS)
|
||||
txhdr->header_control |= cpu_to_le16(ADM8211_TXHDRCTL_ENABLE_RTS);
|
||||
|
||||
txhdr->retry_limit = info->control.retry_limit;
|
||||
txhdr->retry_limit = info->control.rates[0].count;
|
||||
|
||||
adm8211_tx_raw(dev, skb, plcp_signal, hdrlen);
|
||||
|
||||
|
Reference in New Issue
Block a user