From 81b813ed2fde96fd28cee477281b724ea4a28dcc Mon Sep 17 00:00:00 2001 From: Ping-Ke Shih Date: Mon, 29 Jan 2018 11:26:36 +0800 Subject: [PATCH] rtlwifi: Add rate section and its related definition and comment Add comments to make it to be easier to understand, and add compile time assertions. Signed-off-by: Ping-Ke Shih Acked-by: Larry Finger Signed-off-by: Kalle Valo --- drivers/net/wireless/realtek/rtlwifi/base.c | 3 +++ drivers/net/wireless/realtek/rtlwifi/wifi.h | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c index c000c85a3ded..6db3389e2ced 100644 --- a/drivers/net/wireless/realtek/rtlwifi/base.c +++ b/drivers/net/wireless/realtek/rtlwifi/base.c @@ -2647,6 +2647,9 @@ EXPORT_SYMBOL_GPL(rtl_global_var); static int __init rtl_core_module_init(void) { BUILD_BUG_ON(TX_PWR_BY_RATE_NUM_RATE < TX_PWR_BY_RATE_NUM_SECTION); + BUILD_BUG_ON(MAX_RATE_SECTION_NUM != MAX_RATE_SECTION); + BUILD_BUG_ON(MAX_BASE_NUM_IN_PHY_REG_PG_24G != MAX_RATE_SECTION); + BUILD_BUG_ON(MAX_BASE_NUM_IN_PHY_REG_PG_5G != (MAX_RATE_SECTION - 1)); if (rtl_rate_control_register()) pr_err("rtl: Unable to register rtl_rc, use default RC !!\n"); diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 29c1289ad6b2..8dba4d9952be 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -164,7 +164,7 @@ enum rtl8192c_h2c_cmd { #define MAX_TX_COUNT 4 #define MAX_REGULATION_NUM 4 #define MAX_RF_PATH_NUM 4 -#define MAX_RATE_SECTION_NUM 6 +#define MAX_RATE_SECTION_NUM 6 /* = MAX_RATE_SECTION */ #define MAX_2_4G_BANDWIDTH_NUM 4 #define MAX_5G_BANDWIDTH_NUM 4 #define MAX_RF_PATH 4 @@ -175,8 +175,8 @@ enum rtl8192c_h2c_cmd { #define TX_PWR_BY_RATE_NUM_RF 4 #define TX_PWR_BY_RATE_NUM_SECTION 12 #define TX_PWR_BY_RATE_NUM_RATE 84 /* >= TX_PWR_BY_RATE_NUM_SECTION */ -#define MAX_BASE_NUM_IN_PHY_REG_PG_24G 6 -#define MAX_BASE_NUM_IN_PHY_REG_PG_5G 5 +#define MAX_BASE_NUM_IN_PHY_REG_PG_24G 6 /* MAX_RATE_SECTION */ +#define MAX_BASE_NUM_IN_PHY_REG_PG_5G 5 /* MAX_RATE_SECTION -1 */ #define BUFDESC_SEG_NUM 1 /* 0:2 seg, 1: 4 seg, 2: 8 seg */ @@ -272,6 +272,7 @@ enum rate_section { HT_MCS8_MCS15, VHT_1SSMCS0_1SSMCS9, VHT_2SSMCS0_2SSMCS9, + MAX_RATE_SECTION, }; enum intf_type {