Browse Source

qcacmn: Allow STA in LPI mode if AP ctry US and advertises LPI

The existing logic is if STA and AP have different ctry code,
and STA is in ETSI, then it operates in VLP mode irrespective
of AP ctry.
New logic would be if AP ctry is US and if it advertises LPI
power type in HE ops IE via beacon, then STA can advance to
LPI mode.

Change-Id: Ifbee7052854277c3d21ccd21b65b79edb5e89f46
CRs-Fixed: 3084589
Gururaj Pandurangi 3 năm trước cách đây
mục cha
commit
4e553bab35

+ 8 - 1
umac/regulatory/core/src/reg_utils.c

@@ -330,7 +330,8 @@ QDF_STATUS
 reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
 			       uint8_t *ap_ctry, uint8_t *sta_ctry,
 			       enum reg_6g_ap_type *pwr_type_6g,
-			       bool *ctry_code_match)
+			       bool *ctry_code_match,
+			       enum reg_6g_ap_type ap_pwr_type)
 {
 	*pwr_type_6g = REG_INDOOR_AP;
 
@@ -356,6 +357,12 @@ reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
 				  sta_ctry[0], sta_ctry[1]);
 			*pwr_type_6g = REG_VERY_LOW_POWER_AP;
 		}
+
+		if (wlan_reg_is_us(ap_ctry) && ap_pwr_type == REG_INDOOR_AP) {
+			reg_debug("AP ctry:%c%c, AP power type:%d, allow STA IN LPI",
+				  ap_ctry[0], ap_ctry[1], ap_pwr_type);
+			*pwr_type_6g = REG_INDOOR_AP;
+		}
 	} else {
 		*ctry_code_match = true;
 	}

+ 3 - 2
umac/regulatory/core/src/reg_utils.h

@@ -251,14 +251,15 @@ QDF_STATUS reg_get_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
  * @sta_ctry: ptr to sta programmed country
  * @pwr_type_6g: ptr to 6G power type
  * @ctry_code_match: Check for country IE and sta country code match
- *
+ * @ap_pwr_type: AP's power type as advertised in HE ops IE
  * Return: QDF_STATUS
  */
 QDF_STATUS
 reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
 			       uint8_t *ap_ctry, uint8_t *sta_ctry,
 			       enum reg_6g_ap_type *pwr_type_6g,
-			       bool *ctry_code_match);
+			       bool *ctry_code_match,
+			       enum reg_6g_ap_type ap_pwr_type);
 #endif
 
 /**

+ 3 - 2
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -480,14 +480,15 @@ QDF_STATUS wlan_reg_read_current_country(struct wlan_objmgr_psoc *psoc,
  * @sta_ctry: ptr to sta programmed country
  * @pwr_type_6g: ptr to 6G power type
  * @ctry_code_match: Check for country IE and sta country code match
- *
+ * @ap_pwr_type: AP's power type for 6G as advertised in HE ops IE
  * Return: QDF_STATUS
  */
 QDF_STATUS
 wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
 				    uint8_t *ap_ctry, uint8_t *sta_ctry,
 				    enum reg_6g_ap_type *pwr_type_6g,
-				    bool *ctry_code_match);
+				    bool *ctry_code_match,
+				    enum reg_6g_ap_type ap_pwr_type);
 #endif
 
 #ifdef CONFIG_CHAN_FREQ_API

+ 4 - 2
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -90,10 +90,12 @@ QDF_STATUS
 wlan_reg_get_6g_power_type_for_ctry(struct wlan_objmgr_psoc *psoc,
 				    uint8_t *ap_ctry, uint8_t *sta_ctry,
 				    enum reg_6g_ap_type *pwr_type_6g,
-				    bool *ctry_code_match)
+				    bool *ctry_code_match,
+				    enum reg_6g_ap_type ap_pwr_type)
 {
 	return reg_get_6g_power_type_for_ctry(psoc, ap_ctry, sta_ctry,
-					      pwr_type_6g, ctry_code_match);
+					      pwr_type_6g, ctry_code_match,
+					      ap_pwr_type);
 }
 #endif