summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_iwn.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2009-10-24 18:32:38 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2009-10-24 18:32:38 +0000
commit2a0e61964eacd142489e1b4a61361f83c31df3c0 (patch)
tree033ff769db7a5fa3fc0b62ad8c0ae4bfb5e3a095 /sys/dev/pci/if_iwn.c
parente5f78394d4dcf563521c29c653baada3052f7d1a (diff)
always power on adapter before reading ROM.
previously, it was only done for OTPROM but it seems 4965 (which has a good old EEPROM) needs it too.
Diffstat (limited to 'sys/dev/pci/if_iwn.c')
-rw-r--r--sys/dev/pci/if_iwn.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c
index a9aec53e00a..58b83640e1f 100644
--- a/sys/dev/pci/if_iwn.c
+++ b/sys/dev/pci/if_iwn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwn.c,v 1.66 2009/10/24 18:14:57 damien Exp $ */
+/* $OpenBSD: if_iwn.c,v 1.67 2009/10/24 18:32:37 damien Exp $ */
/*-
* Copyright (c) 2007-2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -1318,13 +1318,14 @@ iwn_read_eeprom(struct iwn_softc *sc)
return error;
}
+ /* Adapter has to be powered on for EEPROM access to work. */
+ if ((error = iwn_apm_init(sc)) != 0) {
+ printf("%s: could not power ON adapter\n",
+ sc->sc_dev.dv_xname);
+ return error;
+ }
+
if (sc->sc_flags & IWN_FLAG_HAS_OTPROM) {
- /* Adapter has to be powered on for OTPROM access to work. */
- if ((error = iwn_apm_init(sc)) != 0) {
- printf("%s: could not power ON adapter\n",
- sc->sc_dev.dv_xname);
- return error;
- }
if ((error = iwn_init_otprom(sc)) != 0) {
printf("%s: could not initialize OTPROM\n",
sc->sc_dev.dv_xname);
@@ -1342,8 +1343,7 @@ iwn_read_eeprom(struct iwn_softc *sc)
/* Read adapter-specific information from EEPROM. */
hal->read_eeprom(sc);
- if (sc->sc_flags & IWN_FLAG_HAS_OTPROM)
- iwn_apm_stop(sc); /* Power OFF adapter. */
+ iwn_apm_stop(sc); /* Power OFF adapter. */
iwn_eeprom_unlock(sc);
return 0;