aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/wlan
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb/wlan')
-rw-r--r--sys/dev/usb/wlan/if_mtw.c24
-rw-r--r--sys/dev/usb/wlan/if_upgt.c6
-rw-r--r--sys/dev/usb/wlan/if_zyd.c2
3 files changed, 20 insertions, 12 deletions
diff --git a/sys/dev/usb/wlan/if_mtw.c b/sys/dev/usb/wlan/if_mtw.c
index 6967e5081542..8384c0a2d9fc 100644
--- a/sys/dev/usb/wlan/if_mtw.c
+++ b/sys/dev/usb/wlan/if_mtw.c
@@ -174,7 +174,7 @@ static int mtw_read(struct mtw_softc *, uint16_t, uint32_t *);
static int mtw_read_region_1(struct mtw_softc *, uint16_t, uint8_t *, int);
static int mtw_write_2(struct mtw_softc *, uint16_t, uint16_t);
static int mtw_write(struct mtw_softc *, uint16_t, uint32_t);
-static int mtw_write_region_1(struct mtw_softc *, uint16_t, uint8_t *, int);
+static int mtw_write_region_1(struct mtw_softc *, uint16_t, const uint8_t *, int);
static int mtw_set_region_4(struct mtw_softc *, uint16_t, uint32_t, int);
static int mtw_efuse_read_2(struct mtw_softc *, uint16_t, uint16_t *);
static int mtw_bbp_read(struct mtw_softc *, uint8_t, uint8_t *);
@@ -1277,7 +1277,8 @@ mtw_write(struct mtw_softc *sc, uint16_t reg, uint32_t val)
}
static int
-mtw_write_region_1(struct mtw_softc *sc, uint16_t reg, uint8_t *buf, int len)
+mtw_write_region_1(struct mtw_softc *sc, uint16_t reg, const uint8_t *buf,
+ int len)
{
usb_device_request_t req;
@@ -1286,7 +1287,8 @@ mtw_write_region_1(struct mtw_softc *sc, uint16_t reg, uint8_t *buf, int len)
USETW(req.wValue, 0);
USETW(req.wIndex, reg);
USETW(req.wLength, len);
- return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req, buf));
+ return (usbd_do_request(sc->sc_udev, &sc->sc_mtx, &req,
+ __DECONST(uint8_t *, buf)));
}
static int
@@ -1911,7 +1913,7 @@ mtw_key_set_cb(void *arg)
/* map net80211 cipher to RT2860 security mode */
switch (cipher) {
case IEEE80211_CIPHER_WEP:
- if (k->wk_keylen < 8)
+ if (ieee80211_crypto_get_key_len(k) < 8)
mode = MTW_MODE_WEP40;
else
mode = MTW_MODE_WEP104;
@@ -1936,13 +1938,19 @@ mtw_key_set_cb(void *arg)
}
if (cipher == IEEE80211_CIPHER_TKIP) {
- mtw_write_region_1(sc, base, k->wk_key, 16);
- mtw_write_region_1(sc, base + 16, &k->wk_key[24], 8);
- mtw_write_region_1(sc, base + 24, &k->wk_key[16], 8);
+ /* TODO: note the direct use of tx/rx mic offsets! ew! */
+ mtw_write_region_1(sc, base,
+ ieee80211_crypto_get_key_data(k), 16);
+ /* rxmic */
+ mtw_write_region_1(sc, base + 16,
+ ieee80211_crypto_get_key_rxmic_data(k), 8);
+ /* txmic */
+ mtw_write_region_1(sc, base + 24,
+ ieee80211_crypto_get_key_txmic_data(k), 8);
} else {
/* roundup len to 16-bit: XXX fix write_region_1() instead */
mtw_write_region_1(sc, base, k->wk_key,
- (k->wk_keylen + 1) & ~1);
+ (ieee80211_crypto_get_key_len(k) + 1) & ~1);
}
if (!(k->wk_flags & IEEE80211_KEY_GROUP) ||
diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c
index 1ab833301b3c..a860cc3e0fa9 100644
--- a/sys/dev/usb/wlan/if_upgt.c
+++ b/sys/dev/usb/wlan/if_upgt.c
@@ -1174,7 +1174,7 @@ upgt_eeprom_parse_freq3(struct upgt_softc *sc, uint8_t *data, int len)
sc->sc_eeprom_freq3[channel] = freq3[i];
- DPRINTF(sc, UPGT_DEBUG_FW, "frequence=%d, channel=%d\n",
+ DPRINTF(sc, UPGT_DEBUG_FW, "frequency=%d, channel=%d\n",
le16toh(sc->sc_eeprom_freq3[channel].freq), channel);
}
}
@@ -1216,7 +1216,7 @@ upgt_eeprom_parse_freq4(struct upgt_softc *sc, uint8_t *data, int len)
sc->sc_eeprom_freq4[channel][j].pad = 0;
}
- DPRINTF(sc, UPGT_DEBUG_FW, "frequence=%d, channel=%d\n",
+ DPRINTF(sc, UPGT_DEBUG_FW, "frequency=%d, channel=%d\n",
le16toh(freq4_1[i].freq), channel);
}
}
@@ -1244,7 +1244,7 @@ upgt_eeprom_parse_freq6(struct upgt_softc *sc, uint8_t *data, int len)
sc->sc_eeprom_freq6[channel] = freq6[i];
- DPRINTF(sc, UPGT_DEBUG_FW, "frequence=%d, channel=%d\n",
+ DPRINTF(sc, UPGT_DEBUG_FW, "frequency=%d, channel=%d\n",
le16toh(sc->sc_eeprom_freq6[channel].freq), channel);
}
}
diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c
index 7affdcdce089..b7dfc941224d 100644
--- a/sys/dev/usb/wlan/if_zyd.c
+++ b/sys/dev/usb/wlan/if_zyd.c
@@ -827,7 +827,7 @@ zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen,
if (error)
device_printf(sc->sc_dev, "command timeout\n");
STAILQ_REMOVE(&sc->sc_rqh, &rq, zyd_rq, rq);
- DPRINTF(sc, ZYD_DEBUG_CMD, "finsihed cmd %p, error = %d \n",
+ DPRINTF(sc, ZYD_DEBUG_CMD, "finished cmd %p, error = %d \n",
&rq, error);
return (error);