diff options
author | Ecco Park <eccopark@broadcom.com> | 2013-09-12 06:10:24 +0900 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-05-01 23:35:26 +0200 |
commit | f93415945f9e3efe15493a7485c2f87c980179f8 (patch) | |
tree | ab02bdb2173b3f9c846b6e71b620aeeb81a048a5 /drivers | |
parent | 4b61fb737694337c54458490c1942ef705d3460f (diff) | |
download | kernel_samsung_tuna-f93415945f9e3efe15493a7485c2f87c980179f8.zip kernel_samsung_tuna-f93415945f9e3efe15493a7485c2f87c980179f8.tar.gz kernel_samsung_tuna-f93415945f9e3efe15493a7485c2f87c980179f8.tar.bz2 |
net: wireless: bcmdhd: Fix of Wireless Location Service
Fixed [10378803] [BATCHED-SCAN] WLS_BATCHING commands often
return their command back rather than expected outputs
Signed-off-by: Ecco Park <eccopark@broadcom.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_pno.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_pno.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_android.c | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.c b/drivers/net/wireless/bcmdhd/dhd_pno.c index a604024..384386e 100644 --- a/drivers/net/wireless/bcmdhd/dhd_pno.c +++ b/drivers/net/wireless/bcmdhd/dhd_pno.c @@ -1235,6 +1235,7 @@ _dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason) DHD_ERROR(("failed to allocate dhd_pno_bestnet_entry\n")); goto exit; } + memset(pbestnet_entry, 0, BESTNET_ENTRY_SIZE); pbestnet_entry->recorded_time = jiffies; /* record the current time */ /* create header for the first entry */ allocate_header = (i == 0)? TRUE : FALSE; @@ -1343,8 +1344,10 @@ exit: MFREE(dhd->osh, plbestnet, PNO_BESTNET_LEN); _params->params_batch.get_batch.buf = NULL; _params->params_batch.get_batch.bufsize = 0; + _params->params_batch.get_batch.bytes_written = err; mutex_unlock(&_pno_state->pno_mutex); - complete(&_pno_state->get_batch_done); + if (waitqueue_active(&_pno_state->get_batch_done.wait)) + complete(&_pno_state->get_batch_done); return err; } static void @@ -1370,6 +1373,7 @@ int dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason) { int err = BCME_OK; + char *pbuf = buf; dhd_pno_status_info_t *_pno_state; struct dhd_pno_batch_params *params_batch; NULL_CHECK(dhd, "dhd is NULL", err); @@ -1389,13 +1393,19 @@ dhd_pno_get_for_batch(dhd_pub_t *dhd, char *buf, int bufsize, int reason) params_batch = &_pno_state->pno_params_arr[INDEX_OF_BATCH_PARAMS].params_batch; if (!(_pno_state->pno_mode & DHD_PNO_BATCH_MODE)) { DHD_ERROR(("%s: Batching SCAN mode is not enabled\n", __FUNCTION__)); + memset(pbuf, 0, bufsize); + pbuf += sprintf(pbuf, "scancount=%d\n", 0); + sprintf(pbuf, "%s", RESULTS_END_MARKER); + err = strlen(buf); goto exit; } params_batch->get_batch.buf = buf; params_batch->get_batch.bufsize = bufsize; params_batch->get_batch.reason = reason; + params_batch->get_batch.bytes_written = 0; schedule_work(&_pno_state->work); wait_for_completion(&_pno_state->get_batch_done); + err = params_batch->get_batch.bytes_written; exit: return err; } diff --git a/drivers/net/wireless/bcmdhd/dhd_pno.h b/drivers/net/wireless/bcmdhd/dhd_pno.h index 1e02db1..0cf1bf4 100644 --- a/drivers/net/wireless/bcmdhd/dhd_pno.h +++ b/drivers/net/wireless/bcmdhd/dhd_pno.h @@ -152,6 +152,7 @@ struct dhd_pno_get_batch_info { uint32 expired_tot_scan_cnt; uint32 top_node_cnt; uint32 bufsize; + uint32 bytes_written; int reason; struct list_head scan_results_list; struct list_head expired_scan_results_list; diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c index 7e50bec..4b1f149 100644 --- a/drivers/net/wireless/bcmdhd/wl_android.c +++ b/drivers/net/wireless/bcmdhd/wl_android.c @@ -380,8 +380,6 @@ wls_parse_batching_cmd(struct net_device *dev, char *command, int total_len) err = dhd_dev_pno_get_for_batch(dev, command, total_len); if (err < 0) { DHD_ERROR(("failed to getting batching results\n")); - } else { - err = strlen(command); } } else if (!strncmp(pos, PNO_BATCHING_STOP, strlen(PNO_BATCHING_STOP))) { err = dhd_dev_pno_stop_for_batch(dev); |