Bläddra i källkod

qcacld-3.0: HDD: Add support for 2.4Ghz HT40 STA

- Add support for 2.4Ghz HT40 STA.
- Add HT40 OBSS scan start and stop operation.
- Add support for extraction of OBSS scan paramters from beacon
  and probe response

Change-Id: Idc69d4d17271864c1d3bc2c6e16f25eae73331b0
CRs-Fixed: 947086
Sandeep Puligilla 9 år sedan
förälder
incheckning
93a29ecadd
3 ändrade filer med 93 tillägg och 16 borttagningar
  1. 26 0
      core/hdd/inc/wlan_hdd_cfg.h
  2. 29 0
      core/hdd/src/wlan_hdd_cfg.c
  3. 38 16
      core/hdd/src/wlan_hdd_wext.c

+ 26 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -2871,6 +2871,29 @@ enum dot11p_mode {
 #define CFG_INFORM_BSS_RSSI_RAW_MAX                (1)
 #define CFG_INFORM_BSS_RSSI_RAW_DEFAULT            (1)
 
+
+/*
+ * OBSS scan parameters
+ * obss_active_dwelltime - minimum per channel scan duration in active scan
+ * obss_passive_dwelltime - minimum per channel scan duration in passive scan
+ * obss_width_trigger_interval - During an OBSS scan operation, each channel
+ *  in the set is scanned at least once per configured trigger interval time.
+ */
+#define CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_NAME    "obss_active_dwelltime"
+#define CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_MIN     (5)
+#define CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_MAX     (1000)
+#define CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_DEFAULT (10)
+
+#define CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_NAME   "obss_passive_dwelltime"
+#define CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_MIN    (10)
+#define CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_MAX    (1000)
+#define CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_DEFAULT (20)
+
+#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_NAME "obss_width_trigger_interval"
+#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MIN  (10)
+#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MAX  (900)
+#define CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_DEFAULT (200)
+
 #ifdef QCA_WIFI_3_0_EMU
 /*
  * On M2M emulation platform we have a fixed mapping between macs, hence
@@ -3498,6 +3521,9 @@ struct hdd_config {
 #ifdef FEATURE_LFR_SUBNET_DETECTION
 	bool enable_lfr_subnet_detection;
 #endif
+	uint16_t obss_active_dwelltime;
+	uint16_t obss_passive_dwelltime;
+	uint16_t obss_width_trigger_interval;
 	uint8_t inform_bss_rssi_raw;
 #ifdef QCA_WIFI_3_0_EMU
 	bool enable_m2m_limitation;

+ 29 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -3657,6 +3657,29 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		     CFG_ENABLE_LFR_SUBNET_MIN,
 		     CFG_ENABLE_LFR_SUBNET_MAX),
 #endif
+	REG_VARIABLE(CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_NAME,
+		WLAN_PARAM_Integer,
+		struct hdd_config, obss_active_dwelltime,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_DEFAULT,
+		CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_MIN,
+		CFG_OBSS_HT40_SCAN_ACTIVE_DWELL_TIME_MAX),
+
+	REG_VARIABLE(CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_NAME,
+		WLAN_PARAM_Integer,
+		struct hdd_config, obss_passive_dwelltime,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_DEFAULT,
+		CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_MIN,
+		CFG_OBSS_HT40_SCAN_PASSIVE_DWELL_TIME_MAX),
+
+	REG_VARIABLE(CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_NAME,
+		WLAN_PARAM_Integer,
+		struct hdd_config, obss_width_trigger_interval,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_DEFAULT,
+		CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MIN,
+		CFG_OBSS_HT40_SCAN_WIDTH_TRIGGER_INTERVAL_MAX),
 
 	REG_VARIABLE(CFG_INFORM_BSS_RSSI_RAW_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, inform_bss_rssi_raw,
@@ -6714,6 +6737,12 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 			pHddCtx->config->roam_dense_min_aps;
 	smeConfig->csrConfig.roam_dense_traffic_thresh =
 			pHddCtx->config->roam_dense_traffic_thresh;
+	smeConfig->csrConfig.obss_width_interval =
+			pHddCtx->config->obss_width_trigger_interval;
+	smeConfig->csrConfig.obss_active_dwelltime =
+			pHddCtx->config->obss_active_dwelltime;
+	smeConfig->csrConfig.obss_passive_dwelltime =
+			pHddCtx->config->obss_passive_dwelltime;
 
 	status = sme_update_config(pHddCtx->hHal, smeConfig);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {

+ 38 - 16
core/hdd/src/wlan_hdd_wext.c

@@ -328,7 +328,8 @@ static const hdd_freq_chan_map_t freq_chan_map[] = {
 #define WE_DUMP_PCIE_LOG           16
 #endif
 #define WE_GET_RECOVERY_STAT       17
-#define WE_GET_FW_PROFILE_DATA        18
+#define WE_GET_FW_PROFILE_DATA     18
+#define WE_STOP_OBSS_SCAN          19
 
 /* Private ioctls and their sub-ioctls */
 #define WLAN_PRIV_SET_VAR_INT_GET_NONE   (SIOCIWFIRSTPRIV + 7)
@@ -7423,14 +7424,14 @@ static int __iw_setnone_getnone(struct net_device *dev,
 				struct iw_request_info *info,
 				union iwreq_data *wrqu, char *extra)
 {
-	hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+	hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	hdd_context_t *hdd_ctx;
 	int ret;
 	int sub_cmd;
 
 	ENTER_DEV(dev);
 
-	hdd_ctx = WLAN_HDD_GET_CTX(pAdapter);
+	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	ret = wlan_hdd_validate_context(hdd_ctx);
 	if (0 != ret)
 		return ret;
@@ -7458,25 +7459,25 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	switch (sub_cmd) {
 	case WE_GET_RECOVERY_STAT:
 	{
-		tHalHandle hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+		tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
 		sme_get_recovery_stats(hal);
 		break;
 	}
 
 	case WE_GET_FW_PROFILE_DATA:
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 				WMI_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
 				0, DBG_CMD);
 		break;
 
 	case WE_SET_REASSOC_TRIGGER:
 	{
-		hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
-		tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter);
+		hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+		tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(adapter);
 		uint32_t roamId = 0;
 		tCsrRoamModifyProfileFields modProfileFields;
 		hdd_station_ctx_t *hdd_sta_ctx =
-				   WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+				   WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
 		/* Reassoc to same AP, only supported for Open Security*/
 		if ((hdd_sta_ctx->conn_info.ucEncryptionType ||
@@ -7486,9 +7487,9 @@ static int __iw_setnone_getnone(struct net_device *dev,
 			return -ENOTSUPP;
 		}
 
-		sme_get_modify_profile_fields(hHal, pAdapter->sessionId,
+		sme_get_modify_profile_fields(hHal, adapter->sessionId,
 					      &modProfileFields);
-		sme_roam_reassoc(hHal, pAdapter->sessionId,
+		sme_roam_reassoc(hHal, adapter->sessionId,
 				 NULL, modProfileFields, &roamId, 1);
 		return 0;
 	}
@@ -7496,7 +7497,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_AGC_START:
 	{
 		hddLog(LOG1, "WE_DUMP_AGC_START");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_AGC_START,
 					  0, GEN_CMD);
 		break;
@@ -7504,7 +7505,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_AGC:
 	{
 		hddLog(LOG1, "WE_DUMP_AGC");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_AGC,
 					  0, GEN_CMD);
 		break;
@@ -7513,7 +7514,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_CHANINFO_START:
 	{
 		hddLog(LOG1, "WE_DUMP_CHANINFO_START");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_CHANINFO_START,
 					  0, GEN_CMD);
 		break;
@@ -7521,7 +7522,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_CHANINFO:
 	{
 		hddLog(LOG1, "WE_DUMP_CHANINFO_START");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_CHANINFO,
 					  0, GEN_CMD);
 		break;
@@ -7529,7 +7530,7 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_WATCHDOG:
 	{
 		hddLog(LOG1, "WE_DUMP_WATCHDOG");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_WATCHDOG,
 					  0, GEN_CMD);
 		break;
@@ -7538,12 +7539,29 @@ static int __iw_setnone_getnone(struct net_device *dev,
 	case WE_DUMP_PCIE_LOG:
 	{
 		hddLog(LOGE, "WE_DUMP_PCIE_LOG");
-		ret = wma_cli_set_command(pAdapter->sessionId,
+		ret = wma_cli_set_command(adapter->sessionId,
 					  GEN_PARAM_DUMP_PCIE_ACCESS_LOG,
 					  0, GEN_CMD);
 		break;
 	}
 #endif
+	case WE_STOP_OBSS_SCAN:
+	{
+		/*
+		 * 1.OBSS Scan is mandatory while operating in 2.4GHz
+		 * 2.OBSS scan is stopped by Firmware during the disassociation
+		 * 3.OBSS stop comamnd is added for debugging purpose
+		 */
+		tHalHandle hal;
+
+		hal = WLAN_HDD_GET_HAL_CTX(adapter);
+		if (hal == NULL) {
+			hdd_err("hal context is NULL");
+			return -EINVAL;
+		}
+		sme_ht40_stop_obss_scan(hal, adapter->sessionId);
+	}
+	break;
 	default:
 	{
 		hddLog(LOGE, "%s: unknown ioctl %d", __func__, sub_cmd);
@@ -10473,6 +10491,10 @@ static const struct iw_priv_args we_private_args[] = {
 	 0,
 	 "dump_pcie_log"},
 #endif
+	{WE_STOP_OBSS_SCAN,
+	 0,
+	 0,
+	 "stop_obss_scan"},
 	/* handlers for main ioctl */
 	{WLAN_PRIV_SET_VAR_INT_GET_NONE,
 	 IW_PRIV_TYPE_INT | MAX_VAR_ARGS,