|
@@ -8196,6 +8196,96 @@ static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
|
|
|
ucfg_ipa_send_mcc_scc_msg(hdd_ctx->hdd_pdev, hdd_ctx->mcc_mode);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * hdd_get_safe_channel() - Get safe channel from current regulatory
|
|
|
+ * @hdd_ctx: pointer to hdd context
|
|
|
+ * @adapter: pointer to softap adapter
|
|
|
+ *
|
|
|
+ * This function is used to get safe channel from current regulatory valid
|
|
|
+ * channels to restart SAP if failed to get safe channel from PCL.
|
|
|
+ *
|
|
|
+ * Return: Channel number to restart SAP in case of success. In case of any
|
|
|
+ * failure, the channel number returned is zero.
|
|
|
+ */
|
|
|
+static uint8_t
|
|
|
+hdd_get_safe_channel(struct hdd_context *hdd_ctx,
|
|
|
+ struct hdd_adapter *adapter)
|
|
|
+{
|
|
|
+ struct sir_pcl_list pcl = {0};
|
|
|
+ uint32_t i, j;
|
|
|
+ bool found = false;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ /* Try for safe channel from all valid channel */
|
|
|
+ pcl.pcl_len = MAX_NUM_CHAN;
|
|
|
+ ret = hdd_get_valid_chan(hdd_ctx, pcl.pcl_list,
|
|
|
+ &pcl.pcl_len);
|
|
|
+ if (ret) {
|
|
|
+ hdd_err("error %d in getting valid channel list", ret);
|
|
|
+ return INVALID_CHANNEL_ID;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (i = 0; i < pcl.pcl_len; i++) {
|
|
|
+ hdd_debug("chan[%d]:%d", i, pcl.pcl_list[i]);
|
|
|
+ found = false;
|
|
|
+ for (j = 0; j < hdd_ctx->unsafe_channel_count; j++) {
|
|
|
+ if (pcl.pcl_list[i] ==
|
|
|
+ hdd_ctx->unsafe_channel_list[j]) {
|
|
|
+ hdd_debug("unsafe chan:%d", pcl.pcl_list[i]);
|
|
|
+ found = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (found)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if ((pcl.pcl_list[i] >=
|
|
|
+ adapter->session.ap.sap_config.acs_cfg.start_ch) &&
|
|
|
+ (pcl.pcl_list[i] <=
|
|
|
+ adapter->session.ap.sap_config.acs_cfg.end_ch)) {
|
|
|
+ hdd_debug("found safe chan:%d", pcl.pcl_list[i]);
|
|
|
+ return pcl.pcl_list[i];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return INVALID_CHANNEL_ID;
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+/**
|
|
|
+ * hdd_set_thermal_level_cb() - set thermal level callback function
|
|
|
+ * @hdd_handle: opaque handle for the hdd context
|
|
|
+ * @level: thermal level
|
|
|
+ *
|
|
|
+ * Change IPA data path to SW path when the thermal throttle level greater
|
|
|
+ * than 0, and restore the original data path when throttle level is 0
|
|
|
+ *
|
|
|
+ * Return: none
|
|
|
+ */
|
|
|
+static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
|
|
|
+{
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hdd_get_safe_channel() - Get safe channel from current regulatory
|
|
|
+ * @hdd_ctx: pointer to hdd context
|
|
|
+ * @adapter: pointer to softap adapter
|
|
|
+ *
|
|
|
+ * This function is used to get safe channel from current regulatory valid
|
|
|
+ * channels to restart SAP if failed to get safe channel from PCL.
|
|
|
+ *
|
|
|
+ * Return: Channel number to restart SAP in case of success. In case of any
|
|
|
+ * failure, the channel number returned is zero.
|
|
|
+ */
|
|
|
+static uint8_t
|
|
|
+hdd_get_safe_channel(struct hdd_context *hdd_ctx,
|
|
|
+ struct hdd_adapter *adapter)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
/**
|
|
|
* hdd_get_safe_channel_from_pcl_and_acs_range() - Get safe channel for SAP
|
|
|
* restart
|
|
@@ -8208,16 +8298,14 @@ static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
|
|
|
* Return: Channel number to restart SAP in case of success. In case of any
|
|
|
* failure, the channel number returned is zero.
|
|
|
*/
|
|
|
-static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range(
|
|
|
- struct hdd_adapter *adapter)
|
|
|
+static uint8_t
|
|
|
+hdd_get_safe_channel_from_pcl_and_acs_range(struct hdd_adapter *adapter)
|
|
|
{
|
|
|
struct sir_pcl_list pcl;
|
|
|
QDF_STATUS status;
|
|
|
- uint32_t i, j;
|
|
|
+ uint32_t i;
|
|
|
mac_handle_t mac_handle;
|
|
|
struct hdd_context *hdd_ctx;
|
|
|
- bool found = false;
|
|
|
- int ret;
|
|
|
|
|
|
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
if (!hdd_ctx) {
|
|
@@ -8266,42 +8354,8 @@ static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range(
|
|
|
|
|
|
hdd_debug("no safe channel from PCL found in ACS range");
|
|
|
|
|
|
- /* Try for safe channel from all valid channel */
|
|
|
- pcl.pcl_len = MAX_NUM_CHAN;
|
|
|
- ret = hdd_get_valid_chan(hdd_ctx, pcl.pcl_list,
|
|
|
- &pcl.pcl_len);
|
|
|
- if (ret) {
|
|
|
- hdd_err("error %d in getting valid channel list", ret);
|
|
|
- return INVALID_CHANNEL_ID;
|
|
|
- }
|
|
|
-
|
|
|
- for (i = 0; i < pcl.pcl_len; i++) {
|
|
|
- hdd_debug("chan[%d]:%d", i, pcl.pcl_list[i]);
|
|
|
- found = false;
|
|
|
- for (j = 0; j < hdd_ctx->unsafe_channel_count; j++) {
|
|
|
- if (pcl.pcl_list[i] ==
|
|
|
- hdd_ctx->unsafe_channel_list[j]) {
|
|
|
- hdd_debug("unsafe chan:%d", pcl.pcl_list[i]);
|
|
|
- found = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (found)
|
|
|
- continue;
|
|
|
-
|
|
|
- if ((pcl.pcl_list[i] >=
|
|
|
- adapter->session.ap.sap_config.acs_cfg.start_ch) &&
|
|
|
- (pcl.pcl_list[i] <=
|
|
|
- adapter->session.ap.sap_config.acs_cfg.end_ch)) {
|
|
|
- hdd_debug("found safe chan:%d", pcl.pcl_list[i]);
|
|
|
- return pcl.pcl_list[i];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return INVALID_CHANNEL_ID;
|
|
|
+ return hdd_get_safe_channel(hdd_ctx, adapter);
|
|
|
}
|
|
|
-#endif
|
|
|
|
|
|
/**
|
|
|
* hdd_switch_sap_channel() - Move SAP to the given channel
|
|
@@ -8456,8 +8510,6 @@ void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctxt)
|
|
|
* the ACS while restart.
|
|
|
*/
|
|
|
hdd_ctxt->acs_policy.acs_channel = AUTO_CHANNEL_SELECT;
|
|
|
- adapter->session.ap.sap_config.channel =
|
|
|
- AUTO_CHANNEL_SELECT;
|
|
|
hdd_debug("sending coex indication");
|
|
|
wlan_hdd_send_svc_nlink_msg(hdd_ctxt->radio_index,
|
|
|
WLAN_SVC_LTE_COEX_IND, NULL, 0);
|
|
@@ -8524,7 +8576,6 @@ static void hdd_lte_coex_restart_sap(struct hdd_adapter *adapter,
|
|
|
* the ACS while restart.
|
|
|
*/
|
|
|
hdd_ctx->acs_policy.acs_channel = AUTO_CHANNEL_SELECT;
|
|
|
- adapter->session.ap.sap_config.channel = AUTO_CHANNEL_SELECT;
|
|
|
|
|
|
hdd_debug("sending coex indication");
|
|
|
|
|
@@ -8593,10 +8644,6 @@ static void hdd_init_channel_avoidance(struct hdd_context *hdd_ctx)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-static void hdd_set_thermal_level_cb(hdd_handle_t hdd_handle, u_int8_t level)
|
|
|
-{
|
|
|
-}
|
|
|
-
|
|
|
static inline void hdd_lte_coex_restart_sap(struct hdd_adapter *adapter,
|
|
|
struct hdd_context *hdd_ctx)
|
|
|
{
|
|
@@ -14014,6 +14061,7 @@ void hdd_check_and_restart_sap_with_non_dfs_acs(void)
|
|
|
struct hdd_adapter *ap_adapter;
|
|
|
struct hdd_context *hdd_ctx;
|
|
|
struct cds_context *cds_ctx;
|
|
|
+ uint8_t restart_chan;
|
|
|
|
|
|
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
|
|
if (!hdd_ctx) {
|
|
@@ -14039,13 +14087,15 @@ void hdd_check_and_restart_sap_with_non_dfs_acs(void)
|
|
|
wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev,
|
|
|
ap_adapter->session.ap.operating_channel)) {
|
|
|
|
|
|
- hdd_warn("STA-AP Mode DFS not supported. Restart SAP with Non DFS ACS");
|
|
|
- ap_adapter->session.ap.sap_config.channel =
|
|
|
- AUTO_CHANNEL_SELECT;
|
|
|
- ap_adapter->session.ap.sap_config.
|
|
|
- acs_cfg.acs_mode = true;
|
|
|
+ hdd_warn("STA-AP Mode DFS not supported, Switch SAP channel to Non DFS");
|
|
|
+
|
|
|
+ restart_chan =
|
|
|
+ hdd_get_safe_channel_from_pcl_and_acs_range(ap_adapter);
|
|
|
+ if (!restart_chan ||
|
|
|
+ wlan_reg_is_dfs_ch(hdd_ctx->hdd_pdev, restart_chan))
|
|
|
+ restart_chan = SAP_DEFAULT_5GHZ_CHANNEL;
|
|
|
|
|
|
- hdd_restart_sap(ap_adapter);
|
|
|
+ hdd_switch_sap_channel(ap_adapter, restart_chan, true);
|
|
|
}
|
|
|
}
|
|
|
|