소스 검색

qcacmn: Add china_op_class table to the regulatory component

As per IEEE 802.11 2016 specification Annex E Table E-5, add a new
operating class table for China.

Change-Id: I60d610d637c64df497c7c363a893b8f7efdc8a6c
CRs-Fixed: 2656789
Hariharan Basuthkar 5 년 전
부모
커밋
2905d1d38f
2개의 변경된 파일41개의 추가작업 그리고 5개의 파일을 삭제
  1. 38 4
      umac/regulatory/core/src/reg_opclass.c
  2. 3 1
      umac/regulatory/dispatcher/inc/reg_services_public_struct.h

+ 38 - 4
umac/regulatory/core/src/reg_opclass.c

@@ -254,6 +254,35 @@ static const struct reg_dmn_op_class_map_t japan_op_class[] = {
 	{0, 0, 0, 0, 0, {0} },
 };
 
+static const struct reg_dmn_op_class_map_t china_op_class[] = {
+	{7, 25, BW20, BIT(BEHAV_NONE), 2407,
+	 {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} },
+	{8, 40, BW40_LOW_PRIMARY, BIT(BEHAV_BW40_LOW_PRIMARY), 2407,
+	 {1, 2, 3, 4, 5, 6, 7, 8, 9} },
+	{9, 40, BW40_HIGH_PRIMARY, BIT(BEHAV_BW40_HIGH_PRIMARY), 2407,
+	 {5, 6, 7, 8, 9, 10, 11, 12, 13} },
+	{1, 20, BW20, BIT(BEHAV_NONE), 5000,
+	 {36, 40, 44, 48} },
+	{4, 40, BW40_LOW_PRIMARY, BIT(BEHAV_BW40_LOW_PRIMARY), 5000,
+	 {36, 44} },
+	{117, 40, BW40_HIGH_PRIMARY, BIT(BEHAV_BW40_HIGH_PRIMARY), 5000,
+	 {40, 48} },
+	{2, 20, BW20, BIT(BEHAV_NONE), 5000,
+	 {52, 56, 60, 64} },
+	{5, 40, BW40_LOW_PRIMARY, BIT(BEHAV_BW40_LOW_PRIMARY), 5000,
+	 {52, 60} },
+	{3, 20, BW20, BIT(BEHAV_NONE), 5000,
+	 {149, 153, 157, 161, 165} },
+	{6, 40, BW40_LOW_PRIMARY, BIT(BEHAV_BW40_LOW_PRIMARY), 5000,
+	 {149, 157} },
+	{128, 80, BW80, BIT(BEHAV_NONE), 5000,
+	 {36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161} },
+	{129, 160, BW80, BIT(BEHAV_NONE), 5000,
+	 {36, 40, 44, 48, 52, 56, 60, 64,} },
+	{130, 80, BW80, BIT(BEHAV_BW80_PLUS), 5000,
+	 {36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161} },
+	{0, 0, 0, 0, 0, {0} },
+};
 #ifdef HOST_OPCLASS
 /**
  * reg_get_class_from_country()- Get Class from country
@@ -285,6 +314,9 @@ static const struct reg_dmn_op_class_map_t
 		class = global_op_class;
 		break;
 
+	case OP_CLASS_CHINA:
+		class = china_op_class;
+		break;
 	default:
 		if (!qdf_mem_cmp(country, "US", 2))
 			class = us_op_class;
@@ -292,6 +324,8 @@ static const struct reg_dmn_op_class_map_t
 			class = euro_op_class;
 		else if (!qdf_mem_cmp(country, "JP", 2))
 			class = japan_op_class;
+		else if (!qdf_mem_cmp(country, "CN", 2))
+			class = china_op_class;
 		else
 			class = global_op_class;
 	}
@@ -529,7 +563,7 @@ void reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
 		else if (channel_map == channel_map_eu)
 			op_class_tbl = euro_op_class;
 		else if (channel_map == channel_map_china)
-			op_class_tbl = us_op_class;
+			op_class_tbl = china_op_class;
 		else if (channel_map == channel_map_jp)
 			op_class_tbl = japan_op_class;
 		else
@@ -636,7 +670,7 @@ uint16_t reg_get_op_class_width(struct wlan_objmgr_pdev *pdev,
 		else if (channel_map == channel_map_eu)
 			op_class_tbl = euro_op_class;
 		else if (channel_map == channel_map_china)
-			op_class_tbl = us_op_class;
+			op_class_tbl = china_op_class;
 		else if (channel_map == channel_map_jp)
 			op_class_tbl = japan_op_class;
 		else
@@ -669,7 +703,7 @@ uint16_t reg_chan_opclass_to_freq(uint8_t chan,
 		} else if (channel_map == channel_map_eu) {
 			op_class_tbl = euro_op_class;
 		} else if (channel_map == channel_map_china) {
-			op_class_tbl = us_op_class;
+			op_class_tbl = china_op_class;
 		} else if (channel_map == channel_map_jp) {
 			op_class_tbl = japan_op_class;
 		} else {
@@ -764,7 +798,7 @@ reg_get_op_class_tbl_by_chan_map(const struct
 	else if (channel_map == channel_map_eu)
 		*op_class_tbl = euro_op_class;
 	else if (channel_map == channel_map_china)
-		*op_class_tbl = us_op_class;
+		*op_class_tbl = china_op_class;
 	else if (channel_map == channel_map_jp)
 		*op_class_tbl = japan_op_class;
 	else

+ 3 - 1
umac/regulatory/dispatcher/inc/reg_services_public_struct.h

@@ -101,12 +101,14 @@ enum dfs_reg {
  * OP_CLASS_EU- Class corresponds to EU
  * OP_CLASS_JAPAN- Class corresponds to JAPAN
  * OP_CLASS_GLOBAL- Class corresponds to GLOBAL
+ * OP_CLASS_CHINA- Class corresponds to CHINA
  */
 enum op_class_table_num {
 	OP_CLASS_US = 1,
 	OP_CLASS_EU,
 	OP_CLASS_JAPAN,
-	OP_CLASS_GLOBAL
+	OP_CLASS_GLOBAL,
+	OP_CLASS_CHINA
 };
 
 /**