From patchwork Tue Feb 18 15:03:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3672031 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 01CBD9F370 for ; Tue, 18 Feb 2014 15:03:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DE072020F for ; Tue, 18 Feb 2014 15:03:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2340C201FE for ; Tue, 18 Feb 2014 15:03:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756132AbaBRPDs (ORCPT ); Tue, 18 Feb 2014 10:03:48 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:59878 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755762AbaBRPDq (ORCPT ); Tue, 18 Feb 2014 10:03:46 -0500 Received: by mail-pa0-f52.google.com with SMTP id bj1so16848074pad.11 for ; Tue, 18 Feb 2014 07:03:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=OzYI4touq7zi41Ytx+OllsPFpGYkqSZBOQJFmupM+nM=; b=qgnTwVDP4Wn9eguluN9+t485caqfOOrAlKuaClVDcEJkj+5UdyoKgPljqMMLDNJw+t VEdpK5IEGa68xbZP6ryA1FgjQRjEyLlMBnFPNBxxTsqxM9Bu4p0kVBdi2BX4adl9FRYj G6hBsJhGHpTKMH3WD8ekuQ8rrmb4nlsg7NNwv45ycQzy6HrbrnYFvKrKYaKXyLIPjO05 /WD7gc6jrubl8WuOffoGVDDtauPtavZRBQD320mizNEgXn7hIZyLTvLadb2M4ktkGI0y LBH5eS2R9IIfHcziLD3ZTu3KFZQAYjJlP53MOyj2QERjm7Uaj04ZNci8EW7SeFYbJl3F z20A== X-Received: by 10.66.145.166 with SMTP id sv6mr33875950pab.31.1392735825999; Tue, 18 Feb 2014 07:03:45 -0800 (PST) Received: from will.lan ([175.153.40.117]) by mx.google.com with ESMTPSA id yg4sm25592986pab.19.2014.02.18.07.03.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Feb 2014 07:03:45 -0800 (PST) From: "Zhao, Gang" To: Greg Kroah-Hartman Cc: , Subject: [PATCH] staging: wlan-ng: replace function ieee80211_dsss_chan_to_freq() Date: Tue, 18 Feb 2014 23:03:27 +0800 Message-Id: X-Mailer: git-send-email 1.8.5.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace ieee80211_dsss_chan_to_freq() with more generic ieee80211_channel_to_frequency(), and add a variable to deal with 80 characters problem. File cfg80211.c is included by p80211netdev.c, p80211netdev.c includes , both ieee80211_channel_to_frequency() and IEEE80211_BAND_2GHZ is defined / declared in . So this change is safe. This change is a preparation for the removal of function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}. Signed-off-by: Zhao, Gang --- add Cc to linux-wireless for consistency. drivers/staging/wlan-ng/cfg80211.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index a7d24c9..6c31730 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -400,6 +400,8 @@ static int prism2_scan(struct wiphy *wiphy, numbss = msg1.numbss.data; for (i = 0; i < numbss; i++) { + int freq; + memset(&msg2, 0, sizeof(msg2)); msg2.msgcode = DIDmsg_dot11req_scan_results; msg2.bssindex.data = i; @@ -414,9 +416,10 @@ static int prism2_scan(struct wiphy *wiphy, ie_buf[1] = msg2.ssid.data.len; ie_len = ie_buf[1] + 2; memcpy(&ie_buf[2], &(msg2.ssid.data.data), msg2.ssid.data.len); + freq = ieee80211_channel_to_frequency(msg2.dschannel.data, + IEEE80211_BAND_2GHZ); bss = cfg80211_inform_bss(wiphy, - ieee80211_get_channel(wiphy, - ieee80211_dsss_chan_to_freq(msg2.dschannel.data)), + ieee80211_get_channel(wiphy, freq), (const u8 *) &(msg2.bssid.data.data), msg2.timestamp.data, msg2.capinfo.data, msg2.beaconperiod.data,