From patchwork Mon Jun 5 15:29:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9766361 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2287160364 for ; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14D9426E16 for ; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 094CF2836F; Mon, 5 Jun 2017 15:30:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 740D826E16 for ; Mon, 5 Jun 2017 15:30:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751293AbdFEPaG (ORCPT ); Mon, 5 Jun 2017 11:30:06 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:33839 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751284AbdFEPaE (ORCPT ); Mon, 5 Jun 2017 11:30:04 -0400 Received: by mail-oi0-f65.google.com with SMTP id d99so10783154oic.1 for ; Mon, 05 Jun 2017 08:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=03n6hSrX6qvwR+yXPz+s3ybiW3ZQZjGuwK2gDVzojwg=; b=lhBcOVPYuDzKZWVx6X8KasEQds7UalKfT1wMLoA0zK9voupTLbUNzdcTY82OW/Dac9 xjs68cQ7NYh834/nsaT5oYAwFd/PEnUmNMCKGbzyi0GlwPEf+33kGcA7uNeOQV8ifskt QXtNp/X7OV5qGgxTjU3AcNsjX1aH5xmaTIQQ6oa+2m96D9QY+/eonME2NLdoHXLIYEQf V1tkQoGMJAkqWIFB5wqhq7mtnDYIU8LqNUd2DqUFv1jtby6u0YYfJyN5GZW1mSReju2e Mp7b3BYmg7xk3LD422Te16hNrJzeYK3pXnNO4r0+prFOAQ3q6D0nG5gP/MS7fLxojeMx kQYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=03n6hSrX6qvwR+yXPz+s3ybiW3ZQZjGuwK2gDVzojwg=; b=OTEFfcsTiGArgOdKOt3P8a6aBafl4JUdjOQBWp0J/SQgpbYd4K8UuNE1AUOIHTe0Gp HpbFt8Fie7Wr/NYXwwuvHABkkI8XbYjeZgpDnbYtOeluDfSs86mUH77hyOg/YwW7XED9 HBa736q1TZJzFAEazznrh5gK3n/4d3vOneHhS7ch7b+DvOL/mcr2JXT6TTzEsDUzYYsJ 4z/lw9ZH7S/cdcwa2xqHX7v+tl/+He9TNhMGyyaq5O8HSQZTm1WXspMIw20QI+X9OGSB oQG1U3M38vOYlj+bBOn5wGCeugJ3xXjizF8jwlTNFnRIuARAhX/HYmTLlyuDWE8+j6Kp 79RA== X-Gm-Message-State: AODbwcC7gXOO6XbOTY/sHujNhsugxujHR/8J0FZufvM+qCnGXgVSG/ah XMTrg/TWXbTSldyW X-Received: by 10.157.28.130 with SMTP id l2mr7014633ota.99.1496676603733; Mon, 05 Jun 2017 08:30:03 -0700 (PDT) Received: from localhost.localdomain (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id z23sm5554723otz.11.2017.06.05.08.30.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 08:30:03 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Yan-Hsuan Chuang , Larry Finger , Ping-Ke Shih , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH v2 1/9] rtlwifi: btcoex: add macros to check chip type Date: Mon, 5 Jun 2017 10:29:51 -0500 Message-Id: <20170605152959.27439-2-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170605152959.27439-1-Larry.Finger@lwfinger.net> References: <20170605152959.27439-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yan-Hsuan Chuang For some external functions that have hardware dependency, we need to know the type of the hardware before invoking them. Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Larry Finger Cc: Ping-Ke Shih Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- .../realtek/rtlwifi/btcoexist/halbt_precomp.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h index 39b9a3309cfd..2ac989a4b2bb 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h @@ -37,6 +37,28 @@ #include "halbtcoutsrc.h" +/* Interface type */ +#define RT_PCI_INTERFACE 1 +#define RT_USB_INTERFACE 2 +#define RT_SDIO_INTERFACE 3 +#define DEV_BUS_TYPE RT_PCI_INTERFACE + +/* IC type */ +#define RTL_HW_TYPE(adapter) (rtl_hal((struct rtl_priv *)adapter)->hw_type) + +#define IS_NEW_GENERATION_IC(adapter) \ + (RTL_HW_TYPE(adapter) >= HARDWARE_TYPE_RTL8192EE) +#define IS_HARDWARE_TYPE_8812(adapter) \ + (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8812AE) +#define IS_HARDWARE_TYPE_8821(adapter) \ + (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8821AE) +#define IS_HARDWARE_TYPE_8723A(adapter) \ + (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723AE) +#define IS_HARDWARE_TYPE_8723B(adapter) \ + (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723BE) +#define IS_HARDWARE_TYPE_8192E(adapter) \ + (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8192EE) + #include "halbtc8192e2ant.h" #include "halbtc8723b1ant.h" #include "halbtc8723b2ant.h"