diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-09-18 16:34:24 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-09-18 16:34:24 +0000 |
commit | 5b7b4f1f29e0aa2c9d6b3d13caf2439b179247ca (patch) | |
tree | 0cdbeb12a3d5fc22118aeb736985917373529ad9 /sys/dev | |
parent | a51ccdf48537c6e851bec5f136e763973199cac9 (diff) |
better uath_set_rates().
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/if_uath.c | 13 | ||||
-rw-r--r-- | sys/dev/usb/if_uathreg.h | 7 |
2 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index 9bb35e365a1..7745f6148c5 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.7 2006/09/18 16:30:17 damien Exp $ */ +/* $OpenBSD: if_uath.c,v 1.8 2006/09/18 16:34:23 damien Exp $ */ /*- * Copyright (c) 2006 @@ -1709,9 +1709,6 @@ uath_wme_init(struct uath_softc *sc) Static int uath_set_chan(struct uath_softc *sc, struct ieee80211_channel *c) { -#ifdef UATH_DEBUG - struct ieee80211com *ic = &sc->sc_ic; -#endif struct uath_set_chan chan; bzero(&chan, sizeof chan); @@ -1721,7 +1718,8 @@ uath_set_chan(struct uath_softc *sc, struct ieee80211_channel *c) chan.magic2 = htobe32(50); chan.magic3 = htobe32(1); - DPRINTF(("switching to channel %d\n", ieee80211_chan2ieee(ic, c))); + DPRINTF(("switching to channel %d\n", + ieee80211_chan2ieee(&sc->sc_ic, c))); return uath_cmd_write(sc, UATH_CMD_SET_CHAN, &chan, sizeof chan, 0); } @@ -1777,13 +1775,12 @@ uath_set_rates(struct uath_softc *sc, const struct ieee80211_rateset *rs) bzero(&rates, sizeof rates); rates.magic1 = htobe32(0x02); - rates.magic2 = htobe32(0x21); + rates.size = htobe32(1 + UATH_MAX_NRATES); rates.nrates = rs->rs_nrates; bcopy(rs->rs_rates, rates.rates, rs->rs_nrates); DPRINTF(("setting supported rates nrates=%d\n", rs->rs_nrates)); - return uath_cmd_write(sc, UATH_CMD_SET_RATES, &rates, - 3 * 4 + 1 + rs->rs_nrates, 0); + return uath_cmd_write(sc, UATH_CMD_SET_RATES, &rates, sizeof rates, 0); } Static int diff --git a/sys/dev/usb/if_uathreg.h b/sys/dev/usb/if_uathreg.h index 1b46adaea45..3373928ccd1 100644 --- a/sys/dev/usb/if_uathreg.h +++ b/sys/dev/usb/if_uathreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uathreg.h,v 1.1 2006/09/16 13:21:24 damien Exp $ */ +/* $OpenBSD: if_uathreg.h,v 1.2 2006/09/18 16:34:23 damien Exp $ */ /*- * Copyright (c) 2006 @@ -182,9 +182,10 @@ struct uath_cmd_crypto { struct uath_cmd_rates { uint32_t magic1; uint32_t reserved; - uint32_t magic2; + uint32_t size; uint8_t nrates; - uint8_t rates[IEEE80211_RATE_MAXSIZE]; +#define UATH_MAX_NRATES 30 + uint8_t rates[UATH_MAX_NRATES]; } __packed; /* structure for command UATH_CMD_SET_CHAN */ |