diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 90 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.h | 94 |
2 files changed, 90 insertions, 94 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 7c45ba53f379..7ac57f1fc18b 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -2403,14 +2403,13 @@ static int ipw_set_random_seed(struct ipw_priv *priv) | |||
2403 | 2403 | ||
2404 | static int ipw_send_card_disable(struct ipw_priv *priv, u32 phy_off) | 2404 | static int ipw_send_card_disable(struct ipw_priv *priv, u32 phy_off) |
2405 | { | 2405 | { |
2406 | __le32 v = cpu_to_le32(phy_off); | ||
2406 | if (!priv) { | 2407 | if (!priv) { |
2407 | IPW_ERROR("Invalid args\n"); | 2408 | IPW_ERROR("Invalid args\n"); |
2408 | return -1; | 2409 | return -1; |
2409 | } | 2410 | } |
2410 | 2411 | ||
2411 | phy_off = cpu_to_le32(phy_off); | 2412 | return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(v), &v); |
2412 | return ipw_send_cmd_pdu(priv, IPW_CMD_CARD_DISABLE, sizeof(phy_off), | ||
2413 | &phy_off); | ||
2414 | } | 2413 | } |
2415 | 2414 | ||
2416 | static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power) | 2415 | static int ipw_send_tx_power(struct ipw_priv *priv, struct ipw_tx_power *power) |
@@ -2499,7 +2498,7 @@ static int ipw_send_frag_threshold(struct ipw_priv *priv, u16 frag) | |||
2499 | 2498 | ||
2500 | static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode) | 2499 | static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode) |
2501 | { | 2500 | { |
2502 | u32 param; | 2501 | __le32 param; |
2503 | 2502 | ||
2504 | if (!priv) { | 2503 | if (!priv) { |
2505 | IPW_ERROR("Invalid args\n"); | 2504 | IPW_ERROR("Invalid args\n"); |
@@ -2510,17 +2509,16 @@ static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode) | |||
2510 | * level */ | 2509 | * level */ |
2511 | switch (mode) { | 2510 | switch (mode) { |
2512 | case IPW_POWER_BATTERY: | 2511 | case IPW_POWER_BATTERY: |
2513 | param = IPW_POWER_INDEX_3; | 2512 | param = cpu_to_le32(IPW_POWER_INDEX_3); |
2514 | break; | 2513 | break; |
2515 | case IPW_POWER_AC: | 2514 | case IPW_POWER_AC: |
2516 | param = IPW_POWER_MODE_CAM; | 2515 | param = cpu_to_le32(IPW_POWER_MODE_CAM); |
2517 | break; | 2516 | break; |
2518 | default: | 2517 | default: |
2519 | param = mode; | 2518 | param = cpu_to_le32(mode); |
2520 | break; | 2519 | break; |
2521 | } | 2520 | } |
2522 | 2521 | ||
2523 | param = cpu_to_le32(param); | ||
2524 | return ipw_send_cmd_pdu(priv, IPW_CMD_POWER_MODE, sizeof(param), | 2522 | return ipw_send_cmd_pdu(priv, IPW_CMD_POWER_MODE, sizeof(param), |
2525 | ¶m); | 2523 | ¶m); |
2526 | } | 2524 | } |
@@ -2654,13 +2652,13 @@ static void eeprom_parse_mac(struct ipw_priv *priv, u8 * mac) | |||
2654 | static void ipw_eeprom_init_sram(struct ipw_priv *priv) | 2652 | static void ipw_eeprom_init_sram(struct ipw_priv *priv) |
2655 | { | 2653 | { |
2656 | int i; | 2654 | int i; |
2657 | u16 *eeprom = (u16 *) priv->eeprom; | 2655 | __le16 *eeprom = (__le16 *) priv->eeprom; |
2658 | 2656 | ||
2659 | IPW_DEBUG_TRACE(">>\n"); | 2657 | IPW_DEBUG_TRACE(">>\n"); |
2660 | 2658 | ||
2661 | /* read entire contents of eeprom into private buffer */ | 2659 | /* read entire contents of eeprom into private buffer */ |
2662 | for (i = 0; i < 128; i++) | 2660 | for (i = 0; i < 128; i++) |
2663 | eeprom[i] = le16_to_cpu(eeprom_read_u16(priv, (u8) i)); | 2661 | eeprom[i] = cpu_to_le16(eeprom_read_u16(priv, (u8) i)); |
2664 | 2662 | ||
2665 | /* | 2663 | /* |
2666 | If the data looks correct, then copy it to our private | 2664 | If the data looks correct, then copy it to our private |
@@ -3040,17 +3038,17 @@ static void ipw_arc_release(struct ipw_priv *priv) | |||
3040 | } | 3038 | } |
3041 | 3039 | ||
3042 | struct fw_chunk { | 3040 | struct fw_chunk { |
3043 | u32 address; | 3041 | __le32 address; |
3044 | u32 length; | 3042 | __le32 length; |
3045 | }; | 3043 | }; |
3046 | 3044 | ||
3047 | static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len) | 3045 | static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len) |
3048 | { | 3046 | { |
3049 | int rc = 0, i, addr; | 3047 | int rc = 0, i, addr; |
3050 | u8 cr = 0; | 3048 | u8 cr = 0; |
3051 | u16 *image; | 3049 | __le16 *image; |
3052 | 3050 | ||
3053 | image = (u16 *) data; | 3051 | image = (__le16 *) data; |
3054 | 3052 | ||
3055 | IPW_DEBUG_TRACE(">> \n"); | 3053 | IPW_DEBUG_TRACE(">> \n"); |
3056 | 3054 | ||
@@ -3097,7 +3095,7 @@ static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len) | |||
3097 | /* load new ipw uCode */ | 3095 | /* load new ipw uCode */ |
3098 | for (i = 0; i < len / 2; i++) | 3096 | for (i = 0; i < len / 2; i++) |
3099 | ipw_write_reg16(priv, IPW_BASEBAND_CONTROL_STORE, | 3097 | ipw_write_reg16(priv, IPW_BASEBAND_CONTROL_STORE, |
3100 | cpu_to_le16(image[i])); | 3098 | le16_to_cpu(image[i])); |
3101 | 3099 | ||
3102 | /* enable DINO */ | 3100 | /* enable DINO */ |
3103 | ipw_write_reg8(priv, IPW_BASEBAND_CONTROL_STATUS, 0); | 3101 | ipw_write_reg8(priv, IPW_BASEBAND_CONTROL_STATUS, 0); |
@@ -3116,11 +3114,11 @@ static int ipw_load_ucode(struct ipw_priv *priv, u8 * data, size_t len) | |||
3116 | 3114 | ||
3117 | if (cr & DINO_RXFIFO_DATA) { | 3115 | if (cr & DINO_RXFIFO_DATA) { |
3118 | /* alive_command_responce size is NOT multiple of 4 */ | 3116 | /* alive_command_responce size is NOT multiple of 4 */ |
3119 | u32 response_buffer[(sizeof(priv->dino_alive) + 3) / 4]; | 3117 | __le32 response_buffer[(sizeof(priv->dino_alive) + 3) / 4]; |
3120 | 3118 | ||
3121 | for (i = 0; i < ARRAY_SIZE(response_buffer); i++) | 3119 | for (i = 0; i < ARRAY_SIZE(response_buffer); i++) |
3122 | response_buffer[i] = | 3120 | response_buffer[i] = |
3123 | le32_to_cpu(ipw_read_reg32(priv, | 3121 | cpu_to_le32(ipw_read_reg32(priv, |
3124 | IPW_BASEBAND_RX_FIFO_READ)); | 3122 | IPW_BASEBAND_RX_FIFO_READ)); |
3125 | memcpy(&priv->dino_alive, response_buffer, | 3123 | memcpy(&priv->dino_alive, response_buffer, |
3126 | sizeof(priv->dino_alive)); | 3124 | sizeof(priv->dino_alive)); |
@@ -4396,9 +4394,10 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4396 | struct ipw_rx_notification *notif) | 4394 | struct ipw_rx_notification *notif) |
4397 | { | 4395 | { |
4398 | DECLARE_MAC_BUF(mac); | 4396 | DECLARE_MAC_BUF(mac); |
4397 | u16 size = le16_to_cpu(notif->size); | ||
4399 | notif->size = le16_to_cpu(notif->size); | 4398 | notif->size = le16_to_cpu(notif->size); |
4400 | 4399 | ||
4401 | IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, notif->size); | 4400 | IPW_DEBUG_NOTIF("type = %i (%d bytes)\n", notif->subtype, size); |
4402 | 4401 | ||
4403 | switch (notif->subtype) { | 4402 | switch (notif->subtype) { |
4404 | case HOST_NOTIFICATION_STATUS_ASSOCIATED:{ | 4403 | case HOST_NOTIFICATION_STATUS_ASSOCIATED:{ |
@@ -4453,20 +4452,17 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4453 | if ((sizeof | 4452 | if ((sizeof |
4454 | (struct | 4453 | (struct |
4455 | ieee80211_assoc_response) | 4454 | ieee80211_assoc_response) |
4456 | <= notif->size) | 4455 | <= size) |
4457 | && (notif->size <= 2314)) { | 4456 | && (size <= 2314)) { |
4458 | struct | 4457 | struct |
4459 | ieee80211_rx_stats | 4458 | ieee80211_rx_stats |
4460 | stats = { | 4459 | stats = { |
4461 | .len = | 4460 | .len = size - 1, |
4462 | notif-> | ||
4463 | size - 1, | ||
4464 | }; | 4461 | }; |
4465 | 4462 | ||
4466 | IPW_DEBUG_QOS | 4463 | IPW_DEBUG_QOS |
4467 | ("QoS Associate " | 4464 | ("QoS Associate " |
4468 | "size %d\n", | 4465 | "size %d\n", size); |
4469 | notif->size); | ||
4470 | ieee80211_rx_mgt(priv-> | 4466 | ieee80211_rx_mgt(priv-> |
4471 | ieee, | 4467 | ieee, |
4472 | (struct | 4468 | (struct |
@@ -4671,20 +4667,20 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4671 | struct notif_channel_result *x = | 4667 | struct notif_channel_result *x = |
4672 | ¬if->u.channel_result; | 4668 | ¬if->u.channel_result; |
4673 | 4669 | ||
4674 | if (notif->size == sizeof(*x)) { | 4670 | if (size == sizeof(*x)) { |
4675 | IPW_DEBUG_SCAN("Scan result for channel %d\n", | 4671 | IPW_DEBUG_SCAN("Scan result for channel %d\n", |
4676 | x->channel_num); | 4672 | x->channel_num); |
4677 | } else { | 4673 | } else { |
4678 | IPW_DEBUG_SCAN("Scan result of wrong size %d " | 4674 | IPW_DEBUG_SCAN("Scan result of wrong size %d " |
4679 | "(should be %zd)\n", | 4675 | "(should be %zd)\n", |
4680 | notif->size, sizeof(*x)); | 4676 | size, sizeof(*x)); |
4681 | } | 4677 | } |
4682 | break; | 4678 | break; |
4683 | } | 4679 | } |
4684 | 4680 | ||
4685 | case HOST_NOTIFICATION_STATUS_SCAN_COMPLETED:{ | 4681 | case HOST_NOTIFICATION_STATUS_SCAN_COMPLETED:{ |
4686 | struct notif_scan_complete *x = ¬if->u.scan_complete; | 4682 | struct notif_scan_complete *x = ¬if->u.scan_complete; |
4687 | if (notif->size == sizeof(*x)) { | 4683 | if (size == sizeof(*x)) { |
4688 | IPW_DEBUG_SCAN | 4684 | IPW_DEBUG_SCAN |
4689 | ("Scan completed: type %d, %d channels, " | 4685 | ("Scan completed: type %d, %d channels, " |
4690 | "%d status\n", x->scan_type, | 4686 | "%d status\n", x->scan_type, |
@@ -4692,7 +4688,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4692 | } else { | 4688 | } else { |
4693 | IPW_ERROR("Scan completed of wrong size %d " | 4689 | IPW_ERROR("Scan completed of wrong size %d " |
4694 | "(should be %zd)\n", | 4690 | "(should be %zd)\n", |
4695 | notif->size, sizeof(*x)); | 4691 | size, sizeof(*x)); |
4696 | } | 4692 | } |
4697 | 4693 | ||
4698 | priv->status &= | 4694 | priv->status &= |
@@ -4758,13 +4754,13 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4758 | case HOST_NOTIFICATION_STATUS_FRAG_LENGTH:{ | 4754 | case HOST_NOTIFICATION_STATUS_FRAG_LENGTH:{ |
4759 | struct notif_frag_length *x = ¬if->u.frag_len; | 4755 | struct notif_frag_length *x = ¬if->u.frag_len; |
4760 | 4756 | ||
4761 | if (notif->size == sizeof(*x)) | 4757 | if (size == sizeof(*x)) |
4762 | IPW_ERROR("Frag length: %d\n", | 4758 | IPW_ERROR("Frag length: %d\n", |
4763 | le16_to_cpu(x->frag_length)); | 4759 | le16_to_cpu(x->frag_length)); |
4764 | else | 4760 | else |
4765 | IPW_ERROR("Frag length of wrong size %d " | 4761 | IPW_ERROR("Frag length of wrong size %d " |
4766 | "(should be %zd)\n", | 4762 | "(should be %zd)\n", |
4767 | notif->size, sizeof(*x)); | 4763 | size, sizeof(*x)); |
4768 | break; | 4764 | break; |
4769 | } | 4765 | } |
4770 | 4766 | ||
@@ -4772,7 +4768,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4772 | struct notif_link_deterioration *x = | 4768 | struct notif_link_deterioration *x = |
4773 | ¬if->u.link_deterioration; | 4769 | ¬if->u.link_deterioration; |
4774 | 4770 | ||
4775 | if (notif->size == sizeof(*x)) { | 4771 | if (size == sizeof(*x)) { |
4776 | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, | 4772 | IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, |
4777 | "link deterioration: type %d, cnt %d\n", | 4773 | "link deterioration: type %d, cnt %d\n", |
4778 | x->silence_notification_type, | 4774 | x->silence_notification_type, |
@@ -4782,7 +4778,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4782 | } else { | 4778 | } else { |
4783 | IPW_ERROR("Link Deterioration of wrong size %d " | 4779 | IPW_ERROR("Link Deterioration of wrong size %d " |
4784 | "(should be %zd)\n", | 4780 | "(should be %zd)\n", |
4785 | notif->size, sizeof(*x)); | 4781 | size, sizeof(*x)); |
4786 | } | 4782 | } |
4787 | break; | 4783 | break; |
4788 | } | 4784 | } |
@@ -4798,10 +4794,10 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4798 | 4794 | ||
4799 | case HOST_NOTIFICATION_STATUS_BEACON_STATE:{ | 4795 | case HOST_NOTIFICATION_STATUS_BEACON_STATE:{ |
4800 | struct notif_beacon_state *x = ¬if->u.beacon_state; | 4796 | struct notif_beacon_state *x = ¬if->u.beacon_state; |
4801 | if (notif->size != sizeof(*x)) { | 4797 | if (size != sizeof(*x)) { |
4802 | IPW_ERROR | 4798 | IPW_ERROR |
4803 | ("Beacon state of wrong size %d (should " | 4799 | ("Beacon state of wrong size %d (should " |
4804 | "be %zd)\n", notif->size, sizeof(*x)); | 4800 | "be %zd)\n", size, sizeof(*x)); |
4805 | break; | 4801 | break; |
4806 | } | 4802 | } |
4807 | 4803 | ||
@@ -4816,7 +4812,7 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4816 | 4812 | ||
4817 | case HOST_NOTIFICATION_STATUS_TGI_TX_KEY:{ | 4813 | case HOST_NOTIFICATION_STATUS_TGI_TX_KEY:{ |
4818 | struct notif_tgi_tx_key *x = ¬if->u.tgi_tx_key; | 4814 | struct notif_tgi_tx_key *x = ¬if->u.tgi_tx_key; |
4819 | if (notif->size == sizeof(*x)) { | 4815 | if (size == sizeof(*x)) { |
4820 | IPW_ERROR("TGi Tx Key: state 0x%02x sec type " | 4816 | IPW_ERROR("TGi Tx Key: state 0x%02x sec type " |
4821 | "0x%02x station %d\n", | 4817 | "0x%02x station %d\n", |
4822 | x->key_state, x->security_type, | 4818 | x->key_state, x->security_type, |
@@ -4826,14 +4822,14 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4826 | 4822 | ||
4827 | IPW_ERROR | 4823 | IPW_ERROR |
4828 | ("TGi Tx Key of wrong size %d (should be %zd)\n", | 4824 | ("TGi Tx Key of wrong size %d (should be %zd)\n", |
4829 | notif->size, sizeof(*x)); | 4825 | size, sizeof(*x)); |
4830 | break; | 4826 | break; |
4831 | } | 4827 | } |
4832 | 4828 | ||
4833 | case HOST_NOTIFICATION_CALIB_KEEP_RESULTS:{ | 4829 | case HOST_NOTIFICATION_CALIB_KEEP_RESULTS:{ |
4834 | struct notif_calibration *x = ¬if->u.calibration; | 4830 | struct notif_calibration *x = ¬if->u.calibration; |
4835 | 4831 | ||
4836 | if (notif->size == sizeof(*x)) { | 4832 | if (size == sizeof(*x)) { |
4837 | memcpy(&priv->calib, x, sizeof(*x)); | 4833 | memcpy(&priv->calib, x, sizeof(*x)); |
4838 | IPW_DEBUG_INFO("TODO: Calibration\n"); | 4834 | IPW_DEBUG_INFO("TODO: Calibration\n"); |
4839 | break; | 4835 | break; |
@@ -4841,12 +4837,12 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4841 | 4837 | ||
4842 | IPW_ERROR | 4838 | IPW_ERROR |
4843 | ("Calibration of wrong size %d (should be %zd)\n", | 4839 | ("Calibration of wrong size %d (should be %zd)\n", |
4844 | notif->size, sizeof(*x)); | 4840 | size, sizeof(*x)); |
4845 | break; | 4841 | break; |
4846 | } | 4842 | } |
4847 | 4843 | ||
4848 | case HOST_NOTIFICATION_NOISE_STATS:{ | 4844 | case HOST_NOTIFICATION_NOISE_STATS:{ |
4849 | if (notif->size == sizeof(u32)) { | 4845 | if (size == sizeof(u32)) { |
4850 | priv->exp_avg_noise = | 4846 | priv->exp_avg_noise = |
4851 | exponential_average(priv->exp_avg_noise, | 4847 | exponential_average(priv->exp_avg_noise, |
4852 | (u8) (le32_to_cpu(notif->u.noise.value) & 0xff), | 4848 | (u8) (le32_to_cpu(notif->u.noise.value) & 0xff), |
@@ -4856,14 +4852,14 @@ static void ipw_rx_notification(struct ipw_priv *priv, | |||
4856 | 4852 | ||
4857 | IPW_ERROR | 4853 | IPW_ERROR |
4858 | ("Noise stat is wrong size %d (should be %zd)\n", | 4854 | ("Noise stat is wrong size %d (should be %zd)\n", |
4859 | notif->size, sizeof(u32)); | 4855 | size, sizeof(u32)); |
4860 | break; | 4856 | break; |
4861 | } | 4857 | } |
4862 | 4858 | ||
4863 | default: | 4859 | default: |
4864 | IPW_DEBUG_NOTIF("Unknown notification: " | 4860 | IPW_DEBUG_NOTIF("Unknown notification: " |
4865 | "subtype=%d,flags=0x%2x,size=%d\n", | 4861 | "subtype=%d,flags=0x%2x,size=%d\n", |
4866 | notif->subtype, notif->flags, notif->size); | 4862 | notif->subtype, notif->flags, size); |
4867 | } | 4863 | } |
4868 | } | 4864 | } |
4869 | 4865 | ||
@@ -6767,7 +6763,7 @@ static int ipw_wx_set_mlme(struct net_device *dev, | |||
6767 | { | 6763 | { |
6768 | struct ipw_priv *priv = ieee80211_priv(dev); | 6764 | struct ipw_priv *priv = ieee80211_priv(dev); |
6769 | struct iw_mlme *mlme = (struct iw_mlme *)extra; | 6765 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
6770 | u16 reason; | 6766 | __le16 reason; |
6771 | 6767 | ||
6772 | reason = cpu_to_le16(mlme->reason_code); | 6768 | reason = cpu_to_le16(mlme->reason_code); |
6773 | 6769 | ||
@@ -10438,18 +10434,18 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, | |||
10438 | rt_hdr->it_present = 0; /* after all, it's just an idea */ | 10434 | rt_hdr->it_present = 0; /* after all, it's just an idea */ |
10439 | rt_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_CHANNEL); | 10435 | rt_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_CHANNEL); |
10440 | 10436 | ||
10441 | *(u16*)skb_put(dst, sizeof(u16)) = cpu_to_le16( | 10437 | *(__le16*)skb_put(dst, sizeof(u16)) = cpu_to_le16( |
10442 | ieee80211chan2mhz(priv->channel)); | 10438 | ieee80211chan2mhz(priv->channel)); |
10443 | if (priv->channel > 14) /* 802.11a */ | 10439 | if (priv->channel > 14) /* 802.11a */ |
10444 | *(u16*)skb_put(dst, sizeof(u16)) = | 10440 | *(__le16*)skb_put(dst, sizeof(u16)) = |
10445 | cpu_to_le16(IEEE80211_CHAN_OFDM | | 10441 | cpu_to_le16(IEEE80211_CHAN_OFDM | |
10446 | IEEE80211_CHAN_5GHZ); | 10442 | IEEE80211_CHAN_5GHZ); |
10447 | else if (priv->ieee->mode == IEEE_B) /* 802.11b */ | 10443 | else if (priv->ieee->mode == IEEE_B) /* 802.11b */ |
10448 | *(u16*)skb_put(dst, sizeof(u16)) = | 10444 | *(__le16*)skb_put(dst, sizeof(u16)) = |
10449 | cpu_to_le16(IEEE80211_CHAN_CCK | | 10445 | cpu_to_le16(IEEE80211_CHAN_CCK | |
10450 | IEEE80211_CHAN_2GHZ); | 10446 | IEEE80211_CHAN_2GHZ); |
10451 | else /* 802.11g */ | 10447 | else /* 802.11g */ |
10452 | *(u16*)skb_put(dst, sizeof(u16)) = | 10448 | *(__le16*)skb_put(dst, sizeof(u16)) = |
10453 | cpu_to_le16(IEEE80211_CHAN_OFDM | | 10449 | cpu_to_le16(IEEE80211_CHAN_OFDM | |
10454 | IEEE80211_CHAN_2GHZ); | 10450 | IEEE80211_CHAN_2GHZ); |
10455 | 10451 | ||
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h index b8e815a42be8..fae57a9f8be4 100644 --- a/drivers/net/wireless/ipw2200.h +++ b/drivers/net/wireless/ipw2200.h | |||
@@ -388,18 +388,18 @@ struct clx2_queue { | |||
388 | } __attribute__ ((packed)); | 388 | } __attribute__ ((packed)); |
389 | 389 | ||
390 | struct machdr32 { | 390 | struct machdr32 { |
391 | u16 frame_ctl; | 391 | __le16 frame_ctl; |
392 | u16 duration; // watch out for endians! | 392 | u16 duration; // watch out for endians! |
393 | u8 addr1[MACADRR_BYTE_LEN]; | 393 | u8 addr1[MACADRR_BYTE_LEN]; |
394 | u8 addr2[MACADRR_BYTE_LEN]; | 394 | u8 addr2[MACADRR_BYTE_LEN]; |
395 | u8 addr3[MACADRR_BYTE_LEN]; | 395 | u8 addr3[MACADRR_BYTE_LEN]; |
396 | u16 seq_ctrl; // more endians! | 396 | u16 seq_ctrl; // more endians! |
397 | u8 addr4[MACADRR_BYTE_LEN]; | 397 | u8 addr4[MACADRR_BYTE_LEN]; |
398 | u16 qos_ctrl; | 398 | __le16 qos_ctrl; |
399 | } __attribute__ ((packed)); | 399 | } __attribute__ ((packed)); |
400 | 400 | ||
401 | struct machdr30 { | 401 | struct machdr30 { |
402 | u16 frame_ctl; | 402 | __le16 frame_ctl; |
403 | u16 duration; // watch out for endians! | 403 | u16 duration; // watch out for endians! |
404 | u8 addr1[MACADRR_BYTE_LEN]; | 404 | u8 addr1[MACADRR_BYTE_LEN]; |
405 | u8 addr2[MACADRR_BYTE_LEN]; | 405 | u8 addr2[MACADRR_BYTE_LEN]; |
@@ -409,17 +409,17 @@ struct machdr30 { | |||
409 | } __attribute__ ((packed)); | 409 | } __attribute__ ((packed)); |
410 | 410 | ||
411 | struct machdr26 { | 411 | struct machdr26 { |
412 | u16 frame_ctl; | 412 | __le16 frame_ctl; |
413 | u16 duration; // watch out for endians! | 413 | u16 duration; // watch out for endians! |
414 | u8 addr1[MACADRR_BYTE_LEN]; | 414 | u8 addr1[MACADRR_BYTE_LEN]; |
415 | u8 addr2[MACADRR_BYTE_LEN]; | 415 | u8 addr2[MACADRR_BYTE_LEN]; |
416 | u8 addr3[MACADRR_BYTE_LEN]; | 416 | u8 addr3[MACADRR_BYTE_LEN]; |
417 | u16 seq_ctrl; // more endians! | 417 | u16 seq_ctrl; // more endians! |
418 | u16 qos_ctrl; | 418 | __le16 qos_ctrl; |
419 | } __attribute__ ((packed)); | 419 | } __attribute__ ((packed)); |
420 | 420 | ||
421 | struct machdr24 { | 421 | struct machdr24 { |
422 | u16 frame_ctl; | 422 | __le16 frame_ctl; |
423 | u16 duration; // watch out for endians! | 423 | u16 duration; // watch out for endians! |
424 | u8 addr1[MACADRR_BYTE_LEN]; | 424 | u8 addr1[MACADRR_BYTE_LEN]; |
425 | u8 addr2[MACADRR_BYTE_LEN]; | 425 | u8 addr2[MACADRR_BYTE_LEN]; |
@@ -466,15 +466,15 @@ struct tfd_command { | |||
466 | 466 | ||
467 | struct tfd_data { | 467 | struct tfd_data { |
468 | /* Header */ | 468 | /* Header */ |
469 | u32 work_area_ptr; | 469 | __le32 work_area_ptr; |
470 | u8 station_number; /* 0 for BSS */ | 470 | u8 station_number; /* 0 for BSS */ |
471 | u8 reserved1; | 471 | u8 reserved1; |
472 | u16 reserved2; | 472 | __le16 reserved2; |
473 | 473 | ||
474 | /* Tx Parameters */ | 474 | /* Tx Parameters */ |
475 | u8 cmd_id; | 475 | u8 cmd_id; |
476 | u8 seq_num; | 476 | u8 seq_num; |
477 | u16 len; | 477 | __le16 len; |
478 | u8 priority; | 478 | u8 priority; |
479 | u8 tx_flags; | 479 | u8 tx_flags; |
480 | u8 tx_flags_ext; | 480 | u8 tx_flags_ext; |
@@ -482,11 +482,11 @@ struct tfd_data { | |||
482 | u8 wepkey[DCT_WEP_KEY_FIELD_LENGTH]; | 482 | u8 wepkey[DCT_WEP_KEY_FIELD_LENGTH]; |
483 | u8 rate; | 483 | u8 rate; |
484 | u8 antenna; | 484 | u8 antenna; |
485 | u16 next_packet_duration; | 485 | __le16 next_packet_duration; |
486 | u16 next_frag_len; | 486 | __le16 next_frag_len; |
487 | u16 back_off_counter; //////txop; | 487 | __le16 back_off_counter; //////txop; |
488 | u8 retrylimit; | 488 | u8 retrylimit; |
489 | u16 cwcurrent; | 489 | __le16 cwcurrent; |
490 | u8 reserved3; | 490 | u8 reserved3; |
491 | 491 | ||
492 | /* 802.11 MAC Header */ | 492 | /* 802.11 MAC Header */ |
@@ -498,9 +498,9 @@ struct tfd_data { | |||
498 | } tfd; | 498 | } tfd; |
499 | 499 | ||
500 | /* Payload DMA info */ | 500 | /* Payload DMA info */ |
501 | u32 num_chunks; | 501 | __le32 num_chunks; |
502 | u32 chunk_ptr[NUM_TFD_CHUNKS]; | 502 | __le32 chunk_ptr[NUM_TFD_CHUNKS]; |
503 | u16 chunk_len[NUM_TFD_CHUNKS]; | 503 | __le16 chunk_len[NUM_TFD_CHUNKS]; |
504 | } __attribute__ ((packed)); | 504 | } __attribute__ ((packed)); |
505 | 505 | ||
506 | struct txrx_control_flags { | 506 | struct txrx_control_flags { |
@@ -547,14 +547,14 @@ struct clx2_tx_queue { | |||
547 | // Used for passing to driver number of successes and failures per rate | 547 | // Used for passing to driver number of successes and failures per rate |
548 | struct rate_histogram { | 548 | struct rate_histogram { |
549 | union { | 549 | union { |
550 | u32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; | 550 | __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; |
551 | u32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; | 551 | __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; |
552 | u32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; | 552 | __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; |
553 | } success; | 553 | } success; |
554 | union { | 554 | union { |
555 | u32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; | 555 | __le32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; |
556 | u32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; | 556 | __le32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; |
557 | u32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; | 557 | __le32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; |
558 | } failed; | 558 | } failed; |
559 | } __attribute__ ((packed)); | 559 | } __attribute__ ((packed)); |
560 | 560 | ||
@@ -602,13 +602,13 @@ struct notif_scan_complete { | |||
602 | } __attribute__ ((packed)); | 602 | } __attribute__ ((packed)); |
603 | 603 | ||
604 | struct notif_frag_length { | 604 | struct notif_frag_length { |
605 | u16 frag_length; | 605 | __le16 frag_length; |
606 | u16 reserved; | 606 | __le16 reserved; |
607 | } __attribute__ ((packed)); | 607 | } __attribute__ ((packed)); |
608 | 608 | ||
609 | struct notif_beacon_state { | 609 | struct notif_beacon_state { |
610 | u32 state; | 610 | __le32 state; |
611 | u32 number; | 611 | __le32 number; |
612 | } __attribute__ ((packed)); | 612 | } __attribute__ ((packed)); |
613 | 613 | ||
614 | struct notif_tgi_tx_key { | 614 | struct notif_tgi_tx_key { |
@@ -627,7 +627,7 @@ struct notif_link_deterioration { | |||
627 | u8 modulation; | 627 | u8 modulation; |
628 | struct rate_histogram histogram; | 628 | struct rate_histogram histogram; |
629 | u8 silence_notification_type; /* SILENCE_OVER/UNDER_THRESH */ | 629 | u8 silence_notification_type; /* SILENCE_OVER/UNDER_THRESH */ |
630 | u16 silence_count; | 630 | __le16 silence_count; |
631 | } __attribute__ ((packed)); | 631 | } __attribute__ ((packed)); |
632 | 632 | ||
633 | struct notif_association { | 633 | struct notif_association { |
@@ -645,14 +645,14 @@ struct notif_calibration { | |||
645 | } __attribute__ ((packed)); | 645 | } __attribute__ ((packed)); |
646 | 646 | ||
647 | struct notif_noise { | 647 | struct notif_noise { |
648 | u32 value; | 648 | __le32 value; |
649 | } __attribute__ ((packed)); | 649 | } __attribute__ ((packed)); |
650 | 650 | ||
651 | struct ipw_rx_notification { | 651 | struct ipw_rx_notification { |
652 | u8 reserved[8]; | 652 | u8 reserved[8]; |
653 | u8 subtype; | 653 | u8 subtype; |
654 | u8 flags; | 654 | u8 flags; |
655 | u16 size; | 655 | __le16 size; |
656 | union { | 656 | union { |
657 | struct notif_association assoc; | 657 | struct notif_association assoc; |
658 | struct notif_authenticate auth; | 658 | struct notif_authenticate auth; |
@@ -669,7 +669,7 @@ struct ipw_rx_notification { | |||
669 | } __attribute__ ((packed)); | 669 | } __attribute__ ((packed)); |
670 | 670 | ||
671 | struct ipw_rx_frame { | 671 | struct ipw_rx_frame { |
672 | u32 reserved1; | 672 | __le32 reserved1; |
673 | u8 parent_tsf[4]; // fw_use[0] is boolean for OUR_TSF_IS_GREATER | 673 | u8 parent_tsf[4]; // fw_use[0] is boolean for OUR_TSF_IS_GREATER |
674 | u8 received_channel; // The channel that this frame was received on. | 674 | u8 received_channel; // The channel that this frame was received on. |
675 | // Note that for .11b this does not have to be | 675 | // Note that for .11b this does not have to be |
@@ -680,14 +680,14 @@ struct ipw_rx_frame { | |||
680 | u8 rssi; | 680 | u8 rssi; |
681 | u8 agc; | 681 | u8 agc; |
682 | u8 rssi_dbm; | 682 | u8 rssi_dbm; |
683 | u16 signal; | 683 | __le16 signal; |
684 | u16 noise; | 684 | __le16 noise; |
685 | u8 antennaAndPhy; | 685 | u8 antennaAndPhy; |
686 | u8 control; // control bit should be on in bg | 686 | u8 control; // control bit should be on in bg |
687 | u8 rtscts_rate; // rate of rts or cts (in rts cts sequence rate | 687 | u8 rtscts_rate; // rate of rts or cts (in rts cts sequence rate |
688 | // is identical) | 688 | // is identical) |
689 | u8 rtscts_seen; // 0x1 RTS seen ; 0x2 CTS seen | 689 | u8 rtscts_seen; // 0x1 RTS seen ; 0x2 CTS seen |
690 | u16 length; | 690 | __le16 length; |
691 | u8 data[0]; | 691 | u8 data[0]; |
692 | } __attribute__ ((packed)); | 692 | } __attribute__ ((packed)); |
693 | 693 | ||
@@ -827,14 +827,14 @@ struct ipw_tgi_tx_key { | |||
827 | u8 station_index; | 827 | u8 station_index; |
828 | u8 flags; | 828 | u8 flags; |
829 | u8 key[16]; | 829 | u8 key[16]; |
830 | u32 tx_counter[2]; | 830 | __le32 tx_counter[2]; |
831 | } __attribute__ ((packed)); | 831 | } __attribute__ ((packed)); |
832 | 832 | ||
833 | #define IPW_SCAN_CHANNELS 54 | 833 | #define IPW_SCAN_CHANNELS 54 |
834 | 834 | ||
835 | struct ipw_scan_request { | 835 | struct ipw_scan_request { |
836 | u8 scan_type; | 836 | u8 scan_type; |
837 | u16 dwell_time; | 837 | __le16 dwell_time; |
838 | u8 channels_list[IPW_SCAN_CHANNELS]; | 838 | u8 channels_list[IPW_SCAN_CHANNELS]; |
839 | u8 channels_reserved[3]; | 839 | u8 channels_reserved[3]; |
840 | } __attribute__ ((packed)); | 840 | } __attribute__ ((packed)); |
@@ -849,11 +849,11 @@ enum { | |||
849 | }; | 849 | }; |
850 | 850 | ||
851 | struct ipw_scan_request_ext { | 851 | struct ipw_scan_request_ext { |
852 | u32 full_scan_index; | 852 | __le32 full_scan_index; |
853 | u8 channels_list[IPW_SCAN_CHANNELS]; | 853 | u8 channels_list[IPW_SCAN_CHANNELS]; |
854 | u8 scan_type[IPW_SCAN_CHANNELS / 2]; | 854 | u8 scan_type[IPW_SCAN_CHANNELS / 2]; |
855 | u8 reserved; | 855 | u8 reserved; |
856 | u16 dwell_time[IPW_SCAN_TYPES]; | 856 | __le16 dwell_time[IPW_SCAN_TYPES]; |
857 | } __attribute__ ((packed)); | 857 | } __attribute__ ((packed)); |
858 | 858 | ||
859 | static inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index) | 859 | static inline u8 ipw_get_scan_type(struct ipw_scan_request_ext *scan, u8 index) |
@@ -906,13 +906,13 @@ struct ipw_supported_rates { | |||
906 | } __attribute__ ((packed)); | 906 | } __attribute__ ((packed)); |
907 | 907 | ||
908 | struct ipw_rts_threshold { | 908 | struct ipw_rts_threshold { |
909 | u16 rts_threshold; | 909 | __le16 rts_threshold; |
910 | u16 reserved; | 910 | __le16 reserved; |
911 | } __attribute__ ((packed)); | 911 | } __attribute__ ((packed)); |
912 | 912 | ||
913 | struct ipw_frag_threshold { | 913 | struct ipw_frag_threshold { |
914 | u16 frag_threshold; | 914 | __le16 frag_threshold; |
915 | u16 reserved; | 915 | __le16 reserved; |
916 | } __attribute__ ((packed)); | 916 | } __attribute__ ((packed)); |
917 | 917 | ||
918 | struct ipw_retry_limit { | 918 | struct ipw_retry_limit { |
@@ -931,7 +931,7 @@ struct ipw_dino_config { | |||
931 | struct ipw_aironet_info { | 931 | struct ipw_aironet_info { |
932 | u8 id; | 932 | u8 id; |
933 | u8 length; | 933 | u8 length; |
934 | u16 reserved; | 934 | __le16 reserved; |
935 | } __attribute__ ((packed)); | 935 | } __attribute__ ((packed)); |
936 | 936 | ||
937 | struct ipw_rx_key { | 937 | struct ipw_rx_key { |
@@ -977,12 +977,12 @@ struct ipw_tx_power { | |||
977 | struct ipw_rsn_capabilities { | 977 | struct ipw_rsn_capabilities { |
978 | u8 id; | 978 | u8 id; |
979 | u8 length; | 979 | u8 length; |
980 | u16 version; | 980 | __le16 version; |
981 | } __attribute__ ((packed)); | 981 | } __attribute__ ((packed)); |
982 | 982 | ||
983 | struct ipw_sensitivity_calib { | 983 | struct ipw_sensitivity_calib { |
984 | u16 beacon_rssi_raw; | 984 | __le16 beacon_rssi_raw; |
985 | u16 reserved; | 985 | __le16 reserved; |
986 | } __attribute__ ((packed)); | 986 | } __attribute__ ((packed)); |
987 | 987 | ||
988 | /** | 988 | /** |
@@ -1156,8 +1156,8 @@ struct ipw_rt_hdr { | |||
1156 | u64 rt_tsf; /* TSF */ | 1156 | u64 rt_tsf; /* TSF */ |
1157 | u8 rt_flags; /* radiotap packet flags */ | 1157 | u8 rt_flags; /* radiotap packet flags */ |
1158 | u8 rt_rate; /* rate in 500kb/s */ | 1158 | u8 rt_rate; /* rate in 500kb/s */ |
1159 | u16 rt_channel; /* channel in mhz */ | 1159 | __le16 rt_channel; /* channel in mhz */ |
1160 | u16 rt_chbitmask; /* channel bitfield */ | 1160 | __le16 rt_chbitmask; /* channel bitfield */ |
1161 | s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ | 1161 | s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ |
1162 | s8 rt_dbmnoise; | 1162 | s8 rt_dbmnoise; |
1163 | u8 rt_antenna; /* antenna number */ | 1163 | u8 rt_antenna; /* antenna number */ |