qcacld-3.0: Refine the extscan set epno logic

Make the following updates to the extscan set epno logic:
1) Exclusively use the Unified WMI data structures.
2) Refactor the vendor command processing to improve code
   maintainability.

Change-Id: I8179fd9b9acced01956232f113d656e0137231b5
CRs-Fixed: 2333537
This commit is contained in:
Jeff Johnson
2018-07-18 20:51:47 -07:00
committed by nshrivas
parent e48f34df00
commit 360135b8ea
7 changed files with 182 additions and 271 deletions

View File

@@ -3625,98 +3625,117 @@ int wlan_hdd_cfg80211_extscan_reset_significant_change(struct wiphy *wiphy,
/** /**
* hdd_extscan_epno_fill_network_list() - epno fill network list * hdd_extscan_epno_fill_network() - epno fill single network
* @hddctx: HDD context * @network: aggregate network attribute
* @req_msg: request message * @nw: epno network record to be filled
* @tb: vendor attribute table
* *
* This function reads the network block NL vendor attributes from %tb and * This function takes a single network block NL vendor attribute from
* fill in the epno request message. * @network and decodes it into the internal record @nw.
* *
* Return: 0 on success, error number otherwise * Return: 0 on success, error number otherwise
*/ */
static int hdd_extscan_epno_fill_network_list( static int
struct hdd_context *hddctx, hdd_extscan_epno_fill_network(struct nlattr *network,
struct wifi_epno_params *req_msg, struct wifi_epno_network_params *nw)
struct nlattr **tb)
{ {
struct nlattr *network[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1]; struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
struct nlattr *networks; int id, ssid_len;
int rem1, ssid_len; uint8_t *ssid;
uint8_t index, *ssid;
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 ssid */
id = QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID;
if (!tb[id]) {
hdd_err("attr network ssid failed");
return -EINVAL;
}
ssid_len = nla_len(tb[id]);
/* nla_parse will detect overflow but not underflow */
if (0 == ssid_len) {
hdd_err("zero ssid length");
return -EINVAL;
}
/* Decrement by 1, don't count null character */
ssid_len--;
nw->ssid.length = ssid_len;
hdd_debug("network ssid length %d", ssid_len);
ssid = nla_data(tb[id]);
qdf_mem_copy(nw->ssid.mac_ssid, ssid, ssid_len);
hdd_debug("Ssid (%.*s)", nw->ssid.length, nw->ssid.mac_ssid);
/* Parse and fetch epno flags */
id = QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS;
if (!tb[id]) {
hdd_err("attr epno flags failed");
return -EINVAL;
}
nw->flags = nla_get_u8(tb[id]);
hdd_debug("flags %u", nw->flags);
/* Parse and fetch auth bit */
id = QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT;
if (!tb[id]) {
hdd_err("attr auth bit failed");
return -EINVAL;
}
nw->auth_bit_field = nla_get_u8(tb[id]);
hdd_debug("auth bit %u", nw->auth_bit_field);
return 0;
}
/**
* hdd_extscan_epno_fill_network_list() - epno 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 epno request message @req_msg.
*
* Return: 0 on success, error number otherwise
*/
static int
hdd_extscan_epno_fill_network_list(struct wifi_enhanced_pno_params *req_msg,
struct nlattr *networks)
{
struct nlattr *network;
int rem;
uint32_t index;
uint32_t expected_networks; uint32_t expected_networks;
struct wifi_epno_network_params *nw;
if (!networks) {
hdd_err("attr networks list failed");
return -EINVAL;
}
expected_networks = req_msg->num_networks; expected_networks = req_msg->num_networks;
index = 0; index = 0;
if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST]) { nla_for_each_nested(network, networks, rem) {
hdd_err("attr networks list failed");
return -EINVAL;
}
nla_for_each_nested(networks,
tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST],
rem1) {
if (index == expected_networks) { if (index == expected_networks) {
hdd_warn("ignoring excess networks"); hdd_warn("ignoring excess networks");
break; break;
} }
if (wlan_cfg80211_nla_parse(network, nw = &req_msg->networks[index++];
QCA_WLAN_VENDOR_ATTR_PNO_MAX, if (hdd_extscan_epno_fill_network(network, nw))
nla_data(networks),
nla_len(networks),
wlan_hdd_pno_config_policy)) {
hdd_err("nla_parse failed");
return -EINVAL; return -EINVAL;
}
/* Parse and fetch ssid */
if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]) {
hdd_err("attr network ssid failed");
return -EINVAL;
}
ssid_len = nla_len(
network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]);
/* nla_parse will detect overflow but not underflow */
if (0 == ssid_len) {
hdd_err("zero ssid length");
return -EINVAL;
}
/* Decrement by 1, don't count null character */
ssid_len--;
req_msg->networks[index].ssid.length = ssid_len;
hdd_debug("network ssid length %d", ssid_len);
ssid = nla_data(network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_SSID]);
qdf_mem_copy(req_msg->networks[index].ssid.ssId,
ssid, ssid_len);
hdd_debug("Ssid (%.*s)",
req_msg->networks[index].ssid.length,
req_msg->networks[index].ssid.ssId);
/* Parse and fetch epno flags */
if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]) {
hdd_err("attr epno flags failed");
return -EINVAL;
}
req_msg->networks[index].flags = nla_get_u8(
network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_FLAGS]);
hdd_debug("flags %u", req_msg->networks[index].flags);
/* Parse and fetch auth bit */
if (!network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]) {
hdd_err("attr auth bit failed");
return -EINVAL;
}
req_msg->networks[index].auth_bit_field = nla_get_u8(
network[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORK_AUTH_BIT]);
hdd_debug("auth bit %u",
req_msg->networks[index].auth_bit_field);
index++;
} }
req_msg->num_networks = index; req_msg->num_networks = index;
return 0; return 0;
@@ -3729,8 +3748,8 @@ static int hdd_extscan_epno_fill_network_list(
* @data: data pointer * @data: data pointer
* @data_len: data length * @data_len: data length
* *
* This function reads the NL vendor attributes from %tb and * This function reads the NL vendor attributes from @data and
* fill in the epno request message. * fills in the epno request message.
* *
* Return: 0 on success, error number otherwise * Return: 0 on success, error number otherwise
*/ */
@@ -3739,15 +3758,15 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
const void *data, const void *data,
int data_len) int data_len)
{ {
struct wifi_epno_params *req_msg = NULL; struct wifi_enhanced_pno_params *req_msg;
struct net_device *dev = wdev->netdev; struct net_device *dev = wdev->netdev;
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = wiphy_priv(wiphy); struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
struct nlattr *tb[ struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1];
QCA_WLAN_VENDOR_ATTR_PNO_MAX + 1]; struct nlattr *networks;
QDF_STATUS status; QDF_STATUS status;
uint32_t num_networks, len; uint32_t num_networks, len;
int ret_val; int id, ret_val;
hdd_enter_dev(dev); hdd_enter_dev(dev);
@@ -3772,7 +3791,8 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
} }
/* Parse and fetch number of networks */ /* Parse and fetch number of networks */
if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]) { id = QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS;
if (!tb[id]) {
hdd_err("attr num networks failed"); hdd_err("attr num networks failed");
return -EINVAL; return -EINVAL;
} }
@@ -3781,8 +3801,7 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
* num_networks is also used as EPNO SET/RESET request. * num_networks is also used as EPNO SET/RESET request.
* if num_networks is zero then it is treated as RESET. * if num_networks is zero then it is treated as RESET.
*/ */
num_networks = nla_get_u32( num_networks = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_NUM_NETWORKS]);
if (num_networks > MAX_EPNO_NETWORKS) { if (num_networks > MAX_EPNO_NETWORKS) {
hdd_debug("num of nw: %d exceeded max: %d, resetting to: %d", hdd_debug("num of nw: %d exceeded max: %d, resetting to: %d",
@@ -3792,7 +3811,7 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
hdd_debug("num networks %u", num_networks); hdd_debug("num networks %u", num_networks);
len = sizeof(*req_msg) + len = sizeof(*req_msg) +
(num_networks * sizeof(struct wifi_epno_network)); (num_networks * sizeof(req_msg->networks[0]));
req_msg = qdf_mem_malloc(len); req_msg = qdf_mem_malloc(len);
if (!req_msg) { if (!req_msg) {
@@ -3802,75 +3821,73 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
req_msg->num_networks = num_networks; req_msg->num_networks = num_networks;
/* Parse and fetch request Id */ /* Parse and fetch request Id */
if (!tb[QCA_WLAN_VENDOR_ATTR_PNO_CONFIG_REQUEST_ID]) { id = QCA_WLAN_VENDOR_ATTR_PNO_CONFIG_REQUEST_ID;
if (!tb[id]) {
hdd_err("attr request id failed"); hdd_err("attr request id failed");
goto fail; goto fail;
} }
req_msg->request_id = nla_get_u32( req_msg->request_id = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_PNO_CONFIG_REQUEST_ID]);
hdd_debug("Req Id %u", req_msg->request_id); hdd_debug("Req Id %u", req_msg->request_id);
req_msg->session_id = adapter->session_id; req_msg->vdev_id = adapter->session_id;
hdd_debug("Session Id %d", req_msg->session_id); hdd_debug("Vdev Id %d", req_msg->vdev_id);
if (num_networks) { if (num_networks) {
/* Parse and fetch min_5ghz_rssi */ /* Parse and fetch min_5ghz_rssi */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI;
if (!tb[id]) {
hdd_err("min_5ghz_rssi id failed"); hdd_err("min_5ghz_rssi id failed");
goto fail; goto fail;
} }
req_msg->min_5ghz_rssi = nla_get_u32( req_msg->min_5ghz_rssi = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN5GHZ_RSSI]);
/* Parse and fetch min_24ghz_rssi */ /* Parse and fetch min_24ghz_rssi */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI;
if (!tb[id]) {
hdd_err("min_24ghz_rssi id failed"); hdd_err("min_24ghz_rssi id failed");
goto fail; goto fail;
} }
req_msg->min_24ghz_rssi = nla_get_u32( req_msg->min_24ghz_rssi = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_MIN24GHZ_RSSI]);
/* Parse and fetch initial_score_max */ /* Parse and fetch initial_score_max */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX;
if (!tb[id]) {
hdd_err("initial_score_max id failed"); hdd_err("initial_score_max id failed");
goto fail; goto fail;
} }
req_msg->initial_score_max = nla_get_u32( req_msg->initial_score_max = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_INITIAL_SCORE_MAX]);
/* Parse and fetch current_connection_bonus */ /* Parse and fetch current_connection_bonus */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS;
if (!tb[id]) {
hdd_err("current_connection_bonus id failed"); hdd_err("current_connection_bonus id failed");
goto fail; goto fail;
} }
req_msg->current_connection_bonus = nla_get_u32( req_msg->current_connection_bonus = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_CURRENT_CONNECTION_BONUS]
);
/* Parse and fetch same_network_bonus */ /* Parse and fetch same_network_bonus */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS;
if (!tb[id]) {
hdd_err("same_network_bonus id failed"); hdd_err("same_network_bonus id failed");
goto fail; goto fail;
} }
req_msg->same_network_bonus = nla_get_u32( req_msg->same_network_bonus = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_SAME_NETWORK_BONUS]);
/* Parse and fetch secure_bonus */ /* Parse and fetch secure_bonus */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS;
if (!tb[id]) {
hdd_err("secure_bonus id failed"); hdd_err("secure_bonus id failed");
goto fail; goto fail;
} }
req_msg->secure_bonus = nla_get_u32( req_msg->secure_bonus = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_SECURE_BONUS]);
/* Parse and fetch band_5ghz_bonus */ /* Parse and fetch band_5ghz_bonus */
if (!tb[QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS]) { id = QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS;
if (!tb[id]) {
hdd_err("band_5ghz_bonus id failed"); hdd_err("band_5ghz_bonus id failed");
goto fail; goto fail;
} }
req_msg->band_5ghz_bonus = nla_get_u32( req_msg->band_5ghz_bonus = nla_get_u32(tb[id]);
tb[QCA_WLAN_VENDOR_ATTR_EPNO_BAND5GHZ_BONUS]);
hdd_debug("min_5ghz_rssi: %d min_24ghz_rssi: %d", hdd_debug("min_5ghz_rssi: %d min_24ghz_rssi: %d",
req_msg->min_5ghz_rssi, req_msg->min_5ghz_rssi,
@@ -3883,7 +3900,9 @@ static int __wlan_hdd_cfg80211_set_epno_list(struct wiphy *wiphy,
req_msg->secure_bonus, req_msg->secure_bonus,
req_msg->band_5ghz_bonus); req_msg->band_5ghz_bonus);
if (hdd_extscan_epno_fill_network_list(hdd_ctx, req_msg, tb)) id = QCA_WLAN_VENDOR_ATTR_PNO_SET_LIST_PARAM_EPNO_NETWORKS_LIST;
networks = tb[id];
if (hdd_extscan_epno_fill_network_list(req_msg, networks))
goto fail; goto fail;
} }

View File

@@ -4210,47 +4210,6 @@ typedef struct {
#define MAX_EPNO_NETWORKS 64 #define MAX_EPNO_NETWORKS 64
/**
* struct wifi_epno_network - enhanced pno network block
* @ssid: ssid
* @flags: WIFI_PNO_FLAG_XXX
* @auth_bit_field: auth bit field for matching WPA IE
*/
struct wifi_epno_network {
tSirMacSSid ssid;
uint8_t flags;
uint8_t auth_bit_field;
};
/**
* struct wifi_epno_params - enhanced pno network params
* @request_id: request id number
* @session_id: session_id number
* @min_5ghz_rssi: minimum 5GHz RSSI for a BSSID to be considered
* @min_24ghz_rssi: minimum 2.4GHz RSSI for a BSSID to be considered
* @initial_score_max: maximum score that a network can have before bonuses
* @current_connection_bonus: only report when there is a network's score this
* much higher than the current connection
* @same_network_bonus: score bonus for all n/w with the same network flag
* @secure_bonus: score bonus for networks that are not open
* @band_5ghz_bonus: 5GHz RSSI score bonus (applied to all 5GHz networks)
* @num_networks: number of ssids
* @networks: EPNO networks
*/
struct wifi_epno_params {
uint32_t request_id;
uint32_t session_id;
uint32_t min_5ghz_rssi;
uint32_t min_24ghz_rssi;
uint32_t initial_score_max;
uint32_t current_connection_bonus;
uint32_t same_network_bonus;
uint32_t secure_bonus;
uint32_t band_5ghz_bonus;
uint32_t num_networks;
struct wifi_epno_network networks[];
};
#define SIR_PASSPOINT_LIST_MAX_NETWORKS 8 #define SIR_PASSPOINT_LIST_MAX_NETWORKS 8
#define SIR_PASSPOINT_REALM_LEN 256 #define SIR_PASSPOINT_REALM_LEN 256
#define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16 #define SIR_PASSPOINT_ROAMING_CONSORTIUM_ID_NUM 16

View File

@@ -1081,8 +1081,18 @@ QDF_STATUS
sme_get_cached_results(mac_handle_t mac_handle, sme_get_cached_results(mac_handle_t mac_handle,
struct extscan_cached_result_params *params); struct extscan_cached_result_params *params);
QDF_STATUS sme_set_epno_list(tHalHandle hal, /**
struct wifi_epno_params *req_msg); * sme_set_epno_list() - set epno network list
* @mac_handle: Opaque handle to the MAC context
* @params: request message
*
* This function sends an Enhanced PNO configuration to firmware.
*
* Return: QDF_STATUS enumeration
*/
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, QDF_STATUS sme_set_passpoint_list(tHalHandle hal,
struct wifi_passpoint_req *req_msg); struct wifi_passpoint_req *req_msg);
QDF_STATUS sme_reset_passpoint_list(tHalHandle hal, QDF_STATUS sme_reset_passpoint_list(tHalHandle hal,

View File

@@ -17,7 +17,7 @@
*/ */
/* /*
* DOC: smeApi.c * DOC: sme_api.c
* *
* Definitions for SME APIs * Definitions for SME APIs
*/ */
@@ -11349,59 +11349,25 @@ sme_get_cached_results(mac_handle_t mac_handle,
return status; return status;
} }
/** QDF_STATUS sme_set_epno_list(mac_handle_t mac_handle,
* sme_set_epno_list() - set epno network list struct wifi_enhanced_pno_params *params)
* @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_epno_list(tHalHandle hal,
struct wifi_epno_params *input)
{ {
QDF_STATUS status = QDF_STATUS_SUCCESS; QDF_STATUS status;
tpAniSirGlobal mac = PMAC_STRUCT(hal); tpAniSirGlobal mac = MAC_CONTEXT(mac_handle);
struct scheduler_msg message = {0}; struct scheduler_msg message = {0};
struct wifi_epno_params *req_msg; struct wifi_enhanced_pno_params *req_msg;
int len, i; int len;
SME_ENTER(); SME_ENTER();
/* per contract must make a copy of the params when messaging */
len = sizeof(*req_msg) + len = sizeof(*req_msg) +
(input->num_networks * sizeof(struct wifi_epno_network)); (params->num_networks * sizeof(req_msg->networks[0]));
req_msg = qdf_mem_malloc(len); req_msg = qdf_mem_malloc(len);
if (!req_msg) if (!req_msg)
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
qdf_mem_copy(req_msg, params, len);
req_msg->num_networks = input->num_networks;
req_msg->request_id = input->request_id;
req_msg->session_id = input->session_id;
/* Fill only when num_networks are non zero */
if (req_msg->num_networks) {
req_msg->min_5ghz_rssi = input->min_5ghz_rssi;
req_msg->min_24ghz_rssi = input->min_24ghz_rssi;
req_msg->initial_score_max = input->initial_score_max;
req_msg->same_network_bonus = input->same_network_bonus;
req_msg->secure_bonus = input->secure_bonus;
req_msg->band_5ghz_bonus = input->band_5ghz_bonus;
req_msg->current_connection_bonus =
input->current_connection_bonus;
for (i = 0; i < req_msg->num_networks; i++) {
req_msg->networks[i].flags = input->networks[i].flags;
req_msg->networks[i].auth_bit_field =
input->networks[i].auth_bit_field;
req_msg->networks[i].ssid.length =
input->networks[i].ssid.length;
qdf_mem_copy(req_msg->networks[i].ssid.ssId,
input->networks[i].ssid.ssId,
req_msg->networks[i].ssid.length);
}
}
status = sme_acquire_global_lock(&mac->sme); status = sme_acquire_global_lock(&mac->sme);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
@@ -11418,12 +11384,11 @@ QDF_STATUS sme_set_epno_list(tHalHandle hal,
QDF_MODULE_ID_WMA, QDF_MODULE_ID_WMA,
QDF_MODULE_ID_WMA, &message); QDF_MODULE_ID_WMA, &message);
if (!QDF_IS_STATUS_SUCCESS(status)) { if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err("scheduler_post_msg failed!(err=%d)", sme_err("scheduler_post_msg failed!(err=%d)", status);
status);
qdf_mem_free(req_msg); qdf_mem_free(req_msg);
status = QDF_STATUS_E_FAILURE;
} }
sme_release_global_lock(&mac->sme); sme_release_global_lock(&mac->sme);
return status; return status;
} }

View File

@@ -438,8 +438,18 @@ QDF_STATUS
wma_extscan_get_capabilities(tp_wma_handle wma, wma_extscan_get_capabilities(tp_wma_handle wma,
struct extscan_capabilities_params *params); struct extscan_capabilities_params *params);
/**
* wma_set_epno_network_list() - set epno network list
* @wma: WMA handle
* @req: epno config params request structure
*
* This function reads the incoming epno config request structure
* and constructs the WMI message to the firmware.
*
* Return: 0 on success, error number otherwise
*/
QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma, QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
struct wifi_epno_params *req); struct wifi_enhanced_pno_params *req);
QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma, QDF_STATUS wma_set_passpoint_network_list(tp_wma_handle wma,
struct wifi_passpoint_req *req); struct wifi_passpoint_req *req);

View File

@@ -8216,8 +8216,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
qdf_mem_free(msg->bodyptr); qdf_mem_free(msg->bodyptr);
break; break;
case WMA_SET_EPNO_LIST_REQ: case WMA_SET_EPNO_LIST_REQ:
wma_set_epno_network_list(wma_handle, wma_set_epno_network_list(wma_handle, msg->bodyptr);
(struct wifi_epno_params *)msg->bodyptr);
qdf_mem_free(msg->bodyptr); qdf_mem_free(msg->bodyptr);
break; break;
case WMA_SET_PER_ROAM_CONFIG_CMD: case WMA_SET_PER_ROAM_CONFIG_CMD:

View File

@@ -4743,76 +4743,25 @@ wma_extscan_get_capabilities(tp_wma_handle wma,
params); params);
} }
/** wma_set_epno_network_list() - set epno network list
* @wma: WMA handle
* @req: epno config params request structure
*
* This function reads the incoming epno config request structure
* and constructs the WMI message to the firmware.
*
* Returns: 0 on success, error number otherwise
*/
QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma, QDF_STATUS wma_set_epno_network_list(tp_wma_handle wma,
struct wifi_epno_params *req) struct wifi_enhanced_pno_params *req)
{ {
struct wifi_enhanced_pno_params *params;
uint8_t i = 0;
QDF_STATUS status; QDF_STATUS status;
size_t params_len;
WMA_LOGD("wma_set_epno_network_list"); wma_debug("Enter");
if (!wma || !wma->wmi_handle) { 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; return QDF_STATUS_E_FAILURE;
} }
if (!wmi_service_enabled(wma->wmi_handle,
wmi_service_extscan)) { if (!wmi_service_enabled(wma->wmi_handle, wmi_service_extscan)) {
WMA_LOGE("%s: extscan not enabled", __func__); wma_err("extscan not enabled");
return QDF_STATUS_E_NOSUPPORT; return QDF_STATUS_E_NOSUPPORT;
} }
params_len = sizeof(*params) + (req->num_networks * status = wmi_unified_set_epno_network_list_cmd(wma->wmi_handle, req);
sizeof(struct wifi_epno_network_params)); wma_debug("Exit, vdev %d, status %d", req->vdev_id, status);
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;
/* Fill only when num_networks are non zero */
if (req->num_networks) {
params->min_5ghz_rssi = req->min_5ghz_rssi;
params->min_24ghz_rssi = req->min_24ghz_rssi;
params->initial_score_max = req->initial_score_max;
params->same_network_bonus = req->same_network_bonus;
params->secure_bonus = req->secure_bonus;
params->band_5ghz_bonus = req->band_5ghz_bonus;
params->current_connection_bonus =
req->current_connection_bonus;
for (i = 0; i < req->num_networks; i++) {
params->networks[i].flags = req->networks[i].flags;
params->networks[i].auth_bit_field =
req->networks[i].auth_bit_field;
params->networks[i].ssid.length =
req->networks[i].ssid.length;
qdf_mem_copy(params->networks[i].ssid.mac_ssid,
req->networks[i].ssid.ssId,
req->networks[i].ssid.length);
}
}
status = wmi_unified_set_epno_network_list_cmd(wma->wmi_handle, params);
qdf_mem_free(params);
if (QDF_IS_STATUS_ERROR(status))
return status;
WMA_LOGD("set ePNO list request sent successfully for vdev %d",
req->session_id);
return status; return status;
} }