summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ar5xxx.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2007-04-13 14:44:42 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2007-04-13 14:44:42 +0000
commit5ad6ade5e85987b54b0e14483b27ed413a39ff2d (patch)
tree994b39a0991f3c1555628c557e4dc57865e79b78 /sys/dev/ic/ar5xxx.c
parent05c098915e64978c768534c33db5f8902e731788 (diff)
The integrated Atheros NICs found in IBM/Lenovo ThinkPads use the same
device ID for old AR5212-based 32bit and new AR5424-based 64bit (PCI Express Mini Card) interfaces. Use an extra check to look if the card is 64bit and attach it as a single chip device. This prevents a panic when attaching the device on some laptops like the T60. Tested on a T42 (old AR5212 Mini PCI interface), Tested on a T60 (new AR5424 Mini Card interface) Nevertheless, the AR5424 does not work yet. Thanks to Stefan Konrath
Diffstat (limited to 'sys/dev/ic/ar5xxx.c')
-rw-r--r--sys/dev/ic/ar5xxx.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/ic/ar5xxx.c b/sys/dev/ic/ar5xxx.c
index ee5d132810c..89cffa45279 100644
--- a/sys/dev/ic/ar5xxx.c
+++ b/sys/dev/ic/ar5xxx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.c,v 1.39 2007/03/12 01:04:52 reyk Exp $ */
+/* $OpenBSD: ar5xxx.c,v 1.40 2007/04/13 14:44:41 reyk Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -22,7 +22,6 @@
*/
#include <dev/pci/pcidevs.h>
-
#include <dev/ic/ar5xxx.h>
extern ar5k_attach_t ar5k_ar5210_attach;
@@ -148,9 +147,10 @@ ath_hal_probe(u_int16_t vendor, u_int16_t device)
* Fills in the HAL structure and initialises the device
*/
struct ath_hal *
-ath_hal_attach(u_int16_t device, void *sc, bus_space_tag_t st,
- bus_space_handle_t sh, int *status)
+ath_hal_attach(u_int16_t device, void *arg, bus_space_tag_t st,
+ bus_space_handle_t sh, u_int is_64bit, int *status)
{
+ struct ath_softc *sc = (struct ath_softc *)arg;
struct ath_hal *hal = NULL;
ar5k_attach_t *attach = NULL;
u_int8_t mac[IEEE80211_ADDR_LEN];
@@ -213,6 +213,22 @@ ath_hal_attach(u_int16_t device, void *sc, bus_space_tag_t st,
*/
hal->ah_single_chip = AH_TRUE;
break;
+ case PCI_PRODUCT_ATHEROS_AR5212_IBM:
+ /*
+ * IBM ThinkPads use the same device ID for different
+ * chipset versions. Ugh.
+ */
+ if (is_64bit) {
+ /*
+ * PCI Express "Mini Card" interface based on the
+ * AR5424 chipset
+ */
+ hal->ah_single_chip = AH_TRUE;
+ } else {
+ /* Classic Mini PCI interface based on AR5212 */
+ hal->ah_single_chip = AH_FALSE;
+ }
+ break;
default:
/*
* Multi chip solutions