mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
qcacld-3.0: Send full roam scan period to userspace upon querying
Userspace may query for current configured full roam scan period through the vendor cmd QCA_WLAN_VENDOR_ROAMING_SUBCMD_CONTROL_GET and the attribute QCA_ATTR_ROAM_CONTROL_FULL_SCAN_PERIOD. Fill the full scan period in the same attribute and send as reply Change-Id: I0ab8b3d7b469515244ce27accc852c6d93514b2d CRs-Fixed: 2508804
This commit is contained in:
parent
9ad9e25ed6
commit
a33fdd8376
3 changed files with 61 additions and 1 deletions
|
|
@ -4457,6 +4457,9 @@ hdd_roam_control_config_buf_size(struct hdd_context *hdd_ctx,
|
|||
if (tb[QCA_ATTR_ROAM_CONTROL_STATUS])
|
||||
skb_len += NLA_HDRLEN + sizeof(uint8_t);
|
||||
|
||||
if (tb[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_PERIOD])
|
||||
skb_len += NLA_HDRLEN + sizeof(uint32_t);
|
||||
|
||||
return skb_len;
|
||||
}
|
||||
|
||||
|
|
@ -4479,6 +4482,7 @@ hdd_roam_control_config_fill_data(struct hdd_context *hdd_ctx, uint8_t vdev_id,
|
|||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
uint8_t roam_control;
|
||||
struct nlattr *config;
|
||||
uint32_t full_roam_scan_period;
|
||||
|
||||
config = nla_nest_start(skb, PARAM_ROAM_CONTROL_CONFIG);
|
||||
if (!config)
|
||||
|
|
@ -4498,8 +4502,23 @@ hdd_roam_control_config_fill_data(struct hdd_context *hdd_ctx, uint8_t vdev_id,
|
|||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
nla_nest_end(skb, config);
|
||||
|
||||
if (tb[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_PERIOD]) {
|
||||
status = sme_get_full_roam_scan_period(hdd_ctx->mac_handle,
|
||||
vdev_id,
|
||||
&full_roam_scan_period);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
goto out;
|
||||
hdd_debug("full_roam_scan_period: %u", full_roam_scan_period);
|
||||
|
||||
if (nla_put_u32(skb, QCA_ATTR_ROAM_CONTROL_FULL_SCAN_PERIOD,
|
||||
full_roam_scan_period)) {
|
||||
hdd_info("failed to put full_roam_scan_period");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
nla_nest_end(skb, config);
|
||||
out:
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3710,4 +3710,19 @@ QDF_STATUS sme_set_roam_config_enable(mac_handle_t mac_handle,
|
|||
*/
|
||||
QDF_STATUS sme_get_roam_config_status(mac_handle_t mac_handle, uint8_t vdev_id,
|
||||
uint8_t *config_status);
|
||||
|
||||
/**
|
||||
* sme_get_full_roam_scan_period() - Get full roam scan period
|
||||
* @mac_handle: Opaque handle to the MAC context
|
||||
* @vdev_id: vdev id
|
||||
* @full_roam_scan_period: Pointer of a buffer to fill the full roam scan period
|
||||
*
|
||||
* Get the full scan period cached in neighborRoamInfo and fill in the given
|
||||
* buffer full_roam_scan_period.
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sme_get_full_roam_scan_period(mac_handle_t mac_handle,
|
||||
uint8_t vdev_id,
|
||||
uint32_t *full_roam_scan_period);
|
||||
#endif /* #if !defined( __SME_API_H ) */
|
||||
|
|
|
|||
|
|
@ -16161,3 +16161,29 @@ QDF_STATUS sme_get_roam_config_status(mac_handle_t mac_handle,
|
|||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
sme_get_full_roam_scan_period(mac_handle_t mac_handle, uint8_t vdev_id,
|
||||
uint32_t *full_roam_scan_period)
|
||||
{
|
||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||
QDF_STATUS status;
|
||||
tpCsrNeighborRoamControlInfo neighbor_roam_info;
|
||||
|
||||
if (vdev_id >= WLAN_MAX_VDEVS) {
|
||||
sme_err("Invalid vdev_id: %d", vdev_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = sme_acquire_global_lock(&mac->sme);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
sme_err("Failed to acquire sme lock; status: %d", status);
|
||||
return status;
|
||||
}
|
||||
neighbor_roam_info = &mac->roam.neighborRoamInfo[vdev_id];
|
||||
*full_roam_scan_period =
|
||||
neighbor_roam_info->cfgParams.full_roam_scan_period;
|
||||
sme_release_global_lock(&mac->sme);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue