diff options
author | 2006-03-21 11:19:22 +0000 | |
---|---|---|
committer | 2006-03-21 11:19:22 +0000 | |
commit | d3dd35e64ced7c636b8219968834162cc67ab7a4 (patch) | |
tree | eced38b25d0c980edb4b6beb65994caeff33d4ab /sys/dev/usb/if_ral.c | |
parent | Revert for the moment, according to Mike Belopuhov this produces (diff) | |
download | wireguard-openbsd-d3dd35e64ced7c636b8219968834162cc67ab7a4.tar.xz wireguard-openbsd-d3dd35e64ced7c636b8219968834162cc67ab7a4.zip |
Make ural(4) read and show real MAC/BBP rev instead of hardcoded RT2570
"Go ahead" damien@ via jsg@
Diffstat (limited to 'sys/dev/usb/if_ral.c')
-rw-r--r-- | sys/dev/usb/if_ral.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index 9eabe32b4e5..6a9311e000b 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.65 2006/02/19 08:44:17 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.66 2006/03/21 11:19:22 pedro Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -430,9 +430,9 @@ USB_ATTACH(ural) /* retrieve MAC address and various other things from EEPROM */ ural_read_eeprom(sc); - printf("%s: MAC/BBP RT2570 (rev 0x%02x), RF %s, address %s\n", - USBDEVNAME(sc->sc_dev), sc->asic_rev, ural_get_rf(sc->rf_rev), - ether_sprintf(ic->ic_myaddr)); + printf("%s: MAC/BBP RT%02x (rev 0x%02x), RF %s, address %s\n", + USBDEVNAME(sc->sc_dev), sc->macbbp_rev, sc->asic_rev, + ural_get_rf(sc->rf_rev), ether_sprintf(ic->ic_myaddr)); ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */ @@ -1997,6 +1997,10 @@ ural_read_eeprom(struct ural_softc *sc) struct ieee80211com *ic = &sc->sc_ic; uint16_t val; + /* retrieve MAC/BBP type */ + ural_eeprom_read(sc, RAL_EEPROM_MACBBP, &val, 2); + sc->macbbp_rev = letoh16(val); + ural_eeprom_read(sc, RAL_EEPROM_CONFIG0, &val, 2); val = letoh16(val); sc->rf_rev = (val >> 11) & 0x7; |