From patchwork Wed May 19 15:26:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gertjan van Wingerde X-Patchwork-Id: 100881 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4JFQK1P015794 for ; Wed, 19 May 2010 15:26:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752239Ab0ESP0R (ORCPT ); Wed, 19 May 2010 11:26:17 -0400 Received: from cpsmtpb-ews06.kpnxchange.com ([213.75.39.9]:3993 "EHLO cpsmtpb-ews06.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751887Ab0ESP0O (ORCPT ); Wed, 19 May 2010 11:26:14 -0400 Received: from cpbrm-ews10.kpnxchange.com ([10.94.84.141]) by cpsmtpb-ews06.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 19 May 2010 17:26:11 +0200 Received: from CPSMTPM-EML102.kpnxchange.com ([195.121.3.6]) by cpbrm-ews10.kpnxchange.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 19 May 2010 17:26:11 +0200 Received: from wingerd.gvw.nl ([86.87.118.224]) by CPSMTPM-EML102.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Wed, 19 May 2010 17:26:10 +0200 Received: by wingerd.gvw.nl (Postfix, from userid 501) id 9F8216003B; Wed, 19 May 2010 17:26:10 +0200 (CEST) From: Gertjan van Wingerde To: "John W. Linville" Cc: Ivo van Doorn , Helmut Schaa , , , Gertjan van Wingerde Subject: [PATCH 3/7] rt2x00: Introduce separate interface type for PCI-express. Date: Wed, 19 May 2010 17:26:05 +0200 Message-Id: <1274282769-19244-4-git-send-email-gwingerde@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1274282769-19244-1-git-send-email-gwingerde@gmail.com> References: <1274282769-19244-1-git-send-email-gwingerde@gmail.com> X-OriginalArrivalTime: 19 May 2010 15:26:10.0964 (UTC) FILETIME=[9C4FAD40:01CAF767] X-RecipientDomain: vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 19 May 2010 15:26:20 +0000 (UTC) diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 9fc3612..e7acc6a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h @@ -160,6 +160,7 @@ struct avg_val { enum rt2x00_chip_intf { RT2X00_CHIP_INTF_PCI, + RT2X00_CHIP_INTF_PCIE, RT2X00_CHIP_INTF_USB, RT2X00_CHIP_INTF_SOC, }; @@ -980,7 +981,13 @@ static inline bool rt2x00_intf(struct rt2x00_dev *rt2x00dev, static inline bool rt2x00_is_pci(struct rt2x00_dev *rt2x00dev) { - return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); + return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI) || + rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE); +} + +static inline bool rt2x00_is_pcie(struct rt2x00_dev *rt2x00dev) +{ + return rt2x00_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE); } static inline bool rt2x00_is_usb(struct rt2x00_dev *rt2x00dev) diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 19b8683..fe4b00b 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c @@ -350,7 +350,10 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) rt2x00dev->irq = pci_dev->irq; rt2x00dev->name = pci_name(pci_dev); - rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); + if (pci_dev->is_pcie) + rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCIE); + else + rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_PCI); retval = rt2x00pci_alloc_reg(rt2x00dev); if (retval)