linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	<linux-wireless@vger.kernel.org>, <users@rt2x00.serialmonkey.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 3/7] rt2x00: Introduce separate interface type for PCI-express.
Date: Wed, 19 May 2010 17:26:05 +0200	[thread overview]
Message-ID: <1274282769-19244-4-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1274282769-19244-1-git-send-email-gwingerde@gmail.com>

Needed later for PCI-express specific code in rt2800pci.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00.h    |    9 ++++++++-
 drivers/net/wireless/rt2x00/rt2x00pci.c |    5 ++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

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)
-- 
1.7.1


  parent reply	other threads:[~2010-05-19 15:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 15:26 [PATCH 0/7] rt2x00: Further cleanups and fixes Gertjan van Wingerde
2010-05-19 15:26 ` [PATCH 1/7] rt2x00: Remove RT2870 chipset identification Gertjan van Wingerde
2010-05-19 18:09   ` Ivo Van Doorn
2010-05-19 15:26 ` [PATCH 2/7] rt2x00: Move all register definitions for rt2800 to rt2800.h Gertjan van Wingerde
2010-05-19 18:10   ` Ivo Van Doorn
2010-05-19 15:26 ` Gertjan van Wingerde [this message]
2010-05-19 18:10   ` [PATCH 3/7] rt2x00: Introduce separate interface type for PCI-express Ivo Van Doorn
2010-05-19 15:26 ` [PATCH 4/7] rt2x00: Simplify check for external LNA in rt2800_init_rfcsr Gertjan van Wingerde
2010-05-19 18:11   ` Ivo Van Doorn
2010-05-19 15:26 ` [PATCH 5/7] rt2x00: Move PCI/USB specific register initializations to rt2800{pci,usb} Gertjan van Wingerde
2010-05-19 18:12   ` Ivo Van Doorn
2010-05-19 18:26   ` Ivo van Doorn
2010-05-19 18:33     ` Gertjan van Wingerde
2010-05-19 15:26 ` [PATCH 6/7] rt2x00: Sync rt2800 MCU boot signal with Ralink driver Gertjan van Wingerde
2010-05-19 18:12   ` Ivo Van Doorn
2010-05-19 15:26 ` [PATCH 7/7] rt2x00: Fix HT40 operation in rt2800 Gertjan van Wingerde
2010-05-19 15:51   ` Helmut Schaa
2010-05-19 18:14   ` Ivo Van Doorn
2010-05-19 19:08     ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1274282769-19244-4-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).