qcacld-3.0: Add support for STA+GO and CLI+GO for liberal mode
Currently in liberal mode STA+GO and CLI+GO scenario is not handled, so when sta is there and Go tries to come up then GO should follow STA or CLI's channel in case of force scc but as handling is not there so Go doesn't consider scc channel. Fix is to add handling of STA+GO and CLI+GO for liberal mode. Change-Id: I227fb0661c5c3a41b296fd0c954ac87675f28ed6 CRs-Fixed: 3048501
This commit is contained in:

committed by
Madan Koyyalamudi

parent
7117cb3c42
commit
898339bbbc
@@ -840,15 +840,16 @@ static void wlansap_update_vendor_acs_chan(struct mac_context *mac_ctx,
|
||||
|
||||
#ifdef WLAN_FEATURE_P2P_P2P_STA
|
||||
/**
|
||||
* sap_check_and_process_forcescc_for_other_go() - find if other p2p go is there
|
||||
* and needs to be moved to current p2p go's channel.
|
||||
* sap_check_and_process_forcescc_for_go_plus_go() - find if other p2p
|
||||
* go is there and needs to be moved to current p2p go's channel.
|
||||
*
|
||||
* @cur_sap_ctx: current sap context
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
sap_check_and_process_forcescc_for_other_go(struct sap_context *cur_sap_ctx)
|
||||
sap_check_and_process_forcescc_for_go_plus_go(
|
||||
struct sap_context *cur_sap_ctx)
|
||||
{
|
||||
struct sap_context *sap_ctx;
|
||||
struct mac_context *mac_ctx;
|
||||
@@ -871,15 +872,67 @@ sap_check_and_process_forcescc_for_other_go(struct sap_context *cur_sap_ctx)
|
||||
policy_mgr_process_forcescc_for_go(
|
||||
mac_ctx->psoc, sap_ctx->sessionId,
|
||||
cur_sap_ctx->chan_freq,
|
||||
cur_sap_ctx->ch_params.ch_width);
|
||||
cur_sap_ctx->ch_params.ch_width,
|
||||
PM_P2P_GO_MODE);
|
||||
sap_ctx->is_forcescc_restart_required = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
/**
|
||||
* sap_check_and_process_go_force_scc() - find if other p2p
|
||||
* go/cli/sta is there and needs force scc.
|
||||
*
|
||||
* @cur_sap_ctx: current sap context
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static void
|
||||
sap_check_and_process_forcescc_for_other_go(struct sap_context *cur_sap_ctx)
|
||||
sap_check_and_process_go_force_ssc(struct sap_context *sap_ctx)
|
||||
{
|
||||
struct mac_context *mac_ctx;
|
||||
uint32_t con_freq;
|
||||
enum phy_ch_width ch_width;
|
||||
enum policy_mgr_con_mode existing_vdev_mode = PM_MAX_NUM_OF_MODE;
|
||||
|
||||
mac_ctx = sap_get_mac_context();
|
||||
if (!mac_ctx) {
|
||||
sap_err("Invalid MAC context");
|
||||
return;
|
||||
}
|
||||
if (sap_ctx->vdev->vdev_mlme.vdev_opmode ==
|
||||
QDF_P2P_GO_MODE &&
|
||||
wlan_vdev_get_peer_count(sap_ctx->vdev) == 2 &&
|
||||
policy_mgr_mode_specific_connection_count(
|
||||
mac_ctx->psoc, PM_P2P_GO_MODE, NULL) > 1) {
|
||||
sap_check_and_process_forcescc_for_go_plus_go(sap_ctx);
|
||||
return;
|
||||
}
|
||||
policy_mgr_fetch_existing_con_info(mac_ctx->psoc, sap_ctx->sessionId,
|
||||
sap_ctx->chan_freq,
|
||||
&existing_vdev_mode,
|
||||
&con_freq, &ch_width);
|
||||
|
||||
if (sap_ctx->vdev->vdev_mlme.vdev_opmode == QDF_P2P_GO_MODE &&
|
||||
policy_mgr_go_scc_enforced(mac_ctx->psoc) &&
|
||||
!policy_mgr_is_go_scc_strict(mac_ctx->psoc) &&
|
||||
wlan_vdev_get_peer_count(sap_ctx->vdev) == 2 &&
|
||||
(existing_vdev_mode == PM_P2P_CLIENT_MODE ||
|
||||
existing_vdev_mode == PM_STA_MODE)){
|
||||
policy_mgr_process_forcescc_for_go(mac_ctx->psoc,
|
||||
sap_ctx->sessionId,
|
||||
con_freq, ch_width,
|
||||
existing_vdev_mode);
|
||||
}
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
sap_check_and_process_forcescc_for_go_plus_go(
|
||||
struct sap_context *cur_sap_ctx)
|
||||
{}
|
||||
static inline void
|
||||
sap_check_and_process_go_force_ssc(struct sap_context *cur_sap_ctx)
|
||||
{}
|
||||
#endif
|
||||
|
||||
@@ -1194,20 +1247,12 @@ QDF_STATUS wlansap_roam_callback(void *ctx,
|
||||
sap_signal_hdd_event(sap_ctx, csr_roam_info,
|
||||
eSAP_STA_SET_KEY_EVENT,
|
||||
(void *) eSAP_STATUS_SUCCESS);
|
||||
|
||||
/*
|
||||
* After set key if this is the first peer connecting to new GO
|
||||
* then check for peer count (which is self peer + peer count)
|
||||
* and take decision for GO+GO force SCC
|
||||
* and take decision for GO+GO, STA+GO and CLI+GO force SCC
|
||||
*/
|
||||
if (sap_ctx->vdev->vdev_mlme.vdev_opmode ==
|
||||
QDF_P2P_GO_MODE &&
|
||||
wlan_vdev_get_peer_count(sap_ctx->vdev) == 2 &&
|
||||
policy_mgr_mode_specific_connection_count(
|
||||
mac_ctx->psoc, PM_P2P_GO_MODE,
|
||||
NULL) > 1)
|
||||
sap_check_and_process_forcescc_for_other_go(
|
||||
sap_ctx);
|
||||
sap_check_and_process_go_force_ssc(sap_ctx);
|
||||
}
|
||||
break;
|
||||
case eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED:
|
||||
|
@@ -828,9 +828,64 @@ static void sap_set_forcescc_required(uint8_t vdev_id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sap_process_liberal_scc_for_go - based on existing connections this
|
||||
* function decides current go should start on provided channel or not and
|
||||
* sets force scc required bit for existing GO.
|
||||
*
|
||||
* sap_context: sap_context
|
||||
*
|
||||
* Return: bool
|
||||
*/
|
||||
static bool sap_process_liberal_scc_for_go(struct sap_context *sap_context)
|
||||
{
|
||||
uint8_t existing_vdev_id = WLAN_UMAC_VDEV_ID_MAX;
|
||||
enum policy_mgr_con_mode existing_vdev_mode = PM_MAX_NUM_OF_MODE;
|
||||
uint32_t con_freq;
|
||||
enum phy_ch_width ch_width;
|
||||
struct mac_context *mac_ctx;
|
||||
mac_handle_t mac_handle;
|
||||
|
||||
mac_handle = cds_get_context(QDF_MODULE_ID_SME);
|
||||
mac_ctx = MAC_CONTEXT(mac_handle);
|
||||
if (!mac_ctx) {
|
||||
sap_alert("invalid MAC handle");
|
||||
return true;
|
||||
}
|
||||
|
||||
existing_vdev_id =
|
||||
policy_mgr_fetch_existing_con_info(
|
||||
mac_ctx->psoc,
|
||||
sap_context->sessionId,
|
||||
sap_context->chan_freq,
|
||||
&existing_vdev_mode,
|
||||
&con_freq, &ch_width);
|
||||
|
||||
if (existing_vdev_id <
|
||||
WLAN_UMAC_VDEV_ID_MAX &&
|
||||
existing_vdev_mode == PM_P2P_GO_MODE) {
|
||||
sap_debug("set forcescc flag for go vdev: %d",
|
||||
existing_vdev_id);
|
||||
sap_set_forcescc_required(
|
||||
existing_vdev_id);
|
||||
return true;
|
||||
}
|
||||
if (existing_vdev_id < WLAN_UMAC_VDEV_ID_MAX &&
|
||||
(existing_vdev_mode == PM_STA_MODE ||
|
||||
existing_vdev_mode == PM_P2P_CLIENT_MODE)) {
|
||||
sap_debug("don't override channel, start go on %d",
|
||||
sap_context->chan_freq);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
static void sap_set_forcescc_required(uint8_t vdev_id)
|
||||
{}
|
||||
static bool sap_process_liberal_scc_for_go(struct sap_context *sap_context)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS
|
||||
@@ -849,7 +904,7 @@ sap_validate_chan(struct sap_context *sap_context,
|
||||
bool go_force_scc;
|
||||
struct ch_params ch_params;
|
||||
bool is_go_scc_strict = false;
|
||||
uint8_t first_p2p_go_vdev_id = WLAN_UMAC_VDEV_ID_MAX;
|
||||
bool start_sap_on_provided_freq = false;
|
||||
|
||||
mac_handle = cds_get_context(QDF_MODULE_ID_SME);
|
||||
mac_ctx = MAC_CONTEXT(mac_handle);
|
||||
@@ -868,35 +923,32 @@ sap_validate_chan(struct sap_context *sap_context,
|
||||
sap_context->vdev->vdev_mlme.vdev_opmode == QDF_P2P_GO_MODE) {
|
||||
/*
|
||||
* check whether go_force_scc is enabled or not.
|
||||
* If it not enabled then don't any force scc on existing and new
|
||||
* p2p go vdevs.
|
||||
* If it not enabled then don't any force scc on existing go and
|
||||
* new p2p go vdevs.
|
||||
* Otherwise, if it is enabled then check whether it's in strict
|
||||
* mode or liberal mode.
|
||||
* For strict mode, do force scc on newly p2p go to existing p2p
|
||||
* go channel.
|
||||
* For liberal mode, first form new p2p go on requested channel.
|
||||
* Once set key is done, do force scc on existing p2p go to new
|
||||
* p2p go channel.
|
||||
* For strict mode, do force scc on newly p2p go to existing vdev
|
||||
* channel.
|
||||
* For liberal first form new p2p go on requested channel and
|
||||
* follow below rules:
|
||||
* a.) If Existing vdev mode is P2P GO Once set key is done, do
|
||||
* force scc for existing p2p go and move that go to new p2p
|
||||
* go's channel.
|
||||
*
|
||||
* b.) If Existing vdev mode is P2P CLI/STA Once set key is
|
||||
* done, do force scc for p2p go and move go to cli/sta channel.
|
||||
*/
|
||||
go_force_scc = policy_mgr_go_scc_enforced(mac_ctx->psoc);
|
||||
sap_debug("go force scc value %d", go_force_scc);
|
||||
sap_debug("go force scc enabled %d", go_force_scc);
|
||||
if (go_force_scc) {
|
||||
is_go_scc_strict =
|
||||
policy_mgr_is_go_scc_strict(mac_ctx->psoc);
|
||||
if (!is_go_scc_strict) {
|
||||
sap_debug("liberal mode is enabled");
|
||||
first_p2p_go_vdev_id =
|
||||
policy_mgr_check_forcescc_for_other_go(
|
||||
mac_ctx->psoc,
|
||||
sap_context->sessionId,
|
||||
sap_context->chan_freq);
|
||||
|
||||
if (first_p2p_go_vdev_id <
|
||||
WLAN_UMAC_VDEV_ID_MAX) {
|
||||
sap_set_forcescc_required(
|
||||
first_p2p_go_vdev_id);
|
||||
start_sap_on_provided_freq =
|
||||
sap_process_liberal_scc_for_go(sap_context);
|
||||
if (start_sap_on_provided_freq)
|
||||
goto validation_done;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
goto validation_done;
|
||||
|
Reference in New Issue
Block a user