diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2007-11-26 09:14:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:44 -0500 |
commit | 67d620357a186adc0f4e7d1f5b095ea2c77e7072 (patch) | |
tree | d5ee39e9837d01aefdccfb8fc084b561f8fa7367 /drivers | |
parent | fd105e79d19439d29a6561178fb5fe511e141f6b (diff) |
iwlwifi: 802.11n comply HT add station flow with mac80211 framework
This patch conforms the addition of a new station to the iwlwifi station
table according to the new mac80211's HT framework
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 23 |
4 files changed, 38 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index b4edadf96ecf..503b91745167 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c | |||
@@ -2023,8 +2023,8 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
2023 | if (sta_id == IWL_INVALID_STATION) { | 2023 | if (sta_id == IWL_INVALID_STATION) { |
2024 | IWL_DEBUG_RATE("LQ: ADD station %s\n", | 2024 | IWL_DEBUG_RATE("LQ: ADD station %s\n", |
2025 | print_mac(mac, hdr->addr1)); | 2025 | print_mac(mac, hdr->addr1)); |
2026 | sta_id = iwl4965_add_station_flags(priv, | 2026 | sta_id = iwl4965_add_station_flags(priv, hdr->addr1, |
2027 | hdr->addr1, 0, CMD_ASYNC); | 2027 | 0, CMD_ASYNC, NULL); |
2028 | } | 2028 | } |
2029 | if ((sta_id != IWL_INVALID_STATION)) { | 2029 | if ((sta_id != IWL_INVALID_STATION)) { |
2030 | lq->lq.sta_id = sta_id; | 2030 | lq->lq.sta_id = sta_id; |
@@ -2101,8 +2101,8 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
2101 | if (sta_id == IWL_INVALID_STATION) { | 2101 | if (sta_id == IWL_INVALID_STATION) { |
2102 | IWL_DEBUG_RATE("LQ: ADD station %s\n", | 2102 | IWL_DEBUG_RATE("LQ: ADD station %s\n", |
2103 | print_mac(mac, sta->addr)); | 2103 | print_mac(mac, sta->addr)); |
2104 | sta_id = iwl4965_add_station_flags(priv, | 2104 | sta_id = iwl4965_add_station_flags(priv, sta->addr, |
2105 | sta->addr, 0, CMD_ASYNC); | 2105 | 0, CMD_ASYNC, NULL); |
2106 | } | 2106 | } |
2107 | if ((sta_id != IWL_INVALID_STATION)) { | 2107 | if ((sta_id != IWL_INVALID_STATION)) { |
2108 | crl->lq.sta_id = sta_id; | 2108 | crl->lq.sta_id = sta_id; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 2724208aca7c..55d61000e342 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -4617,39 +4617,33 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct iwl_ht_info *ht_info) | |||
4617 | return; | 4617 | return; |
4618 | } | 4618 | } |
4619 | 4619 | ||
4620 | void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index) | 4620 | void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, |
4621 | struct ieee80211_ht_info *sta_ht_inf) | ||
4621 | { | 4622 | { |
4622 | __le32 sta_flags; | 4623 | __le32 sta_flags; |
4623 | struct sta_ht_info *ht_info = &priv->current_assoc_ht; | ||
4624 | 4624 | ||
4625 | priv->current_channel_width = IWL_CHANNEL_WIDTH_20MHZ; | 4625 | if (!sta_ht_inf || !sta_ht_inf->ht_supported) |
4626 | if (!ht_info->is_ht) | ||
4627 | goto done; | 4626 | goto done; |
4628 | 4627 | ||
4629 | sta_flags = priv->stations[index].sta.station_flags; | 4628 | sta_flags = priv->stations[index].sta.station_flags; |
4630 | 4629 | ||
4631 | if (ht_info->tx_mimo_ps_mode == IWL_MIMO_PS_DYNAMIC) | 4630 | if (((sta_ht_inf->cap & IEEE80211_HT_CAP_MIMO_PS >> 2)) |
4631 | == IWL_MIMO_PS_DYNAMIC) | ||
4632 | sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK; | 4632 | sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK; |
4633 | else | 4633 | else |
4634 | sta_flags &= ~STA_FLG_RTS_MIMO_PROT_MSK; | 4634 | sta_flags &= ~STA_FLG_RTS_MIMO_PROT_MSK; |
4635 | 4635 | ||
4636 | sta_flags |= cpu_to_le32( | 4636 | sta_flags |= cpu_to_le32( |
4637 | (u32)ht_info->ampdu_factor << STA_FLG_MAX_AGG_SIZE_POS); | 4637 | (u32)sta_ht_inf->ampdu_factor << STA_FLG_MAX_AGG_SIZE_POS); |
4638 | 4638 | ||
4639 | sta_flags |= cpu_to_le32( | 4639 | sta_flags |= cpu_to_le32( |
4640 | (u32)ht_info->mpdu_density << STA_FLG_AGG_MPDU_DENSITY_POS); | 4640 | (u32)sta_ht_inf->ampdu_density << STA_FLG_AGG_MPDU_DENSITY_POS); |
4641 | |||
4642 | sta_flags &= (~STA_FLG_FAT_EN_MSK); | ||
4643 | ht_info->tx_chan_width = IWL_CHANNEL_WIDTH_20MHZ; | ||
4644 | ht_info->chan_width_cap = IWL_CHANNEL_WIDTH_20MHZ; | ||
4645 | 4641 | ||
4646 | if (iwl4965_is_fat_tx_allowed(priv, ht_info)) { | 4642 | if (iwl4965_is_fat_tx_allowed(priv, sta_ht_inf)) |
4647 | sta_flags |= STA_FLG_FAT_EN_MSK; | 4643 | sta_flags |= STA_FLG_FAT_EN_MSK; |
4648 | ht_info->chan_width_cap = IWL_CHANNEL_WIDTH_40MHZ; | 4644 | else |
4649 | if (ht_info->supported_chan_width == IWL_CHANNEL_WIDTH_40MHZ) | 4645 | sta_flags &= (~STA_FLG_FAT_EN_MSK); |
4650 | ht_info->tx_chan_width = IWL_CHANNEL_WIDTH_40MHZ; | 4646 | |
4651 | } | ||
4652 | priv->current_channel_width = ht_info->tx_chan_width; | ||
4653 | priv->stations[index].sta.station_flags = sta_flags; | 4647 | priv->stations[index].sta.station_flags = sta_flags; |
4654 | done: | 4648 | done: |
4655 | return; | 4649 | return; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h index 6fdfb4a3be93..50209e6cdd0c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.h +++ b/drivers/net/wireless/iwlwifi/iwl-4965.h | |||
@@ -649,8 +649,8 @@ struct iwl4965_driver_hw_info { | |||
649 | struct iwl4965_addsta_cmd; | 649 | struct iwl4965_addsta_cmd; |
650 | extern int iwl4965_send_add_station(struct iwl4965_priv *priv, | 650 | extern int iwl4965_send_add_station(struct iwl4965_priv *priv, |
651 | struct iwl4965_addsta_cmd *sta, u8 flags); | 651 | struct iwl4965_addsta_cmd *sta, u8 flags); |
652 | extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *bssid, | 652 | extern u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, |
653 | int is_ap, u8 flags); | 653 | int is_ap, u8 flags, void *ht_data); |
654 | extern int iwl4965_is_network_packet(struct iwl4965_priv *priv, | 654 | extern int iwl4965_is_network_packet(struct iwl4965_priv *priv, |
655 | struct ieee80211_hdr *header); | 655 | struct ieee80211_hdr *header); |
656 | extern int iwl4965_power_init_handle(struct iwl4965_priv *priv); | 656 | extern int iwl4965_power_init_handle(struct iwl4965_priv *priv); |
@@ -785,8 +785,6 @@ extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd | |||
785 | struct ieee80211_tx_control *ctrl, void *sta_in); | 785 | struct ieee80211_tx_control *ctrl, void *sta_in); |
786 | extern int iwl4965_alive_notify(struct iwl4965_priv *priv); | 786 | extern int iwl4965_alive_notify(struct iwl4965_priv *priv); |
787 | extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode); | 787 | extern void iwl4965_update_rate_scaling(struct iwl4965_priv *priv, u8 mode); |
788 | extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index); | ||
789 | |||
790 | extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv); | 788 | extern void iwl4965_chain_noise_reset(struct iwl4965_priv *priv); |
791 | extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags, | 789 | extern void iwl4965_init_sensitivity(struct iwl4965_priv *priv, u8 flags, |
792 | u8 force); | 790 | u8 force); |
@@ -801,6 +799,8 @@ extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, | |||
801 | int mode); | 799 | int mode); |
802 | extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, | 800 | extern void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, |
803 | struct iwl_ht_info *ht_info); | 801 | struct iwl_ht_info *ht_info); |
802 | extern void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index, | ||
803 | struct ieee80211_ht_info *sta_ht_inf); | ||
804 | #ifdef CONFIG_IWL4965_HT_AGG | 804 | #ifdef CONFIG_IWL4965_HT_AGG |
805 | extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, | 805 | extern int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, u8 *da, |
806 | u16 tid, u16 *start_seq_num); | 806 | u16 tid, u16 *start_seq_num); |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 2c706395e0a4..9f89f596283c 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -497,7 +497,8 @@ static void iwl4965_clear_stations_table(struct iwl4965_priv *priv) | |||
497 | /** | 497 | /** |
498 | * iwl4965_add_station_flags - Add station to tables in driver and device | 498 | * iwl4965_add_station_flags - Add station to tables in driver and device |
499 | */ | 499 | */ |
500 | u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, int is_ap, u8 flags) | 500 | u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, |
501 | int is_ap, u8 flags, void *ht_data) | ||
501 | { | 502 | { |
502 | int i; | 503 | int i; |
503 | int index = IWL_INVALID_STATION; | 504 | int index = IWL_INVALID_STATION; |
@@ -554,7 +555,8 @@ u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, int is_a | |||
554 | /* BCAST station and IBSS stations do not work in HT mode */ | 555 | /* BCAST station and IBSS stations do not work in HT mode */ |
555 | if (index != priv->hw_setting.bcast_sta_id && | 556 | if (index != priv->hw_setting.bcast_sta_id && |
556 | priv->iw_mode != IEEE80211_IF_TYPE_IBSS) | 557 | priv->iw_mode != IEEE80211_IF_TYPE_IBSS) |
557 | iwl4965_set_ht_add_station(priv, index); | 558 | iwl4965_set_ht_add_station(priv, index, |
559 | (struct ieee80211_ht_info *) ht_data); | ||
558 | #endif /*CONFIG_IWL4965_HT*/ | 560 | #endif /*CONFIG_IWL4965_HT*/ |
559 | 561 | ||
560 | spin_unlock_irqrestore(&priv->sta_lock, flags_spin); | 562 | spin_unlock_irqrestore(&priv->sta_lock, flags_spin); |
@@ -900,7 +902,19 @@ static int iwl4965_rxon_add_station(struct iwl4965_priv *priv, | |||
900 | u8 sta_id; | 902 | u8 sta_id; |
901 | 903 | ||
902 | /* Add station to device's station table */ | 904 | /* Add station to device's station table */ |
903 | sta_id = iwl4965_add_station_flags(priv, addr, is_ap, 0); | 905 | #ifdef CONFIG_IWL4965_HT |
906 | struct ieee80211_conf *conf = &priv->hw->conf; | ||
907 | struct ieee80211_ht_info *cur_ht_config = &conf->ht_conf; | ||
908 | |||
909 | if ((is_ap) && | ||
910 | (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && | ||
911 | (priv->iw_mode == IEEE80211_IF_TYPE_STA)) | ||
912 | sta_id = iwl4965_add_station_flags(priv, addr, is_ap, | ||
913 | 0, cur_ht_config); | ||
914 | else | ||
915 | #endif /* CONFIG_IWL4965_HT */ | ||
916 | sta_id = iwl4965_add_station_flags(priv, addr, is_ap, | ||
917 | 0, NULL); | ||
904 | 918 | ||
905 | /* Set up default rate scaling table in device's station table */ | 919 | /* Set up default rate scaling table in device's station table */ |
906 | iwl4965_add_station(priv, addr, is_ap); | 920 | iwl4965_add_station(priv, addr, is_ap); |
@@ -2834,7 +2848,8 @@ static int iwl4965_get_sta_id(struct iwl4965_priv *priv, | |||
2834 | return sta_id; | 2848 | return sta_id; |
2835 | 2849 | ||
2836 | /* Create new station table entry */ | 2850 | /* Create new station table entry */ |
2837 | sta_id = iwl4965_add_station_flags(priv, hdr->addr1, 0, CMD_ASYNC); | 2851 | sta_id = iwl4965_add_station_flags(priv, hdr->addr1, |
2852 | 0, CMD_ASYNC, NULL); | ||
2838 | 2853 | ||
2839 | if (sta_id != IWL_INVALID_STATION) | 2854 | if (sta_id != IWL_INVALID_STATION) |
2840 | return sta_id; | 2855 | return sta_id; |