@@ -923,14 +923,28 @@ static u32 iwl_mvm_find_ie_offset(u8 *beacon, u8 eid, u32 frame_size)
923
923
return ie - beacon ;
924
924
}
925
925
926
+ static u8 iwl_mvm_mac_ctxt_get_lowest_rate (struct ieee80211_tx_info * info ,
927
+ struct ieee80211_vif * vif )
928
+ {
929
+ u8 rate ;
930
+
931
+ if (info -> band == NL80211_BAND_5GHZ || vif -> p2p )
932
+ rate = IWL_FIRST_OFDM_RATE ;
933
+ else
934
+ rate = IWL_FIRST_CCK_RATE ;
935
+
936
+ return rate ;
937
+ }
938
+
926
939
static void iwl_mvm_mac_ctxt_set_tx (struct iwl_mvm * mvm ,
927
940
struct ieee80211_vif * vif ,
928
941
struct sk_buff * beacon ,
929
942
struct iwl_tx_cmd * tx )
930
943
{
931
944
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
932
945
struct ieee80211_tx_info * info ;
933
- u32 rate , tx_flags ;
946
+ u8 rate ;
947
+ u32 tx_flags ;
934
948
935
949
info = IEEE80211_SKB_CB (beacon );
936
950
@@ -955,14 +969,12 @@ static void iwl_mvm_mac_ctxt_set_tx(struct iwl_mvm *mvm,
955
969
cpu_to_le32 (BIT (mvm -> mgmt_last_antenna_idx ) <<
956
970
RATE_MCS_ANT_POS );
957
971
958
- if (info -> band == NL80211_BAND_5GHZ || vif -> p2p ) {
959
- rate = IWL_FIRST_OFDM_RATE ;
960
- } else {
961
- rate = IWL_FIRST_CCK_RATE ;
962
- tx -> rate_n_flags |= cpu_to_le32 (RATE_MCS_CCK_MSK );
963
- }
972
+ rate = iwl_mvm_mac_ctxt_get_lowest_rate (info , vif );
964
973
965
974
tx -> rate_n_flags |= cpu_to_le32 (iwl_mvm_mac80211_idx_to_hwrate (rate ));
975
+ if (rate == IWL_FIRST_CCK_RATE )
976
+ tx -> rate_n_flags |= cpu_to_le32 (RATE_MCS_CCK_MSK );
977
+
966
978
}
967
979
968
980
static int iwl_mvm_mac_ctxt_send_beacon_cmd (struct iwl_mvm * mvm ,
@@ -1033,19 +1045,27 @@ static int iwl_mvm_mac_ctxt_send_beacon_v7(struct iwl_mvm *mvm,
1033
1045
sizeof (beacon_cmd ));
1034
1046
}
1035
1047
1036
- static int iwl_mvm_mac_ctxt_send_beacon_v8 (struct iwl_mvm * mvm ,
1048
+ static int iwl_mvm_mac_ctxt_send_beacon_v9 (struct iwl_mvm * mvm ,
1037
1049
struct ieee80211_vif * vif ,
1038
1050
struct sk_buff * beacon )
1039
1051
{
1040
1052
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
1053
+ struct ieee80211_tx_info * info = IEEE80211_SKB_CB (beacon );
1041
1054
struct iwl_mac_beacon_cmd beacon_cmd = {};
1055
+ u8 rate = iwl_mvm_mac_ctxt_get_lowest_rate (info , vif );
1056
+ u16 flags ;
1057
+
1058
+ flags = iwl_mvm_mac80211_idx_to_hwrate (rate );
1042
1059
1060
+ if (rate == IWL_FIRST_CCK_RATE )
1061
+ flags |= IWL_MAC_BEACON_CCK ;
1062
+
1063
+ beacon_cmd .flags = cpu_to_le16 (flags );
1043
1064
beacon_cmd .byte_cnt = cpu_to_le16 ((u16 )beacon -> len );
1044
1065
beacon_cmd .template_id = cpu_to_le32 ((u32 )mvmvif -> id );
1045
1066
1046
1067
if (vif -> type == NL80211_IFTYPE_AP )
1047
- iwl_mvm_mac_ctxt_set_tim (mvm ,
1048
- & beacon_cmd .tim_idx ,
1068
+ iwl_mvm_mac_ctxt_set_tim (mvm , & beacon_cmd .tim_idx ,
1049
1069
& beacon_cmd .tim_size ,
1050
1070
beacon -> data , beacon -> len );
1051
1071
@@ -1073,10 +1093,11 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm,
1073
1093
IWL_UCODE_TLV_CAPA_CSA_AND_TBTT_OFFLOAD ))
1074
1094
return iwl_mvm_mac_ctxt_send_beacon_v6 (mvm , vif , beacon );
1075
1095
1076
- if (!iwl_mvm_has_new_tx_api (mvm ))
1077
- return iwl_mvm_mac_ctxt_send_beacon_v7 (mvm , vif , beacon );
1096
+ if (fw_has_api (& mvm -> fw -> ucode_capa ,
1097
+ IWL_UCODE_TLV_API_NEW_BEACON_TEMPLATE ))
1098
+ return iwl_mvm_mac_ctxt_send_beacon_v9 (mvm , vif , beacon );
1078
1099
1079
- return iwl_mvm_mac_ctxt_send_beacon_v8 (mvm , vif , beacon );
1100
+ return iwl_mvm_mac_ctxt_send_beacon_v7 (mvm , vif , beacon );
1080
1101
}
1081
1102
1082
1103
/* The beacon template for the AP/GO/IBSS has changed and needs update */
0 commit comments