qcacld-3.0: Add support for WAIT_FOR_READY in state ctrl param
Currently, driver state control param write only support WiFi On/Off. There is no provision for user space to know that whether the driver recovery is complete or not. To address this, add support for WAIT_FOR_READY string in the state control param write. Whenever WAIT_FOR_READY string is written to the state control param, driver should wait for ongoing recovery to complete and then return. Change-Id: If97c44497f1bbe69683b7483c179f9dc14fa75f1 CRs-Fixed: 3141194
This commit is contained in:

committed by
Madan Koyyalamudi

parent
83da2e2f69
commit
08c076908b
@@ -17299,9 +17299,11 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
|
||||
char buf[3];
|
||||
static const char wlan_off_str[] = "OFF";
|
||||
static const char wlan_on_str[] = "ON";
|
||||
static const char wlan_wait_for_ready_str[] = "WAIT_FOR_READY";
|
||||
int ret;
|
||||
unsigned long rc;
|
||||
struct hdd_context *hdd_ctx;
|
||||
bool is_wait_for_ready = false;
|
||||
|
||||
if (copy_from_user(buf, user_buf, 3)) {
|
||||
pr_err("Failed to read buffer\n");
|
||||
@@ -17317,7 +17319,11 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
|
||||
if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) == 0)
|
||||
pr_info("Wifi Turning On from UI\n");
|
||||
|
||||
if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) != 0) {
|
||||
if (strncmp(buf, wlan_wait_for_ready_str,
|
||||
strlen(wlan_wait_for_ready_str)) == 0) {
|
||||
is_wait_for_ready = true;
|
||||
pr_info("Wifi wait for ready from UI\n");
|
||||
} else if (strncmp(buf, wlan_on_str, strlen(wlan_on_str)) != 0) {
|
||||
pr_err("Invalid value received from framework");
|
||||
goto exit;
|
||||
}
|
||||
@@ -17332,6 +17338,9 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
|
||||
}
|
||||
}
|
||||
|
||||
if (is_wait_for_ready)
|
||||
return count;
|
||||
|
||||
/*
|
||||
* Flush idle shutdown work for cases to synchronize the wifi on
|
||||
* during the idle shutdown.
|
||||
|
Reference in New Issue
Block a user