summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2009-11-15 14:04:03 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2009-11-15 14:04:03 +0000
commit9fb43e3df4f7129d8df3b814baede2c7e1656f11 (patch)
tree3537a079a19dc8d4a031aab08c1576b8a7a07e1f /sys/dev/ic
parent6446a2b9afe587bc50d6aacd613e231aa0114d90 (diff)
AR9287 uses GPIO pin 8 for LED, not 1.
Turn link LED on while associated.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ar5416.c3
-rw-r--r--sys/dev/ic/ar9280.c3
-rw-r--r--sys/dev/ic/ar9285.c3
-rw-r--r--sys/dev/ic/ar9287.c3
-rw-r--r--sys/dev/ic/athn.c10
-rw-r--r--sys/dev/ic/athnreg.h3
-rw-r--r--sys/dev/ic/athnvar.h3
7 files changed, 18 insertions, 10 deletions
diff --git a/sys/dev/ic/ar5416.c b/sys/dev/ic/ar5416.c
index 0a52e669194..f75421d98d0 100644
--- a/sys/dev/ic/ar5416.c
+++ b/sys/dev/ic/ar5416.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5416.c,v 1.2 2009/11/14 20:18:25 deraadt Exp $ */
+/* $OpenBSD: ar5416.c,v 1.3 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -96,6 +96,7 @@ ar5416_attach(struct athn_softc *sc)
sc->eep_size = sizeof (struct ar5416_eeprom);
sc->def_nf = AR5416_PHY_CCA_MAX_GOOD_VALUE;
sc->ngpiopins = 14;
+ sc->led_pin = 1;
sc->workaround = AR5416_WA_DEFAULT;
sc->ops.setup = ar5416_setup;
sc->ops.swap_rom = ar5416_swap_rom;
diff --git a/sys/dev/ic/ar9280.c b/sys/dev/ic/ar9280.c
index ffa07d28a4c..bd034c1acdd 100644
--- a/sys/dev/ic/ar9280.c
+++ b/sys/dev/ic/ar9280.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar9280.c,v 1.1 2009/11/14 16:55:11 damien Exp $ */
+/* $OpenBSD: ar9280.c,v 1.2 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -82,6 +82,7 @@ ar9280_attach(struct athn_softc *sc)
sc->eep_size = sizeof (struct ar5416_eeprom);
sc->def_nf = AR9280_PHY_CCA_MAX_GOOD_VALUE;
sc->ngpiopins = 10;
+ sc->led_pin = 1;
sc->workaround = AR9280_WA_DEFAULT;
sc->ops.setup = ar9280_setup;
sc->ops.swap_rom = ar5416_swap_rom;
diff --git a/sys/dev/ic/ar9285.c b/sys/dev/ic/ar9285.c
index ea32614691d..dbc2463ae57 100644
--- a/sys/dev/ic/ar9285.c
+++ b/sys/dev/ic/ar9285.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar9285.c,v 1.2 2009/11/14 20:18:25 deraadt Exp $ */
+/* $OpenBSD: ar9285.c,v 1.3 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -89,6 +89,7 @@ ar9285_attach(struct athn_softc *sc)
sc->eep_size = sizeof (struct ar9285_eeprom);
sc->def_nf = AR9285_PHY_CCA_MAX_GOOD_VALUE;
sc->ngpiopins = 12;
+ sc->led_pin = 1;
sc->workaround = AR9285_WA_DEFAULT;
sc->ops.setup = ar9285_setup;
sc->ops.swap_rom = ar9285_swap_rom;
diff --git a/sys/dev/ic/ar9287.c b/sys/dev/ic/ar9287.c
index e9dde7745f9..239a53b1093 100644
--- a/sys/dev/ic/ar9287.c
+++ b/sys/dev/ic/ar9287.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar9287.c,v 1.2 2009/11/14 20:18:25 deraadt Exp $ */
+/* $OpenBSD: ar9287.c,v 1.3 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -90,6 +90,7 @@ ar9287_attach(struct athn_softc *sc)
sc->eep_size = sizeof (struct ar9287_eeprom);
sc->def_nf = AR9287_PHY_CCA_MAX_GOOD_VALUE;
sc->ngpiopins = 11;
+ sc->led_pin = 8;
sc->workaround = AR9285_WA_DEFAULT;
sc->ops.setup = ar9287_setup;
sc->ops.swap_rom = ar9287_swap_rom;
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index 601c25e61bb..487ba442264 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.2 2009/11/15 10:25:27 damien Exp $ */
+/* $OpenBSD: athn.c,v 1.3 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -317,10 +317,10 @@ athn_attach(struct athn_softc *sc)
athn_btcoex_init(sc);
#endif
- athn_gpio_config_output(sc, AR_GPIO_LED_PIN,
+ athn_gpio_config_output(sc, sc->led_pin,
AR_GPIO_OUTPUT_MUX_AS_OUTPUT);
/* LED off, active low. */
- athn_gpio_write(sc, AR_GPIO_LED_PIN, 1);
+ athn_gpio_write(sc, sc->led_pin, 1);
if (AR_SINGLE_CHIP(sc)) {
printf("%s: %s rev %d (%dT%dR), ROM rev %d\n",
@@ -4322,6 +4322,8 @@ athn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
int error;
timeout_del(&sc->calib_to);
+ if (ic->ic_state == IEEE80211_S_RUN)
+ athn_gpio_write(sc, sc->led_pin, 1);
switch (nstate) {
case IEEE80211_S_INIT:
@@ -4340,6 +4342,8 @@ athn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
case IEEE80211_S_ASSOC:
break;
case IEEE80211_S_RUN:
+ athn_gpio_write(sc, sc->led_pin, 0);
+
if (ic->ic_opmode == IEEE80211_M_MONITOR)
break;
diff --git a/sys/dev/ic/athnreg.h b/sys/dev/ic/athnreg.h
index f5ef1e222ce..6cbe50c0068 100644
--- a/sys/dev/ic/athnreg.h
+++ b/sys/dev/ic/athnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: athnreg.h,v 1.2 2009/11/14 20:54:57 damien Exp $ */
+/* $OpenBSD: athnreg.h,v 1.3 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -2141,7 +2141,6 @@ struct ar_rx_desc {
#define AR_KEYTABLE_SIZE 128
/* GPIO pins. */
-#define AR_GPIO_LED_PIN 1
#define AR_GPIO_WLANACTIVE_PIN 5
#define AR_GPIO_BTACTIVE_PIN 6
#define AR_GPIO_BTPRIORITY_PIN 7
diff --git a/sys/dev/ic/athnvar.h b/sys/dev/ic/athnvar.h
index d727bf7dce4..c5ec813e00e 100644
--- a/sys/dev/ic/athnvar.h
+++ b/sys/dev/ic/athnvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: athnvar.h,v 1.1 2009/11/14 16:55:11 damien Exp $ */
+/* $OpenBSD: athnvar.h,v 1.2 2009/11/15 14:04:02 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -374,6 +374,7 @@ struct athn_softc {
#define ATHN_FLAG_BTCOEX (ATHN_FLAG_BTCOEX2WIRE | ATHN_FLAG_BTCOEX3WIRE)
uint8_t ngpiopins;
+ int led_pin;
int rfsilent_pin;
uint16_t mac_ver;