aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMichael Wu <flamingice@sourmilk.net>2007-10-10 17:28:59 -0400
committerJohn W. Linville <linville@tuxdriver.com>2007-10-18 15:38:24 -0400
commit98798f4875b7149db4eb7d0a126fc6dcd9637821 (patch)
treeb34c9b2401f68fabf354493b6bb9992c3eceeeb4 /drivers/net/wireless
parentd20c678a450a25c1c12925f60c1b4cc040acc17d (diff)
[PATCH] rtl8187: Fix more frag bit checking, rts duration calc
The wrong pointer is passed to ieee80211_get_morefrag. Fix this. While we're at it, reorder things so they look better and the rts duration calculation is done with the right length. Thanks to Christoph Hellwig for finding the ieee80211_get_morefrag issue. Signed-off-by: Michael Wu <flamingice@sourmilk.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/rtl8187_dev.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 0ef887dd2867..805b2af50afc 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -131,7 +131,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
131 struct rtl8187_tx_hdr *hdr; 131 struct rtl8187_tx_hdr *hdr;
132 struct rtl8187_tx_info *info; 132 struct rtl8187_tx_info *info;
133 struct urb *urb; 133 struct urb *urb;
134 u32 tmp; 134 __le16 rts_dur = 0;
135 u32 flags;
135 136
136 urb = usb_alloc_urb(0, GFP_ATOMIC); 137 urb = usb_alloc_urb(0, GFP_ATOMIC);
137 if (!urb) { 138 if (!urb) {
@@ -139,24 +140,24 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
139 return 0; 140 return 0;
140 } 141 }
141 142
142 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 143 flags = skb->len;
143 tmp = skb->len - sizeof(*hdr); 144 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
144 tmp |= RTL8187_TX_FLAG_NO_ENCRYPT; 145 flags |= control->rts_cts_rate << 19;
145 tmp |= control->rts_cts_rate << 19; 146 flags |= control->tx_rate << 24;
146 tmp |= control->tx_rate << 24; 147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb)) 148 flags |= RTL8187_TX_FLAG_MORE_FRAG;
148 tmp |= RTL8187_TX_FLAG_MORE_FRAG;
149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
150 tmp |= RTL8187_TX_FLAG_RTS; 150 flags |= RTL8187_TX_FLAG_RTS;
151 hdr->rts_duration = 151 rts_dur = ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
152 ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
153 } 152 }
154 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 153 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
155 tmp |= RTL8187_TX_FLAG_CTS; 154 flags |= RTL8187_TX_FLAG_CTS;
156 hdr->flags = cpu_to_le32(tmp); 155
156 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
157 hdr->flags = cpu_to_le32(flags);
157 hdr->len = 0; 158 hdr->len = 0;
158 tmp = control->retry_limit << 8; 159 hdr->rts_duration = rts_dur;
159 hdr->retry = cpu_to_le32(tmp); 160 hdr->retry = cpu_to_le32(control->retry_limit << 8);
160 161
161 info = (struct rtl8187_tx_info *)skb->cb; 162 info = (struct rtl8187_tx_info *)skb->cb;
162 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); 163 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);