aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorIgal Chernobelsky <igalc@ti.com>2013-09-09 05:24:35 -0400
committerLuciano Coelho <luciano.coelho@intel.com>2013-10-23 02:47:40 -0400
commit4b6741443264d20aa7a1cb52185a7d13589590fe (patch)
tree22971a93f9423efae3c09abf477d5eec5726740d /drivers/net/wireless
parent71e996bef90b23919f627a38367b9e8b44b77d37 (diff)
wlcore: fix interrogate command length
Change interrogate command prototype to have command size and returned buffer length. This fixes the issue when command parameters are needed to be passed to FW in addition to acx header as in the case with get RSSI command, where role_id has to be passed. Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.c10
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c9
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.h3
-rw-r--r--drivers/net/wireless/ti/wlcore/testmode.c3
4 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
index 7a970cd9c555..ec83675a2446 100644
--- a/drivers/net/wireless/ti/wlcore/acx.c
+++ b/drivers/net/wireless/ti/wlcore/acx.c
@@ -162,7 +162,8 @@ int wl1271_acx_mem_map(struct wl1271 *wl, struct acx_header *mem_map,
162 162
163 wl1271_debug(DEBUG_ACX, "acx mem map"); 163 wl1271_debug(DEBUG_ACX, "acx mem map");
164 164
165 ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map, len); 165 ret = wl1271_cmd_interrogate(wl, ACX_MEM_MAP, mem_map,
166 sizeof(struct acx_header), len);
166 if (ret < 0) 167 if (ret < 0)
167 return ret; 168 return ret;
168 169
@@ -722,6 +723,7 @@ int wl1271_acx_statistics(struct wl1271 *wl, void *stats)
722 wl1271_debug(DEBUG_ACX, "acx statistics"); 723 wl1271_debug(DEBUG_ACX, "acx statistics");
723 724
724 ret = wl1271_cmd_interrogate(wl, ACX_STATISTICS, stats, 725 ret = wl1271_cmd_interrogate(wl, ACX_STATISTICS, stats,
726 sizeof(struct acx_header),
725 wl->stats.fw_stats_len); 727 wl->stats.fw_stats_len);
726 if (ret < 0) { 728 if (ret < 0) {
727 wl1271_warning("acx statistics failed: %d", ret); 729 wl1271_warning("acx statistics failed: %d", ret);
@@ -1470,8 +1472,8 @@ int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1470 1472
1471 tsf_info->role_id = wlvif->role_id; 1473 tsf_info->role_id = wlvif->role_id;
1472 1474
1473 ret = wl1271_cmd_interrogate(wl, ACX_TSF_INFO, 1475 ret = wl1271_cmd_interrogate(wl, ACX_TSF_INFO, tsf_info,
1474 tsf_info, sizeof(*tsf_info)); 1476 sizeof(struct acx_header), sizeof(*tsf_info));
1475 if (ret < 0) { 1477 if (ret < 0) {
1476 wl1271_warning("acx tsf info interrogate failed"); 1478 wl1271_warning("acx tsf info interrogate failed");
1477 goto out; 1479 goto out;
@@ -1752,7 +1754,7 @@ int wlcore_acx_average_rssi(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1752 1754
1753 acx->role_id = wlvif->role_id; 1755 acx->role_id = wlvif->role_id;
1754 ret = wl1271_cmd_interrogate(wl, ACX_ROAMING_STATISTICS_TBL, 1756 ret = wl1271_cmd_interrogate(wl, ACX_ROAMING_STATISTICS_TBL,
1755 acx, sizeof(*acx)); 1757 acx, sizeof(*acx), sizeof(*acx));
1756 if (ret < 0) { 1758 if (ret < 0) {
1757 wl1271_warning("acx roaming statistics failed: %d", ret); 1759 wl1271_warning("acx roaming statistics failed: %d", ret);
1758 ret = -ENOMEM; 1760 ret = -ENOMEM;
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 9e5416f8764d..e65cdfced9b2 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -845,7 +845,8 @@ EXPORT_SYMBOL_GPL(wl1271_cmd_test);
845 * @buf: buffer for the response, including all headers, must work with dma 845 * @buf: buffer for the response, including all headers, must work with dma
846 * @len: length of buf 846 * @len: length of buf
847 */ 847 */
848int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len) 848int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf,
849 size_t cmd_len, size_t res_len)
849{ 850{
850 struct acx_header *acx = buf; 851 struct acx_header *acx = buf;
851 int ret; 852 int ret;
@@ -854,10 +855,10 @@ int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
854 855
855 acx->id = cpu_to_le16(id); 856 acx->id = cpu_to_le16(id);
856 857
857 /* payload length, does not include any headers */ 858 /* response payload length, does not include any headers */
858 acx->len = cpu_to_le16(len - sizeof(*acx)); 859 acx->len = cpu_to_le16(res_len - sizeof(*acx));
859 860
860 ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, sizeof(*acx), len); 861 ret = wl1271_cmd_send(wl, CMD_INTERROGATE, acx, cmd_len, res_len);
861 if (ret < 0) 862 if (ret < 0)
862 wl1271_error("INTERROGATE command failed"); 863 wl1271_error("INTERROGATE command failed");
863 864
diff --git a/drivers/net/wireless/ti/wlcore/cmd.h b/drivers/net/wireless/ti/wlcore/cmd.h
index fd34123047cd..323d4a856e4b 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.h
+++ b/drivers/net/wireless/ti/wlcore/cmd.h
@@ -45,7 +45,8 @@ int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif,
45 enum ieee80211_band band, int channel); 45 enum ieee80211_band band, int channel);
46int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif); 46int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif);
47int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer); 47int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer);
48int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len); 48int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf,
49 size_t cmd_len, size_t res_len);
49int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len); 50int wl1271_cmd_configure(struct wl1271 *wl, u16 id, void *buf, size_t len);
50int wlcore_cmd_configure_failsafe(struct wl1271 *wl, u16 id, void *buf, 51int wlcore_cmd_configure_failsafe(struct wl1271 *wl, u16 id, void *buf,
51 size_t len, unsigned long valid_rets); 52 size_t len, unsigned long valid_rets);
diff --git a/drivers/net/wireless/ti/wlcore/testmode.c b/drivers/net/wireless/ti/wlcore/testmode.c
index a3b7d950d8e9..ddad58f614da 100644
--- a/drivers/net/wireless/ti/wlcore/testmode.c
+++ b/drivers/net/wireless/ti/wlcore/testmode.c
@@ -179,7 +179,8 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
179 goto out_sleep; 179 goto out_sleep;
180 } 180 }
181 181
182 ret = wl1271_cmd_interrogate(wl, ie_id, cmd, sizeof(*cmd)); 182 ret = wl1271_cmd_interrogate(wl, ie_id, cmd,
183 sizeof(struct acx_header), sizeof(*cmd));
183 if (ret < 0) { 184 if (ret < 0) {
184 wl1271_warning("testmode cmd interrogate failed: %d", ret); 185 wl1271_warning("testmode cmd interrogate failed: %d", ret);
185 goto out_free; 186 goto out_free;