From patchwork Mon Mar 11 14:05:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mahesh Palivela X-Patchwork-Id: 2248961 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 58FFEDF5B1 for ; Mon, 11 Mar 2013 14:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753129Ab3CKONx (ORCPT ); Mon, 11 Mar 2013 10:13:53 -0400 Received: from hub022-nj-2.exch022.serverdata.net ([206.225.164.185]:39516 "EHLO HUB022-nj-2.exch022.serverdata.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692Ab3CKONx (ORCPT ); Mon, 11 Mar 2013 10:13:53 -0400 X-Greylist: delayed 480 seconds by postgrey-1.27 at vger.kernel.org; Mon, 11 Mar 2013 10:13:53 EDT Received: from [192.168.15.102] (49.207.247.112) by east.exch022.serverdata.net (10.240.6.34) with Microsoft SMTP Server (TLS) id 14.2.318.1; Mon, 11 Mar 2013 07:05:49 -0700 Message-ID: <513DE4BB.9010104@posedge.com> Date: Mon, 11 Mar 2013 19:35:47 +0530 From: Mahesh Palivela User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Johannes Berg CC: "linux-wireless@vger.kernel.org" Subject: [PATCH] mac80211: Enable sw scan with chan context Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Mahesh Palivela Enable software scan with channel context in use. Signed-off-by: Mahesh Palivela --- net/mac80211/scan.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) tx_flags |= IEEE80211_TX_CTL_NO_CCK_RATE; @@ -404,7 +409,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, local->scan_req->ssids[i].ssid_len, local->scan_req->ie, local->scan_req->ie_len, local->scan_req->rates[band], false, - tx_flags, local->hw.conf.channel, true); + tx_flags, scan_chan, true); /* * After sending probe requests, wait for probe responses -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 43a45cf..58076ec 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -309,10 +309,6 @@ EXPORT_SYMBOL(ieee80211_scan_completed); static int ieee80211_start_sw_scan(struct ieee80211_local *local) { - /* Software scan is not supported in multi-channel cases */ - if (local->use_chanctx) - return -EOPNOTSUPP; - /* * Hardware/driver doesn't support hw_scan, so use software * scanning instead. First send a nullfunc frame with power save @@ -387,9 +383,18 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local, { int i; struct ieee80211_sub_if_data *sdata; - enum ieee80211_band band = local->hw.conf.channel->band; + enum ieee80211_band band; + struct ieee80211_channel *scan_chan; u32 tx_flags; + if (!local->use_chanctx) { + band = local->hw.conf.channel->band; + scan_chan = local->hw.conf.channel; + } else { + band = local->scan_channel->band; + scan_chan = local->scan_channel; + } + tx_flags = IEEE80211_TX_INTFL_OFFCHAN_TX_OK; if (local->scan_req->no_cck)