linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>,
	Nick Kossifidis <mickflemm@gmail.com>
Subject: [PATCH 6/6] ath5k: Do not let the driver through for not yet supported radios
Date: Fri, 5 Oct 2007 21:20:57 -0400	[thread overview]
Message-ID: <20071006012057.GF25022@pogo> (raw)
In-Reply-To: <20071006012017.GE25022@pogo>

The IBM AR5424 card uses the same vendor:device ID as an old AR5212. AR5424
is not yet supported though. We detect this and report it.

OpenBSD has similar checks but they check for 64-bit.

Changes to ath5k_base.[ch]
Changes-licensed-under: 3-clause-BSD

Changes to hw.c
Changes-licensed-under: ISC

Signed-off-by: Luis R. Rodriguez <mcgrof@gmail.com>
---
 drivers/net/wireless/ath5k/base.c |    1 +
 drivers/net/wireless/ath5k/base.h |    1 +
 drivers/net/wireless/ath5k/hw.c   |   22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c
index caf9562..97a7613 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -2423,6 +2423,7 @@ static int __devinit ath_pci_probe(struct pci_dev *pdev,
 	sc->iobase = mem;
 	sc->cachelsz = csz * sizeof(u32); /* convert to bytes */
 	sc->opmode = IEEE80211_IF_TYPE_STA;
+	sc->pci_express = !!pci_find_capability(pdev, PCI_CAP_ID_EXP);
 	mutex_init(&sc->lock);
 	spin_lock_init(&sc->rxbuflock);
 	spin_lock_init(&sc->txbuflock);
diff --git a/drivers/net/wireless/ath5k/base.h b/drivers/net/wireless/ath5k/base.h
index 1bd1d1f..fde51f1 100644
--- a/drivers/net/wireless/ath5k/base.h
+++ b/drivers/net/wireless/ath5k/base.h
@@ -131,6 +131,7 @@ struct ath_softc {
 	struct ieee80211_rate	rates[AR5K_MAX_RATES * NUM_IEEE80211_MODES];
 	enum ieee80211_if_types	opmode;
 	struct ath_hw		*ah;		/* Atheros HW */
+	unsigned int		pci_express : 1;/* indicates PCI Express */
 
 	int			debug;
 
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c
index 445fa96..5f2edce 100644
--- a/drivers/net/wireless/ath5k/hw.c
+++ b/drivers/net/wireless/ath5k/hw.c
@@ -240,6 +240,28 @@ struct ath_hw *ath5k_hw_attach(u16 device,
 		 */
 		hal->ah_single_chip = true;
 		break;
+	case PCI_DEVICE_ID_ATHEROS_AR5212_IBM:
+		/*
+		* IBM ThinkPads use the same device ID for different
+		* chipset versions... we differentiate by pci_express
+		*/
+		if (sc->pci_express) {
+			/*
+			* PCI Express "Mini Card" interface based on the
+			* AR5424 chipset.
+			*/
+			hal->ah_single_chip = true;
+			/* not yet supported */
+			dev_info(&sc->pdev->dev, 
+				"PCI-Express AR5424 not yet supported\n");
+				ret = -EINVAL;
+			goto err_free;
+		} else {
+			/* Classic Mini PCI interface based on AR5212 */
+			hal->ah_single_chip = false;
+		}
+		break;
+
 	default:
 		/*
 		 * Multi chip solutions
-- 
1.5.2.5


  reply	other threads:[~2007-10-06  1:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-06  1:04 [PATCH 0/6] ath5k: initvals, radar, promiscuous bug and multicast Luis R. Rodriguez
2007-10-06  1:16 ` [PATCH 1/6] ath5k: Ported new initval changes from OpenBSD to ath5k Luis R. Rodriguez
2007-10-06  1:18   ` [PATCH 2/6] ath5k: Enable radar detection Luis R. Rodriguez
2007-10-06  1:19     ` [PATCH 3/6] ath5k: Fix a bug which pushed us to enable the promiscuous filter Luis R. Rodriguez
2007-10-06  1:19       ` [PATCH 4/6] ath5k: Add proper support for multicast Luis R. Rodriguez
2007-10-06  1:20         ` [PATCH 5/6] ath5k: Add documenation for atheros bssid_mask Luis R. Rodriguez
2007-10-06  1:20           ` Luis R. Rodriguez [this message]
2007-10-07 10:13             ` [PATCH 6/6] ath5k: Do not let the driver through for not yet supported radios Nick Kossifidis
2007-10-08 20:48               ` Luis R. Rodriguez
2007-10-09  2:37                 ` Nick Kossifidis
2007-10-09  7:02                   ` Holger Schurig
2007-10-09  8:17                     ` Nick Kossifidis
2007-10-09 20:05           ` [PATCH 5/6] ath5k: Add documenation for atheros bssid_mask Johannes Berg
2007-10-09 20:01         ` [PATCH 4/6] ath5k: Add proper support for multicast Johannes Berg
2007-10-10 18:11           ` Luis R. Rodriguez
2007-10-07  9:56     ` [PATCH 2/6] ath5k: Enable radar detection Nick Kossifidis
2007-10-07 10:28       ` Nick Kossifidis
2007-10-08 20:34         ` Luis R. Rodriguez
2007-10-08 21:18           ` Michael Taylor
2007-10-09  7:05             ` Holger Schurig
2007-10-09  9:34               ` Johannes Berg
2007-10-09 15:59                 ` Luis R. Rodriguez
2007-10-07  9:49   ` [PATCH 1/6] ath5k: Ported new initval changes from OpenBSD to ath5k Nick Kossifidis
2007-10-08 20:38     ` Luis R. Rodriguez
2007-10-09  2:31       ` Nick Kossifidis
2007-10-09  7:17         ` Jiri Slaby
2007-10-09  8:15           ` Nick Kossifidis
2007-10-06  1:23 ` [PATCH 0/6] ath5k: initvals, radar, promiscuous bug and multicast Luis R. Rodriguez

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=20071006012057.GF25022@pogo \
    --to=mcgrof@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mickflemm@gmail.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).