aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap/hostap_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 0f27059bbe8..3d9e7b7a17b 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -46,7 +46,6 @@
46#include <linux/rtnetlink.h> 46#include <linux/rtnetlink.h>
47#include <linux/wireless.h> 47#include <linux/wireless.h>
48#include <net/iw_handler.h> 48#include <net/iw_handler.h>
49#include <net/ieee80211.h>
50#include <net/lib80211.h> 49#include <net/lib80211.h>
51#include <asm/irq.h> 50#include <asm/irq.h>
52 51
@@ -1840,8 +1839,8 @@ static int prism2_tx_80211(struct sk_buff *skb, struct net_device *dev)
1840 hdr_len = 24; 1839 hdr_len = 24;
1841 skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len); 1840 skb_copy_from_linear_data(skb, &txdesc.frame_control, hdr_len);
1842 fc = le16_to_cpu(txdesc.frame_control); 1841 fc = le16_to_cpu(txdesc.frame_control);
1843 if (WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA && 1842 if (ieee80211_is_data(txdesc.frame_control) &&
1844 (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS) && 1843 ieee80211_has_a4(txdesc.frame_control) &&
1845 skb->len >= 30) { 1844 skb->len >= 30) {
1846 /* Addr4 */ 1845 /* Addr4 */
1847 skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4, 1846 skb_copy_from_linear_data_offset(skb, hdr_len, txdesc.addr4,
@@ -2082,7 +2081,7 @@ static void hostap_rx_skb(local_info_t *local, struct sk_buff *skb)
2082 stats.rate = rxdesc->rate; 2081 stats.rate = rxdesc->rate;
2083 2082
2084 /* Convert Prism2 RX structure into IEEE 802.11 header */ 2083 /* Convert Prism2 RX structure into IEEE 802.11 header */
2085 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(rxdesc->frame_control)); 2084 hdrlen = hostap_80211_get_hdrlen(rxdesc->frame_control);
2086 if (hdrlen > rx_hdrlen) 2085 if (hdrlen > rx_hdrlen)
2087 hdrlen = rx_hdrlen; 2086 hdrlen = rx_hdrlen;
2088 2087
@@ -2204,7 +2203,7 @@ static void hostap_tx_callback(local_info_t *local,
2204 return; 2203 return;
2205 } 2204 }
2206 2205
2207 hdrlen = hostap_80211_get_hdrlen(le16_to_cpu(txdesc->frame_control)); 2206 hdrlen = hostap_80211_get_hdrlen(txdesc->frame_control);
2208 len = le16_to_cpu(txdesc->data_len); 2207 len = le16_to_cpu(txdesc->data_len);
2209 skb = dev_alloc_skb(hdrlen + len); 2208 skb = dev_alloc_skb(hdrlen + len);
2210 if (skb == NULL) { 2209 if (skb == NULL) {
@@ -2315,8 +2314,7 @@ static void hostap_sta_tx_exc_tasklet(unsigned long data)
2315 if (skb->len >= sizeof(*txdesc)) { 2314 if (skb->len >= sizeof(*txdesc)) {
2316 /* Convert Prism2 RX structure into IEEE 802.11 header 2315 /* Convert Prism2 RX structure into IEEE 802.11 header
2317 */ 2316 */
2318 u16 fc = le16_to_cpu(txdesc->frame_control); 2317 int hdrlen = hostap_80211_get_hdrlen(txdesc->frame_control);
2319 int hdrlen = hostap_80211_get_hdrlen(fc);
2320 memmove(skb_pull(skb, sizeof(*txdesc) - hdrlen), 2318 memmove(skb_pull(skb, sizeof(*txdesc) - hdrlen),
2321 &txdesc->frame_control, hdrlen); 2319 &txdesc->frame_control, hdrlen);
2322 2320
@@ -2394,12 +2392,12 @@ static void prism2_txexc(local_info_t *local)
2394 PDEBUG(DEBUG_EXTRA, " retry_count=%d tx_rate=%d fc=0x%04x " 2392 PDEBUG(DEBUG_EXTRA, " retry_count=%d tx_rate=%d fc=0x%04x "
2395 "(%s%s%s::%d%s%s)\n", 2393 "(%s%s%s::%d%s%s)\n",
2396 txdesc.retry_count, txdesc.tx_rate, fc, 2394 txdesc.retry_count, txdesc.tx_rate, fc,
2397 WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_MGMT ? "Mgmt" : "", 2395 ieee80211_is_mgmt(txdesc.frame_control) ? "Mgmt" : "",
2398 WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_CTL ? "Ctrl" : "", 2396 ieee80211_is_ctl(txdesc.frame_control) ? "Ctrl" : "",
2399 WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA ? "Data" : "", 2397 ieee80211_is_data(txdesc.frame_control) ? "Data" : "",
2400 WLAN_FC_GET_STYPE(fc) >> 4, 2398 (fc & IEEE80211_FCTL_STYPE) >> 4,
2401 fc & IEEE80211_FCTL_TODS ? " ToDS" : "", 2399 ieee80211_has_tods(txdesc.frame_control) ? " ToDS" : "",
2402 fc & IEEE80211_FCTL_FROMDS ? " FromDS" : ""); 2400 ieee80211_has_fromds(txdesc.frame_control) ? " FromDS" : "");
2403 PDEBUG(DEBUG_EXTRA, " A1=%pM A2=%pM A3=%pM A4=%pM\n", 2401 PDEBUG(DEBUG_EXTRA, " A1=%pM A2=%pM A3=%pM A4=%pM\n",
2404 txdesc.addr1, txdesc.addr2, 2402 txdesc.addr1, txdesc.addr2,
2405 txdesc.addr3, txdesc.addr4); 2403 txdesc.addr3, txdesc.addr4);