diff options
author | Jahnavi Meher <jahnavi.meher@gmail.com> | 2014-06-16 10:16:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-19 15:49:23 -0400 |
commit | 85af5bf829813df5571779e795b73ee498173945 (patch) | |
tree | 2e0319990f567e2e413a4e056fa056631191d05f | |
parent | 7b748dc0ed95cfee7962c5359299e4f305989769 (diff) |
rsi: Adding support for 5GHz
Adding support for 5GHz.
Signed-off-by: Jahnavi Meher <jahnavi.meher@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_mac80211.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_91x_mgmt.c | 81 | ||||
-rw-r--r-- | drivers/net/wireless/rsi/rsi_mgmt.h | 1 |
3 files changed, 87 insertions, 12 deletions
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 45bdb9953755..4700714e600f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c | |||
@@ -723,17 +723,17 @@ static int rsi_mac80211_set_rate_mask(struct ieee80211_hw *hw, | |||
723 | { | 723 | { |
724 | struct rsi_hw *adapter = hw->priv; | 724 | struct rsi_hw *adapter = hw->priv; |
725 | struct rsi_common *common = adapter->priv; | 725 | struct rsi_common *common = adapter->priv; |
726 | enum ieee80211_band band = hw->conf.chandef.chan->band; | ||
726 | 727 | ||
727 | mutex_lock(&common->mutex); | 728 | mutex_lock(&common->mutex); |
729 | common->fixedrate_mask[band] = 0; | ||
728 | 730 | ||
729 | common->fixedrate_mask[IEEE80211_BAND_2GHZ] = 0; | 731 | if (mask->control[band].legacy == 0xfff) { |
730 | 732 | common->fixedrate_mask[band] = | |
731 | if (mask->control[IEEE80211_BAND_2GHZ].legacy == 0xfff) { | 733 | (mask->control[band].ht_mcs[0] << 12); |
732 | common->fixedrate_mask[IEEE80211_BAND_2GHZ] = | ||
733 | (mask->control[IEEE80211_BAND_2GHZ].ht_mcs[0] << 12); | ||
734 | } else { | 734 | } else { |
735 | common->fixedrate_mask[IEEE80211_BAND_2GHZ] = | 735 | common->fixedrate_mask[band] = |
736 | mask->control[IEEE80211_BAND_2GHZ].legacy; | 736 | mask->control[band].legacy; |
737 | } | 737 | } |
738 | mutex_unlock(&common->mutex); | 738 | mutex_unlock(&common->mutex); |
739 | 739 | ||
@@ -980,6 +980,7 @@ int rsi_mac80211_attach(struct rsi_common *common) | |||
980 | 980 | ||
981 | hw->max_tx_aggregation_subframes = 6; | 981 | hw->max_tx_aggregation_subframes = 6; |
982 | rsi_register_rates_channels(adapter, IEEE80211_BAND_2GHZ); | 982 | rsi_register_rates_channels(adapter, IEEE80211_BAND_2GHZ); |
983 | rsi_register_rates_channels(adapter, IEEE80211_BAND_5GHZ); | ||
983 | hw->rate_control_algorithm = "AARF"; | 984 | hw->rate_control_algorithm = "AARF"; |
984 | 985 | ||
985 | SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); | 986 | SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); |
@@ -997,6 +998,8 @@ int rsi_mac80211_attach(struct rsi_common *common) | |||
997 | wiphy->available_antennas_tx = 1; | 998 | wiphy->available_antennas_tx = 1; |
998 | wiphy->bands[IEEE80211_BAND_2GHZ] = | 999 | wiphy->bands[IEEE80211_BAND_2GHZ] = |
999 | &adapter->sbands[IEEE80211_BAND_2GHZ]; | 1000 | &adapter->sbands[IEEE80211_BAND_2GHZ]; |
1001 | wiphy->bands[IEEE80211_BAND_5GHZ] = | ||
1002 | &adapter->sbands[IEEE80211_BAND_5GHZ]; | ||
1000 | 1003 | ||
1001 | status = ieee80211_register_hw(hw); | 1004 | status = ieee80211_register_hw(hw); |
1002 | if (status) | 1005 | if (status) |
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 92f584e636d4..cbd5a7e7c73c 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c | |||
@@ -623,6 +623,9 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode) | |||
623 | { | 623 | { |
624 | struct sk_buff *skb = NULL; | 624 | struct sk_buff *skb = NULL; |
625 | struct rsi_vap_caps *vap_caps; | 625 | struct rsi_vap_caps *vap_caps; |
626 | struct rsi_hw *adapter = common->priv; | ||
627 | struct ieee80211_hw *hw = adapter->hw; | ||
628 | struct ieee80211_conf *conf = &hw->conf; | ||
626 | u16 vap_id = 0; | 629 | u16 vap_id = 0; |
627 | 630 | ||
628 | rsi_dbg(MGMT_TX_ZONE, "%s: Sending VAP capabilities frame\n", __func__); | 631 | rsi_dbg(MGMT_TX_ZONE, "%s: Sending VAP capabilities frame\n", __func__); |
@@ -652,13 +655,24 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode) | |||
652 | vap_caps->frag_threshold = cpu_to_le16(IEEE80211_MAX_FRAG_THRESHOLD); | 655 | vap_caps->frag_threshold = cpu_to_le16(IEEE80211_MAX_FRAG_THRESHOLD); |
653 | 656 | ||
654 | vap_caps->rts_threshold = cpu_to_le16(common->rts_threshold); | 657 | vap_caps->rts_threshold = cpu_to_le16(common->rts_threshold); |
655 | vap_caps->default_mgmt_rate = 0; | 658 | vap_caps->default_mgmt_rate = cpu_to_le32(RSI_RATE_6); |
656 | if (conf_is_ht40(&common->priv->hw->conf)) { | 659 | |
657 | vap_caps->default_ctrl_rate = | 660 | if (common->band == IEEE80211_BAND_5GHZ) { |
658 | cpu_to_le32(RSI_RATE_6 | FULL40M_ENABLE << 16); | ||
659 | } else { | ||
660 | vap_caps->default_ctrl_rate = cpu_to_le32(RSI_RATE_6); | 661 | vap_caps->default_ctrl_rate = cpu_to_le32(RSI_RATE_6); |
662 | if (conf_is_ht40(&common->priv->hw->conf)) { | ||
663 | vap_caps->default_ctrl_rate |= | ||
664 | cpu_to_le32(FULL40M_ENABLE << 16); | ||
665 | } | ||
666 | } else { | ||
667 | vap_caps->default_ctrl_rate = cpu_to_le32(RSI_RATE_1); | ||
668 | if (conf_is_ht40_minus(conf)) | ||
669 | vap_caps->default_ctrl_rate |= | ||
670 | cpu_to_le32(UPPER_20_ENABLE << 16); | ||
671 | else if (conf_is_ht40_plus(conf)) | ||
672 | vap_caps->default_ctrl_rate |= | ||
673 | cpu_to_le32(LOWER_20_ENABLE << 16); | ||
661 | } | 674 | } |
675 | |||
662 | vap_caps->default_data_rate = 0; | 676 | vap_caps->default_data_rate = 0; |
663 | vap_caps->beacon_interval = cpu_to_le16(200); | 677 | vap_caps->beacon_interval = cpu_to_le16(200); |
664 | vap_caps->dtim_period = cpu_to_le16(4); | 678 | vap_caps->dtim_period = cpu_to_le16(4); |
@@ -835,6 +849,63 @@ static int rsi_send_reset_mac(struct rsi_common *common) | |||
835 | } | 849 | } |
836 | 850 | ||
837 | /** | 851 | /** |
852 | * rsi_band_check() - This function programs the band | ||
853 | * @common: Pointer to the driver private structure. | ||
854 | * | ||
855 | * Return: 0 on success, corresponding error code on failure. | ||
856 | */ | ||
857 | int rsi_band_check(struct rsi_common *common) | ||
858 | { | ||
859 | struct rsi_hw *adapter = common->priv; | ||
860 | struct ieee80211_hw *hw = adapter->hw; | ||
861 | u8 prev_bw = common->channel_width; | ||
862 | u8 prev_ep = common->endpoint; | ||
863 | struct ieee80211_channel *curchan = hw->conf.chandef.chan; | ||
864 | int status = 0; | ||
865 | |||
866 | if (common->band != curchan->band) { | ||
867 | common->rf_reset = 1; | ||
868 | common->band = curchan->band; | ||
869 | } | ||
870 | |||
871 | if ((hw->conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT) || | ||
872 | (hw->conf.chandef.width == NL80211_CHAN_WIDTH_20)) | ||
873 | common->channel_width = BW_20MHZ; | ||
874 | else | ||
875 | common->channel_width = BW_40MHZ; | ||
876 | |||
877 | if (common->band == IEEE80211_BAND_2GHZ) { | ||
878 | if (common->channel_width) | ||
879 | common->endpoint = EP_2GHZ_40MHZ; | ||
880 | else | ||
881 | common->endpoint = EP_2GHZ_20MHZ; | ||
882 | } else { | ||
883 | if (common->channel_width) | ||
884 | common->endpoint = EP_5GHZ_40MHZ; | ||
885 | else | ||
886 | common->endpoint = EP_5GHZ_20MHZ; | ||
887 | } | ||
888 | |||
889 | if (common->endpoint != prev_ep) { | ||
890 | status = rsi_program_bb_rf(common); | ||
891 | if (status) | ||
892 | return status; | ||
893 | } | ||
894 | |||
895 | if (common->channel_width != prev_bw) { | ||
896 | status = rsi_load_bootup_params(common); | ||
897 | if (status) | ||
898 | return status; | ||
899 | |||
900 | status = rsi_load_radio_caps(common); | ||
901 | if (status) | ||
902 | return status; | ||
903 | } | ||
904 | |||
905 | return status; | ||
906 | } | ||
907 | |||
908 | /** | ||
838 | * rsi_set_channel() - This function programs the channel. | 909 | * rsi_set_channel() - This function programs the channel. |
839 | * @common: Pointer to the driver private structure. | 910 | * @common: Pointer to the driver private structure. |
840 | * @channel: Channel value to be set. | 911 | * @channel: Channel value to be set. |
diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h index 8bff6640dd10..f10d6c67e82f 100644 --- a/drivers/net/wireless/rsi/rsi_mgmt.h +++ b/drivers/net/wireless/rsi/rsi_mgmt.h | |||
@@ -304,4 +304,5 @@ void rsi_core_qos_processor(struct rsi_common *common); | |||
304 | void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb); | 304 | void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb); |
305 | int rsi_send_mgmt_pkt(struct rsi_common *common, struct sk_buff *skb); | 305 | int rsi_send_mgmt_pkt(struct rsi_common *common, struct sk_buff *skb); |
306 | int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb); | 306 | int rsi_send_data_pkt(struct rsi_common *common, struct sk_buff *skb); |
307 | int rsi_band_check(struct rsi_common *common); | ||
307 | #endif | 308 | #endif |