diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.h | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 83 |
4 files changed, 50 insertions, 64 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index f018ce464d97..a8223c4cc97c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -464,7 +464,7 @@ static void rs_tx_status(void *priv_rate, | |||
464 | IWL_DEBUG_RATE("enter\n"); | 464 | IWL_DEBUG_RATE("enter\n"); |
465 | 465 | ||
466 | retries = tx_resp->retry_count; | 466 | retries = tx_resp->retry_count; |
467 | 467 | /* FIXME : this is wrong */ | |
468 | first_index = &sband->bitrates[0] - tx_resp->control.tx_rate; | 468 | first_index = &sband->bitrates[0] - tx_resp->control.tx_rate; |
469 | if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { | 469 | if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { |
470 | IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); | 470 | IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 886a4b86605c..cc141f8ba616 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -3459,14 +3459,15 @@ static int parse_elems(u8 *start, size_t len, struct ieee802_11_elems *elems) | |||
3459 | return 0; | 3459 | return 0; |
3460 | } | 3460 | } |
3461 | 3461 | ||
3462 | void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, int mode) | 3462 | void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, |
3463 | enum ieee80211_band band) | ||
3463 | { | 3464 | { |
3464 | ht_info->cap = 0; | 3465 | ht_info->cap = 0; |
3465 | memset(ht_info->supp_mcs_set, 0, 16); | 3466 | memset(ht_info->supp_mcs_set, 0, 16); |
3466 | 3467 | ||
3467 | ht_info->ht_supported = 1; | 3468 | ht_info->ht_supported = 1; |
3468 | 3469 | ||
3469 | if (mode == MODE_IEEE80211A) { | 3470 | if (band == IEEE80211_BAND_5GHZ) { |
3470 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH; | 3471 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SUP_WIDTH; |
3471 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40; | 3472 | ht_info->cap |= (u16)IEEE80211_HT_CAP_SGI_40; |
3472 | ht_info->supp_mcs_set[4] = 0x01; | 3473 | ht_info->supp_mcs_set[4] = 0x01; |
@@ -3896,7 +3897,9 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl4965_priv *priv, | |||
3896 | tx_status->flags |= IEEE80211_TX_STATUS_AMPDU; | 3897 | tx_status->flags |= IEEE80211_TX_STATUS_AMPDU; |
3897 | tx_status->ampdu_ack_map = successes; | 3898 | tx_status->ampdu_ack_map = successes; |
3898 | tx_status->ampdu_ack_len = agg->frame_count; | 3899 | tx_status->ampdu_ack_len = agg->frame_count; |
3900 | /* FIXME Wrong rate | ||
3899 | tx_status->control.tx_rate = agg->rate_n_flags; | 3901 | tx_status->control.tx_rate = agg->rate_n_flags; |
3902 | */ | ||
3900 | 3903 | ||
3901 | IWL_DEBUG_TX_REPLY("Bitmap %llx\n", bitmap); | 3904 | IWL_DEBUG_TX_REPLY("Bitmap %llx\n", bitmap); |
3902 | 3905 | ||
@@ -4218,7 +4221,7 @@ void iwl4965_add_station(struct iwl4965_priv *priv, const u8 *addr, int is_ap) | |||
4218 | 4221 | ||
4219 | static u8 iwl4965_is_channel_extension(struct iwl4965_priv *priv, | 4222 | static u8 iwl4965_is_channel_extension(struct iwl4965_priv *priv, |
4220 | enum ieee80211_band band, | 4223 | enum ieee80211_band band, |
4221 | u16 channel, u8 extension_chan_offset) | 4224 | u16 channel, u8 extension_chan_offset) |
4222 | { | 4225 | { |
4223 | const struct iwl4965_channel_info *ch_info; | 4226 | const struct iwl4965_channel_info *ch_info; |
4224 | 4227 | ||
@@ -4252,7 +4255,7 @@ static u8 iwl4965_is_fat_tx_allowed(struct iwl4965_priv *priv, | |||
4252 | return 0; | 4255 | return 0; |
4253 | } | 4256 | } |
4254 | 4257 | ||
4255 | return (iwl4965_is_channel_extension(priv, priv->phymode, | 4258 | return (iwl4965_is_channel_extension(priv, priv->band, |
4256 | iwl_ht_conf->control_channel, | 4259 | iwl_ht_conf->control_channel, |
4257 | iwl_ht_conf->extension_chan_offset)); | 4260 | iwl_ht_conf->extension_chan_offset)); |
4258 | } | 4261 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index cb8f7f2a8d48..45cf4830568e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h | |||
@@ -772,17 +772,21 @@ extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, | |||
772 | extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv); | 772 | extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv); |
773 | 773 | ||
774 | #ifdef CONFIG_IWL4965_HT | 774 | #ifdef CONFIG_IWL4965_HT |
775 | extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, | 775 | void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, |
776 | int mode); | 776 | enum ieee80211_band band); |
777 | extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, | 777 | void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, |
778 | struct iwl_ht_info *ht_info); | 778 | struct iwl_ht_info *ht_info); |
779 | extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, | 779 | void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, |
780 | struct ieee80211_ht_info *sta_ht_inf); | 780 | struct ieee80211_ht_info *sta_ht_inf); |
781 | extern int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, | 781 | int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, |
782 | enum ieee80211_ampdu_mlme_action action, | 782 | enum ieee80211_ampdu_mlme_action action, |
783 | const u8 *addr, u16 tid, u16 *ssn); | 783 | const u8 *addr, u16 tid, u16 *ssn); |
784 | extern int iwl4965_check_empty_hw_queue(struct iwl4965_priv *priv, int sta_id, | 784 | int iwl4965_check_empty_hw_queue(struct iwl4965_priv *priv, int sta_id, |
785 | u8 tid, int txq_id); | 785 | u8 tid, int txq_id); |
786 | #else | ||
787 | static inline void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, | ||
788 | enum ieee80211_band band) {} | ||
789 | |||
786 | #endif /*CONFIG_IWL4965_HT */ | 790 | #endif /*CONFIG_IWL4965_HT */ |
787 | /* Structures, enum, and defines specific to the 4965 */ | 791 | /* Structures, enum, and defines specific to the 4965 */ |
788 | 792 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 933e0d44f69f..d0e385aa59e8 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -1893,24 +1893,20 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate, | |||
1893 | return ret_rates; | 1893 | return ret_rates; |
1894 | } | 1894 | } |
1895 | 1895 | ||
1896 | #ifdef CONFIG_IWL4965_HT | ||
1897 | void static iwl4965_set_ht_capab(struct ieee80211_hw *hw, | ||
1898 | struct ieee80211_ht_cap *ht_cap, | ||
1899 | u8 use_current_config); | ||
1900 | #endif | ||
1901 | |||
1902 | /** | 1896 | /** |
1903 | * iwl4965_fill_probe_req - fill in all required fields and IE for probe request | 1897 | * iwl4965_fill_probe_req - fill in all required fields and IE for probe request |
1904 | */ | 1898 | */ |
1905 | static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, | 1899 | static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, |
1906 | struct ieee80211_mgmt *frame, | 1900 | enum ieee80211_band band, |
1907 | int left, int is_direct) | 1901 | struct ieee80211_mgmt *frame, |
1902 | int left, int is_direct) | ||
1908 | { | 1903 | { |
1909 | int len = 0; | 1904 | int len = 0; |
1910 | u8 *pos = NULL; | 1905 | u8 *pos = NULL; |
1911 | u16 active_rates, ret_rates, cck_rates, active_rate_basic; | 1906 | u16 active_rates, ret_rates, cck_rates, active_rate_basic; |
1912 | #ifdef CONFIG_IWL4965_HT | 1907 | #ifdef CONFIG_IWL4965_HT |
1913 | struct ieee80211_hw_mode *mode; | 1908 | const struct ieee80211_supported_band *sband = |
1909 | iwl4965_get_hw_mode(priv, band); | ||
1914 | #endif /* CONFIG_IWL4965_HT */ | 1910 | #endif /* CONFIG_IWL4965_HT */ |
1915 | 1911 | ||
1916 | /* Make sure there is enough space for the probe request, | 1912 | /* Make sure there is enough space for the probe request, |
@@ -1995,13 +1991,18 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, | |||
1995 | len += 2 + *pos; | 1991 | len += 2 + *pos; |
1996 | 1992 | ||
1997 | #ifdef CONFIG_IWL4965_HT | 1993 | #ifdef CONFIG_IWL4965_HT |
1998 | mode = priv->hw->conf.mode; | 1994 | if (sband && sband->ht_info.ht_supported) { |
1999 | if (mode->ht_info.ht_supported) { | 1995 | struct ieee80211_ht_cap *ht_cap; |
2000 | pos += (*pos) + 1; | 1996 | pos += (*pos) + 1; |
2001 | *pos++ = WLAN_EID_HT_CAPABILITY; | 1997 | *pos++ = WLAN_EID_HT_CAPABILITY; |
2002 | *pos++ = sizeof(struct ieee80211_ht_cap); | 1998 | *pos++ = sizeof(struct ieee80211_ht_cap); |
2003 | iwl4965_set_ht_capab(priv->hw, | 1999 | ht_cap = (struct ieee80211_ht_cap *)pos; |
2004 | (struct ieee80211_ht_cap *)pos, 0); | 2000 | ht_cap->cap_info = cpu_to_le16(sband->ht_info.cap); |
2001 | memcpy(ht_cap->supp_mcs_set, sband->ht_info.supp_mcs_set, 16); | ||
2002 | ht_cap->ampdu_params_info =(sband->ht_info.ampdu_factor & | ||
2003 | IEEE80211_HT_CAP_AMPDU_FACTOR) | | ||
2004 | ((sband->ht_info.ampdu_density << 2) & | ||
2005 | IEEE80211_HT_CAP_AMPDU_DENSITY); | ||
2005 | len += 2 + sizeof(struct ieee80211_ht_cap); | 2006 | len += 2 + sizeof(struct ieee80211_ht_cap); |
2006 | } | 2007 | } |
2007 | #endif /*CONFIG_IWL4965_HT */ | 2008 | #endif /*CONFIG_IWL4965_HT */ |
@@ -3592,8 +3593,9 @@ static int iwl4965_tx_status_reply_tx(struct iwl4965_priv *priv, | |||
3592 | tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; | 3593 | tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; |
3593 | tx_status->flags = iwl4965_is_tx_success(status)? | 3594 | tx_status->flags = iwl4965_is_tx_success(status)? |
3594 | IEEE80211_TX_STATUS_ACK : 0; | 3595 | IEEE80211_TX_STATUS_ACK : 0; |
3596 | /* FIXME Wrong Rate | ||
3595 | tx_status->control.tx_rate = | 3597 | tx_status->control.tx_rate = |
3596 | iwl4965_hw_get_rate_n_flags(tx_resp->rate_n_flags); | 3598 | iwl4965_hw_get_rate_n_flags(tx_resp->rate_n_flags); */ |
3597 | /* FIXME: code repetition end */ | 3599 | /* FIXME: code repetition end */ |
3598 | 3600 | ||
3599 | IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", | 3601 | IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", |
@@ -5775,22 +5777,20 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv) | |||
5775 | } | 5777 | } |
5776 | 5778 | ||
5777 | /* 5.2GHz channels start after the 2.4GHz channels */ | 5779 | /* 5.2GHz channels start after the 2.4GHz channels */ |
5778 | #ifdef CONFIG_IWL4965_HT | ||
5779 | iwl4965_init_ht_hw_capab(&modes[A].ht_info, MODE_IEEE80211A); | ||
5780 | #endif | ||
5781 | #ifdef CONFIG_IWL4965_HT | ||
5782 | iwl4965_init_ht_hw_capab(&modes[G].ht_info, MODE_IEEE80211G); | ||
5783 | #endif | ||
5784 | band = &priv->bands[IEEE80211_BAND_5GHZ]; | 5780 | band = &priv->bands[IEEE80211_BAND_5GHZ]; |
5785 | band->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)]; | 5781 | band->channels = &channels[ARRAY_SIZE(iwl4965_eeprom_band_1)]; |
5786 | band->bitrates = &rates[4]; | 5782 | band->bitrates = &rates[4]; |
5787 | band->n_bitrates = 8; /* just OFDM */ | 5783 | band->n_bitrates = 8; /* just OFDM */ |
5788 | 5784 | ||
5785 | iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_5GHZ); | ||
5786 | |||
5789 | band = &priv->bands[IEEE80211_BAND_2GHZ]; | 5787 | band = &priv->bands[IEEE80211_BAND_2GHZ]; |
5790 | band->channels = channels; | 5788 | band->channels = channels; |
5791 | band->bitrates = rates; | 5789 | band->bitrates = rates; |
5792 | band->n_bitrates = 12; /* OFDM & CCK */ | 5790 | band->n_bitrates = 12; /* OFDM & CCK */ |
5793 | 5791 | ||
5792 | iwl4965_init_ht_hw_capab(&band->ht_info, IEEE80211_BAND_2GHZ); | ||
5793 | |||
5794 | priv->ieee_channels = channels; | 5794 | priv->ieee_channels = channels; |
5795 | priv->ieee_rates = rates; | 5795 | priv->ieee_rates = rates; |
5796 | 5796 | ||
@@ -6860,8 +6860,9 @@ static void iwl4965_bg_request_scan(struct work_struct *data) | |||
6860 | int rc = 0; | 6860 | int rc = 0; |
6861 | struct iwl4965_scan_cmd *scan; | 6861 | struct iwl4965_scan_cmd *scan; |
6862 | struct ieee80211_conf *conf = NULL; | 6862 | struct ieee80211_conf *conf = NULL; |
6863 | u8 direct_mask; | 6863 | u16 cmd_len; |
6864 | enum ieee80211_band band; | 6864 | enum ieee80211_band band; |
6865 | u8 direct_mask; | ||
6865 | 6866 | ||
6866 | conf = ieee80211_get_hw_conf(priv->hw); | 6867 | conf = ieee80211_get_hw_conf(priv->hw); |
6867 | 6868 | ||
@@ -6970,18 +6971,10 @@ static void iwl4965_bg_request_scan(struct work_struct *data) | |||
6970 | } else | 6971 | } else |
6971 | direct_mask = 0; | 6972 | direct_mask = 0; |
6972 | 6973 | ||
6973 | /* We don't build a direct scan probe request; the uCode will do | ||
6974 | * that based on the direct_mask added to each channel entry */ | ||
6975 | scan->tx_cmd.len = cpu_to_le16( | ||
6976 | iwl4965_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, | ||
6977 | IWL_MAX_SCAN_SIZE - sizeof(*scan), 0)); | ||
6978 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; | 6974 | scan->tx_cmd.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK; |
6979 | scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; | 6975 | scan->tx_cmd.sta_id = priv->hw_setting.bcast_sta_id; |
6980 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; | 6976 | scan->tx_cmd.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; |
6981 | 6977 | ||
6982 | /* flags + rate selection */ | ||
6983 | |||
6984 | scan->tx_cmd.tx_flags |= cpu_to_le32(0x200); | ||
6985 | 6978 | ||
6986 | switch (priv->scan_bands) { | 6979 | switch (priv->scan_bands) { |
6987 | case 2: | 6980 | case 2: |
@@ -7007,6 +7000,13 @@ static void iwl4965_bg_request_scan(struct work_struct *data) | |||
7007 | goto done; | 7000 | goto done; |
7008 | } | 7001 | } |
7009 | 7002 | ||
7003 | /* We don't build a direct scan probe request; the uCode will do | ||
7004 | * that based on the direct_mask added to each channel entry */ | ||
7005 | cmd_len = iwl4965_fill_probe_req(priv, band, | ||
7006 | (struct ieee80211_mgmt *)scan->data, | ||
7007 | IWL_MAX_SCAN_SIZE - sizeof(*scan), 0); | ||
7008 | |||
7009 | scan->tx_cmd.len = cpu_to_le16(cmd_len); | ||
7010 | /* select Rx chains */ | 7010 | /* select Rx chains */ |
7011 | 7011 | ||
7012 | /* Force use of chains B and C (0x6) for scan Rx. | 7012 | /* Force use of chains B and C (0x6) for scan Rx. |
@@ -7468,10 +7468,10 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co | |||
7468 | } | 7468 | } |
7469 | 7469 | ||
7470 | #ifdef CONFIG_IWL4965_HT | 7470 | #ifdef CONFIG_IWL4965_HT |
7471 | /* if we are switching fron ht to 2.4 clear flags | 7471 | /* if we are switching from ht to 2.4 clear flags |
7472 | * from any ht related info since 2.4 does not | 7472 | * from any ht related info since 2.4 does not |
7473 | * support ht */ | 7473 | * support ht */ |
7474 | if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel) | 7474 | if ((le16_to_cpu(priv->staging_rxon.channel) != conf->channel->hw_value) |
7475 | #ifdef IEEE80211_CONF_CHANNEL_SWITCH | 7475 | #ifdef IEEE80211_CONF_CHANNEL_SWITCH |
7476 | && !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) | 7476 | && !(conf->flags & IEEE80211_CONF_CHANNEL_SWITCH) |
7477 | #endif | 7477 | #endif |
@@ -8188,27 +8188,6 @@ static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw, | |||
8188 | return 0; | 8188 | return 0; |
8189 | } | 8189 | } |
8190 | 8190 | ||
8191 | static void iwl4965_set_ht_capab(struct ieee80211_hw *hw, | ||
8192 | struct ieee80211_ht_cap *ht_cap, | ||
8193 | u8 use_current_config) | ||
8194 | { | ||
8195 | struct ieee80211_conf *conf = &hw->conf; | ||
8196 | |||
8197 | if (use_current_config) { | ||
8198 | ht_cap->cap_info = cpu_to_le16(conf->ht_conf.cap); | ||
8199 | memcpy(ht_cap->supp_mcs_set, | ||
8200 | conf->ht_conf.supp_mcs_set, 16); | ||
8201 | } else { | ||
8202 | ht_cap->cap_info = cpu_to_le16(mode->ht_info.cap); | ||
8203 | memcpy(ht_cap->supp_mcs_set, | ||
8204 | mode->ht_info.supp_mcs_set, 16); | ||
8205 | } | ||
8206 | ht_cap->ampdu_params_info = | ||
8207 | (mode->ht_info.ampdu_factor & IEEE80211_HT_CAP_AMPDU_FACTOR) | | ||
8208 | ((mode->ht_info.ampdu_density << 2) & | ||
8209 | IEEE80211_HT_CAP_AMPDU_DENSITY); | ||
8210 | } | ||
8211 | |||
8212 | #endif /*CONFIG_IWL4965_HT*/ | 8191 | #endif /*CONFIG_IWL4965_HT*/ |
8213 | 8192 | ||
8214 | /***************************************************************************** | 8193 | /***************************************************************************** |