From patchwork Fri Mar 20 13:54:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6056981 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33988BF90F for ; Fri, 20 Mar 2015 13:57:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46C41204D1 for ; Fri, 20 Mar 2015 13:57:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E104201BC for ; Fri, 20 Mar 2015 13:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751834AbbCTN5v (ORCPT ); Fri, 20 Mar 2015 09:57:51 -0400 Received: from mail-la0-f54.google.com ([209.85.215.54]:35191 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbbCTN4t (ORCPT ); Fri, 20 Mar 2015 09:56:49 -0400 Received: by labjg1 with SMTP id jg1so87648890lab.2 for ; Fri, 20 Mar 2015 06:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GSKuGiU81814rgCM4DbU6JtTVH6LqPDMw3pVjcY1TLk=; b=Hbq/PcZnLfjF5luxuQ5uMy56qoNdV/aehkJd9l+5Bu67VzpFBM7mmCVky9Z0ZQ0v6m vSR5pZNb2YyxAP86dZtTAiogKm+3bypPMVTtxuHM9zBs/y2JQit2Tsn/JzJ4FLJ/1vIm zvwvdFjEC9P433mvGnpOA2CyhaVJDYoSh6puI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GSKuGiU81814rgCM4DbU6JtTVH6LqPDMw3pVjcY1TLk=; b=HQBAJkblOeA5gO9ZR8ZLcvmtgng7yLjx7l53KE1azwX7bttBC0+J+8FDU++d7TGjXT pjxCOM5vX5hsLczybGE/SzBwk8vmj1oleh1nNwdL0e0fsDQjSa85B6gO/uz7+FLxbNs+ J/iRXLPXy4OenHWb5m7Kld5Lr9MnOTg4kxrnbzhcdhj6/9NMqrKSJJJtOflyt6CJVAK8 Yn4Fcbnop/IhuBhhkAW6LVoHeWiZXKMqdFdyKp67Ltjq75wPu7T24j3E/MWPs0rXutlj aPvS+wSTptVPzoTErcz5j3FYM/FETqoWnf8Ha0EruewDi+n1UEC1tM0JL5Uw1BP2Rzxl ZHMw== X-Gm-Message-State: ALoCoQlSbDhtjy5pc6NcAEagVVkpz1bE57yvwfEl8hUyGFOmjrIO/SxNyriRcVIb56T7ZsczHhKRlWObMfYdcMAlbPMrAfdM3l0QBOHuMe+t7xMJw1mzn7rQJk0CT+4qZqpkjdr0YUwV X-Received: by 10.152.9.200 with SMTP id c8mr71770147lab.67.1426859808339; Fri, 20 Mar 2015 06:56:48 -0700 (PDT) Received: from bob.homerouter.cpe (apn-77-113-71-242.dynamic.gprs.plus.pl. [77.113.71.242]) by mx.google.com with ESMTPSA id us1sm955771lbc.1.2015.03.20.06.56.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 06:56:46 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 1/9] ath10k: move rate definitions to file start Date: Fri, 20 Mar 2015 13:54:07 +0000 Message-Id: <1426859655-11797-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426859655-11797-1-git-send-email-michal.kazior@tieto.com> References: <1426859655-11797-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 Prepare the code for future changes so that new code can refer to rate-related stuff without forward declarations. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 63 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 1214a3b..456d671 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -30,6 +30,38 @@ #include "wmi.h" #include "wmi-ops.h" +/*********/ +/* Rates */ +/*********/ + +#define RATETAB_ENT(_rate, _rateid, _flags) { \ + .bitrate = (_rate), \ + .flags = (_flags), \ + .hw_value = (_rateid), \ +} + +static struct ieee80211_rate ath10k_rates[] = { + /* CCK */ + RATETAB_ENT(10, 0x82, 0), + RATETAB_ENT(20, 0x84, 0), + RATETAB_ENT(55, 0x8b, 0), + RATETAB_ENT(110, 0x96, 0), + /* OFDM */ + RATETAB_ENT(60, 0x0c, 0), + RATETAB_ENT(90, 0x12, 0), + RATETAB_ENT(120, 0x18, 0), + RATETAB_ENT(180, 0x24, 0), + RATETAB_ENT(240, 0x30, 0), + RATETAB_ENT(360, 0x48, 0), + RATETAB_ENT(480, 0x60, 0), + RATETAB_ENT(540, 0x6c, 0), +}; + +#define ath10k_a_rates (ath10k_rates + 4) +#define ath10k_a_rates_size (ARRAY_SIZE(ath10k_rates) - 4) +#define ath10k_g_rates (ath10k_rates + 0) +#define ath10k_g_rates_size (ARRAY_SIZE(ath10k_rates)) + /**********/ /* Crypto */ /**********/ @@ -5420,12 +5452,6 @@ static const struct ieee80211_ops ath10k_ops = { #endif }; -#define RATETAB_ENT(_rate, _rateid, _flags) { \ - .bitrate = (_rate), \ - .flags = (_flags), \ - .hw_value = (_rateid), \ -} - #define CHAN2G(_channel, _freq, _flags) { \ .band = IEEE80211_BAND_2GHZ, \ .hw_value = (_channel), \ @@ -5488,31 +5514,6 @@ static const struct ieee80211_channel ath10k_5ghz_channels[] = { CHAN5G(165, 5825, 0), }; -/* Note: Be careful if you re-order these. There is code which depends on this - * ordering. - */ -static struct ieee80211_rate ath10k_rates[] = { - /* CCK */ - RATETAB_ENT(10, 0x82, 0), - RATETAB_ENT(20, 0x84, 0), - RATETAB_ENT(55, 0x8b, 0), - RATETAB_ENT(110, 0x96, 0), - /* OFDM */ - RATETAB_ENT(60, 0x0c, 0), - RATETAB_ENT(90, 0x12, 0), - RATETAB_ENT(120, 0x18, 0), - RATETAB_ENT(180, 0x24, 0), - RATETAB_ENT(240, 0x30, 0), - RATETAB_ENT(360, 0x48, 0), - RATETAB_ENT(480, 0x60, 0), - RATETAB_ENT(540, 0x6c, 0), -}; - -#define ath10k_a_rates (ath10k_rates + 4) -#define ath10k_a_rates_size (ARRAY_SIZE(ath10k_rates) - 4) -#define ath10k_g_rates (ath10k_rates + 0) -#define ath10k_g_rates_size (ARRAY_SIZE(ath10k_rates)) - struct ath10k *ath10k_mac_create(size_t priv_size) { struct ieee80211_hw *hw;