qcacld-3.0: Correct logic to send an auto-resume indication to userspace

Driver sends the auto-resume flag to user space in the following two
scenarios in order to specify that the driver will automatically resume
reporting beacon or not:

Scenario 1: In the case of Disconnection
Driver should not set an auto-resume flag
QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES in subsequent
QCA_WLAN_VENDOR_BEACON_REPORTING_OP_PAUSE event irrespective of
do_not_resume flag is present in the recent
QCA_WLAN_VENDOR_BEACON_REPORTING_OP_START command.

Scenario 2: In the case of Scan
Driver should send QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES in
subsequent QCA_WLAN_VENDOR_BEACON_REPORTING_OP_PAUSE event only if
do_not_resume flag is set in the recent
QCA_WLAN_VENDOR_BEACON_REPORTING_OP_START command.

Currently, there is a possibility to send an auto-resume flag to userspace
in case of disconnection also, which is not as per the expectation of
userspace from the host.

Change-Id: I94cc7dc699b874422d0cf14cd4144c82adb4c2ac
CRs-Fixed: 2485792
This commit is contained in:
Abhinav Kumar 2019-07-08 17:44:26 +05:30 committed by nshrivas
parent 92fd1ee387
commit 5bb0a54fdd

View File

@ -492,7 +492,7 @@ void hdd_beacon_recv_pause_indication(hdd_handle_t hdd_handle,
* the QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES shall not be
* set by the driver.
*/
if (!is_disconnected || !do_not_resume)
if (!is_disconnected && !do_not_resume)
if (nla_put_flag(vendor_event,
QCA_WLAN_VENDOR_ATTR_BEACON_REPORTING_AUTO_RESUMES)) {
hdd_err("QCA_WLAN_VENDOR_ATTR put fail");