mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
qcacld-3.0: Refine the passpoint set/reset logic
Make the following updates to the passpoint set/reset logic: 1) Exclusively use the Unified WMI data structures. 2) Refactor the vendor command processing to improve code maintainability. Change-Id: I39945b2cec90c3f34c81e5ca525842f1af9340f7 CRs-Fixed: 2334234
This commit is contained in:
parent
93fbc1527d
commit
2a7f101484
7 changed files with 214 additions and 297 deletions
|
|
@ -3949,109 +3949,125 @@ int wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define PARAM_ID QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID
|
||||
#define PARAM_REALM QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM
|
||||
#define PARAM_ROAM_ID \
|
||||
QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID
|
||||
#define PARAM_ROAM_PLMN \
|
||||
QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN
|
||||
|
||||
/**
|
||||
* hdd_extscan_passpoint_fill_network_list() - passpoint fill network list
|
||||
* @hddctx: HDD context
|
||||
* @req_msg: request message
|
||||
* @tb: vendor attribute table
|
||||
* hdd_extscan_passpoint_fill_network() - passpoint fill single network
|
||||
* @network: aggregate network attribute
|
||||
* @nw: passpoint network record to be filled
|
||||
*
|
||||
* This function reads the network block NL vendor attributes from %tb and
|
||||
* fill in the passpoint request message.
|
||||
* This function takes a single network block NL vendor attribute from
|
||||
* @network and decodes it into the internal record @nw.
|
||||
*
|
||||
* Return: 0 on success, error number otherwise
|
||||
*/
|
||||
static int hdd_extscan_passpoint_fill_network_list(
|
||||
struct hdd_context *hddctx,
|
||||
struct wifi_passpoint_req *req_msg,
|
||||
struct nlattr **tb)
|
||||
static int
|
||||
hdd_extscan_passpoint_fill_network(struct nlattr *network,
|
||||
struct wifi_passpoint_network_param *nw)
|
||||
{
|
||||
struct nlattr *network[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
|
||||
struct nlattr *networks;
|
||||
int rem1;
|
||||
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
|
||||
int id;
|
||||
size_t len;
|
||||
uint8_t index;
|
||||
|
||||
if (!network) {
|
||||
hdd_err("attr network attr failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_cfg80211_nla_parse(tb, QCA_WLAN_VENDOR_ATTR_PNO_MAX,
|
||||
nla_data(network),
|
||||
nla_len(network),
|
||||
wlan_hdd_pno_config_policy)) {
|
||||
hdd_err("nla_parse failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Parse and fetch identifier */
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ID;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr passpoint id failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nw->id = nla_get_u32(tb[id]);
|
||||
hdd_debug("Id %u", nw->id);
|
||||
|
||||
/* Parse and fetch realm */
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_REALM;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr realm failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
len = nla_strlcpy(nw->realm, tb[id],
|
||||
WMI_PASSPOINT_REALM_LEN);
|
||||
/* Don't send partial realm to firmware */
|
||||
if (len >= WMI_PASSPOINT_REALM_LEN) {
|
||||
hdd_err("user passed invalid realm, len:%zu", len);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_debug("realm: %s", nw->realm);
|
||||
|
||||
/* Parse and fetch roaming consortium ids */
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_CNSRTM_ID;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr roaming consortium ids failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nla_memcpy(&nw->roaming_consortium_ids, tb[id],
|
||||
sizeof(nw->roaming_consortium_ids));
|
||||
hdd_debug("roaming consortium ids");
|
||||
|
||||
/* Parse and fetch plmn */
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_NETWORK_PARAM_ROAM_PLMN;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr plmn failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nla_memcpy(&nw->plmn, tb[id],
|
||||
WMI_PASSPOINT_PLMN_LEN);
|
||||
hdd_debug("plmn %02x:%02x:%02x)",
|
||||
nw->plmn[0],
|
||||
nw->plmn[1],
|
||||
nw->plmn[2]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_extscan_passpoint_fill_networks() - passpoint fill network list
|
||||
* @req_msg: request message
|
||||
* @networks: aggregate network list attribute
|
||||
*
|
||||
* This function reads the network block NL vendor attributes from
|
||||
* @networks and fills in the passpoint request message.
|
||||
*
|
||||
* Return: 0 on success, error number otherwise
|
||||
*/
|
||||
static int
|
||||
hdd_extscan_passpoint_fill_networks(struct wifi_passpoint_req_param *req_msg,
|
||||
struct nlattr *networks)
|
||||
{
|
||||
struct nlattr *network;
|
||||
int rem;
|
||||
uint32_t index;
|
||||
uint32_t expected_networks;
|
||||
struct wifi_passpoint_network_param *nw;
|
||||
|
||||
if (!networks) {
|
||||
hdd_err("attr networks list failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
expected_networks = req_msg->num_networks;
|
||||
index = 0;
|
||||
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY]) {
|
||||
hdd_err("attr network array failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nla_for_each_nested(networks,
|
||||
tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY],
|
||||
rem1) {
|
||||
|
||||
nla_for_each_nested(network, networks, rem) {
|
||||
if (index == expected_networks) {
|
||||
hdd_warn("ignoring excess networks");
|
||||
break;
|
||||
}
|
||||
|
||||
if (wlan_cfg80211_nla_parse(network,
|
||||
QCA_WLAN_VENDOR_ATTR_PNO_MAX,
|
||||
nla_data(networks),
|
||||
nla_len(networks),
|
||||
wlan_hdd_pno_config_policy)) {
|
||||
hdd_err("nla_parse failed");
|
||||
nw = &req_msg->networks[index++];
|
||||
if (hdd_extscan_passpoint_fill_network(network, nw))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Parse and fetch identifier */
|
||||
if (!network[PARAM_ID]) {
|
||||
hdd_err("attr passpoint id failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
req_msg->networks[index].id = nla_get_u32(network[PARAM_ID]);
|
||||
hdd_debug("Id %u", req_msg->networks[index].id);
|
||||
|
||||
/* Parse and fetch realm */
|
||||
if (!network[PARAM_REALM]) {
|
||||
hdd_err("attr realm failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
len = nla_strlcpy(req_msg->networks[index].realm,
|
||||
network[PARAM_REALM],
|
||||
SIR_PASSPOINT_REALM_LEN);
|
||||
/* Don't send partial realm to firmware */
|
||||
if (len >= SIR_PASSPOINT_REALM_LEN) {
|
||||
hdd_err("user passed invalid realm, len:%zu", len);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_debug("realm: %s", req_msg->networks[index].realm);
|
||||
|
||||
/* Parse and fetch roaming consortium ids */
|
||||
if (!network[PARAM_ROAM_ID]) {
|
||||
hdd_err("attr roaming consortium ids failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nla_memcpy(&req_msg->networks[index].roaming_consortium_ids,
|
||||
network[PARAM_ROAM_ID],
|
||||
sizeof(req_msg->networks[0].roaming_consortium_ids));
|
||||
hdd_debug("roaming consortium ids");
|
||||
|
||||
/* Parse and fetch plmn */
|
||||
if (!network[PARAM_ROAM_PLMN]) {
|
||||
hdd_err("attr plmn failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
nla_memcpy(&req_msg->networks[index].plmn,
|
||||
network[PARAM_ROAM_PLMN],
|
||||
SIR_PASSPOINT_PLMN_LEN);
|
||||
hdd_debug("plmn %02x:%02x:%02x)",
|
||||
req_msg->networks[index].plmn[0],
|
||||
req_msg->networks[index].plmn[1],
|
||||
req_msg->networks[index].plmn[2]);
|
||||
|
||||
index++;
|
||||
}
|
||||
req_msg->num_networks = index;
|
||||
return 0;
|
||||
|
|
@ -4074,14 +4090,15 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
|
|||
const void *data,
|
||||
int data_len)
|
||||
{
|
||||
struct wifi_passpoint_req *req_msg = NULL;
|
||||
struct net_device *dev = wdev->netdev;
|
||||
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
struct wifi_passpoint_req_param *req_msg;
|
||||
struct net_device *dev = wdev->netdev;
|
||||
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
|
||||
struct nlattr *networks;
|
||||
uint32_t num_networks;
|
||||
QDF_STATUS status;
|
||||
uint32_t num_networks = 0;
|
||||
int ret;
|
||||
int id, ret;
|
||||
|
||||
hdd_enter_dev(dev);
|
||||
|
||||
|
|
@ -4101,12 +4118,12 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
/* Parse and fetch number of networks */
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM]) {
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr num networks failed");
|
||||
return -EINVAL;
|
||||
}
|
||||
num_networks = nla_get_u32(
|
||||
tb[QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NUM]);
|
||||
num_networks = nla_get_u32(tb[id]);
|
||||
if (num_networks > SIR_PASSPOINT_LIST_MAX_NETWORKS) {
|
||||
hdd_err("num networks %u exceeds max %u",
|
||||
num_networks, SIR_PASSPOINT_LIST_MAX_NETWORKS);
|
||||
|
|
@ -4124,18 +4141,20 @@ static int __wlan_hdd_cfg80211_set_passpoint_list(struct wiphy *wiphy,
|
|||
req_msg->num_networks = num_networks;
|
||||
|
||||
/* Parse and fetch request Id */
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
|
||||
id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr request id failed");
|
||||
goto fail;
|
||||
}
|
||||
req_msg->request_id = nla_get_u32(
|
||||
tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
|
||||
req_msg->request_id = nla_get_u32(tb[id]);
|
||||
|
||||
req_msg->session_id = adapter->session_id;
|
||||
hdd_debug("Req Id %u Session Id %d", req_msg->request_id,
|
||||
req_msg->session_id);
|
||||
req_msg->vdev_id = adapter->session_id;
|
||||
hdd_debug("Req Id %u Vdev Id %d",
|
||||
req_msg->request_id, req_msg->vdev_id);
|
||||
|
||||
if (hdd_extscan_passpoint_fill_network_list(hdd_ctx, req_msg, tb))
|
||||
id = QCA_WLAN_VENDOR_ATTR_PNO_PASSPOINT_LIST_PARAM_NETWORK_ARRAY;
|
||||
networks = tb[id];
|
||||
if (hdd_extscan_passpoint_fill_networks(req_msg, networks))
|
||||
goto fail;
|
||||
|
||||
status = sme_set_passpoint_list(hdd_ctx->mac_handle, req_msg);
|
||||
|
|
@ -4196,13 +4215,13 @@ static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
|
|||
const void *data,
|
||||
int data_len)
|
||||
{
|
||||
struct wifi_passpoint_req *req_msg = NULL;
|
||||
struct net_device *dev = wdev->netdev;
|
||||
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
struct wifi_passpoint_req_param *req_msg;
|
||||
struct net_device *dev = wdev->netdev;
|
||||
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
||||
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
|
||||
QDF_STATUS status;
|
||||
int ret;
|
||||
int id, ret;
|
||||
|
||||
hdd_enter_dev(dev);
|
||||
|
||||
|
|
@ -4228,16 +4247,16 @@ static int __wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
/* Parse and fetch request Id */
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
|
||||
id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID;
|
||||
if (!tb[id]) {
|
||||
hdd_err("attr request id failed");
|
||||
goto fail;
|
||||
}
|
||||
req_msg->request_id = nla_get_u32(
|
||||
tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
|
||||
req_msg->request_id = nla_get_u32(tb[id]);
|
||||
|
||||
req_msg->session_id = adapter->session_id;
|
||||
hdd_debug("Req Id %u Session Id %d",
|
||||
req_msg->request_id, req_msg->session_id);
|
||||
req_msg->vdev_id = adapter->session_id;
|
||||
hdd_debug("Req Id %u Vdev Id %d",
|
||||
req_msg->request_id, req_msg->vdev_id);
|
||||
|
||||
status = sme_reset_passpoint_list(hdd_ctx->mac_handle, req_msg);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
|
|
|
|||
|
|
@ -4211,35 +4211,6 @@ typedef struct {
|
|||
#define MAX_EPNO_NETWORKS 64
|
||||
|
||||
#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
|
||||
#define SIR_PASSPOINT_REALM_LEN 256
|
||||
#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16
|
||||
#define SIR_PASSPOINT_PLMN_LEN 3
|
||||
/**
|
||||
* struct wifi_passpoint_network - passpoint network block
|
||||
* @id: identifier of this network block
|
||||
* @realm: null terminated UTF8 encoded realm, 0 if unspecified
|
||||
* @roaming_consortium_ids: roaming consortium ids to match, 0s if unspecified
|
||||
* @plmn: mcc/mnc combination as per rules, 0s if unspecified
|
||||
*/
|
||||
struct wifi_passpoint_network {
|
||||
uint32_t id;
|
||||
uint8_t realm[SIR_PASSPOINT_REALM_LEN];
|
||||
int64_t roaming_consortium_ids[SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM];
|
||||
uint8_t plmn[SIR_PASSPOINT_PLMN_LEN];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wifi_passpoint_req - passpoint request
|
||||
* @request_id: request identifier
|
||||
* @num_networks: number of networks
|
||||
* @networks: passpoint networks
|
||||
*/
|
||||
struct wifi_passpoint_req {
|
||||
uint32_t request_id;
|
||||
uint32_t session_id;
|
||||
uint32_t num_networks;
|
||||
struct wifi_passpoint_network networks[];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wifi_passpoint_match - wifi passpoint network match
|
||||
|
|
|
|||
|
|
@ -1093,10 +1093,28 @@ sme_get_cached_results(mac_handle_t mac_handle,
|
|||
QDF_STATUS sme_set_epno_list(mac_handle_t mac_handle,
|
||||
struct wifi_enhanced_pno_params *params);
|
||||
|
||||
QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
|
||||
struct wifi_passpoint_req *req_msg);
|
||||
QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,
|
||||
struct wifi_passpoint_req *req_msg);
|
||||
/**
|
||||
* sme_set_passpoint_list() - set passpoint network list
|
||||
* @mac_handle: Opaque handle to the MAC context
|
||||
* @params: set passpoint list request parameters
|
||||
*
|
||||
* This function constructs the cds message and fill in message type,
|
||||
* bodyptr with @params and posts it to WDA queue.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS sme_set_passpoint_list(mac_handle_t mac_handle,
|
||||
struct wifi_passpoint_req_param *params);
|
||||
|
||||
/**
|
||||
* sme_reset_passpoint_list() - reset passpoint network list
|
||||
* @mac_handle: Opaque handle to the MAC context
|
||||
* @params: reset passpoint list request parameters
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS sme_reset_passpoint_list(mac_handle_t mac_handle,
|
||||
struct wifi_passpoint_req_param *params);
|
||||
|
||||
QDF_STATUS sme_ext_scan_register_callback(mac_handle_t mac_handle,
|
||||
ext_scan_ind_cb ext_scan_ind_cb);
|
||||
|
|
|
|||
|
|
@ -11392,48 +11392,23 @@ QDF_STATUS sme_set_epno_list(mac_handle_t mac_handle,
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_set_passpoint_list() - set passpoint network list
|
||||
* @hal: global hal handle
|
||||
* @input: request message
|
||||
*
|
||||
* This function constructs the cds message and fill in message type,
|
||||
* bodyptr with @input and posts it to WDA queue.
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
|
||||
struct wifi_passpoint_req *input)
|
||||
QDF_STATUS sme_set_passpoint_list(mac_handle_t mac_handle,
|
||||
struct wifi_passpoint_req_param *params)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
tpAniSirGlobal mac = PMAC_STRUCT(hal);
|
||||
QDF_STATUS status;
|
||||
tpAniSirGlobal mac = MAC_CONTEXT(mac_handle);
|
||||
struct scheduler_msg message = {0};
|
||||
struct wifi_passpoint_req *req_msg;
|
||||
int len, i;
|
||||
struct wifi_passpoint_req_param *req_msg;
|
||||
int len;
|
||||
|
||||
SME_ENTER();
|
||||
|
||||
len = sizeof(*req_msg) +
|
||||
(input->num_networks * sizeof(struct wifi_passpoint_network));
|
||||
(params->num_networks * sizeof(params->networks[0]));
|
||||
req_msg = qdf_mem_malloc(len);
|
||||
if (!req_msg)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
req_msg->num_networks = input->num_networks;
|
||||
req_msg->request_id = input->request_id;
|
||||
req_msg->session_id = input->session_id;
|
||||
for (i = 0; i < req_msg->num_networks; i++) {
|
||||
req_msg->networks[i].id =
|
||||
input->networks[i].id;
|
||||
qdf_mem_copy(req_msg->networks[i].realm,
|
||||
input->networks[i].realm,
|
||||
strlen(input->networks[i].realm) + 1);
|
||||
qdf_mem_copy(req_msg->networks[i].plmn,
|
||||
input->networks[i].plmn,
|
||||
SIR_PASSPOINT_PLMN_LEN);
|
||||
qdf_mem_copy(req_msg->networks[i].roaming_consortium_ids,
|
||||
input->networks[i].roaming_consortium_ids,
|
||||
sizeof(req_msg->networks[i].roaming_consortium_ids));
|
||||
}
|
||||
qdf_mem_copy(req_msg, params, len);
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
|
|
@ -11453,34 +11428,25 @@ QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
|
|||
sme_err("scheduler_post_msg failed!(err=%d)",
|
||||
status);
|
||||
qdf_mem_free(req_msg);
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sme_release_global_lock(&mac->sme);
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_reset_passpoint_list() - reset passpoint network list
|
||||
* @hHal: global hal handle
|
||||
* @input: request message
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,
|
||||
struct wifi_passpoint_req *input)
|
||||
QDF_STATUS sme_reset_passpoint_list(mac_handle_t mac_handle,
|
||||
struct wifi_passpoint_req_param *params)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
tpAniSirGlobal mac = PMAC_STRUCT(hal);
|
||||
QDF_STATUS status;
|
||||
tpAniSirGlobal mac = MAC_CONTEXT(mac_handle);
|
||||
struct scheduler_msg message = {0};
|
||||
struct wifi_passpoint_req *req_msg;
|
||||
struct wifi_passpoint_req_param *req_msg;
|
||||
|
||||
SME_ENTER();
|
||||
|
||||
req_msg = qdf_mem_malloc(sizeof(*req_msg));
|
||||
if (!req_msg)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
req_msg->request_id = input->request_id;
|
||||
req_msg->session_id = input->session_id;
|
||||
*req_msg = *params;
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
|
|
@ -11500,7 +11466,6 @@ QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,
|
|||
sme_err("scheduler_post_msg failed!(err=%d)",
|
||||
status);
|
||||
qdf_mem_free(req_msg);
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
sme_release_global_lock(&mac->sme);
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -451,11 +451,32 @@ wma_extscan_get_capabilities(tp_wma_handle wma,
|
|||
QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
|
||||
struct wifi_enhanced_pno_params *req);
|
||||
|
||||
QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req *req);
|
||||
/**
|
||||
* wma_set_passpoint_network_list() - set passpoint network list
|
||||
* @wma: WMA handle
|
||||
* @params: passpoint network request structure
|
||||
*
|
||||
* This function sends the passpoint configs down to the firmware
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS
|
||||
wma_set_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req_param *params);
|
||||
|
||||
QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req *req);
|
||||
/**
|
||||
* wma_reset_passpoint_network_list() - reset passpoint network list
|
||||
* @wma: WMA handle
|
||||
* @params: passpoint network request structure
|
||||
*
|
||||
* This function sends down WMI command with network id set to wildcard id.
|
||||
* firmware shall clear all the config entries
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS
|
||||
wma_reset_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req_param *params);
|
||||
#endif
|
||||
|
||||
QDF_STATUS wma_scan_probe_setoui(tp_wma_handle wma, tSirScanMacOui *psetoui);
|
||||
|
|
|
|||
|
|
@ -8228,16 +8228,13 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
|
|||
/* Issue reset passpoint network list first and clear
|
||||
* the entries
|
||||
*/
|
||||
wma_reset_passpoint_network_list(wma_handle,
|
||||
(struct wifi_passpoint_req *)msg->bodyptr);
|
||||
wma_reset_passpoint_network_list(wma_handle, msg->bodyptr);
|
||||
|
||||
wma_set_passpoint_network_list(wma_handle,
|
||||
(struct wifi_passpoint_req *)msg->bodyptr);
|
||||
wma_set_passpoint_network_list(wma_handle, msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
case WMA_RESET_PASSPOINT_LIST_REQ:
|
||||
wma_reset_passpoint_network_list(wma_handle,
|
||||
(struct wifi_passpoint_req *)msg->bodyptr);
|
||||
wma_reset_passpoint_network_list(wma_handle, msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
#endif /* FEATURE_WLAN_EXTSCAN */
|
||||
|
|
|
|||
|
|
@ -4766,124 +4766,50 @@ QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_set_passpoint_network_list() - set passpoint network list
|
||||
* @handle: WMA handle
|
||||
* @req: passpoint network request structure
|
||||
*
|
||||
* This function reads the incoming @req and fill in the destination
|
||||
* WMI structure and send down the passpoint configs down to the firmware
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req *req)
|
||||
QDF_STATUS
|
||||
wma_set_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req_param *params)
|
||||
{
|
||||
struct wifi_passpoint_req_param *params;
|
||||
int i = 0;
|
||||
QDF_STATUS status;
|
||||
size_t params_len;
|
||||
|
||||
WMA_LOGD("wma_set_passpoint_network_list");
|
||||
wma_debug("Enter");
|
||||
|
||||
if (!wma || !wma->wmi_handle) {
|
||||
WMA_LOGE("%s: WMA is closed, can not issue cmd", __func__);
|
||||
wma_err("WMA is closed, can not issue cmd");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
if (!wmi_service_enabled(wma->wmi_handle,
|
||||
wmi_service_extscan)) {
|
||||
WMA_LOGE("%s: extscan not enabled", __func__);
|
||||
if (!wmi_service_enabled(wma->wmi_handle, wmi_service_extscan)) {
|
||||
wma_err("extscan not enabled");
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
params_len = sizeof(*params) + (req->num_networks *
|
||||
sizeof(struct wifi_passpoint_network_param));
|
||||
params = qdf_mem_malloc(params_len);
|
||||
if (!params)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
params->request_id = req->request_id;
|
||||
params->vdev_id = req->session_id;
|
||||
params->num_networks = req->num_networks;
|
||||
for (i = 0; i < req->num_networks; i++) {
|
||||
params->networks[i].id = req->networks[i].id;
|
||||
qdf_mem_copy(params->networks[i].realm, req->networks[i].realm,
|
||||
WMI_PASSPOINT_REALM_LEN);
|
||||
qdf_mem_copy(params->networks[i].roaming_consortium_ids,
|
||||
req->networks[i].roaming_consortium_ids,
|
||||
WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM *
|
||||
sizeof(int64_t));
|
||||
qdf_mem_copy(params->networks[i].plmn, req->networks[i].plmn,
|
||||
WMI_PASSPOINT_PLMN_LEN);
|
||||
}
|
||||
|
||||
status = wmi_unified_set_passpoint_network_list_cmd(wma->wmi_handle,
|
||||
params);
|
||||
qdf_mem_free(params);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return status;
|
||||
|
||||
WMA_LOGD("Set passpoint network list request is sent successfully for vdev %d",
|
||||
req->session_id);
|
||||
params);
|
||||
wma_debug("Exit, vdev %d, status %d", params->vdev_id, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_reset_passpoint_network_list() - reset passpoint network list
|
||||
* @handle: WMA handle
|
||||
* @req: passpoint network request structure
|
||||
*
|
||||
* This function sends down WMI command with network id set to wildcard id.
|
||||
* firmware shall clear all the config entries
|
||||
*
|
||||
* Return: QDF_STATUS enumeration
|
||||
*/
|
||||
QDF_STATUS wma_reset_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req *req)
|
||||
QDF_STATUS
|
||||
wma_reset_passpoint_network_list(tp_wma_handle wma,
|
||||
struct wifi_passpoint_req_param *params)
|
||||
{
|
||||
struct wifi_passpoint_req_param *params;
|
||||
int i = 0;
|
||||
QDF_STATUS status;
|
||||
size_t params_len;
|
||||
|
||||
WMA_LOGD("wma_reset_passpoint_network_list");
|
||||
wma_debug("Enter");
|
||||
|
||||
if (!wma || !wma->wmi_handle) {
|
||||
WMA_LOGE("%s: WMA is closed, can not issue cmd", __func__);
|
||||
wma_err("WMA is closed, can not issue cmd");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
if (!wmi_service_enabled(wma->wmi_handle,
|
||||
wmi_service_extscan)) {
|
||||
WMA_LOGE("%s: extscan not enabled", __func__);
|
||||
if (!wmi_service_enabled(wma->wmi_handle, wmi_service_extscan)) {
|
||||
wma_err("extscan not enabled");
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
params_len = sizeof(*params) + (req->num_networks *
|
||||
sizeof(struct wifi_passpoint_network_param));
|
||||
params = qdf_mem_malloc(params_len);
|
||||
if (!params)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
params->request_id = req->request_id;
|
||||
params->vdev_id = req->session_id;
|
||||
params->num_networks = req->num_networks;
|
||||
for (i = 0; i < req->num_networks; i++) {
|
||||
params->networks[i].id = req->networks[i].id;
|
||||
qdf_mem_copy(params->networks[i].realm, req->networks[i].realm,
|
||||
WMI_PASSPOINT_REALM_LEN);
|
||||
qdf_mem_copy(params->networks[i].roaming_consortium_ids,
|
||||
req->networks[i].roaming_consortium_ids,
|
||||
WMI_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM *
|
||||
sizeof(int64_t));
|
||||
qdf_mem_copy(params->networks[i].plmn, req->networks[i].plmn,
|
||||
WMI_PASSPOINT_PLMN_LEN);
|
||||
}
|
||||
|
||||
status = wmi_unified_reset_passpoint_network_list_cmd(wma->wmi_handle,
|
||||
params);
|
||||
qdf_mem_free(params);
|
||||
params);
|
||||
wma_debug("Exit, vdev %d, status %d", params->vdev_id, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue