Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2936169ybl; Thu, 29 Aug 2019 15:22:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4iVPkqjeBTCYSEqrTDqSSLZOyGnZJkkmIQqCRQqD4VQWLqhLc0hesozq/qkci+hoEdqBF X-Received: by 2002:a17:90a:650c:: with SMTP id i12mr12297706pjj.11.1567117349294; Thu, 29 Aug 2019 15:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567117349; cv=none; d=google.com; s=arc-20160816; b=nTHH02EVzV1ZA3KXV3Qru/HH0Iiqu1oSixQ97T1Jbw1p8h3pDk2eqQQft5vfDJod/3 T8WMwWp8Q5w5rZD8ilNWhMHc2nIpJ5PJJ6sZJfJYJgLW6XKAxDzvvO6Q96qzBvRpfRp5 1B7Q4PGJ/AelyVFo1RRMNNQj7b9T1ExVHt91poJZp2IvVmcOeR0AUa2JkaZc9uaaqQ9a bJp/0GKqew3HcCo0NJRx+C+tp31hZaOqF+JfNPKZwlS1V3aY+zfC3bPxugI2Irfx1J9H FmaiFt1YmhFOjrD3yhleDzmtymEfhXWaYrzrh0EFwALeXjBg1svADJFKcMTEKeFfeOaL w9lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=3Vsxw0Dd0zDxedNhcOzD+9xW6QJtpx41scu6j5MfXSQ=; b=WwKb+NFJM6uo23T+lrKh/0unjC15+06y3+kUZX9KadYO4izCDBQWTNmd48kJI5UcCO 30LMCqRUtML5AAf1aLv5lRaiQPqzGcEZFbW0BPkdUAbdYi6Xl1y1ih7CvpHcS6bYNE8W y/fpoiftKfUZVRQfiiEQ4jj0LX0A+WeNMZgvsHFv0Jd/vKtkBPz3hTW2ZqElE5uatgnv x+nlriWfGrc1IQsXwIdDzH0U7AzzWk3t0aFfq/JRbNVb2EkBf6VxdDOi2+NfAYVOFigd vSAZY6TzzcP+GUj9eSAwRQSyXnQcVSfvC51dyHusb6jhcrQtln/GjgSUq50IYI5dkesH oLhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c130si3962017pfc.103.2019.08.29.15.22.09; Thu, 29 Aug 2019 15:22:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727969AbfH2WWA (ORCPT + 99 others); Thu, 29 Aug 2019 18:22:00 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:53947 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727763AbfH2WWA (ORCPT ); Thu, 29 Aug 2019 18:22:00 -0400 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 29 Aug 2019 15:22:00 -0700 Received: from asinghal-linux.qualcomm.com ([10.234.220.60]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 29 Aug 2019 15:22:00 -0700 Received: by asinghal-linux.qualcomm.com (Postfix, from userid 73644) id 0D30136AF; Thu, 29 Aug 2019 15:22:00 -0700 (PDT) From: Amar Singhal To: johannes@sipsolutions.net, jouni@codeaurora.org Cc: linux-wireless@vger.kernel.org, jjohnson@codeaurora.org, rmanohar@codeaurora.org, Amar Singhal Subject: [PATCH] cfg80211: Convert 6 GHz channel frequency to channel number Date: Thu, 29 Aug 2019 15:21:30 -0700 Message-Id: <1567117290-19295-1-git-send-email-asinghal@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Enhance function ieee80211_frequency_to_channel by adding 6 GHz channels. Signed-off-by: Amar Singhal --- net/wireless/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index cf63b63..9aba8d54 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -111,8 +111,10 @@ int ieee80211_frequency_to_channel(int freq) return (freq - 2407) / 5; else if (freq >= 4910 && freq <= 4980) return (freq - 4000) / 5; - else if (freq <= 45000) /* DMG band lower limit */ + else if (freq > 5000 && freq <= 5920) return (freq - 5000) / 5; + else if (freq >= 5945 && freq <= 7205) + return (freq - 5940) / 5; else if (freq >= 58320 && freq <= 70200) return (freq - 56160) / 2160; else -- 1.9.1