aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl8187_dev.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-21 06:40:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:23 -0400
commite6a9854b05c1a6af1308fe2b8c68f35abf28a3ee (patch)
tree241f611f8194586ccabf61bacb060508773b9d05 /drivers/net/wireless/rtl8187_dev.c
parentcb121bad67a32cde37adc2729b7e18aa4fd3063e (diff)
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>
Diffstat (limited to 'drivers/net/wireless/rtl8187_dev.c')
-rw-r--r--drivers/net/wireless/rtl8187_dev.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index cd839bcb6d78..6260ed8ce12b 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -160,13 +160,13 @@ static void rtl8187_tx_cb(struct urb *urb)
160{ 160{
161 struct sk_buff *skb = (struct sk_buff *)urb->context; 161 struct sk_buff *skb = (struct sk_buff *)urb->context;
162 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 162 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
163 struct ieee80211_hw *hw = info->driver_data[0]; 163 struct ieee80211_hw *hw = info->rate_driver_data[0];
164 struct rtl8187_priv *priv = hw->priv; 164 struct rtl8187_priv *priv = hw->priv;
165 165
166 usb_free_urb(info->driver_data[1]); 166 usb_free_urb(info->rate_driver_data[1]);
167 skb_pull(skb, priv->is_rtl8187b ? sizeof(struct rtl8187b_tx_hdr) : 167 skb_pull(skb, priv->is_rtl8187b ? sizeof(struct rtl8187b_tx_hdr) :
168 sizeof(struct rtl8187_tx_hdr)); 168 sizeof(struct rtl8187_tx_hdr));
169 memset(&info->status, 0, sizeof(info->status)); 169 ieee80211_tx_info_clear_status(info);
170 info->flags |= IEEE80211_TX_STAT_ACK; 170 info->flags |= IEEE80211_TX_STAT_ACK;
171 ieee80211_tx_status_irqsafe(hw, skb); 171 ieee80211_tx_status_irqsafe(hw, skb);
172} 172}
@@ -194,12 +194,12 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
194 flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24; 194 flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24;
195 if (ieee80211_has_morefrags(((struct ieee80211_hdr *)skb->data)->frame_control)) 195 if (ieee80211_has_morefrags(((struct ieee80211_hdr *)skb->data)->frame_control))
196 flags |= RTL818X_TX_DESC_FLAG_MOREFRAG; 196 flags |= RTL818X_TX_DESC_FLAG_MOREFRAG;
197 if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { 197 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) {
198 flags |= RTL818X_TX_DESC_FLAG_RTS; 198 flags |= RTL818X_TX_DESC_FLAG_RTS;
199 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; 199 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19;
200 rts_dur = ieee80211_rts_duration(dev, priv->vif, 200 rts_dur = ieee80211_rts_duration(dev, priv->vif,
201 skb->len, info); 201 skb->len, info);
202 } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { 202 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
203 flags |= RTL818X_TX_DESC_FLAG_CTS; 203 flags |= RTL818X_TX_DESC_FLAG_CTS;
204 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19; 204 flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19;
205 } 205 }
@@ -210,7 +210,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
210 hdr->flags = cpu_to_le32(flags); 210 hdr->flags = cpu_to_le32(flags);
211 hdr->len = 0; 211 hdr->len = 0;
212 hdr->rts_duration = rts_dur; 212 hdr->rts_duration = rts_dur;
213 hdr->retry = cpu_to_le32(info->control.retry_limit << 8); 213 hdr->retry = cpu_to_le32((info->control.rates[0].count - 1) << 8);
214 buf = hdr; 214 buf = hdr;
215 215
216 ep = 2; 216 ep = 2;
@@ -228,7 +228,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
228 memset(hdr, 0, sizeof(*hdr)); 228 memset(hdr, 0, sizeof(*hdr));
229 hdr->flags = cpu_to_le32(flags); 229 hdr->flags = cpu_to_le32(flags);
230 hdr->rts_duration = rts_dur; 230 hdr->rts_duration = rts_dur;
231 hdr->retry = cpu_to_le32(info->control.retry_limit << 8); 231 hdr->retry = cpu_to_le32((info->control.rates[0].count - 1) << 8);
232 hdr->tx_duration = 232 hdr->tx_duration =
233 ieee80211_generic_frame_duration(dev, priv->vif, 233 ieee80211_generic_frame_duration(dev, priv->vif,
234 skb->len, txrate); 234 skb->len, txrate);
@@ -240,8 +240,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
240 ep = epmap[skb_get_queue_mapping(skb)]; 240 ep = epmap[skb_get_queue_mapping(skb)];
241 } 241 }
242 242
243 info->driver_data[0] = dev; 243 info->rate_driver_data[0] = dev;
244 info->driver_data[1] = urb; 244 info->rate_driver_data[1] = urb;
245 245
246 usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), 246 usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep),
247 buf, skb->len, rtl8187_tx_cb, skb); 247 buf, skb->len, rtl8187_tx_cb, skb);