iwlwifi: renamed all occurrences of IWL_RATE_COUNT to IWL_RATE_INDEX_COUNT
PATCH 1/1 iwlwifi: renamed all occurrences of IWL_RATE_COUNT to IWL_RATE_INDEX_COUNT
A FIXME requested to eventaully rename IWL_RATE_COUNT to IWL_RATE_INDEX_COUNT, as it's a more appropriate name.
Signed-off-by William Batista <[email protected]>
--- drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 2 +- drivers/net/wireless/intel/iwlwifi/dvm/rs.c | 48 +++++++++---------- drivers/net/wireless/intel/iwlwifi/dvm/rs.h | 16 +++---- drivers/net/wireless/intel/iwlwifi/dvm/tx.c | 2 +- .../net/wireless/intel/iwlwifi/fw/api/rs.h | 6 +-- drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 36 +++++++------- drivers/net/wireless/intel/iwlwifi/mvm/rs.h | 10 ++-- drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/utils.c | 4 +- 10 files changed, 64 insertions(+), 64 deletions(-)
drivers/net/wireless/intel/iwlwifi/dvm/lib.c +1 -1
@@ -89,7 +89,7 @@ int iwlagn_hwrate_to_mac80211_idx(u32 rate_n_flags, enum nl80211_band band) }else {if (band ==NL80211_BAND_5GHZ ) band_offset =IWL_FIRST_OFDM_RATE ; -for (idx = band_offset; idx <IWL_RATE_COUNT_LEGACY ; idx++) +for (idx = band_offset; idx <IWL_RATE_INDEX_COUNT_LEGACY ; idx++)if (iwl_rates[idx].plcp == (rate_n_flags &0xFF ))return idx - band_offset; }
drivers/net/wireless/intel/iwlwifi/dvm/rs.c +24 -24
189 lines not on this page · raw message
drivers/net/wireless/intel/iwlwifi/dvm/rs.h +8 -8
@@ -34,7 +34,7 @@ struct iwl_rate_info {/* * These serve as indexes into -* struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; +* struct iwl_rate_info iwl_rates[IWL_RATE_INDEX_COUNT]; */ enum {IWL_RATE_1M_INDEX =0 ,
@@ -50,10 +50,10 @@ enum {IWL_RATE_48M_INDEX ,IWL_RATE_54M_INDEX ,IWL_RATE_60M_INDEX , -IWL_RATE_COUNT ,/*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/ -IWL_RATE_COUNT_LEGACY =IWL_RATE_COUNT -1 ,/* Excluding 60M */ -IWL_RATE_INVM_INDEX =IWL_RATE_COUNT , - IWL_RATE_INVALID = IWL_RATE_COUNT, +IWL_RATE_INDEX_COUNT , +IWL_RATE_INDEX_COUNT_LEGACY =IWL_RATE_INDEX_COUNT -1 ,/* Excluding 60M */ +IWL_RATE_INVM_INDEX =IWL_RATE_INDEX_COUNT , + IWL_RATE_INVALID = IWL_RATE_INDEX_COUNT, }; enum {
@@ -161,7 +161,7 @@ enum { IWL_RATE_11M_IEEE = 22, }; -#define IWL_RATES_MASK ((1 << IWL_RATE_COUNT) - 1) +#define IWL_RATES_MASK ((1 << IWL_RATE_INDEX_COUNT) - 1)#define IWL_INVALID_VALUE -1
@@ -246,7 +246,7 @@ enum {#define TID_MAX_TIME_DIFF ((TID_QUEUE_MAX_SIZE - 1) * TID_QUEUE_CELL_SPACING)#define TIME_WRAP_AROUND (x, y) (((y) > (x)) ? (y) - (x) : (0-(x)) + (y)) -extern const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT ]; +extern const struct iwl_rate_info iwl_rates[IWL_RATE_INDEX_COUNT ];enum iwl_table_type {LQ_NONE ,
@@ -302,7 +302,7 @@ struct iwl_scale_tbl_info {u8 max_search;/* maximun number of tables we can search */ const u16 *expected_tpt;/* throughput metrics; expected_tpt_G, etc. */ u32 current_rate;/* rate_n_flags, uCode API format */ -struct iwl_rate_scale_data win[IWL_RATE_COUNT ];/* rate histories */ +struct iwl_rate_scale_data win[IWL_RATE_INDEX_COUNT ];/* rate histories */ };struct iwl_traffic_load {
drivers/net/wireless/intel/iwlwifi/dvm/tx.c +1 -1
@@ -156,7 +156,7 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,*/ rate_idx = info->control.rates[0 ].idx;if (info->control.rates[0 ].flags &IEEE80211_TX_RC_MCS || - (rate_idx <0 ) || (rate_idx >IWL_RATE_COUNT_LEGACY )) + (rate_idx <0 ) || (rate_idx >IWL_RATE_INDEX_COUNT_LEGACY )) rate_idx =rate_lowest_index ( &priv->nvm_data->bands[info->band], sta);/* For 5 GHZ band, remap mac80211 rate indices into driver indices */
drivers/net/wireless/intel/iwlwifi/fw/api/rs.h +3 -3
@@ -186,7 +186,7 @@ struct iwl_tlc_update_notif {/* * These serve as indexes into -* struct iwl_rate_info fw_rate_idx_to_plcp[IWL_RATE_COUNT]; +* struct iwl_rate_info fw_rate_idx_to_plcp[IWL_RATE_INDEX_COUNT]; * TODO: avoid overlap between legacy and HT rates */ enum {
@@ -224,8 +224,8 @@ enum {IWL_RATE_MCS_10_INDEX ,IWL_RATE_MCS_11_INDEX ,IWL_LAST_HE_RATE =IWL_RATE_MCS_11_INDEX , -IWL_RATE_COUNT_LEGACY =IWL_LAST_NON_HT_RATE +1 , - IWL_RATE_COUNT = IWL_LAST_HE_RATE + 1, +IWL_RATE_INDEX_COUNT_LEGACY =IWL_LAST_NON_HT_RATE +1 , + IWL_RATE_INDEX_COUNT = IWL_LAST_HE_RATE + 1, };#define IWL_RATE_BIT_MSK (r) BIT(IWL_RATE_##r##M_INDEX)
drivers/net/wireless/intel/iwlwifi/mvm/rs.c +18 -18
@@ -80,7 +80,7 @@ static const u8 ant_toggle_lookup[] = {* maps to IWL_RATE_INVALID * */ -static const struct iwl_rs_rate_info iwl_rates[IWL_RATE_COUNT ] = { +static const struct iwl_rs_rate_info iwl_rates[IWL_RATE_INDEX_COUNT ] = {IWL_DECLARE_RATE_INFO (1 ,INV ,INV ,2 ),/* 1mbps */ IWL_DECLARE_RATE_INFO (2 ,INV ,1 ,5 ),/* 2mbps */ IWL_DECLARE_RATE_INFO (5 ,INV ,2 ,11 ),/*5.5mbps */
@@ -396,63 +396,63 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta, bool force_search);* CCK rates are only valid in legacy table and will only be used in G * (2.4 GHz) band. */ -static const u16 expected_tpt_legacy[IWL_RATE_COUNT ] = { +static const u16 expected_tpt_legacy[IWL_RATE_INDEX_COUNT ] = {7 ,13 ,35 ,58 ,40 ,57 ,72 ,98 ,121 ,154 ,177 ,186 ,0 ,0 ,0 };/* Expected TpT tables. 4 indexes: * 0 - NGI, 1 - SGI, 2 - AGG+NGI, 3 - AGG+SGI */ -static const u16 expected_tpt_siso_20MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_siso_20MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,42 ,0 ,76 ,102 ,124 ,159 ,183 ,193 ,202 ,216 ,0 }, {0 ,0 ,0 ,0 ,46 ,0 ,82 ,110 ,132 ,168 ,192 ,202 ,210 ,225 ,0 }, {0 ,0 ,0 ,0 ,49 ,0 ,97 ,145 ,192 ,285 ,375 ,420 ,464 ,551 ,0 }, {0 ,0 ,0 ,0 ,54 ,0 ,108 ,160 ,213 ,315 ,415 ,465 ,513 ,608 ,0 }, }; -static const u16 expected_tpt_siso_40MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_siso_40MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,77 ,0 ,127 ,160 ,184 ,220 ,242 ,250 ,257 ,269 ,275 }, {0 ,0 ,0 ,0 ,83 ,0 ,135 ,169 ,193 ,229 ,250 ,257 ,264 ,275 ,280 }, {0 ,0 ,0 ,0 ,101 ,0 ,199 ,295 ,389 ,570 ,744 ,828 ,911 ,1070 ,1173 }, {0 ,0 ,0 ,0 ,112 ,0 ,220 ,326 ,429 ,629 ,819 ,912 ,1000 ,1173 ,1284 }, }; -static const u16 expected_tpt_siso_80MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_siso_80MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,130 ,0 ,191 ,223 ,244 ,273 ,288 ,294 ,298 ,305 ,308 }, {0 ,0 ,0 ,0 ,138 ,0 ,200 ,231 ,251 ,279 ,293 ,298 ,302 ,308 ,312 }, {0 ,0 ,0 ,0 ,217 ,0 ,429 ,634 ,834 ,1220 ,1585 ,1760 ,1931 ,2258 ,2466 }, {0 ,0 ,0 ,0 ,241 ,0 ,475 ,701 ,921 ,1343 ,1741 ,1931 ,2117 ,2468 ,2691 }, }; -static const u16 expected_tpt_siso_160MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_siso_160MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,191 ,0 ,244 ,288 ,298 ,308 ,313 ,318 ,323 ,328 ,330 }, {0 ,0 ,0 ,0 ,200 ,0 ,251 ,293 ,302 ,312 ,317 ,322 ,327 ,332 ,334 }, {0 ,0 ,0 ,0 ,439 ,0 ,875 ,1307 ,1736 ,2584 ,3419 ,3831 ,4240 ,5049 ,5581 }, {0 ,0 ,0 ,0 ,488 ,0 ,972 ,1451 ,1925 ,2864 ,3785 ,4240 ,4691 ,5581 ,6165 }, }; -static const u16 expected_tpt_mimo2_20MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_mimo2_20MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,74 ,0 ,123 ,155 ,179 ,213 ,235 ,243 ,250 ,261 ,0 }, {0 ,0 ,0 ,0 ,81 ,0 ,131 ,164 ,187 ,221 ,242 ,250 ,256 ,267 ,0 }, {0 ,0 ,0 ,0 ,98 ,0 ,193 ,286 ,375 ,550 ,718 ,799 ,878 ,1032 ,0 }, {0 ,0 ,0 ,0 ,109 ,0 ,214 ,316 ,414 ,607 ,790 ,879 ,965 ,1132 ,0 }, }; -static const u16 expected_tpt_mimo2_40MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_mimo2_40MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,123 ,0 ,182 ,214 ,235 ,264 ,279 ,285 ,289 ,296 ,300 }, {0 ,0 ,0 ,0 ,131 ,0 ,191 ,222 ,242 ,270 ,284 ,289 ,293 ,300 ,303 }, {0 ,0 ,0 ,0 ,200 ,0 ,390 ,571 ,741 ,1067 ,1365 ,1505 ,1640 ,1894 ,2053 }, {0 ,0 ,0 ,0 ,221 ,0 ,430 ,630 ,816 ,1169 ,1490 ,1641 ,1784 ,2053 ,2221 }, }; -static const u16 expected_tpt_mimo2_80MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_mimo2_80MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,182 ,0 ,240 ,264 ,278 ,299 ,308 ,311 ,313 ,317 ,319 }, {0 ,0 ,0 ,0 ,190 ,0 ,247 ,269 ,282 ,302 ,310 ,313 ,315 ,319 ,320 }, {0 ,0 ,0 ,0 ,428 ,0 ,833 ,1215 ,1577 ,2254 ,2863 ,3147 ,3418 ,3913 ,4219 }, {0 ,0 ,0 ,0 ,474 ,0 ,920 ,1338 ,1732 ,2464 ,3116 ,3418 ,3705 ,4225 ,4545 }, }; -static const u16 expected_tpt_mimo2_160MHz[4 ][IWL_RATE_COUNT ] = { +static const u16 expected_tpt_mimo2_160MHz[4 ][IWL_RATE_INDEX_COUNT ] = { {0 ,0 ,0 ,0 ,240 ,0 ,278 ,308 ,313 ,319 ,322 ,324 ,328 ,330 ,334 }, {0 ,0 ,0 ,0 ,247 ,0 ,282 ,310 ,315 ,320 ,323 ,325 ,329 ,332 ,338 }, {0 ,0 ,0 ,0 ,875 ,0 ,1735 ,2582 ,3414 ,5043 ,6619 ,7389 ,8147 ,9629 ,10592 },
@@ -460,7 +460,7 @@ static const u16 expected_tpt_mimo2_160MHz[4][IWL_RATE_COUNT] = { };/* mbps, mcs */ -static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_COUNT ] = { +static const struct iwl_rate_mcs_info iwl_rate_mcs[IWL_RATE_INDEX_COUNT ] = { {"1" ,"BPSK DSSS" }, {"2" ,"QPSK DSSS" }, {"5.5" ,"BPSK CCK" },
@@ -586,7 +586,7 @@ static void rs_rate_scale_clear_tbl_windows(struct iwl_mvm *mvm,int i;IWL_DEBUG_RATE (mvm,"Clearing up window stats\n" ); -for (i =0 ; i <IWL_RATE_COUNT ; i++) +for (i =0 ; i <IWL_RATE_INDEX_COUNT ; i++)rs_rate_scale_clear_window (&tbl->win[i]);for (i =0 ; i <ARRAY_SIZE (tbl->tpc_win); i++)
@@ -794,7 +794,7 @@ static int rs_collect_tlc_data(struct iwl_mvm *mvm, {struct iwl_rate_scale_data *window =NULL ; -if (scale_index <0 || scale_index >=IWL_RATE_COUNT ) +if (scale_index <0 || scale_index >=IWL_RATE_INDEX_COUNT )return -EINVAL ;if (tbl->column !=RS_COLUMN_INVALID ) {
@@ -1040,7 +1040,7 @@ static u16 rs_get_adjacent_rate(struct iwl_mvm *mvm, u8 index, u16 rate_mask,/* Find the next rate that is in the rate mask */ i = index +1 ; -for (mask = (1 << i); i <IWL_RATE_COUNT ; i++, mask <<=1 ) { +for (mask = (1 << i); i <IWL_RATE_INDEX_COUNT ; i++, mask <<=1 ) {if (rate_mask & mask) { high = i;break ;
@@ -1284,7 +1284,7 @@ static const u16 *rs_get_expected_tpt_table(struct iwl_lq_sta *lq_sta, u32 bw) {/* Used to choose among HT tables */ -const u16 (*ht_tbl_pointer)[IWL_RATE_COUNT ]; +const u16 (*ht_tbl_pointer)[IWL_RATE_INDEX_COUNT ]; if (WARN_ON_ONCE(column->mode != RS_LEGACY && column->mode != RS_SISO &&
@@ -3936,7 +3936,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,is_ht80 (rate) ?"80MHz" :is_ht160 (rate) ?"160MHz" :"ERR" , rate->index); -for (j =0 ; j <IWL_RATE_COUNT ; j++) { +for (j =0 ; j <IWL_RATE_INDEX_COUNT ; j++) { desc += sprintf(buff+desc, "counter=%d success=%d %%=%d\n", tbl->win[j].counter,
@@ -4005,7 +4005,7 @@ static ssize_t rs_sta_dbgfs_drv_tx_stats_read(struct file *file, endpos = pos + bufsz; pos +=scnprintf (pos, endpos - pos,"COLUMN," ); -for (rate =0 ; rate <IWL_RATE_COUNT ; rate++) +for (rate =0 ; rate <IWL_RATE_INDEX_COUNT ; rate++) pos +=scnprintf (pos, endpos - pos,"%s," , rate_name[rate]); pos +=scnprintf (pos, endpos - pos,"\n" );
@@ -4013,7 +4013,7 @@ static ssize_t rs_sta_dbgfs_drv_tx_stats_read(struct file *file, pos +=scnprintf (pos, endpos - pos,"%s," , column_name[col]); -for (rate =0 ; rate <IWL_RATE_COUNT ; rate++) { +for (rate =0 ; rate <IWL_RATE_INDEX_COUNT ; rate++) { stats = &(lq_sta->pers.tx_stats[col][rate]); pos += scnprintf(pos, endpos - pos, "%llu/%llu,",
drivers/net/wireless/intel/iwlwifi/mvm/rs.h +5 -5
@@ -37,8 +37,8 @@ struct iwl_rs_rate_info {#define IWL_RATE_60M_PLCP 3enum { -IWL_RATE_INVM_INDEX =IWL_RATE_COUNT , -IWL_RATE_INVALID =IWL_RATE_COUNT , +IWL_RATE_INVM_INDEX =IWL_RATE_INDEX_COUNT , +IWL_RATE_INVALID =IWL_RATE_INDEX_COUNT , };#define LINK_QUAL_MAX_RETRY_NUM 16
@@ -123,7 +123,7 @@ enum { IWL_RATE_HT_MIMO2_MCS_9_PLCP = IWL_RATE_HT_SISO_MCS_INV_PLCP, }; -#define IWL_RATES_MASK ((1 << IWL_RATE_COUNT) - 1) +#define IWL_RATES_MASK ((1 << IWL_RATE_INDEX_COUNT) - 1)#define IWL_INVALID_VALUE -1
@@ -302,7 +302,7 @@ struct iwl_scale_tbl_info {struct rs_rate rate;enum rs_column column;const u16 *expected_tpt;/* throughput metrics; expected_tpt_G, etc. */ -struct iwl_rate_scale_data win[IWL_RATE_COUNT ];/* rate histories */ +struct iwl_rate_scale_data win[IWL_RATE_INDEX_COUNT ];/* rate histories */ /* per txpower-reduction history */ struct iwl_rate_scale_data tpc_win[TPC_MAX_REDUCTION +1 ]; };
@@ -388,7 +388,7 @@ struct iwl_lq_sta {u8 chains;s8 chain_signal[IEEE80211_MAX_CHAINS ];s8 last_rssi; -struct rs_rate_stats tx_stats[RS_COLUMN_COUNT ][IWL_RATE_COUNT ]; +struct rs_rate_stats tx_stats[RS_COLUMN_COUNT ][IWL_RATE_INDEX_COUNT ];struct iwl_mvm *drv;spinlock_t lock;/* for races in reinit/update table */ } pers;
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +1 -1
@@ -1009,7 +1009,7 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,static int rate_to_scan_rate_flag (unsigned int rate) { -static const int rate_to_scan_rate[IWL_RATE_COUNT ] = { +static const int rate_to_scan_rate[IWL_RATE_INDEX_COUNT ] = { [IWL_RATE_1M_INDEX ] =SCAN_CONFIG_RATE_1M , [IWL_RATE_2M_INDEX ] =SCAN_CONFIG_RATE_2M , [IWL_RATE_5M_INDEX ] =SCAN_CONFIG_RATE_5M ,
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +1 -1
@@ -284,7 +284,7 @@ static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm, }/* if the rate isn't a well known legacy rate, take the lowest one */ -if (rate_idx <0 || rate_idx >=IWL_RATE_COUNT_LEGACY ) +if (rate_idx <0 || rate_idx >=IWL_RATE_INDEX_COUNT_LEGACY ) rate_idx =rate_lowest_index ( &mvm->nvm_data->bands[info->band], sta);
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +2 -2
@@ -141,7 +141,7 @@ int iwl_mvm_send_cmd_pdu_status(struct iwl_mvm *mvm, u32 id, u16 len,/* * Translate from fw_rate_index (IWL_RATE_XXM_INDEX) to PLCP */ -static const u8 fw_rate_idx_to_plcp[IWL_RATE_COUNT ] = { +static const u8 fw_rate_idx_to_plcp[IWL_RATE_INDEX_COUNT ] = {IWL_DECLARE_RATE_INFO (1 ),IWL_DECLARE_RATE_INFO (2 ),IWL_DECLARE_RATE_INFO (5 ),
@@ -166,7 +166,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,/* Legacy rate format, search for match in table */ if (band !=NL80211_BAND_2GHZ ) band_offset =IWL_FIRST_OFDM_RATE ; -for (idx = band_offset; idx <IWL_RATE_COUNT_LEGACY ; idx++) +for (idx = band_offset; idx <IWL_RATE_INDEX_COUNT_LEGACY ; idx++)if (fw_rate_idx_to_plcp[idx] == rate)return idx - band_offset;
Signature · 1 line
2.32.0
Quoted 4 lines · William Batista
A FIXME requested to eventaully rename
IWL_RATE_COUNTtoIWL_RATE_INDEX_COUNT, as it's a more appropriate name.Signed-off-by William Batista <[email protected]>
This address does not match your "From:" address :(
Quoted 1 line
drivers/net/wireless/intel/iwlwifi/dvm/lib.c | 2 +-
<snip>
These files have nothing to do with me.
Perhaps you should get experience with working with the files in drivers/staging/* first, before trying to work on other portions of the kernel that are more strict with their development rules.
good luck!
greg k-h