From: Raja Mani <rmani@qca.qualcomm.com>
To: Jouni Malinen <jouni@qca.qualcomm.com>
Cc: <kvalo@qca.qualcomm.com>, <linux-wireless@vger.kernel.org>,
Edward Lu <shaol@qca.qualcomm.com>
Subject: Re: [PATCH 11/20] ath6kl: Support channel set request for startscan command
Date: Tue, 30 Aug 2011 15:34:19 +0530 [thread overview]
Message-ID: <4E5CB5A3.6070507@qca.qualcomm.com> (raw)
In-Reply-To: <1314620641-24257-12-git-send-email-jouni@qca.qualcomm.com>
On Monday 29 August 2011 05:53 PM, Jouni Malinen wrote:
> From: Edward Lu<elu@qca.qualcomm.com>
>
> Signed-off-by: Edward Lu<elu@qca.qualcomm.com>
> Signed-off-by: Jouni Malinen<jouni@qca.qualcomm.com>
> ---
> drivers/net/wireless/ath/ath6kl/cfg80211.c | 23 ++++++++++++++++++++++-
> drivers/net/wireless/ath/ath6kl/wmi.c | 8 +++++---
> 2 files changed, 27 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> index d287f0a..e78d332 100644
> --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
> +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
> @@ -748,6 +748,8 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
> struct cfg80211_scan_request *request)
> {
> struct ath6kl *ar = (struct ath6kl *)ath6kl_priv(ndev);
> + s8 n_channels = 0;
> + u16 *channels = NULL;
> int ret = 0;
>
> if (!ath6kl_cfg80211_ready(ar))
> @@ -785,14 +787,33 @@ static int ath6kl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
> }
> }
>
> + if (request->n_channels> 0) {
> + u8 i;
> +
> + n_channels = (request->n_channels> 127) ?
> + 127 : request->n_channels;
> +
> + channels = kzalloc(n_channels * sizeof(u16), GFP_KERNEL);
> + if (channels == NULL) {
> + ath6kl_err("failed to set scan channels, "
> + "scan all channels");
> + n_channels = 0;
> + }
> +
> + for (i = 0; i< n_channels; i++)
> + channels[i] = request->channels[i]->center_freq;
> + }
> +
> if (ath6kl_wmi_startscan_cmd(ar->wmi, WMI_LONG_SCAN, 0,
> - false, 0, 0, 0, NULL) != 0) {
> + false, 0, 0, n_channels, channels) != 0) {
> ath6kl_err("wmi_startscan_cmd failed\n");
kfree(channels) for failure cases ??
> ret = -EIO;
> }
>
> ar->scan_req = request;
>
> + kfree(channels);
> +
> return ret;
> }
>
> diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
> index 2d80bdb..87e4d65 100644
> --- a/drivers/net/wireless/ath/ath6kl/wmi.c
> +++ b/drivers/net/wireless/ath/ath6kl/wmi.c
> @@ -1709,7 +1709,7 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
> struct sk_buff *skb;
> struct wmi_start_scan_cmd *sc;
> s8 size;
> - int ret;
> + int i, ret;
>
> size = sizeof(struct wmi_start_scan_cmd);
>
> @@ -1734,8 +1734,10 @@ int ath6kl_wmi_startscan_cmd(struct wmi *wmi, enum wmi_scan_type scan_type,
> sc->force_scan_intvl = cpu_to_le32(force_scan_interval);
> sc->num_ch = num_chan;
>
> - if (num_chan)
> - memcpy(sc->ch_list, ch_list, num_chan * sizeof(u16));
> + if (num_chan) {
> + for (i = 0; i< num_chan; i++)
> + sc->ch_list[i] = cpu_to_le16(ch_list[i]);
> + }
>
> ret = ath6kl_wmi_cmd_send(wmi, skb, WMI_START_SCAN_CMDID,
> NO_SYNC_WMIFLAG);
next prev parent reply other threads:[~2011-08-30 10:04 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-29 12:23 [PATCH 00/20] ath6kl: AP mode and P2P Jouni Malinen
2011-08-29 12:23 ` [PATCH 01/20] ath6kl: Add functionality for starting AP mode Jouni Malinen
2011-08-30 5:47 ` Raja Mani
2011-08-30 8:40 ` Jouni Malinen
2011-08-30 8:49 ` Kalle Valo
2011-08-30 10:38 ` Jouni Malinen
2011-08-30 9:10 ` Raja Mani
2011-08-30 9:02 ` Kalle Valo
2011-08-30 14:03 ` Jouni Malinen
2011-08-29 12:23 ` [PATCH 02/20] ath6kl: Fix AP mode (Re)AssocReq IE processing Jouni Malinen
2011-08-29 12:23 ` [PATCH 03/20] ath6kl: Delay initial group key setup in AP mode Jouni Malinen
2011-08-29 12:23 ` [PATCH 04/20] ath6kl: Use change_station() to authorize/unauthorize STAs Jouni Malinen
2011-08-30 9:06 ` Kalle Valo
2011-08-30 14:09 ` Jouni Malinen
2011-08-29 12:23 ` [PATCH 05/20] ath6kl: Add new WMI commands and events for P2P Jouni Malinen
2011-08-29 12:23 ` [PATCH 06/20] ath6kl: Implement remain_on_channel and cancel_remain_on_channel Jouni Malinen
2011-08-29 12:23 ` [PATCH 07/20] ath6kl: Implement mgmt_tx Jouni Malinen
2011-08-30 9:23 ` Kalle Valo
2011-08-30 14:13 ` Jouni Malinen
2011-08-29 12:23 ` [PATCH 08/20] ath6kl: Request P2P capabilities during target init Jouni Malinen
2011-08-30 9:51 ` Raja Mani
2011-08-30 14:30 ` Jouni Malinen
2011-08-29 12:23 ` [PATCH 09/20] ath6kl: Add cfg80211 calls for remain-on-channel events Jouni Malinen
2011-08-29 12:23 ` [PATCH 10/20] ath6kl: Use set_appie command to add Probe Request IEs Jouni Malinen
2011-08-30 9:26 ` Kalle Valo
2011-08-30 14:16 ` Jouni Malinen
2011-08-29 12:23 ` [PATCH 11/20] ath6kl: Support channel set request for startscan command Jouni Malinen
2011-08-30 9:33 ` Kalle Valo
2011-08-30 9:51 ` Vasanthakumar Thiagarajan
2011-08-30 11:45 ` Vasanthakumar Thiagarajan
2011-08-30 14:44 ` Jouni Malinen
2011-08-30 10:04 ` Raja Mani [this message]
2011-08-30 10:30 ` Kalle Valo
2011-08-30 10:33 ` Raja Mani
2011-08-29 12:23 ` [PATCH 12/20] ath6kl: Report received Probe Request frames to cfg80211 Jouni Malinen
2011-08-29 12:23 ` [PATCH 13/20] ath6kl: Notify cfg80211 of TX status of mgmt_tx frames Jouni Malinen
2011-08-29 12:23 ` [PATCH 14/20] ath6kl: Report received Action frames to cfg80211 Jouni Malinen
2011-08-29 12:23 ` [PATCH 15/20] ath6kl: Advertise supported mgmt_stypes Jouni Malinen
2011-08-29 12:23 ` [PATCH 16/20] ath6kl: Add support for new P2P iftypes in mode changes Jouni Malinen
2011-08-29 12:23 ` [PATCH 17/20] ath6kl: Fix a typo in ath6k context Jouni Malinen
2011-08-29 12:23 ` [PATCH 18/20] ath6kl: Fix default key installation in AP mode Jouni Malinen
2011-08-29 12:24 ` [PATCH 19/20] ath6kl: Do not clear CONNECT bit setting in AP mode for STA disconnect Jouni Malinen
2011-08-29 12:24 ` [PATCH 20/20] ath6kl: Include P2P IE(s) in GO Probe Response depending on request Jouni Malinen
2011-08-30 9:51 ` [PATCH 00/20] ath6kl: AP mode and P2P Kalle Valo
2011-08-30 15:54 ` Jouni Malinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E5CB5A3.6070507@qca.qualcomm.com \
--to=rmani@qca.qualcomm.com \
--cc=jouni@qca.qualcomm.com \
--cc=kvalo@qca.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
--cc=shaol@qca.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).