Bläddra i källkod

qcacmn: Return center channel for 6G opclass 132

For a 6G radio, the API reg_get_channels_from_opclassmap currently
returns the 20 MHz IEEE channel numbers for the 40MHz 6G operating class
(132). As per the IEEE802.11 specification it should return the channel
center frequency index for the operating class 132.

To fix this issue, modify reg_get_chan_or_chan_center to return channel
center frequency index for 6G 40 MHz operating class 132.

For non-6G 40MHz channels the primary channel frequency is returned
as center. For 6G, however, the center of the entire 40Mhz band is
returned. Therefore, handle opclass 132 ( 6G band 40MHz channels)
as a special case for 40Mhz bandwidth.

Change-Id: I02f2fce418519a3e020d9b87d5ec401a73ad5ce8
CRs-Fixed: 3101303
Hariharan Basuthkar 3 år sedan
förälder
incheckning
d01c9ce923

+ 7 - 0
umac/regulatory/core/src/reg_opclass.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1470,6 +1471,12 @@ static uint8_t reg_get_chan_or_chan_center(const struct
 				    idx,
 				    NUM_20_MHZ_CHAN_IN_160_MHZ_CHAN,
 				    &center_chan);
+	} else if ((op_class_tbl->op_class == BW_40_MHZ) &&
+		   (op_class_tbl->op_class == OPCLS_132)) {
+		reg_get_channel_cen(op_class_tbl,
+				    idx,
+				    NUM_20_MHZ_CHAN_IN_40_MHZ_CHAN,
+				    &center_chan);
 	} else {
 		center_chan = op_class_tbl->channels[*idx];
 		*idx = *idx + 1;

+ 3 - 1
umac/regulatory/core/src/reg_opclass.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- *
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -29,6 +29,8 @@
 #include <wlan_reg_afc.h>
 #endif
 
+#define OPCLS_132 132
+
 #ifdef HOST_OPCLASS
 /**
  * reg_dmn_get_chanwidth_from_opclass() - Get channel width from opclass.

+ 2 - 1
umac/regulatory/core/src/reg_services_common.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -36,6 +36,7 @@
 #define FREQ_TO_CHAN_SCALE     5
 /* The distance between the 80Mhz center and the nearest 20Mhz channel */
 #define NEAREST_20MHZ_CHAN_FREQ_OFFSET     10
+#define NUM_20_MHZ_CHAN_IN_40_MHZ_CHAN     2
 #define NUM_20_MHZ_CHAN_IN_80_MHZ_CHAN     4
 #define NUM_20_MHZ_CHAN_IN_160_MHZ_CHAN    8