diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-27 01:54:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:10 -0500 |
commit | 5b5e807fb8b56e31319fe8b27e1b072bb80862a8 (patch) | |
tree | cd72cb9c83895ab8533b4551193b193b0fb5e19d /drivers/net/wireless | |
parent | e62e1ee02900bc315d7aeba55196a78f8f62f1c5 (diff) |
ipw2200: do not byteswap struct ipw_associate
keep it little-endian, update places that use its members
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 48 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.h | 18 |
2 files changed, 26 insertions, 40 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 7ac57f1fc18..3e6ad7b92c8 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -2352,27 +2352,13 @@ static int ipw_set_sensitivity(struct ipw_priv *priv, u16 sens) | |||
2352 | static int ipw_send_associate(struct ipw_priv *priv, | 2352 | static int ipw_send_associate(struct ipw_priv *priv, |
2353 | struct ipw_associate *associate) | 2353 | struct ipw_associate *associate) |
2354 | { | 2354 | { |
2355 | struct ipw_associate tmp_associate; | ||
2356 | |||
2357 | if (!priv || !associate) { | 2355 | if (!priv || !associate) { |
2358 | IPW_ERROR("Invalid args\n"); | 2356 | IPW_ERROR("Invalid args\n"); |
2359 | return -1; | 2357 | return -1; |
2360 | } | 2358 | } |
2361 | 2359 | ||
2362 | memcpy(&tmp_associate, associate, sizeof(*associate)); | 2360 | return ipw_send_cmd_pdu(priv, IPW_CMD_ASSOCIATE, sizeof(*associate), |
2363 | tmp_associate.policy_support = | 2361 | associate); |
2364 | cpu_to_le16(tmp_associate.policy_support); | ||
2365 | tmp_associate.assoc_tsf_msw = cpu_to_le32(tmp_associate.assoc_tsf_msw); | ||
2366 | tmp_associate.assoc_tsf_lsw = cpu_to_le32(tmp_associate.assoc_tsf_lsw); | ||
2367 | tmp_associate.capability = cpu_to_le16(tmp_associate.capability); | ||
2368 | tmp_associate.listen_interval = | ||
2369 | cpu_to_le16(tmp_associate.listen_interval); | ||
2370 | tmp_associate.beacon_interval = | ||
2371 | cpu_to_le16(tmp_associate.beacon_interval); | ||
2372 | tmp_associate.atim_window = cpu_to_le16(tmp_associate.atim_window); | ||
2373 | |||
2374 | return ipw_send_cmd_pdu(priv, IPW_CMD_ASSOCIATE, sizeof(tmp_associate), | ||
2375 | &tmp_associate); | ||
2376 | } | 2362 | } |
2377 | 2363 | ||
2378 | static int ipw_send_supported_rates(struct ipw_priv *priv, | 2364 | static int ipw_send_supported_rates(struct ipw_priv *priv, |
@@ -4168,7 +4154,7 @@ static void ipw_gather_stats(struct ipw_priv *priv) | |||
4168 | priv->last_missed_beacons = priv->missed_beacons; | 4154 | priv->last_missed_beacons = priv->missed_beacons; |
4169 | if (priv->assoc_request.beacon_interval) { | 4155 | if (priv->assoc_request.beacon_interval) { |
4170 | missed_beacons_percent = missed_beacons_delta * | 4156 | missed_beacons_percent = missed_beacons_delta * |
4171 | (HZ * priv->assoc_request.beacon_interval) / | 4157 | (HZ * le16_to_cpu(priv->assoc_request.beacon_interval)) / |
4172 | (IPW_STATS_INTERVAL * 10); | 4158 | (IPW_STATS_INTERVAL * 10); |
4173 | } else { | 4159 | } else { |
4174 | missed_beacons_percent = 0; | 4160 | missed_beacons_percent = 0; |
@@ -4432,9 +4418,9 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4432 | workqueue, | 4418 | workqueue, |
4433 | &priv-> | 4419 | &priv-> |
4434 | adhoc_check, | 4420 | adhoc_check, |
4435 | priv-> | 4421 | le16_to_cpu(priv-> |
4436 | assoc_request. | 4422 | assoc_request. |
4437 | beacon_interval); | 4423 | beacon_interval)); |
4438 | break; | 4424 | break; |
4439 | } | 4425 | } |
4440 | 4426 | ||
@@ -6044,7 +6030,7 @@ static void ipw_adhoc_check(void *data) | |||
6044 | } | 6030 | } |
6045 | 6031 | ||
6046 | queue_delayed_work(priv->workqueue, &priv->adhoc_check, | 6032 | queue_delayed_work(priv->workqueue, &priv->adhoc_check, |
6047 | priv->assoc_request.beacon_interval); | 6033 | le16_to_cpu(priv->assoc_request.beacon_interval)); |
6048 | } | 6034 | } |
6049 | 6035 | ||
6050 | static void ipw_bg_adhoc_check(struct work_struct *work) | 6036 | static void ipw_bg_adhoc_check(struct work_struct *work) |
@@ -7287,7 +7273,7 @@ static int ipw_associate_network(struct ipw_priv *priv, | |||
7287 | priv->assoc_request.auth_type = AUTH_OPEN; | 7273 | priv->assoc_request.auth_type = AUTH_OPEN; |
7288 | 7274 | ||
7289 | if (priv->ieee->wpa_ie_len) { | 7275 | if (priv->ieee->wpa_ie_len) { |
7290 | priv->assoc_request.policy_support = 0x02; /* RSN active */ | 7276 | priv->assoc_request.policy_support = cpu_to_le16(0x02); /* RSN active */ |
7291 | ipw_set_rsn_capa(priv, priv->ieee->wpa_ie, | 7277 | ipw_set_rsn_capa(priv, priv->ieee->wpa_ie, |
7292 | priv->ieee->wpa_ie_len); | 7278 | priv->ieee->wpa_ie_len); |
7293 | } | 7279 | } |
@@ -7304,7 +7290,7 @@ static int ipw_associate_network(struct ipw_priv *priv, | |||
7304 | else if (network->mode & priv->ieee->mode & IEEE_B) | 7290 | else if (network->mode & priv->ieee->mode & IEEE_B) |
7305 | priv->assoc_request.ieee_mode = IPW_B_MODE; | 7291 | priv->assoc_request.ieee_mode = IPW_B_MODE; |
7306 | 7292 | ||
7307 | priv->assoc_request.capability = network->capability; | 7293 | priv->assoc_request.capability = cpu_to_le16(network->capability); |
7308 | if ((network->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) | 7294 | if ((network->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) |
7309 | && !(priv->config & CFG_PREAMBLE_LONG)) { | 7295 | && !(priv->config & CFG_PREAMBLE_LONG)) { |
7310 | priv->assoc_request.preamble_length = DCT_FLAG_SHORT_PREAMBLE; | 7296 | priv->assoc_request.preamble_length = DCT_FLAG_SHORT_PREAMBLE; |
@@ -7313,13 +7299,13 @@ static int ipw_associate_network(struct ipw_priv *priv, | |||
7313 | 7299 | ||
7314 | /* Clear the short preamble if we won't be supporting it */ | 7300 | /* Clear the short preamble if we won't be supporting it */ |
7315 | priv->assoc_request.capability &= | 7301 | priv->assoc_request.capability &= |
7316 | ~WLAN_CAPABILITY_SHORT_PREAMBLE; | 7302 | ~cpu_to_le16(WLAN_CAPABILITY_SHORT_PREAMBLE); |
7317 | } | 7303 | } |
7318 | 7304 | ||
7319 | /* Clear capability bits that aren't used in Ad Hoc */ | 7305 | /* Clear capability bits that aren't used in Ad Hoc */ |
7320 | if (priv->ieee->iw_mode == IW_MODE_ADHOC) | 7306 | if (priv->ieee->iw_mode == IW_MODE_ADHOC) |
7321 | priv->assoc_request.capability &= | 7307 | priv->assoc_request.capability &= |
7322 | ~WLAN_CAPABILITY_SHORT_SLOT_TIME; | 7308 | ~cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT_TIME); |
7323 | 7309 | ||
7324 | IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, " | 7310 | IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, " |
7325 | "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n", | 7311 | "802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n", |
@@ -7341,7 +7327,7 @@ static int ipw_associate_network(struct ipw_priv *priv, | |||
7341 | '1' + priv->ieee->sec.active_key : '.', | 7327 | '1' + priv->ieee->sec.active_key : '.', |
7342 | priv->capability & CAP_PRIVACY_ON ? '.' : ' '); | 7328 | priv->capability & CAP_PRIVACY_ON ? '.' : ' '); |
7343 | 7329 | ||
7344 | priv->assoc_request.beacon_interval = network->beacon_interval; | 7330 | priv->assoc_request.beacon_interval = cpu_to_le16(network->beacon_interval); |
7345 | if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && | 7331 | if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && |
7346 | (network->time_stamp[0] == 0) && (network->time_stamp[1] == 0)) { | 7332 | (network->time_stamp[0] == 0) && (network->time_stamp[1] == 0)) { |
7347 | priv->assoc_request.assoc_type = HC_IBSS_START; | 7333 | priv->assoc_request.assoc_type = HC_IBSS_START; |
@@ -7352,21 +7338,21 @@ static int ipw_associate_network(struct ipw_priv *priv, | |||
7352 | priv->assoc_request.assoc_type = HC_REASSOCIATE; | 7338 | priv->assoc_request.assoc_type = HC_REASSOCIATE; |
7353 | else | 7339 | else |
7354 | priv->assoc_request.assoc_type = HC_ASSOCIATE; | 7340 | priv->assoc_request.assoc_type = HC_ASSOCIATE; |
7355 | priv->assoc_request.assoc_tsf_msw = network->time_stamp[1]; | 7341 | priv->assoc_request.assoc_tsf_msw = cpu_to_le32(network->time_stamp[1]); |
7356 | priv->assoc_request.assoc_tsf_lsw = network->time_stamp[0]; | 7342 | priv->assoc_request.assoc_tsf_lsw = cpu_to_le32(network->time_stamp[0]); |
7357 | } | 7343 | } |
7358 | 7344 | ||
7359 | memcpy(priv->assoc_request.bssid, network->bssid, ETH_ALEN); | 7345 | memcpy(priv->assoc_request.bssid, network->bssid, ETH_ALEN); |
7360 | 7346 | ||
7361 | if (priv->ieee->iw_mode == IW_MODE_ADHOC) { | 7347 | if (priv->ieee->iw_mode == IW_MODE_ADHOC) { |
7362 | memset(&priv->assoc_request.dest, 0xFF, ETH_ALEN); | 7348 | memset(&priv->assoc_request.dest, 0xFF, ETH_ALEN); |
7363 | priv->assoc_request.atim_window = network->atim_window; | 7349 | priv->assoc_request.atim_window = cpu_to_le16(network->atim_window); |
7364 | } else { | 7350 | } else { |
7365 | memcpy(priv->assoc_request.dest, network->bssid, ETH_ALEN); | 7351 | memcpy(priv->assoc_request.dest, network->bssid, ETH_ALEN); |
7366 | priv->assoc_request.atim_window = 0; | 7352 | priv->assoc_request.atim_window = 0; |
7367 | } | 7353 | } |
7368 | 7354 | ||
7369 | priv->assoc_request.listen_interval = network->listen_interval; | 7355 | priv->assoc_request.listen_interval = cpu_to_le16(network->listen_interval); |
7370 | 7356 | ||
7371 | err = ipw_send_ssid(priv, priv->essid, priv->essid_len); | 7357 | err = ipw_send_ssid(priv, priv->essid, priv->essid_len); |
7372 | if (err) { | 7358 | if (err) { |
@@ -10862,9 +10848,9 @@ static void shim__set_security(struct net_device *dev, | |||
10862 | #if 0 | 10848 | #if 0 |
10863 | if ((priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) && | 10849 | if ((priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) && |
10864 | (((priv->assoc_request.capability & | 10850 | (((priv->assoc_request.capability & |
10865 | WLAN_CAPABILITY_PRIVACY) && !sec->enabled) || | 10851 | cpu_to_le16(WLAN_CAPABILITY_PRIVACY)) && !sec->enabled) || |
10866 | (!(priv->assoc_request.capability & | 10852 | (!(priv->assoc_request.capability & |
10867 | WLAN_CAPABILITY_PRIVACY) && sec->enabled))) { | 10853 | cpu_to_le16(WLAN_CAPABILITY_PRIVACY)) && sec->enabled))) { |
10868 | IPW_DEBUG_ASSOC("Disassociating due to capability " | 10854 | IPW_DEBUG_ASSOC("Disassociating due to capability " |
10869 | "change.\n"); | 10855 | "change.\n"); |
10870 | ipw_disassociate(priv); | 10856 | ipw_disassociate(priv); |
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index fae57a9f8be..fdc187e0769 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -881,20 +881,20 @@ struct ipw_associate { | |||
881 | u8 auth_type:4, auth_key:4; | 881 | u8 auth_type:4, auth_key:4; |
882 | u8 assoc_type; | 882 | u8 assoc_type; |
883 | u8 reserved; | 883 | u8 reserved; |
884 | u16 policy_support; | 884 | __le16 policy_support; |
885 | u8 preamble_length; | 885 | u8 preamble_length; |
886 | u8 ieee_mode; | 886 | u8 ieee_mode; |
887 | u8 bssid[ETH_ALEN]; | 887 | u8 bssid[ETH_ALEN]; |
888 | u32 assoc_tsf_msw; | 888 | __le32 assoc_tsf_msw; |
889 | u32 assoc_tsf_lsw; | 889 | __le32 assoc_tsf_lsw; |
890 | u16 capability; | 890 | __le16 capability; |
891 | u16 listen_interval; | 891 | __le16 listen_interval; |
892 | u16 beacon_interval; | 892 | __le16 beacon_interval; |
893 | u8 dest[ETH_ALEN]; | 893 | u8 dest[ETH_ALEN]; |
894 | u16 atim_window; | 894 | __le16 atim_window; |
895 | u8 smr; | 895 | u8 smr; |
896 | u8 reserved1; | 896 | u8 reserved1; |
897 | u16 reserved2; | 897 | __le16 reserved2; |
898 | } __attribute__ ((packed)); | 898 | } __attribute__ ((packed)); |
899 | 899 | ||
900 | struct ipw_supported_rates { | 900 | struct ipw_supported_rates { |
@@ -1759,7 +1759,7 @@ enum { | |||
1759 | #define HC_IBSS_RECONF 4 | 1759 | #define HC_IBSS_RECONF 4 |
1760 | #define HC_DISASSOC_QUIET 5 | 1760 | #define HC_DISASSOC_QUIET 5 |
1761 | 1761 | ||
1762 | #define HC_QOS_SUPPORT_ASSOC 0x01 | 1762 | #define HC_QOS_SUPPORT_ASSOC cpu_to_le16(0x01) |
1763 | 1763 | ||
1764 | #define IPW_RATE_CAPABILITIES 1 | 1764 | #define IPW_RATE_CAPABILITIES 1 |
1765 | #define IPW_RATE_CONNECT 0 | 1765 | #define IPW_RATE_CONNECT 0 |