Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19bb468f authored by Ananya Barat's avatar Ananya Barat Committed by nshrivas
Browse files

qcacmn: Populate the correct opclass for 6G channels

For the 6G band, the only valid opclass_table is the global_op_class
as per the current specification. Therefore, if the band is 6G set the
opclass to global_op_class instead of the default us_op_class.

As per specification for chan width 40 MHz, there is no behav limit
for both Low Primary and High Primary channels. Hence, set behav limit
as BIT(BEHAV_NONE) if channel width is 40 MHz.

Change-Id: I534f5b898e10cf21042a117aa71e824a85d73fb3
CRs-Fixed: 2608059
parent 107961d9
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -433,6 +433,30 @@ uint16_t reg_dmn_get_curr_opclasses(uint8_t *num_classes, uint8_t *class)
}

#ifdef CONFIG_CHAN_FREQ_API
void reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
					  qdf_freq_t freq,
					  uint16_t chan_width,
					  bool global_tbl_lookup,
					  uint16_t behav_limit,
					  uint8_t *op_class,
					  uint8_t *chan_num)
{
	if (reg_freq_to_band(freq) == REG_BAND_6G) {
		global_tbl_lookup = true;
		if (chan_width == BW_40_MHZ)
			behav_limit = BIT(BEHAV_NONE);
	} else {
		global_tbl_lookup = false;
	}

	reg_freq_width_to_chan_op_class(pdev, freq,
					chan_width,
					global_tbl_lookup,
					behav_limit,
					op_class,
					chan_num);
}

void reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
				     qdf_freq_t freq,
				     uint16_t chan_width,
+32 −0
Original line number Diff line number Diff line
@@ -127,6 +127,28 @@ void reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
				     uint8_t *op_class,
				     uint8_t *chan_num);

/**
 * reg_freq_width_to_chan_op_class_auto() - convert frequency to operating
 * class,channel after fixing up the global_tbl_lookup and behav_limit
 * for 6G frequencies.
 * @pdev: pdev pointer
 * @freq: channel frequency in mhz
 * @chan_width: channel width
 * @global_tbl_lookup: whether to lookup global op class tbl
 * @behav_limit: behavior limit
 * @op_class: operating class
 * @chan_num: channel number
 *
 * Return: Void.
 */
void reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
					  qdf_freq_t freq,
					  uint16_t chan_width,
					  bool global_tbl_lookup,
					  uint16_t behav_limit,
					  uint8_t *op_class,
					  uint8_t *chan_num);

/**
 * reg_freq_to_chan_op_class() - convert frequency to oper class,
 *                                   channel
@@ -271,6 +293,16 @@ reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
{
}

static inline void
reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
				     qdf_freq_t freq,
				     bool global_tbl_lookup,
				     uint16_t behav_limit,
				     uint8_t *op_class,
				     uint8_t *chan_num)
{
}

static inline void
reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
			  qdf_freq_t freq,
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@

#define BW_80_MHZ     80
#define BW_160_MHZ    160
#define BW_40_MHZ     40

/**
 * enum dfs_reg - DFS region
+21 −0
Original line number Diff line number Diff line
@@ -1153,6 +1153,27 @@ void wlan_reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
					  uint8_t *op_class,
					  uint8_t *chan_num);

/**
 * wlan_reg_freq_width_to_chan_op_class_auto() - convert frequency to
 * operating class,channel
 * @pdev: pdev pointer
 * @freq: channel frequency in mhz
 * @chan_width: channel width
 * @global_tbl_lookup: whether to lookup global op class tbl
 * @behav_limit: behavior limit
 * @op_class: operating class
 * @chan_num: channel number
 *
 * Return: Void.
 */
void wlan_reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
					       qdf_freq_t freq,
					       uint16_t chan_width,
					       bool global_tbl_lookup,
					       uint16_t behav_limit,
					       uint8_t *op_class,
					       uint8_t *chan_num);

/**
 * wlan_reg_freq_to_chan_and_op_class() - Converts freq to oper class
 * @pdev: pdev ptr
+15 −0
Original line number Diff line number Diff line
@@ -995,6 +995,21 @@ void wlan_reg_freq_width_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
					       chan_num);
}

void wlan_reg_freq_width_to_chan_op_class_auto(struct wlan_objmgr_pdev *pdev,
					       qdf_freq_t freq,
					       uint16_t chan_width,
					       bool global_tbl_lookup,
					       uint16_t behav_limit,
					       uint8_t *op_class,
					       uint8_t *chan_num)
{
	reg_freq_width_to_chan_op_class_auto(pdev, freq, chan_width,
					     global_tbl_lookup,
					     behav_limit,
					     op_class,
					     chan_num);
}

void wlan_reg_freq_to_chan_op_class(struct wlan_objmgr_pdev *pdev,
				    qdf_freq_t freq,
				    bool global_tbl_lookup,