diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-21 03:30:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:05 -0500 |
commit | 8a9faf3cd08b91aca1502dbe18e3b5063fda2e87 (patch) | |
tree | 4588f25ca8cd11833252370c3b0c7566004de050 | |
parent | 3eb9b41f2474c53fe469fbe383955d5aae9e76e4 (diff) |
hostap annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211.h | 34 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_80211_rx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ap.c | 72 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_common.h | 34 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_download.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_info.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 66 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_main.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_pci.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/hostap/hostap_wlan.h | 202 |
11 files changed, 233 insertions, 235 deletions
diff --git a/drivers/net/wireless/hostap/hostap_80211.h b/drivers/net/wireless/hostap/hostap_80211.h index cc1ee7f4f5f8..d6b9362a3d5c 100644 --- a/drivers/net/wireless/hostap/hostap_80211.h +++ b/drivers/net/wireless/hostap/hostap_80211.h | |||
@@ -5,52 +5,52 @@ | |||
5 | #include <net/ieee80211_crypt.h> | 5 | #include <net/ieee80211_crypt.h> |
6 | 6 | ||
7 | struct hostap_ieee80211_mgmt { | 7 | struct hostap_ieee80211_mgmt { |
8 | u16 frame_control; | 8 | __le16 frame_control; |
9 | u16 duration; | 9 | __le16 duration; |
10 | u8 da[6]; | 10 | u8 da[6]; |
11 | u8 sa[6]; | 11 | u8 sa[6]; |
12 | u8 bssid[6]; | 12 | u8 bssid[6]; |
13 | u16 seq_ctrl; | 13 | __le16 seq_ctrl; |
14 | union { | 14 | union { |
15 | struct { | 15 | struct { |
16 | u16 auth_alg; | 16 | __le16 auth_alg; |
17 | u16 auth_transaction; | 17 | __le16 auth_transaction; |
18 | u16 status_code; | 18 | __le16 status_code; |
19 | /* possibly followed by Challenge text */ | 19 | /* possibly followed by Challenge text */ |
20 | u8 variable[0]; | 20 | u8 variable[0]; |
21 | } __attribute__ ((packed)) auth; | 21 | } __attribute__ ((packed)) auth; |
22 | struct { | 22 | struct { |
23 | u16 reason_code; | 23 | __le16 reason_code; |
24 | } __attribute__ ((packed)) deauth; | 24 | } __attribute__ ((packed)) deauth; |
25 | struct { | 25 | struct { |
26 | u16 capab_info; | 26 | __le16 capab_info; |
27 | u16 listen_interval; | 27 | __le16 listen_interval; |
28 | /* followed by SSID and Supported rates */ | 28 | /* followed by SSID and Supported rates */ |
29 | u8 variable[0]; | 29 | u8 variable[0]; |
30 | } __attribute__ ((packed)) assoc_req; | 30 | } __attribute__ ((packed)) assoc_req; |
31 | struct { | 31 | struct { |
32 | u16 capab_info; | 32 | __le16 capab_info; |
33 | u16 status_code; | 33 | __le16 status_code; |
34 | u16 aid; | 34 | __le16 aid; |
35 | /* followed by Supported rates */ | 35 | /* followed by Supported rates */ |
36 | u8 variable[0]; | 36 | u8 variable[0]; |
37 | } __attribute__ ((packed)) assoc_resp, reassoc_resp; | 37 | } __attribute__ ((packed)) assoc_resp, reassoc_resp; |
38 | struct { | 38 | struct { |
39 | u16 capab_info; | 39 | __le16 capab_info; |
40 | u16 listen_interval; | 40 | __le16 listen_interval; |
41 | u8 current_ap[6]; | 41 | u8 current_ap[6]; |
42 | /* followed by SSID and Supported rates */ | 42 | /* followed by SSID and Supported rates */ |
43 | u8 variable[0]; | 43 | u8 variable[0]; |
44 | } __attribute__ ((packed)) reassoc_req; | 44 | } __attribute__ ((packed)) reassoc_req; |
45 | struct { | 45 | struct { |
46 | u16 reason_code; | 46 | __le16 reason_code; |
47 | } __attribute__ ((packed)) disassoc; | 47 | } __attribute__ ((packed)) disassoc; |
48 | struct { | 48 | struct { |
49 | } __attribute__ ((packed)) probe_req; | 49 | } __attribute__ ((packed)) probe_req; |
50 | struct { | 50 | struct { |
51 | u8 timestamp[8]; | 51 | u8 timestamp[8]; |
52 | u16 beacon_int; | 52 | __le16 beacon_int; |
53 | u16 capab_info; | 53 | __le16 capab_info; |
54 | /* followed by some of SSID, Supported rates, | 54 | /* followed by some of SSID, Supported rates, |
55 | * FH Params, DS Params, CF Params, IBSS Params, TIM */ | 55 | * FH Params, DS Params, CF Params, IBSS Params, TIM */ |
56 | u8 variable[0]; | 56 | u8 variable[0]; |
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c index ef084df3d48e..49978bdb4324 100644 --- a/drivers/net/wireless/hostap/hostap_80211_rx.c +++ b/drivers/net/wireless/hostap/hostap_80211_rx.c | |||
@@ -1039,7 +1039,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb, | |||
1039 | memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); | 1039 | memcpy(skb_push(skb, ETH_ALEN), src, ETH_ALEN); |
1040 | memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); | 1040 | memcpy(skb_push(skb, ETH_ALEN), dst, ETH_ALEN); |
1041 | } else { | 1041 | } else { |
1042 | u16 len; | 1042 | __be16 len; |
1043 | /* Leave Ethernet header part of hdr and full payload */ | 1043 | /* Leave Ethernet header part of hdr and full payload */ |
1044 | skb_pull(skb, hdrlen); | 1044 | skb_pull(skb, hdrlen); |
1045 | len = htons(skb->len); | 1045 | len = htons(skb->len); |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 6bbdb76b32df..ad040a3bb8a7 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -258,7 +258,7 @@ static void ap_handle_timer(unsigned long data) | |||
258 | sta->addr, ap->tx_callback_poll); | 258 | sta->addr, ap->tx_callback_poll); |
259 | } else { | 259 | } else { |
260 | int deauth = sta->timeout_next == STA_DEAUTH; | 260 | int deauth = sta->timeout_next == STA_DEAUTH; |
261 | u16 resp; | 261 | __le16 resp; |
262 | PDEBUG(DEBUG_AP, "%s: sending %s info to STA %s" | 262 | PDEBUG(DEBUG_AP, "%s: sending %s info to STA %s" |
263 | "(last=%lu, jiffies=%lu)\n", | 263 | "(last=%lu, jiffies=%lu)\n", |
264 | local->dev->name, | 264 | local->dev->name, |
@@ -300,13 +300,13 @@ void hostap_deauth_all_stas(struct net_device *dev, struct ap_data *ap, | |||
300 | int resend) | 300 | int resend) |
301 | { | 301 | { |
302 | u8 addr[ETH_ALEN]; | 302 | u8 addr[ETH_ALEN]; |
303 | u16 resp; | 303 | __le16 resp; |
304 | int i; | 304 | int i; |
305 | 305 | ||
306 | PDEBUG(DEBUG_AP, "%s: Deauthenticate all stations\n", dev->name); | 306 | PDEBUG(DEBUG_AP, "%s: Deauthenticate all stations\n", dev->name); |
307 | memset(addr, 0xff, ETH_ALEN); | 307 | memset(addr, 0xff, ETH_ALEN); |
308 | 308 | ||
309 | resp = __constant_cpu_to_le16(WLAN_REASON_PREV_AUTH_NOT_VALID); | 309 | resp = cpu_to_le16(WLAN_REASON_PREV_AUTH_NOT_VALID); |
310 | 310 | ||
311 | /* deauth message sent; try to resend it few times; the message is | 311 | /* deauth message sent; try to resend it few times; the message is |
312 | * broadcast, so it may be delayed until next DTIM; there is not much | 312 | * broadcast, so it may be delayed until next DTIM; there is not much |
@@ -462,7 +462,7 @@ void ap_control_flush_macs(struct mac_restrictions *mac_restrictions) | |||
462 | int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac) | 462 | int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac) |
463 | { | 463 | { |
464 | struct sta_info *sta; | 464 | struct sta_info *sta; |
465 | u16 resp; | 465 | __le16 resp; |
466 | 466 | ||
467 | spin_lock_bh(&ap->sta_table_lock); | 467 | spin_lock_bh(&ap->sta_table_lock); |
468 | sta = ap_get_sta(ap, mac); | 468 | sta = ap_get_sta(ap, mac); |
@@ -628,7 +628,8 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) | |||
628 | struct ap_data *ap = data; | 628 | struct ap_data *ap = data; |
629 | struct net_device *dev = ap->local->dev; | 629 | struct net_device *dev = ap->local->dev; |
630 | struct ieee80211_hdr_4addr *hdr; | 630 | struct ieee80211_hdr_4addr *hdr; |
631 | u16 fc, *pos, auth_alg, auth_transaction, status; | 631 | u16 fc, auth_alg, auth_transaction, status; |
632 | __le16 *pos; | ||
632 | struct sta_info *sta = NULL; | 633 | struct sta_info *sta = NULL; |
633 | char *txt = NULL; | 634 | char *txt = NULL; |
634 | DECLARE_MAC_BUF(mac); | 635 | DECLARE_MAC_BUF(mac); |
@@ -649,7 +650,7 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data) | |||
649 | return; | 650 | return; |
650 | } | 651 | } |
651 | 652 | ||
652 | pos = (u16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); | 653 | pos = (__le16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); |
653 | auth_alg = le16_to_cpu(*pos++); | 654 | auth_alg = le16_to_cpu(*pos++); |
654 | auth_transaction = le16_to_cpu(*pos++); | 655 | auth_transaction = le16_to_cpu(*pos++); |
655 | status = le16_to_cpu(*pos++); | 656 | status = le16_to_cpu(*pos++); |
@@ -698,7 +699,8 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) | |||
698 | struct ap_data *ap = data; | 699 | struct ap_data *ap = data; |
699 | struct net_device *dev = ap->local->dev; | 700 | struct net_device *dev = ap->local->dev; |
700 | struct ieee80211_hdr_4addr *hdr; | 701 | struct ieee80211_hdr_4addr *hdr; |
701 | u16 fc, *pos, status; | 702 | u16 fc, status; |
703 | __le16 *pos; | ||
702 | struct sta_info *sta = NULL; | 704 | struct sta_info *sta = NULL; |
703 | char *txt = NULL; | 705 | char *txt = NULL; |
704 | DECLARE_MAC_BUF(mac); | 706 | DECLARE_MAC_BUF(mac); |
@@ -736,7 +738,7 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data) | |||
736 | goto done; | 738 | goto done; |
737 | } | 739 | } |
738 | 740 | ||
739 | pos = (u16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); | 741 | pos = (__le16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); |
740 | pos++; | 742 | pos++; |
741 | status = le16_to_cpu(*pos++); | 743 | status = le16_to_cpu(*pos++); |
742 | if (status == WLAN_STATUS_SUCCESS) { | 744 | if (status == WLAN_STATUS_SUCCESS) { |
@@ -1298,7 +1300,8 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1298 | struct ap_data *ap = local->ap; | 1300 | struct ap_data *ap = local->ap; |
1299 | char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL; | 1301 | char body[8 + WLAN_AUTH_CHALLENGE_LEN], *challenge = NULL; |
1300 | int len, olen; | 1302 | int len, olen; |
1301 | u16 auth_alg, auth_transaction, status_code, *pos; | 1303 | u16 auth_alg, auth_transaction, status_code; |
1304 | __le16 *pos; | ||
1302 | u16 resp = WLAN_STATUS_SUCCESS, fc; | 1305 | u16 resp = WLAN_STATUS_SUCCESS, fc; |
1303 | struct sta_info *sta = NULL; | 1306 | struct sta_info *sta = NULL; |
1304 | struct ieee80211_crypt_data *crypt; | 1307 | struct ieee80211_crypt_data *crypt; |
@@ -1332,7 +1335,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1332 | crypt = local->crypt[idx]; | 1335 | crypt = local->crypt[idx]; |
1333 | } | 1336 | } |
1334 | 1337 | ||
1335 | pos = (u16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); | 1338 | pos = (__le16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); |
1336 | auth_alg = __le16_to_cpu(*pos); | 1339 | auth_alg = __le16_to_cpu(*pos); |
1337 | pos++; | 1340 | pos++; |
1338 | auth_transaction = __le16_to_cpu(*pos); | 1341 | auth_transaction = __le16_to_cpu(*pos); |
@@ -1465,7 +1468,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb, | |||
1465 | } | 1468 | } |
1466 | 1469 | ||
1467 | fail: | 1470 | fail: |
1468 | pos = (u16 *) body; | 1471 | pos = (__le16 *) body; |
1469 | *pos = cpu_to_le16(auth_alg); | 1472 | *pos = cpu_to_le16(auth_alg); |
1470 | pos++; | 1473 | pos++; |
1471 | *pos = cpu_to_le16(auth_transaction + 1); | 1474 | *pos = cpu_to_le16(auth_transaction + 1); |
@@ -1510,7 +1513,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1510 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; | 1513 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; |
1511 | char body[12], *p, *lpos; | 1514 | char body[12], *p, *lpos; |
1512 | int len, left; | 1515 | int len, left; |
1513 | u16 *pos; | 1516 | __le16 *pos; |
1514 | u16 resp = WLAN_STATUS_SUCCESS; | 1517 | u16 resp = WLAN_STATUS_SUCCESS; |
1515 | struct sta_info *sta = NULL; | 1518 | struct sta_info *sta = NULL; |
1516 | int send_deauth = 0; | 1519 | int send_deauth = 0; |
@@ -1540,7 +1543,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1540 | atomic_inc(&sta->users); | 1543 | atomic_inc(&sta->users); |
1541 | spin_unlock_bh(&local->ap->sta_table_lock); | 1544 | spin_unlock_bh(&local->ap->sta_table_lock); |
1542 | 1545 | ||
1543 | pos = (u16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); | 1546 | pos = (__le16 *) (skb->data + IEEE80211_MGMT_HDR_LEN); |
1544 | sta->capability = __le16_to_cpu(*pos); | 1547 | sta->capability = __le16_to_cpu(*pos); |
1545 | pos++; left -= 2; | 1548 | pos++; left -= 2; |
1546 | sta->listen_interval = __le16_to_cpu(*pos); | 1549 | sta->listen_interval = __le16_to_cpu(*pos); |
@@ -1636,25 +1639,24 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1636 | } | 1639 | } |
1637 | 1640 | ||
1638 | fail: | 1641 | fail: |
1639 | pos = (u16 *) body; | 1642 | pos = (__le16 *) body; |
1640 | 1643 | ||
1641 | if (send_deauth) { | 1644 | if (send_deauth) { |
1642 | *pos = __constant_cpu_to_le16( | 1645 | *pos = cpu_to_le16(WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH); |
1643 | WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH); | ||
1644 | pos++; | 1646 | pos++; |
1645 | } else { | 1647 | } else { |
1646 | /* FIX: CF-Pollable and CF-PollReq should be set to match the | 1648 | /* FIX: CF-Pollable and CF-PollReq should be set to match the |
1647 | * values in beacons/probe responses */ | 1649 | * values in beacons/probe responses */ |
1648 | /* FIX: how about privacy and WEP? */ | 1650 | /* FIX: how about privacy and WEP? */ |
1649 | /* capability */ | 1651 | /* capability */ |
1650 | *pos = __constant_cpu_to_le16(WLAN_CAPABILITY_ESS); | 1652 | *pos = cpu_to_le16(WLAN_CAPABILITY_ESS); |
1651 | pos++; | 1653 | pos++; |
1652 | 1654 | ||
1653 | /* status_code */ | 1655 | /* status_code */ |
1654 | *pos = __cpu_to_le16(resp); | 1656 | *pos = cpu_to_le16(resp); |
1655 | pos++; | 1657 | pos++; |
1656 | 1658 | ||
1657 | *pos = __cpu_to_le16((sta && sta->aid > 0 ? sta->aid : 0) | | 1659 | *pos = cpu_to_le16((sta && sta->aid > 0 ? sta->aid : 0) | |
1658 | BIT(14) | BIT(15)); /* AID */ | 1660 | BIT(14) | BIT(15)); /* AID */ |
1659 | pos++; | 1661 | pos++; |
1660 | 1662 | ||
@@ -1681,7 +1683,7 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb, | |||
1681 | 0x96 : 0x16; | 1683 | 0x96 : 0x16; |
1682 | (*lpos)++; | 1684 | (*lpos)++; |
1683 | } | 1685 | } |
1684 | pos = (u16 *) p; | 1686 | pos = (__le16 *) p; |
1685 | } | 1687 | } |
1686 | 1688 | ||
1687 | prism2_send_mgmt(dev, IEEE80211_FTYPE_MGMT | | 1689 | prism2_send_mgmt(dev, IEEE80211_FTYPE_MGMT | |
@@ -1718,7 +1720,8 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb, | |||
1718 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; | 1720 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; |
1719 | char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN); | 1721 | char *body = (char *) (skb->data + IEEE80211_MGMT_HDR_LEN); |
1720 | int len; | 1722 | int len; |
1721 | u16 reason_code, *pos; | 1723 | u16 reason_code; |
1724 | __le16 *pos; | ||
1722 | struct sta_info *sta = NULL; | 1725 | struct sta_info *sta = NULL; |
1723 | DECLARE_MAC_BUF(mac); | 1726 | DECLARE_MAC_BUF(mac); |
1724 | 1727 | ||
@@ -1729,8 +1732,8 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb, | |||
1729 | return; | 1732 | return; |
1730 | } | 1733 | } |
1731 | 1734 | ||
1732 | pos = (u16 *) body; | 1735 | pos = (__le16 *) body; |
1733 | reason_code = __le16_to_cpu(*pos); | 1736 | reason_code = le16_to_cpu(*pos); |
1734 | 1737 | ||
1735 | PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " | 1738 | PDEBUG(DEBUG_AP, "%s: deauthentication: %s len=%d, " |
1736 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, | 1739 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, |
@@ -1760,7 +1763,8 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, | |||
1760 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; | 1763 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; |
1761 | char *body = skb->data + IEEE80211_MGMT_HDR_LEN; | 1764 | char *body = skb->data + IEEE80211_MGMT_HDR_LEN; |
1762 | int len; | 1765 | int len; |
1763 | u16 reason_code, *pos; | 1766 | u16 reason_code; |
1767 | __le16 *pos; | ||
1764 | struct sta_info *sta = NULL; | 1768 | struct sta_info *sta = NULL; |
1765 | DECLARE_MAC_BUF(mac); | 1769 | DECLARE_MAC_BUF(mac); |
1766 | 1770 | ||
@@ -1771,8 +1775,8 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb, | |||
1771 | return; | 1775 | return; |
1772 | } | 1776 | } |
1773 | 1777 | ||
1774 | pos = (u16 *) body; | 1778 | pos = (__le16 *) body; |
1775 | reason_code = __le16_to_cpu(*pos); | 1779 | reason_code = le16_to_cpu(*pos); |
1776 | 1780 | ||
1777 | PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " | 1781 | PDEBUG(DEBUG_AP, "%s: disassociation: %s len=%d, " |
1778 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, | 1782 | "reason_code=%d\n", dev->name, print_mac(mac, hdr->addr2), len, |
@@ -1817,7 +1821,7 @@ static void ap_handle_dropped_data(local_info_t *local, | |||
1817 | { | 1821 | { |
1818 | struct net_device *dev = local->dev; | 1822 | struct net_device *dev = local->dev; |
1819 | struct sta_info *sta; | 1823 | struct sta_info *sta; |
1820 | u16 reason; | 1824 | __le16 reason; |
1821 | 1825 | ||
1822 | spin_lock_bh(&local->ap->sta_table_lock); | 1826 | spin_lock_bh(&local->ap->sta_table_lock); |
1823 | sta = ap_get_sta(local->ap, hdr->addr2); | 1827 | sta = ap_get_sta(local->ap, hdr->addr2); |
@@ -1831,8 +1835,7 @@ static void ap_handle_dropped_data(local_info_t *local, | |||
1831 | return; | 1835 | return; |
1832 | } | 1836 | } |
1833 | 1837 | ||
1834 | reason = __constant_cpu_to_le16( | 1838 | reason = cpu_to_le16(WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); |
1835 | WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); | ||
1836 | prism2_send_mgmt(dev, IEEE80211_FTYPE_MGMT | | 1839 | prism2_send_mgmt(dev, IEEE80211_FTYPE_MGMT | |
1837 | ((sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) ? | 1840 | ((sta == NULL || !(sta->flags & WLAN_STA_ASSOC)) ? |
1838 | IEEE80211_STYPE_DEAUTH : IEEE80211_STYPE_DISASSOC), | 1841 | IEEE80211_STYPE_DEAUTH : IEEE80211_STYPE_DISASSOC), |
@@ -1892,7 +1895,7 @@ static void handle_pspoll(local_info_t *local, | |||
1892 | return; | 1895 | return; |
1893 | } | 1896 | } |
1894 | 1897 | ||
1895 | aid = __le16_to_cpu(hdr->duration_id); | 1898 | aid = le16_to_cpu(hdr->duration_id); |
1896 | if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14))) { | 1899 | if ((aid & (BIT(15) | BIT(14))) != (BIT(15) | BIT(14))) { |
1897 | PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n"); | 1900 | PDEBUG(DEBUG_PS, " PSPOLL and AID[15:14] not set\n"); |
1898 | return; | 1901 | return; |
@@ -1998,7 +2001,8 @@ static void handle_beacon(local_info_t *local, struct sk_buff *skb, | |||
1998 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; | 2001 | struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) skb->data; |
1999 | char *body = skb->data + IEEE80211_MGMT_HDR_LEN; | 2002 | char *body = skb->data + IEEE80211_MGMT_HDR_LEN; |
2000 | int len, left; | 2003 | int len, left; |
2001 | u16 *pos, beacon_int, capability; | 2004 | u16 beacon_int, capability; |
2005 | __le16 *pos; | ||
2002 | char *ssid = NULL; | 2006 | char *ssid = NULL; |
2003 | unsigned char *supp_rates = NULL; | 2007 | unsigned char *supp_rates = NULL; |
2004 | int ssid_len = 0, supp_rates_len = 0; | 2008 | int ssid_len = 0, supp_rates_len = 0; |
@@ -2013,16 +2017,16 @@ static void handle_beacon(local_info_t *local, struct sk_buff *skb, | |||
2013 | return; | 2017 | return; |
2014 | } | 2018 | } |
2015 | 2019 | ||
2016 | pos = (u16 *) body; | 2020 | pos = (__le16 *) body; |
2017 | left = len; | 2021 | left = len; |
2018 | 2022 | ||
2019 | /* Timestamp (8 octets) */ | 2023 | /* Timestamp (8 octets) */ |
2020 | pos += 4; left -= 8; | 2024 | pos += 4; left -= 8; |
2021 | /* Beacon interval (2 octets) */ | 2025 | /* Beacon interval (2 octets) */ |
2022 | beacon_int = __le16_to_cpu(*pos); | 2026 | beacon_int = le16_to_cpu(*pos); |
2023 | pos++; left -= 2; | 2027 | pos++; left -= 2; |
2024 | /* Capability information (2 octets) */ | 2028 | /* Capability information (2 octets) */ |
2025 | capability = __le16_to_cpu(*pos); | 2029 | capability = le16_to_cpu(*pos); |
2026 | pos++; left -= 2; | 2030 | pos++; left -= 2; |
2027 | 2031 | ||
2028 | if (local->ap->ap_policy != AP_OTHER_AP_EVEN_IBSS && | 2032 | if (local->ap->ap_policy != AP_OTHER_AP_EVEN_IBSS && |
diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h index 517f89845144..b470c743c2d1 100644 --- a/drivers/net/wireless/hostap/hostap_common.h +++ b/drivers/net/wireless/hostap/hostap_common.h | |||
@@ -188,10 +188,10 @@ | |||
188 | 188 | ||
189 | struct hfa384x_comp_ident | 189 | struct hfa384x_comp_ident |
190 | { | 190 | { |
191 | u16 id; | 191 | __le16 id; |
192 | u16 variant; | 192 | __le16 variant; |
193 | u16 major; | 193 | __le16 major; |
194 | u16 minor; | 194 | __le16 minor; |
195 | } __attribute__ ((packed)); | 195 | } __attribute__ ((packed)); |
196 | 196 | ||
197 | #define HFA384X_COMP_ID_PRI 0x15 | 197 | #define HFA384X_COMP_ID_PRI 0x15 |
@@ -200,33 +200,33 @@ struct hfa384x_comp_ident | |||
200 | 200 | ||
201 | struct hfa384x_sup_range | 201 | struct hfa384x_sup_range |
202 | { | 202 | { |
203 | u16 role; | 203 | __le16 role; |
204 | u16 id; | 204 | __le16 id; |
205 | u16 variant; | 205 | __le16 variant; |
206 | u16 bottom; | 206 | __le16 bottom; |
207 | u16 top; | 207 | __le16 top; |
208 | } __attribute__ ((packed)); | 208 | } __attribute__ ((packed)); |
209 | 209 | ||
210 | 210 | ||
211 | struct hfa384x_build_id | 211 | struct hfa384x_build_id |
212 | { | 212 | { |
213 | u16 pri_seq; | 213 | __le16 pri_seq; |
214 | u16 sec_seq; | 214 | __le16 sec_seq; |
215 | } __attribute__ ((packed)); | 215 | } __attribute__ ((packed)); |
216 | 216 | ||
217 | /* FD01 - Download Buffer */ | 217 | /* FD01 - Download Buffer */ |
218 | struct hfa384x_rid_download_buffer | 218 | struct hfa384x_rid_download_buffer |
219 | { | 219 | { |
220 | u16 page; | 220 | __le16 page; |
221 | u16 offset; | 221 | __le16 offset; |
222 | u16 length; | 222 | __le16 length; |
223 | } __attribute__ ((packed)); | 223 | } __attribute__ ((packed)); |
224 | 224 | ||
225 | /* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */ | 225 | /* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */ |
226 | struct hfa384x_comms_quality { | 226 | struct hfa384x_comms_quality { |
227 | u16 comm_qual; /* 0 .. 92 */ | 227 | __le16 comm_qual; /* 0 .. 92 */ |
228 | u16 signal_level; /* 27 .. 154 */ | 228 | __le16 signal_level; /* 27 .. 154 */ |
229 | u16 noise_level; /* 27 .. 154 */ | 229 | __le16 noise_level; /* 27 .. 154 */ |
230 | } __attribute__ ((packed)); | 230 | } __attribute__ ((packed)); |
231 | 231 | ||
232 | 232 | ||
diff --git a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c index c7678e67697d..89d3849abfe0 100644 --- a/drivers/net/wireless/hostap/hostap_download.c +++ b/drivers/net/wireless/hostap/hostap_download.c | |||
@@ -100,7 +100,7 @@ static int hfa384x_from_aux(struct net_device *dev, unsigned int addr, int len, | |||
100 | 100 | ||
101 | #ifdef PRISM2_PCI | 101 | #ifdef PRISM2_PCI |
102 | { | 102 | { |
103 | u16 *pos = (u16 *) buf; | 103 | __le16 *pos = (__le16 *) buf; |
104 | while (len > 0) { | 104 | while (len > 0) { |
105 | *pos++ = HFA384X_INW_DATA(HFA384X_AUXDATA_OFF); | 105 | *pos++ = HFA384X_INW_DATA(HFA384X_AUXDATA_OFF); |
106 | len -= 2; | 106 | len -= 2; |
@@ -131,7 +131,7 @@ static int hfa384x_to_aux(struct net_device *dev, unsigned int addr, int len, | |||
131 | 131 | ||
132 | #ifdef PRISM2_PCI | 132 | #ifdef PRISM2_PCI |
133 | { | 133 | { |
134 | u16 *pos = (u16 *) buf; | 134 | __le16 *pos = (__le16 *) buf; |
135 | while (len > 0) { | 135 | while (len > 0) { |
136 | HFA384X_OUTW_DATA(*pos++, HFA384X_AUXDATA_OFF); | 136 | HFA384X_OUTW_DATA(*pos++, HFA384X_AUXDATA_OFF); |
137 | len -= 2; | 137 | len -= 2; |
@@ -147,7 +147,7 @@ static int hfa384x_to_aux(struct net_device *dev, unsigned int addr, int len, | |||
147 | 147 | ||
148 | static int prism2_pda_ok(u8 *buf) | 148 | static int prism2_pda_ok(u8 *buf) |
149 | { | 149 | { |
150 | u16 *pda = (u16 *) buf; | 150 | __le16 *pda = (__le16 *) buf; |
151 | int pos; | 151 | int pos; |
152 | u16 len, pdr; | 152 | u16 len, pdr; |
153 | 153 | ||
@@ -544,9 +544,9 @@ static int prism2_download_nonvolatile(local_info_t *local, | |||
544 | struct net_device *dev = local->dev; | 544 | struct net_device *dev = local->dev; |
545 | int ret = 0, i; | 545 | int ret = 0, i; |
546 | struct { | 546 | struct { |
547 | u16 page; | 547 | __le16 page; |
548 | u16 offset; | 548 | __le16 offset; |
549 | u16 len; | 549 | __le16 len; |
550 | } dlbuffer; | 550 | } dlbuffer; |
551 | u32 bufaddr; | 551 | u32 bufaddr; |
552 | 552 | ||
@@ -565,14 +565,12 @@ static int prism2_download_nonvolatile(local_info_t *local, | |||
565 | goto out; | 565 | goto out; |
566 | } | 566 | } |
567 | 567 | ||
568 | dlbuffer.page = le16_to_cpu(dlbuffer.page); | ||
569 | dlbuffer.offset = le16_to_cpu(dlbuffer.offset); | ||
570 | dlbuffer.len = le16_to_cpu(dlbuffer.len); | ||
571 | |||
572 | printk(KERN_DEBUG "Download buffer: %d bytes at 0x%04x:0x%04x\n", | 568 | printk(KERN_DEBUG "Download buffer: %d bytes at 0x%04x:0x%04x\n", |
573 | dlbuffer.len, dlbuffer.page, dlbuffer.offset); | 569 | le16_to_cpu(dlbuffer.len), |
570 | le16_to_cpu(dlbuffer.page), | ||
571 | le16_to_cpu(dlbuffer.offset)); | ||
574 | 572 | ||
575 | bufaddr = (dlbuffer.page << 7) + dlbuffer.offset; | 573 | bufaddr = (le16_to_cpu(dlbuffer.page) << 7) + le16_to_cpu(dlbuffer.offset); |
576 | 574 | ||
577 | local->hw_downloading = 1; | 575 | local->hw_downloading = 1; |
578 | 576 | ||
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 700a9c34815b..77237bb3b2f9 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -1075,7 +1075,7 @@ static int prism2_setup_rids(struct net_device *dev) | |||
1075 | { | 1075 | { |
1076 | struct hostap_interface *iface; | 1076 | struct hostap_interface *iface; |
1077 | local_info_t *local; | 1077 | local_info_t *local; |
1078 | u16 tmp; | 1078 | __le16 tmp; |
1079 | int ret = 0; | 1079 | int ret = 0; |
1080 | 1080 | ||
1081 | iface = netdev_priv(dev); | 1081 | iface = netdev_priv(dev); |
@@ -1084,11 +1084,11 @@ static int prism2_setup_rids(struct net_device *dev) | |||
1084 | hostap_set_word(dev, HFA384X_RID_TICKTIME, 2000); | 1084 | hostap_set_word(dev, HFA384X_RID_TICKTIME, 2000); |
1085 | 1085 | ||
1086 | if (!local->fw_ap) { | 1086 | if (!local->fw_ap) { |
1087 | tmp = hostap_get_porttype(local); | 1087 | u16 tmp1 = hostap_get_porttype(local); |
1088 | ret = hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE, tmp); | 1088 | ret = hostap_set_word(dev, HFA384X_RID_CNFPORTTYPE, tmp1); |
1089 | if (ret) { | 1089 | if (ret) { |
1090 | printk("%s: Port type setting to %d failed\n", | 1090 | printk("%s: Port type setting to %d failed\n", |
1091 | dev->name, tmp); | 1091 | dev->name, tmp1); |
1092 | goto fail; | 1092 | goto fail; |
1093 | } | 1093 | } |
1094 | } | 1094 | } |
@@ -1117,7 +1117,7 @@ static int prism2_setup_rids(struct net_device *dev) | |||
1117 | ret = -EINVAL; | 1117 | ret = -EINVAL; |
1118 | goto fail; | 1118 | goto fail; |
1119 | } | 1119 | } |
1120 | local->channel_mask = __le16_to_cpu(tmp); | 1120 | local->channel_mask = le16_to_cpu(tmp); |
1121 | 1121 | ||
1122 | if (local->channel < 1 || local->channel > 14 || | 1122 | if (local->channel < 1 || local->channel > 14 || |
1123 | !(local->channel_mask & (1 << (local->channel - 1)))) { | 1123 | !(local->channel_mask & (1 << (local->channel - 1)))) { |
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c index 636f4b2382ea..e559b8d9fca6 100644 --- a/drivers/net/wireless/hostap/hostap_info.c +++ b/drivers/net/wireless/hostap/hostap_info.c | |||
@@ -303,7 +303,7 @@ static void prism2_info_hostscanresults(local_info_t *local, | |||
303 | int i, result_size, copy_len, new_count; | 303 | int i, result_size, copy_len, new_count; |
304 | struct hfa384x_hostscan_result *results, *prev; | 304 | struct hfa384x_hostscan_result *results, *prev; |
305 | unsigned long flags; | 305 | unsigned long flags; |
306 | u16 *pos; | 306 | __le16 *pos; |
307 | u8 *ptr; | 307 | u8 *ptr; |
308 | 308 | ||
309 | wake_up_interruptible(&local->hostscan_wq); | 309 | wake_up_interruptible(&local->hostscan_wq); |
@@ -314,7 +314,7 @@ static void prism2_info_hostscanresults(local_info_t *local, | |||
314 | return; | 314 | return; |
315 | } | 315 | } |
316 | 316 | ||
317 | pos = (u16 *) buf; | 317 | pos = (__le16 *) buf; |
318 | copy_len = result_size = le16_to_cpu(*pos); | 318 | copy_len = result_size = le16_to_cpu(*pos); |
319 | if (result_size == 0) { | 319 | if (result_size == 0) { |
320 | printk(KERN_DEBUG "%s: invalid result_size (0) in " | 320 | printk(KERN_DEBUG "%s: invalid result_size (0) in " |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 3a57d48cc360..0ca0bfeb0ada 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -84,7 +84,7 @@ static int prism2_get_datarates(struct net_device *dev, u8 *rates) | |||
84 | if (len < 2) | 84 | if (len < 2) |
85 | return 0; | 85 | return 0; |
86 | 86 | ||
87 | val = le16_to_cpu(*(u16 *) buf); /* string length */ | 87 | val = le16_to_cpu(*(__le16 *) buf); /* string length */ |
88 | 88 | ||
89 | if (len - 2 < val || val > 10) | 89 | if (len - 2 < val || val > 10) |
90 | return 0; | 90 | return 0; |
@@ -496,7 +496,7 @@ static int prism2_ioctl_giwsens(struct net_device *dev, | |||
496 | { | 496 | { |
497 | struct hostap_interface *iface; | 497 | struct hostap_interface *iface; |
498 | local_info_t *local; | 498 | local_info_t *local; |
499 | u16 val; | 499 | __le16 val; |
500 | 500 | ||
501 | iface = netdev_priv(dev); | 501 | iface = netdev_priv(dev); |
502 | local = iface->local; | 502 | local = iface->local; |
@@ -506,7 +506,7 @@ static int prism2_ioctl_giwsens(struct net_device *dev, | |||
506 | 0) | 506 | 0) |
507 | return -EINVAL; | 507 | return -EINVAL; |
508 | 508 | ||
509 | sens->value = __le16_to_cpu(val); | 509 | sens->value = le16_to_cpu(val); |
510 | sens->fixed = 1; | 510 | sens->fixed = 1; |
511 | 511 | ||
512 | return 0; | 512 | return 0; |
@@ -561,17 +561,17 @@ static int prism2_ioctl_siwrts(struct net_device *dev, | |||
561 | { | 561 | { |
562 | struct hostap_interface *iface; | 562 | struct hostap_interface *iface; |
563 | local_info_t *local; | 563 | local_info_t *local; |
564 | u16 val; | 564 | __le16 val; |
565 | 565 | ||
566 | iface = netdev_priv(dev); | 566 | iface = netdev_priv(dev); |
567 | local = iface->local; | 567 | local = iface->local; |
568 | 568 | ||
569 | if (rts->disabled) | 569 | if (rts->disabled) |
570 | val = __constant_cpu_to_le16(2347); | 570 | val = cpu_to_le16(2347); |
571 | else if (rts->value < 0 || rts->value > 2347) | 571 | else if (rts->value < 0 || rts->value > 2347) |
572 | return -EINVAL; | 572 | return -EINVAL; |
573 | else | 573 | else |
574 | val = __cpu_to_le16(rts->value); | 574 | val = cpu_to_le16(rts->value); |
575 | 575 | ||
576 | if (local->func->set_rid(dev, HFA384X_RID_RTSTHRESHOLD, &val, 2) || | 576 | if (local->func->set_rid(dev, HFA384X_RID_RTSTHRESHOLD, &val, 2) || |
577 | local->func->reset_port(dev)) | 577 | local->func->reset_port(dev)) |
@@ -588,7 +588,7 @@ static int prism2_ioctl_giwrts(struct net_device *dev, | |||
588 | { | 588 | { |
589 | struct hostap_interface *iface; | 589 | struct hostap_interface *iface; |
590 | local_info_t *local; | 590 | local_info_t *local; |
591 | u16 val; | 591 | __le16 val; |
592 | 592 | ||
593 | iface = netdev_priv(dev); | 593 | iface = netdev_priv(dev); |
594 | local = iface->local; | 594 | local = iface->local; |
@@ -597,7 +597,7 @@ static int prism2_ioctl_giwrts(struct net_device *dev, | |||
597 | 0) | 597 | 0) |
598 | return -EINVAL; | 598 | return -EINVAL; |
599 | 599 | ||
600 | rts->value = __le16_to_cpu(val); | 600 | rts->value = le16_to_cpu(val); |
601 | rts->disabled = (rts->value == 2347); | 601 | rts->disabled = (rts->value == 2347); |
602 | rts->fixed = 1; | 602 | rts->fixed = 1; |
603 | 603 | ||
@@ -611,17 +611,17 @@ static int prism2_ioctl_siwfrag(struct net_device *dev, | |||
611 | { | 611 | { |
612 | struct hostap_interface *iface; | 612 | struct hostap_interface *iface; |
613 | local_info_t *local; | 613 | local_info_t *local; |
614 | u16 val; | 614 | __le16 val; |
615 | 615 | ||
616 | iface = netdev_priv(dev); | 616 | iface = netdev_priv(dev); |
617 | local = iface->local; | 617 | local = iface->local; |
618 | 618 | ||
619 | if (rts->disabled) | 619 | if (rts->disabled) |
620 | val = __constant_cpu_to_le16(2346); | 620 | val = cpu_to_le16(2346); |
621 | else if (rts->value < 256 || rts->value > 2346) | 621 | else if (rts->value < 256 || rts->value > 2346) |
622 | return -EINVAL; | 622 | return -EINVAL; |
623 | else | 623 | else |
624 | val = __cpu_to_le16(rts->value & ~0x1); /* even numbers only */ | 624 | val = cpu_to_le16(rts->value & ~0x1); /* even numbers only */ |
625 | 625 | ||
626 | local->fragm_threshold = rts->value & ~0x1; | 626 | local->fragm_threshold = rts->value & ~0x1; |
627 | if (local->func->set_rid(dev, HFA384X_RID_FRAGMENTATIONTHRESHOLD, &val, | 627 | if (local->func->set_rid(dev, HFA384X_RID_FRAGMENTATIONTHRESHOLD, &val, |
@@ -638,7 +638,7 @@ static int prism2_ioctl_giwfrag(struct net_device *dev, | |||
638 | { | 638 | { |
639 | struct hostap_interface *iface; | 639 | struct hostap_interface *iface; |
640 | local_info_t *local; | 640 | local_info_t *local; |
641 | u16 val; | 641 | __le16 val; |
642 | 642 | ||
643 | iface = netdev_priv(dev); | 643 | iface = netdev_priv(dev); |
644 | local = iface->local; | 644 | local = iface->local; |
@@ -647,7 +647,7 @@ static int prism2_ioctl_giwfrag(struct net_device *dev, | |||
647 | &val, 2, 1) < 0) | 647 | &val, 2, 1) < 0) |
648 | return -EINVAL; | 648 | return -EINVAL; |
649 | 649 | ||
650 | rts->value = __le16_to_cpu(val); | 650 | rts->value = le16_to_cpu(val); |
651 | rts->disabled = (rts->value == 2346); | 651 | rts->disabled = (rts->value == 2346); |
652 | rts->fixed = 1; | 652 | rts->fixed = 1; |
653 | 653 | ||
@@ -718,8 +718,8 @@ static int prism2_ioctl_siwap(struct net_device *dev, | |||
718 | if (local->host_roaming == 1 && local->iw_mode == IW_MODE_INFRA) { | 718 | if (local->host_roaming == 1 && local->iw_mode == IW_MODE_INFRA) { |
719 | struct hfa384x_scan_request scan_req; | 719 | struct hfa384x_scan_request scan_req; |
720 | memset(&scan_req, 0, sizeof(scan_req)); | 720 | memset(&scan_req, 0, sizeof(scan_req)); |
721 | scan_req.channel_list = __constant_cpu_to_le16(0x3fff); | 721 | scan_req.channel_list = cpu_to_le16(0x3fff); |
722 | scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS); | 722 | scan_req.txrate = cpu_to_le16(HFA384X_RATES_1MBPS); |
723 | if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, | 723 | if (local->func->set_rid(dev, HFA384X_RID_SCANREQUEST, |
724 | &scan_req, sizeof(scan_req))) { | 724 | &scan_req, sizeof(scan_req))) { |
725 | printk(KERN_DEBUG "%s: ScanResults request failed - " | 725 | printk(KERN_DEBUG "%s: ScanResults request failed - " |
@@ -812,7 +812,7 @@ static int prism2_ioctl_giwnickn(struct net_device *dev, | |||
812 | 812 | ||
813 | len = local->func->get_rid(dev, HFA384X_RID_CNFOWNNAME, | 813 | len = local->func->get_rid(dev, HFA384X_RID_CNFOWNNAME, |
814 | &name, MAX_NAME_LEN + 2, 0); | 814 | &name, MAX_NAME_LEN + 2, 0); |
815 | val = __le16_to_cpu(*(u16 *) name); | 815 | val = le16_to_cpu(*(__le16 *) name); |
816 | if (len > MAX_NAME_LEN + 2 || len < 0 || val > MAX_NAME_LEN) | 816 | if (len > MAX_NAME_LEN + 2 || len < 0 || val > MAX_NAME_LEN) |
817 | return -EOPNOTSUPP; | 817 | return -EOPNOTSUPP; |
818 | 818 | ||
@@ -963,7 +963,7 @@ static int prism2_ioctl_giwessid(struct net_device *dev, | |||
963 | memset(ssid, 0, sizeof(ssid)); | 963 | memset(ssid, 0, sizeof(ssid)); |
964 | len = local->func->get_rid(dev, HFA384X_RID_CURRENTSSID, | 964 | len = local->func->get_rid(dev, HFA384X_RID_CURRENTSSID, |
965 | &ssid, MAX_SSID_LEN + 2, 0); | 965 | &ssid, MAX_SSID_LEN + 2, 0); |
966 | val = __le16_to_cpu(*(u16 *) ssid); | 966 | val = le16_to_cpu(*(__le16 *) ssid); |
967 | if (len > MAX_SSID_LEN + 2 || len < 0 || val > MAX_SSID_LEN) { | 967 | if (len > MAX_SSID_LEN + 2 || len < 0 || val > MAX_SSID_LEN) { |
968 | return -EOPNOTSUPP; | 968 | return -EOPNOTSUPP; |
969 | } | 969 | } |
@@ -1319,7 +1319,7 @@ static int prism2_ioctl_giwpower(struct net_device *dev, | |||
1319 | #else /* PRISM2_NO_STATION_MODES */ | 1319 | #else /* PRISM2_NO_STATION_MODES */ |
1320 | struct hostap_interface *iface; | 1320 | struct hostap_interface *iface; |
1321 | local_info_t *local; | 1321 | local_info_t *local; |
1322 | u16 enable, mcast; | 1322 | __le16 enable, mcast; |
1323 | 1323 | ||
1324 | iface = netdev_priv(dev); | 1324 | iface = netdev_priv(dev); |
1325 | local = iface->local; | 1325 | local = iface->local; |
@@ -1328,7 +1328,7 @@ static int prism2_ioctl_giwpower(struct net_device *dev, | |||
1328 | < 0) | 1328 | < 0) |
1329 | return -EINVAL; | 1329 | return -EINVAL; |
1330 | 1330 | ||
1331 | if (!__le16_to_cpu(enable)) { | 1331 | if (!le16_to_cpu(enable)) { |
1332 | rrq->disabled = 1; | 1332 | rrq->disabled = 1; |
1333 | return 0; | 1333 | return 0; |
1334 | } | 1334 | } |
@@ -1336,29 +1336,29 @@ static int prism2_ioctl_giwpower(struct net_device *dev, | |||
1336 | rrq->disabled = 0; | 1336 | rrq->disabled = 0; |
1337 | 1337 | ||
1338 | if ((rrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { | 1338 | if ((rrq->flags & IW_POWER_TYPE) == IW_POWER_TIMEOUT) { |
1339 | u16 timeout; | 1339 | __le16 timeout; |
1340 | if (local->func->get_rid(dev, | 1340 | if (local->func->get_rid(dev, |
1341 | HFA384X_RID_CNFPMHOLDOVERDURATION, | 1341 | HFA384X_RID_CNFPMHOLDOVERDURATION, |
1342 | &timeout, 2, 1) < 0) | 1342 | &timeout, 2, 1) < 0) |
1343 | return -EINVAL; | 1343 | return -EINVAL; |
1344 | 1344 | ||
1345 | rrq->flags = IW_POWER_TIMEOUT; | 1345 | rrq->flags = IW_POWER_TIMEOUT; |
1346 | rrq->value = __le16_to_cpu(timeout) * 1024; | 1346 | rrq->value = le16_to_cpu(timeout) * 1024; |
1347 | } else { | 1347 | } else { |
1348 | u16 period; | 1348 | __le16 period; |
1349 | if (local->func->get_rid(dev, HFA384X_RID_CNFMAXSLEEPDURATION, | 1349 | if (local->func->get_rid(dev, HFA384X_RID_CNFMAXSLEEPDURATION, |
1350 | &period, 2, 1) < 0) | 1350 | &period, 2, 1) < 0) |
1351 | return -EINVAL; | 1351 | return -EINVAL; |
1352 | 1352 | ||
1353 | rrq->flags = IW_POWER_PERIOD; | 1353 | rrq->flags = IW_POWER_PERIOD; |
1354 | rrq->value = __le16_to_cpu(period) * 1024; | 1354 | rrq->value = le16_to_cpu(period) * 1024; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | if (local->func->get_rid(dev, HFA384X_RID_CNFMULTICASTRECEIVE, &mcast, | 1357 | if (local->func->get_rid(dev, HFA384X_RID_CNFMULTICASTRECEIVE, &mcast, |
1358 | 2, 1) < 0) | 1358 | 2, 1) < 0) |
1359 | return -EINVAL; | 1359 | return -EINVAL; |
1360 | 1360 | ||
1361 | if (__le16_to_cpu(mcast)) | 1361 | if (le16_to_cpu(mcast)) |
1362 | rrq->flags |= IW_POWER_ALL_R; | 1362 | rrq->flags |= IW_POWER_ALL_R; |
1363 | else | 1363 | else |
1364 | rrq->flags |= IW_POWER_UNICAST_R; | 1364 | rrq->flags |= IW_POWER_UNICAST_R; |
@@ -1435,7 +1435,7 @@ static int prism2_ioctl_giwretry(struct net_device *dev, | |||
1435 | { | 1435 | { |
1436 | struct hostap_interface *iface; | 1436 | struct hostap_interface *iface; |
1437 | local_info_t *local; | 1437 | local_info_t *local; |
1438 | u16 shortretry, longretry, lifetime, altretry; | 1438 | __le16 shortretry, longretry, lifetime, altretry; |
1439 | 1439 | ||
1440 | iface = netdev_priv(dev); | 1440 | iface = netdev_priv(dev); |
1441 | local = iface->local; | 1441 | local = iface->local; |
@@ -1448,15 +1448,11 @@ static int prism2_ioctl_giwretry(struct net_device *dev, | |||
1448 | &lifetime, 2, 1) < 0) | 1448 | &lifetime, 2, 1) < 0) |
1449 | return -EINVAL; | 1449 | return -EINVAL; |
1450 | 1450 | ||
1451 | le16_to_cpus(&shortretry); | ||
1452 | le16_to_cpus(&longretry); | ||
1453 | le16_to_cpus(&lifetime); | ||
1454 | |||
1455 | rrq->disabled = 0; | 1451 | rrq->disabled = 0; |
1456 | 1452 | ||
1457 | if ((rrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { | 1453 | if ((rrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME) { |
1458 | rrq->flags = IW_RETRY_LIFETIME; | 1454 | rrq->flags = IW_RETRY_LIFETIME; |
1459 | rrq->value = lifetime * 1024; | 1455 | rrq->value = le16_to_cpu(lifetime) * 1024; |
1460 | } else { | 1456 | } else { |
1461 | if (local->manual_retry_count >= 0) { | 1457 | if (local->manual_retry_count >= 0) { |
1462 | rrq->flags = IW_RETRY_LIMIT; | 1458 | rrq->flags = IW_RETRY_LIMIT; |
@@ -1468,10 +1464,10 @@ static int prism2_ioctl_giwretry(struct net_device *dev, | |||
1468 | rrq->value = local->manual_retry_count; | 1464 | rrq->value = local->manual_retry_count; |
1469 | } else if ((rrq->flags & IW_RETRY_LONG)) { | 1465 | } else if ((rrq->flags & IW_RETRY_LONG)) { |
1470 | rrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG; | 1466 | rrq->flags = IW_RETRY_LIMIT | IW_RETRY_LONG; |
1471 | rrq->value = longretry; | 1467 | rrq->value = le16_to_cpu(longretry); |
1472 | } else { | 1468 | } else { |
1473 | rrq->flags = IW_RETRY_LIMIT; | 1469 | rrq->flags = IW_RETRY_LIMIT; |
1474 | rrq->value = shortretry; | 1470 | rrq->value = le16_to_cpu(shortretry); |
1475 | if (shortretry != longretry) | 1471 | if (shortretry != longretry) |
1476 | rrq->flags |= IW_RETRY_SHORT; | 1472 | rrq->flags |= IW_RETRY_SHORT; |
1477 | } | 1473 | } |
@@ -3101,7 +3097,7 @@ static int prism2_set_genericelement(struct net_device *dev, u8 *elem, | |||
3101 | if (buf == NULL) | 3097 | if (buf == NULL) |
3102 | return -ENOMEM; | 3098 | return -ENOMEM; |
3103 | 3099 | ||
3104 | *((u16 *) buf) = cpu_to_le16(len); | 3100 | *((__le16 *) buf) = cpu_to_le16(len); |
3105 | memcpy(buf + 2, elem, len); | 3101 | memcpy(buf + 2, elem, len); |
3106 | 3102 | ||
3107 | kfree(local->generic_elem); | 3103 | kfree(local->generic_elem); |
@@ -3761,7 +3757,7 @@ static int prism2_ioctl_siwmlme(struct net_device *dev, | |||
3761 | struct hostap_interface *iface = netdev_priv(dev); | 3757 | struct hostap_interface *iface = netdev_priv(dev); |
3762 | local_info_t *local = iface->local; | 3758 | local_info_t *local = iface->local; |
3763 | struct iw_mlme *mlme = (struct iw_mlme *) extra; | 3759 | struct iw_mlme *mlme = (struct iw_mlme *) extra; |
3764 | u16 reason; | 3760 | __le16 reason; |
3765 | 3761 | ||
3766 | reason = cpu_to_le16(mlme->reason_code); | 3762 | reason = cpu_to_le16(mlme->reason_code); |
3767 | 3763 | ||
@@ -3783,7 +3779,7 @@ static int prism2_ioctl_siwmlme(struct net_device *dev, | |||
3783 | static int prism2_ioctl_mlme(local_info_t *local, | 3779 | static int prism2_ioctl_mlme(local_info_t *local, |
3784 | struct prism2_hostapd_param *param) | 3780 | struct prism2_hostapd_param *param) |
3785 | { | 3781 | { |
3786 | u16 reason; | 3782 | __le16 reason; |
3787 | 3783 | ||
3788 | reason = cpu_to_le16(param->u.mlme.reason_code); | 3784 | reason = cpu_to_le16(param->u.mlme.reason_code); |
3789 | switch (param->u.mlme.cmd) { | 3785 | switch (param->u.mlme.cmd) { |
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 17c58e9bdad5..20d387f6658c 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -296,7 +296,7 @@ int hostap_tx_callback_unregister(local_info_t *local, u16 idx) | |||
296 | int hostap_set_word(struct net_device *dev, int rid, u16 val) | 296 | int hostap_set_word(struct net_device *dev, int rid, u16 val) |
297 | { | 297 | { |
298 | struct hostap_interface *iface; | 298 | struct hostap_interface *iface; |
299 | u16 tmp = cpu_to_le16(val); | 299 | __le16 tmp = cpu_to_le16(val); |
300 | iface = netdev_priv(dev); | 300 | iface = netdev_priv(dev); |
301 | return iface->local->func->set_rid(dev, rid, &tmp, 2); | 301 | return iface->local->func->set_rid(dev, rid, &tmp, 2); |
302 | } | 302 | } |
@@ -1095,15 +1095,15 @@ int prism2_sta_deauth(local_info_t *local, u16 reason) | |||
1095 | { | 1095 | { |
1096 | union iwreq_data wrqu; | 1096 | union iwreq_data wrqu; |
1097 | int ret; | 1097 | int ret; |
1098 | __le16 val = cpu_to_le16(reason); | ||
1098 | 1099 | ||
1099 | if (local->iw_mode != IW_MODE_INFRA || | 1100 | if (local->iw_mode != IW_MODE_INFRA || |
1100 | memcmp(local->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0 || | 1101 | memcmp(local->bssid, "\x00\x00\x00\x00\x00\x00", ETH_ALEN) == 0 || |
1101 | memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) | 1102 | memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0) |
1102 | return 0; | 1103 | return 0; |
1103 | 1104 | ||
1104 | reason = cpu_to_le16(reason); | ||
1105 | ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH, | 1105 | ret = prism2_sta_send_mgmt(local, local->bssid, IEEE80211_STYPE_DEAUTH, |
1106 | (u8 *) &reason, 2); | 1106 | (u8 *) &val, 2); |
1107 | memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); | 1107 | memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); |
1108 | wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); | 1108 | wireless_send_event(local->dev, SIOCGIWAP, &wrqu, NULL); |
1109 | return ret; | 1109 | return ret; |
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c index fc876ba18572..3a874fc621d3 100644 --- a/drivers/net/wireless/hostap/hostap_pci.c +++ b/drivers/net/wireless/hostap/hostap_pci.c | |||
@@ -128,8 +128,8 @@ static inline u16 hfa384x_inw_debug(struct net_device *dev, int a) | |||
128 | #define HFA384X_INB(a) hfa384x_inb_debug(dev, (a)) | 128 | #define HFA384X_INB(a) hfa384x_inb_debug(dev, (a)) |
129 | #define HFA384X_OUTW(v,a) hfa384x_outw_debug(dev, (a), (v)) | 129 | #define HFA384X_OUTW(v,a) hfa384x_outw_debug(dev, (a), (v)) |
130 | #define HFA384X_INW(a) hfa384x_inw_debug(dev, (a)) | 130 | #define HFA384X_INW(a) hfa384x_inw_debug(dev, (a)) |
131 | #define HFA384X_OUTW_DATA(v,a) hfa384x_outw_debug(dev, (a), cpu_to_le16((v))) | 131 | #define HFA384X_OUTW_DATA(v,a) hfa384x_outw_debug(dev, (a), le16_to_cpu((v))) |
132 | #define HFA384X_INW_DATA(a) (u16) le16_to_cpu(hfa384x_inw_debug(dev, (a))) | 132 | #define HFA384X_INW_DATA(a) cpu_to_le16(hfa384x_inw_debug(dev, (a))) |
133 | 133 | ||
134 | #else /* PRISM2_IO_DEBUG */ | 134 | #else /* PRISM2_IO_DEBUG */ |
135 | 135 | ||
@@ -173,8 +173,8 @@ static inline u16 hfa384x_inw(struct net_device *dev, int a) | |||
173 | #define HFA384X_INB(a) hfa384x_inb(dev, (a)) | 173 | #define HFA384X_INB(a) hfa384x_inb(dev, (a)) |
174 | #define HFA384X_OUTW(v,a) hfa384x_outw(dev, (a), (v)) | 174 | #define HFA384X_OUTW(v,a) hfa384x_outw(dev, (a), (v)) |
175 | #define HFA384X_INW(a) hfa384x_inw(dev, (a)) | 175 | #define HFA384X_INW(a) hfa384x_inw(dev, (a)) |
176 | #define HFA384X_OUTW_DATA(v,a) hfa384x_outw(dev, (a), cpu_to_le16((v))) | 176 | #define HFA384X_OUTW_DATA(v,a) hfa384x_outw(dev, (a), le16_to_cpu((v))) |
177 | #define HFA384X_INW_DATA(a) (u16) le16_to_cpu(hfa384x_inw(dev, (a))) | 177 | #define HFA384X_INW_DATA(a) cpu_to_le16(hfa384x_inw(dev, (a))) |
178 | 178 | ||
179 | #endif /* PRISM2_IO_DEBUG */ | 179 | #endif /* PRISM2_IO_DEBUG */ |
180 | 180 | ||
@@ -183,10 +183,10 @@ static int hfa384x_from_bap(struct net_device *dev, u16 bap, void *buf, | |||
183 | int len) | 183 | int len) |
184 | { | 184 | { |
185 | u16 d_off; | 185 | u16 d_off; |
186 | u16 *pos; | 186 | __le16 *pos; |
187 | 187 | ||
188 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; | 188 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; |
189 | pos = (u16 *) buf; | 189 | pos = (__le16 *) buf; |
190 | 190 | ||
191 | for ( ; len > 1; len -= 2) | 191 | for ( ; len > 1; len -= 2) |
192 | *pos++ = HFA384X_INW_DATA(d_off); | 192 | *pos++ = HFA384X_INW_DATA(d_off); |
@@ -201,10 +201,10 @@ static int hfa384x_from_bap(struct net_device *dev, u16 bap, void *buf, | |||
201 | static int hfa384x_to_bap(struct net_device *dev, u16 bap, void *buf, int len) | 201 | static int hfa384x_to_bap(struct net_device *dev, u16 bap, void *buf, int len) |
202 | { | 202 | { |
203 | u16 d_off; | 203 | u16 d_off; |
204 | u16 *pos; | 204 | __le16 *pos; |
205 | 205 | ||
206 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; | 206 | d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF; |
207 | pos = (u16 *) buf; | 207 | pos = (__le16 *) buf; |
208 | 208 | ||
209 | for ( ; len > 1; len -= 2) | 209 | for ( ; len > 1; len -= 2) |
210 | HFA384X_OUTW_DATA(*pos++, d_off); | 210 | HFA384X_OUTW_DATA(*pos++, d_off); |
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h index e6516a186d0e..15445bce2ac7 100644 --- a/drivers/net/wireless/hostap/hostap_wlan.h +++ b/drivers/net/wireless/hostap/hostap_wlan.h | |||
@@ -39,20 +39,20 @@ struct linux_wlan_ng_prism_hdr { | |||
39 | } __attribute__ ((packed)); | 39 | } __attribute__ ((packed)); |
40 | 40 | ||
41 | struct linux_wlan_ng_cap_hdr { | 41 | struct linux_wlan_ng_cap_hdr { |
42 | u32 version; | 42 | __be32 version; |
43 | u32 length; | 43 | __be32 length; |
44 | u64 mactime; | 44 | __be64 mactime; |
45 | u64 hosttime; | 45 | __be64 hosttime; |
46 | u32 phytype; | 46 | __be32 phytype; |
47 | u32 channel; | 47 | __be32 channel; |
48 | u32 datarate; | 48 | __be32 datarate; |
49 | u32 antenna; | 49 | __be32 antenna; |
50 | u32 priority; | 50 | __be32 priority; |
51 | u32 ssi_type; | 51 | __be32 ssi_type; |
52 | s32 ssi_signal; | 52 | __be32 ssi_signal; |
53 | s32 ssi_noise; | 53 | __be32 ssi_noise; |
54 | u32 preamble; | 54 | __be32 preamble; |
55 | u32 encoding; | 55 | __be32 encoding; |
56 | } __attribute__ ((packed)); | 56 | } __attribute__ ((packed)); |
57 | 57 | ||
58 | #define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ | 58 | #define LWNG_CAP_DID_BASE (4 | (1 << 6)) /* section 4, group 1 */ |
@@ -60,28 +60,28 @@ struct linux_wlan_ng_cap_hdr { | |||
60 | 60 | ||
61 | struct hfa384x_rx_frame { | 61 | struct hfa384x_rx_frame { |
62 | /* HFA384X RX frame descriptor */ | 62 | /* HFA384X RX frame descriptor */ |
63 | u16 status; /* HFA384X_RX_STATUS_ flags */ | 63 | __le16 status; /* HFA384X_RX_STATUS_ flags */ |
64 | u32 time; /* timestamp, 1 microsecond resolution */ | 64 | __le32 time; /* timestamp, 1 microsecond resolution */ |
65 | u8 silence; /* 27 .. 154; seems to be 0 */ | 65 | u8 silence; /* 27 .. 154; seems to be 0 */ |
66 | u8 signal; /* 27 .. 154 */ | 66 | u8 signal; /* 27 .. 154 */ |
67 | u8 rate; /* 10, 20, 55, or 110 */ | 67 | u8 rate; /* 10, 20, 55, or 110 */ |
68 | u8 rxflow; | 68 | u8 rxflow; |
69 | u32 reserved; | 69 | __le32 reserved; |
70 | 70 | ||
71 | /* 802.11 */ | 71 | /* 802.11 */ |
72 | u16 frame_control; | 72 | __le16 frame_control; |
73 | u16 duration_id; | 73 | __le16 duration_id; |
74 | u8 addr1[6]; | 74 | u8 addr1[6]; |
75 | u8 addr2[6]; | 75 | u8 addr2[6]; |
76 | u8 addr3[6]; | 76 | u8 addr3[6]; |
77 | u16 seq_ctrl; | 77 | __le16 seq_ctrl; |
78 | u8 addr4[6]; | 78 | u8 addr4[6]; |
79 | u16 data_len; | 79 | __le16 data_len; |
80 | 80 | ||
81 | /* 802.3 */ | 81 | /* 802.3 */ |
82 | u8 dst_addr[6]; | 82 | u8 dst_addr[6]; |
83 | u8 src_addr[6]; | 83 | u8 src_addr[6]; |
84 | u16 len; | 84 | __be16 len; |
85 | 85 | ||
86 | /* followed by frame data; max 2304 bytes */ | 86 | /* followed by frame data; max 2304 bytes */ |
87 | } __attribute__ ((packed)); | 87 | } __attribute__ ((packed)); |
@@ -89,28 +89,28 @@ struct hfa384x_rx_frame { | |||
89 | 89 | ||
90 | struct hfa384x_tx_frame { | 90 | struct hfa384x_tx_frame { |
91 | /* HFA384X TX frame descriptor */ | 91 | /* HFA384X TX frame descriptor */ |
92 | u16 status; /* HFA384X_TX_STATUS_ flags */ | 92 | __le16 status; /* HFA384X_TX_STATUS_ flags */ |
93 | u16 reserved1; | 93 | __le16 reserved1; |
94 | u16 reserved2; | 94 | __le16 reserved2; |
95 | u32 sw_support; | 95 | __le32 sw_support; |
96 | u8 retry_count; /* not yet implemented */ | 96 | u8 retry_count; /* not yet implemented */ |
97 | u8 tx_rate; /* Host AP only; 0 = firmware, or 10, 20, 55, 110 */ | 97 | u8 tx_rate; /* Host AP only; 0 = firmware, or 10, 20, 55, 110 */ |
98 | u16 tx_control; /* HFA384X_TX_CTRL_ flags */ | 98 | __le16 tx_control; /* HFA384X_TX_CTRL_ flags */ |
99 | 99 | ||
100 | /* 802.11 */ | 100 | /* 802.11 */ |
101 | u16 frame_control; /* parts not used */ | 101 | __le16 frame_control; /* parts not used */ |
102 | u16 duration_id; | 102 | __le16 duration_id; |
103 | u8 addr1[6]; | 103 | u8 addr1[6]; |
104 | u8 addr2[6]; /* filled by firmware */ | 104 | u8 addr2[6]; /* filled by firmware */ |
105 | u8 addr3[6]; | 105 | u8 addr3[6]; |
106 | u16 seq_ctrl; /* filled by firmware */ | 106 | __le16 seq_ctrl; /* filled by firmware */ |
107 | u8 addr4[6]; | 107 | u8 addr4[6]; |
108 | u16 data_len; | 108 | __le16 data_len; |
109 | 109 | ||
110 | /* 802.3 */ | 110 | /* 802.3 */ |
111 | u8 dst_addr[6]; | 111 | u8 dst_addr[6]; |
112 | u8 src_addr[6]; | 112 | u8 src_addr[6]; |
113 | u16 len; | 113 | __be16 len; |
114 | 114 | ||
115 | /* followed by frame data; max 2304 bytes */ | 115 | /* followed by frame data; max 2304 bytes */ |
116 | } __attribute__ ((packed)); | 116 | } __attribute__ ((packed)); |
@@ -118,8 +118,8 @@ struct hfa384x_tx_frame { | |||
118 | 118 | ||
119 | struct hfa384x_rid_hdr | 119 | struct hfa384x_rid_hdr |
120 | { | 120 | { |
121 | u16 len; | 121 | __le16 len; |
122 | u16 rid; | 122 | __le16 rid; |
123 | } __attribute__ ((packed)); | 123 | } __attribute__ ((packed)); |
124 | 124 | ||
125 | 125 | ||
@@ -130,78 +130,78 @@ struct hfa384x_rid_hdr | |||
130 | #define HFA384X_LEVEL_TO_dBm_sign(v) (v) * 100 / 255 - 100 | 130 | #define HFA384X_LEVEL_TO_dBm_sign(v) (v) * 100 / 255 - 100 |
131 | 131 | ||
132 | struct hfa384x_scan_request { | 132 | struct hfa384x_scan_request { |
133 | u16 channel_list; | 133 | __le16 channel_list; |
134 | u16 txrate; /* HFA384X_RATES_* */ | 134 | __le16 txrate; /* HFA384X_RATES_* */ |
135 | } __attribute__ ((packed)); | 135 | } __attribute__ ((packed)); |
136 | 136 | ||
137 | struct hfa384x_hostscan_request { | 137 | struct hfa384x_hostscan_request { |
138 | u16 channel_list; | 138 | __le16 channel_list; |
139 | u16 txrate; | 139 | __le16 txrate; |
140 | u16 target_ssid_len; | 140 | __le16 target_ssid_len; |
141 | u8 target_ssid[32]; | 141 | u8 target_ssid[32]; |
142 | } __attribute__ ((packed)); | 142 | } __attribute__ ((packed)); |
143 | 143 | ||
144 | struct hfa384x_join_request { | 144 | struct hfa384x_join_request { |
145 | u8 bssid[6]; | 145 | u8 bssid[6]; |
146 | u16 channel; | 146 | __le16 channel; |
147 | } __attribute__ ((packed)); | 147 | } __attribute__ ((packed)); |
148 | 148 | ||
149 | struct hfa384x_info_frame { | 149 | struct hfa384x_info_frame { |
150 | u16 len; | 150 | __le16 len; |
151 | u16 type; | 151 | __le16 type; |
152 | } __attribute__ ((packed)); | 152 | } __attribute__ ((packed)); |
153 | 153 | ||
154 | struct hfa384x_comm_tallies { | 154 | struct hfa384x_comm_tallies { |
155 | u16 tx_unicast_frames; | 155 | __le16 tx_unicast_frames; |
156 | u16 tx_multicast_frames; | 156 | __le16 tx_multicast_frames; |
157 | u16 tx_fragments; | 157 | __le16 tx_fragments; |
158 | u16 tx_unicast_octets; | 158 | __le16 tx_unicast_octets; |
159 | u16 tx_multicast_octets; | 159 | __le16 tx_multicast_octets; |
160 | u16 tx_deferred_transmissions; | 160 | __le16 tx_deferred_transmissions; |
161 | u16 tx_single_retry_frames; | 161 | __le16 tx_single_retry_frames; |
162 | u16 tx_multiple_retry_frames; | 162 | __le16 tx_multiple_retry_frames; |
163 | u16 tx_retry_limit_exceeded; | 163 | __le16 tx_retry_limit_exceeded; |
164 | u16 tx_discards; | 164 | __le16 tx_discards; |
165 | u16 rx_unicast_frames; | 165 | __le16 rx_unicast_frames; |
166 | u16 rx_multicast_frames; | 166 | __le16 rx_multicast_frames; |
167 | u16 rx_fragments; | 167 | __le16 rx_fragments; |
168 | u16 rx_unicast_octets; | 168 | __le16 rx_unicast_octets; |
169 | u16 rx_multicast_octets; | 169 | __le16 rx_multicast_octets; |
170 | u16 rx_fcs_errors; | 170 | __le16 rx_fcs_errors; |
171 | u16 rx_discards_no_buffer; | 171 | __le16 rx_discards_no_buffer; |
172 | u16 tx_discards_wrong_sa; | 172 | __le16 tx_discards_wrong_sa; |
173 | u16 rx_discards_wep_undecryptable; | 173 | __le16 rx_discards_wep_undecryptable; |
174 | u16 rx_message_in_msg_fragments; | 174 | __le16 rx_message_in_msg_fragments; |
175 | u16 rx_message_in_bad_msg_fragments; | 175 | __le16 rx_message_in_bad_msg_fragments; |
176 | } __attribute__ ((packed)); | 176 | } __attribute__ ((packed)); |
177 | 177 | ||
178 | struct hfa384x_comm_tallies32 { | 178 | struct hfa384x_comm_tallies32 { |
179 | u32 tx_unicast_frames; | 179 | __le32 tx_unicast_frames; |
180 | u32 tx_multicast_frames; | 180 | __le32 tx_multicast_frames; |
181 | u32 tx_fragments; | 181 | __le32 tx_fragments; |
182 | u32 tx_unicast_octets; | 182 | __le32 tx_unicast_octets; |
183 | u32 tx_multicast_octets; | 183 | __le32 tx_multicast_octets; |
184 | u32 tx_deferred_transmissions; | 184 | __le32 tx_deferred_transmissions; |
185 | u32 tx_single_retry_frames; | 185 | __le32 tx_single_retry_frames; |
186 | u32 tx_multiple_retry_frames; | 186 | __le32 tx_multiple_retry_frames; |
187 | u32 tx_retry_limit_exceeded; | 187 | __le32 tx_retry_limit_exceeded; |
188 | u32 tx_discards; | 188 | __le32 tx_discards; |
189 | u32 rx_unicast_frames; | 189 | __le32 rx_unicast_frames; |
190 | u32 rx_multicast_frames; | 190 | __le32 rx_multicast_frames; |
191 | u32 rx_fragments; | 191 | __le32 rx_fragments; |
192 | u32 rx_unicast_octets; | 192 | __le32 rx_unicast_octets; |
193 | u32 rx_multicast_octets; | 193 | __le32 rx_multicast_octets; |
194 | u32 rx_fcs_errors; | 194 | __le32 rx_fcs_errors; |
195 | u32 rx_discards_no_buffer; | 195 | __le32 rx_discards_no_buffer; |
196 | u32 tx_discards_wrong_sa; | 196 | __le32 tx_discards_wrong_sa; |
197 | u32 rx_discards_wep_undecryptable; | 197 | __le32 rx_discards_wep_undecryptable; |
198 | u32 rx_message_in_msg_fragments; | 198 | __le32 rx_message_in_msg_fragments; |
199 | u32 rx_message_in_bad_msg_fragments; | 199 | __le32 rx_message_in_bad_msg_fragments; |
200 | } __attribute__ ((packed)); | 200 | } __attribute__ ((packed)); |
201 | 201 | ||
202 | struct hfa384x_scan_result_hdr { | 202 | struct hfa384x_scan_result_hdr { |
203 | u16 reserved; | 203 | __le16 reserved; |
204 | u16 scan_reason; | 204 | __le16 scan_reason; |
205 | #define HFA384X_SCAN_IN_PROGRESS 0 /* no results available yet */ | 205 | #define HFA384X_SCAN_IN_PROGRESS 0 /* no results available yet */ |
206 | #define HFA384X_SCAN_HOST_INITIATED 1 | 206 | #define HFA384X_SCAN_HOST_INITIATED 1 |
207 | #define HFA384X_SCAN_FIRMWARE_INITIATED 2 | 207 | #define HFA384X_SCAN_FIRMWARE_INITIATED 2 |
@@ -211,30 +211,30 @@ struct hfa384x_scan_result_hdr { | |||
211 | #define HFA384X_SCAN_MAX_RESULTS 32 | 211 | #define HFA384X_SCAN_MAX_RESULTS 32 |
212 | 212 | ||
213 | struct hfa384x_scan_result { | 213 | struct hfa384x_scan_result { |
214 | u16 chid; | 214 | __le16 chid; |
215 | u16 anl; | 215 | __le16 anl; |
216 | u16 sl; | 216 | __le16 sl; |
217 | u8 bssid[6]; | 217 | u8 bssid[6]; |
218 | u16 beacon_interval; | 218 | __le16 beacon_interval; |
219 | u16 capability; | 219 | __le16 capability; |
220 | u16 ssid_len; | 220 | __le16 ssid_len; |
221 | u8 ssid[32]; | 221 | u8 ssid[32]; |
222 | u8 sup_rates[10]; | 222 | u8 sup_rates[10]; |
223 | u16 rate; | 223 | __le16 rate; |
224 | } __attribute__ ((packed)); | 224 | } __attribute__ ((packed)); |
225 | 225 | ||
226 | struct hfa384x_hostscan_result { | 226 | struct hfa384x_hostscan_result { |
227 | u16 chid; | 227 | __le16 chid; |
228 | u16 anl; | 228 | __le16 anl; |
229 | u16 sl; | 229 | __le16 sl; |
230 | u8 bssid[6]; | 230 | u8 bssid[6]; |
231 | u16 beacon_interval; | 231 | __le16 beacon_interval; |
232 | u16 capability; | 232 | __le16 capability; |
233 | u16 ssid_len; | 233 | __le16 ssid_len; |
234 | u8 ssid[32]; | 234 | u8 ssid[32]; |
235 | u8 sup_rates[10]; | 235 | u8 sup_rates[10]; |
236 | u16 rate; | 236 | __le16 rate; |
237 | u16 atim; | 237 | __le16 atim; |
238 | } __attribute__ ((packed)); | 238 | } __attribute__ ((packed)); |
239 | 239 | ||
240 | struct comm_tallies_sums { | 240 | struct comm_tallies_sums { |