33#include <sys/sockio.h>
34#include <sys/sysctl.h>
38#include <sys/kernel.h>
39#include <sys/socket.h>
41#include <sys/malloc.h>
42#include <sys/module.h>
44#include <sys/endian.h>
49#include <net/if_var.h>
50#include <net/if_arp.h>
51#include <net/ethernet.h>
53#include <net/if_media.h>
54#include <net/if_types.h>
57#include <netinet/in.h>
58#include <netinet/in_systm.h>
59#include <netinet/in_var.h>
60#include <netinet/if_ether.h>
61#include <netinet/ip.h>
64#include <net80211/ieee80211_var.h>
65#include <net80211/ieee80211_regdomain.h>
66#include <net80211/ieee80211_radiotap.h>
67#include <net80211/ieee80211_ratectl.h>
73#define USB_DEBUG_VAR rum_debug
81static int rum_debug = 0;
83static SYSCTL_NODE(_hw_usb, OID_AUTO, rum, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
90#define RUM_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
101 RUM_DEV(CISCOLINKSYS, WUSB54GC),
102 RUM_DEV(CISCOLINKSYS, WUSB54GR),
103 RUM_DEV(CONCEPTRONIC2, C54RU2),
117 RUM_DEV(GUILLEMOT, HWGUSB254LB),
118 RUM_DEV(GUILLEMOT, HWGUSB254V2AP),
158 const char [IFNAMSIZ],
int,
enum ieee80211_opmode,
159 int,
const uint8_t [IEEE80211_ADDR_LEN],
160 const uint8_t [IEEE80211_ADDR_LEN]);
168 struct ieee80211vap *);
173 const struct ieee80211_rx_stats *,
int,
int);
176 enum ieee80211_state,
int);
180 uint32_t, uint8_t, uint8_t,
int,
int,
int);
182 struct ieee80211_node *,
183 const struct ieee80211_key *);
185 struct ieee80211_node *);
187 struct ieee80211_node *,
188 const struct ieee80211_bpf_params *);
190 struct ieee80211_node *);
191static int rum_transmit(
struct ieee80211com *,
struct mbuf *);
215 struct ieee80211_channel *);
217 struct ieee80211_channel *);
219 struct ieee80211vap *);
243static int rum_reset(
struct ieee80211vap *, u_long);
245 struct ieee80211vap *);
247 struct ieee80211vap *);
252 struct ieee80211_key *, uint16_t);
262 struct ieee80211_key *, ieee80211_keyix *,
265 const struct ieee80211_key *);
267 const struct ieee80211_key *);
268static int rum_raw_xmit(
struct ieee80211_node *,
struct mbuf *,
269 const struct ieee80211_bpf_params *);
274 struct ieee80211_channel[]);
277 struct ieee80211_node *);
343 { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64,
344 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140,
345 149, 153, 157, 161, 165 };
351 { 1, 0x00b03, 0x001e1, 0x1a014, 0x30282 },
352 { 2, 0x00b03, 0x001e1, 0x1a014, 0x30287 },
353 { 3, 0x00b03, 0x001e2, 0x1a014, 0x30282 },
354 { 4, 0x00b03, 0x001e2, 0x1a014, 0x30287 },
355 { 5, 0x00b03, 0x001e3, 0x1a014, 0x30282 },
356 { 6, 0x00b03, 0x001e3, 0x1a014, 0x30287 },
357 { 7, 0x00b03, 0x001e4, 0x1a014, 0x30282 },
358 { 8, 0x00b03, 0x001e4, 0x1a014, 0x30287 },
359 { 9, 0x00b03, 0x001e5, 0x1a014, 0x30282 },
360 { 10, 0x00b03, 0x001e5, 0x1a014, 0x30287 },
361 { 11, 0x00b03, 0x001e6, 0x1a014, 0x30282 },
362 { 12, 0x00b03, 0x001e6, 0x1a014, 0x30287 },
363 { 13, 0x00b03, 0x001e7, 0x1a014, 0x30282 },
364 { 14, 0x00b03, 0x001e8, 0x1a014, 0x30284 },
366 { 34, 0x00b03, 0x20266, 0x36014, 0x30282 },
367 { 38, 0x00b03, 0x20267, 0x36014, 0x30284 },
368 { 42, 0x00b03, 0x20268, 0x36014, 0x30286 },
369 { 46, 0x00b03, 0x20269, 0x36014, 0x30288 },
371 { 36, 0x00b03, 0x00266, 0x26014, 0x30288 },
372 { 40, 0x00b03, 0x00268, 0x26014, 0x30280 },
373 { 44, 0x00b03, 0x00269, 0x26014, 0x30282 },
374 { 48, 0x00b03, 0x0026a, 0x26014, 0x30284 },
375 { 52, 0x00b03, 0x0026b, 0x26014, 0x30286 },
376 { 56, 0x00b03, 0x0026c, 0x26014, 0x30288 },
377 { 60, 0x00b03, 0x0026e, 0x26014, 0x30280 },
378 { 64, 0x00b03, 0x0026f, 0x26014, 0x30282 },
380 { 100, 0x00b03, 0x0028a, 0x2e014, 0x30280 },
381 { 104, 0x00b03, 0x0028b, 0x2e014, 0x30282 },
382 { 108, 0x00b03, 0x0028c, 0x2e014, 0x30284 },
383 { 112, 0x00b03, 0x0028d, 0x2e014, 0x30286 },
384 { 116, 0x00b03, 0x0028e, 0x2e014, 0x30288 },
385 { 120, 0x00b03, 0x002a0, 0x2e014, 0x30280 },
386 { 124, 0x00b03, 0x002a1, 0x2e014, 0x30282 },
387 { 128, 0x00b03, 0x002a2, 0x2e014, 0x30284 },
388 { 132, 0x00b03, 0x002a3, 0x2e014, 0x30286 },
389 { 136, 0x00b03, 0x002a4, 0x2e014, 0x30288 },
390 { 140, 0x00b03, 0x002a6, 0x2e014, 0x30280 },
392 { 149, 0x00b03, 0x002a8, 0x2e014, 0x30287 },
393 { 153, 0x00b03, 0x002a9, 0x2e014, 0x30289 },
394 { 157, 0x00b03, 0x002ab, 0x2e014, 0x30281 },
395 { 161, 0x00b03, 0x002ac, 0x2e014, 0x30283 },
396 { 165, 0x00b03, 0x002ad, 0x2e014, 0x30285 }
398 { 1, 0x00b33, 0x011e1, 0x1a014, 0x30282 },
399 { 2, 0x00b33, 0x011e1, 0x1a014, 0x30287 },
400 { 3, 0x00b33, 0x011e2, 0x1a014, 0x30282 },
401 { 4, 0x00b33, 0x011e2, 0x1a014, 0x30287 },
402 { 5, 0x00b33, 0x011e3, 0x1a014, 0x30282 },
403 { 6, 0x00b33, 0x011e3, 0x1a014, 0x30287 },
404 { 7, 0x00b33, 0x011e4, 0x1a014, 0x30282 },
405 { 8, 0x00b33, 0x011e4, 0x1a014, 0x30287 },
406 { 9, 0x00b33, 0x011e5, 0x1a014, 0x30282 },
407 { 10, 0x00b33, 0x011e5, 0x1a014, 0x30287 },
408 { 11, 0x00b33, 0x011e6, 0x1a014, 0x30282 },
409 { 12, 0x00b33, 0x011e6, 0x1a014, 0x30287 },
410 { 13, 0x00b33, 0x011e7, 0x1a014, 0x30282 },
411 { 14, 0x00b33, 0x011e8, 0x1a014, 0x30284 },
413 { 34, 0x00b33, 0x01266, 0x26014, 0x30282 },
414 { 38, 0x00b33, 0x01267, 0x26014, 0x30284 },
415 { 42, 0x00b33, 0x01268, 0x26014, 0x30286 },
416 { 46, 0x00b33, 0x01269, 0x26014, 0x30288 },
418 { 36, 0x00b33, 0x01266, 0x26014, 0x30288 },
419 { 40, 0x00b33, 0x01268, 0x26014, 0x30280 },
420 { 44, 0x00b33, 0x01269, 0x26014, 0x30282 },
421 { 48, 0x00b33, 0x0126a, 0x26014, 0x30284 },
422 { 52, 0x00b33, 0x0126b, 0x26014, 0x30286 },
423 { 56, 0x00b33, 0x0126c, 0x26014, 0x30288 },
424 { 60, 0x00b33, 0x0126e, 0x26014, 0x30280 },
425 { 64, 0x00b33, 0x0126f, 0x26014, 0x30282 },
427 { 100, 0x00b33, 0x0128a, 0x2e014, 0x30280 },
428 { 104, 0x00b33, 0x0128b, 0x2e014, 0x30282 },
429 { 108, 0x00b33, 0x0128c, 0x2e014, 0x30284 },
430 { 112, 0x00b33, 0x0128d, 0x2e014, 0x30286 },
431 { 116, 0x00b33, 0x0128e, 0x2e014, 0x30288 },
432 { 120, 0x00b33, 0x012a0, 0x2e014, 0x30280 },
433 { 124, 0x00b33, 0x012a1, 0x2e014, 0x30282 },
434 { 128, 0x00b33, 0x012a2, 0x2e014, 0x30284 },
435 { 132, 0x00b33, 0x012a3, 0x2e014, 0x30286 },
436 { 136, 0x00b33, 0x012a4, 0x2e014, 0x30288 },
437 { 140, 0x00b33, 0x012a6, 0x2e014, 0x30280 },
439 { 149, 0x00b33, 0x012a8, 0x2e014, 0x30287 },
440 { 153, 0x00b33, 0x012a9, 0x2e014, 0x30289 },
441 { 157, 0x00b33, 0x012ab, 0x2e014, 0x30281 },
442 { 161, 0x00b33, 0x012ac, 0x2e014, 0x30283 },
443 { 165, 0x00b33, 0x012ad, 0x2e014, 0x30285 }
485 struct rum_softc *sc = device_get_softc(self);
486 struct ieee80211com *ic = &sc->
sc_ic;
497 mbufq_init(&sc->
sc_snd, ifqmaxlen);
503 device_printf(self,
"could not allocate USB transfers, "
510 for (ntries = 0; ntries < 100; ntries++) {
517 device_printf(sc->
sc_dev,
"timeout waiting for chip to settle\n");
525 device_printf(sc->
sc_dev,
"MAC/BBP RT2573 (rev 0x%05x), RF %s\n",
532 ic->ic_name = device_get_nameunit(self);
533 ic->ic_phytype = IEEE80211_T_OFDM;
539 | IEEE80211_C_MONITOR
543 | IEEE80211_C_SHPREAMBLE
549 | IEEE80211_C_SWSLEEP
553 IEEE80211_CRYPTO_WEP |
554 IEEE80211_CRYPTO_AES_CCM |
555 IEEE80211_CRYPTO_TKIPMIC |
556 IEEE80211_CRYPTO_TKIP;
561 ieee80211_ifattach(ic);
576 ieee80211_radiotap_attach(ic,
585 ieee80211_announce(ic);
597 struct rum_softc *sc = device_get_softc(self);
598 struct ieee80211com *ic = &sc->
sc_ic;
613 if (ic->ic_softc == sc) {
615 ieee80211_ifdetach(ic);
638 DPRINTFN(1,
"Control request failed, %s (retrying)\n",
660static struct ieee80211vap *
662 enum ieee80211_opmode opmode,
int flags,
663 const uint8_t bssid[IEEE80211_ADDR_LEN],
664 const uint8_t mac[IEEE80211_ADDR_LEN])
668 struct ieee80211vap *vap;
670 if (!TAILQ_EMPTY(&ic->ic_vaps))
672 rvp = malloc(
sizeof(
struct rum_vap), M_80211_VAP, M_WAITOK | M_ZERO);
676 if (ieee80211_vap_setup(ic, vap,
name, unit, opmode,
677 flags | IEEE80211_CLONE_NOBEACONS, bssid) != 0) {
679 free(rvp, M_80211_VAP);
693 if (opmode == IEEE80211_M_STA) {
704 rvp->
bmiss = vap->iv_bmiss;
710 ieee80211_ratectl_init(vap);
711 ieee80211_ratectl_setinterval(vap, 1000 );
713 ieee80211_vap_attach(vap, ieee80211_media_change,
714 ieee80211_media_status, mac);
715 ic->ic_opmode = opmode;
723 struct ieee80211com *ic = vap->iv_ic;
727 ieee80211_new_state(vap, IEEE80211_S_INIT, -1);
728 ieee80211_draintask(ic, &vap->iv_nstate_task);
737 ieee80211_ratectl_deinit(vap);
738 ieee80211_vap_detach(vap);
740 free(rvp, M_80211_VAP);
759 memset(rc, 0,
sizeof (*rc));
769 struct ieee80211com *ic = &sc->
sc_ic;
771 KASSERT(
len <=
sizeof(
union sec_param), (
"buffer overflow"));
775 device_printf(sc->
sc_dev,
"%s: cmdq overflow\n", __func__);
798 if (
data->m != NULL) {
799 ieee80211_tx_complete(
data->ni,
data->m, txerr);
831 KASSERT(vap != NULL, (
"%s: vap is NULL\n", __func__));
834 if (
data->ni != NULL &&
data->ni->ni_vap == vap) {
835 ieee80211_free_node(
data->ni);
838 KASSERT(
data->m != NULL, (
"%s: m is NULL\n",
865 if (
data->m != NULL) {
869 if (
data->ni != NULL) {
870 ieee80211_free_node(
data->ni);
879 struct ieee80211com *ic = vap->iv_ic;
886 DPRINTFN(12,
"dropping 'sleeping' bit, "
887 "device must be awake now\n");
899 DPRINTFN(13,
"bmiss event is ignored whilst sleeping\n");
905 const struct ieee80211_rx_stats *rxs,
908 struct ieee80211vap *vap = ni->ni_vap;
909 struct rum_softc *sc = vap->iv_ic->ic_softc;
912 if (
vap->iv_state == IEEE80211_S_SLEEP &&
913 subtype == IEEE80211_FC0_SUBTYPE_BEACON) {
915 DPRINTFN(12,
"beacon, mybss %d (flags %02X)\n",
931 rvp->
recv_mgmt(ni, m, subtype, rxs, rssi, nf);
941 DPRINTFN(12,
"moving to %s state (sleep time %u)\n",
948 "%s: could not change power state: %s\n",
963 struct ieee80211com *ic = vap->iv_ic;
965 const struct ieee80211_txparam *tp;
966 enum ieee80211_state ostate;
967 struct ieee80211_node *ni;
971 ostate = vap->iv_state;
973 ieee80211_state_name[ostate],
974 ieee80211_state_name[nstate]);
976 IEEE80211_UNLOCK(ic);
980 if (ostate == IEEE80211_S_SLEEP && vap->iv_opmode == IEEE80211_M_STA) {
992 case IEEE80211_S_INIT:
993 if (ostate == IEEE80211_S_RUN)
998 case IEEE80211_S_RUN:
999 if (ostate == IEEE80211_S_SLEEP)
1002 ni = ieee80211_ref_node(vap->iv_bss);
1004 if (vap->iv_opmode != IEEE80211_M_MONITOR) {
1005 if (ic->ic_bsschan == IEEE80211_CHAN_ANYC ||
1006 ni->ni_chan == IEEE80211_CHAN_ANYC) {
1015 IEEE80211_ADDR_COPY(sc->
sc_bssid, ni->ni_bssid);
1019 if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
1020 vap->iv_opmode == IEEE80211_M_IBSS) {
1025 if (vap->iv_opmode != IEEE80211_M_MONITOR &&
1026 vap->iv_opmode != IEEE80211_M_AHDEMO) {
1033 tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
1034 if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE)
1037 ieee80211_free_node(ni);
1039 case IEEE80211_S_SLEEP:
1041 if (vap->iv_opmode != IEEE80211_M_STA)
1058 device_printf(sc->
sc_dev,
1059 "%s: could not move to the SLEEP state: %s\n",
1068 return (ret == 0 ? rvp->
newstate(vap, nstate, arg) : ret);
1075 struct ieee80211vap *vap;
1086 DPRINTFN(11,
"transfer complete, %d bytes\n", actlen);
1098 STAILQ_REMOVE_HEAD(&sc->
tx_q,
next);
1102 DPRINTFN(0,
"data overflow, %u bytes\n",
1111 vap =
data->ni->ni_vap;
1112 if (ieee80211_radiotap_active_vap(vap)) {
1119 ieee80211_radiotap_tx(vap, m);
1124 if ((
len % 64) == 0)
1127 DPRINTFN(11,
"sending frame len=%u xferlen=%u\n",
1128 m->m_pkthdr.len,
len);
1139 DPRINTFN(11,
"transfer error, %s\n",
1142 counter_u64_add(sc->
sc_ic.ic_oerrors, 1);
1151 device_printf(sc->
sc_dev,
"device timeout\n");
1169 struct ieee80211com *ic = &sc->
sc_ic;
1170 struct ieee80211_frame_min *wh;
1171 struct ieee80211_node *ni;
1172 struct epoch_tracker et;
1173 struct mbuf *m = NULL;
1184 DPRINTFN(15,
"rx done, actlen=%d\n",
len);
1187 DPRINTF(
"%s: xfer too short %d\n",
1189 counter_u64_add(ic->ic_ierrors, 1);
1200 if (
len < ((flags >> 16) & 0xfff)) {
1201 DPRINTFN(5,
"%s: frame is truncated from %d to %d "
1202 "bytes\n", device_get_nameunit(sc->
sc_dev),
1203 (flags >> 16) & 0xfff,
len);
1204 counter_u64_add(ic->ic_ierrors, 1);
1207 len = (flags >> 16) & 0xfff;
1208 if (
len <
sizeof(
struct ieee80211_frame_ack)) {
1209 DPRINTFN(5,
"%s: frame too short %d\n",
1211 counter_u64_add(ic->ic_ierrors, 1);
1220 DPRINTFN(5,
"PHY or CRC error\n");
1221 counter_u64_add(ic->ic_ierrors, 1);
1227 DPRINTFN(5,
"IV/EIV error\n");
1230 DPRINTFN(5,
"MIC error\n");
1233 DPRINTFN(5,
"Key error\n");
1236 counter_u64_add(ic->ic_ierrors, 1);
1240 m = m_get2(
len, M_NOWAIT, MT_DATA, M_PKTHDR);
1242 DPRINTF(
"could not allocate mbuf\n");
1243 counter_u64_add(ic->ic_ierrors, 1);
1247 mtod(m, uint8_t *),
len);
1249 wh = mtod(m,
struct ieee80211_frame_min *);
1251 if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) &&
1254 wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED;
1255 m->m_flags |= M_WEP;
1259 m->m_pkthdr.len = m->m_len =
len;
1261 if (ieee80211_radiotap_active(ic)) {
1267 IEEE80211_T_OFDM : IEEE80211_T_CCK);
1286 if (m->m_len >=
sizeof(
struct ieee80211_frame_min))
1287 ni = ieee80211_find_rxnode(ic, wh);
1291 NET_EPOCH_ENTER(et);
1293 (void) ieee80211_input(ni, m, rssi,
1295 ieee80211_free_node(ni);
1297 (
void) ieee80211_input_all(ic, m, rssi,
1320 case 12:
return 0xb;
1321 case 18:
return 0xf;
1322 case 24:
return 0xa;
1323 case 36:
return 0xe;
1324 case 48:
return 0x9;
1325 case 72:
return 0xd;
1326 case 96:
return 0x8;
1327 case 108:
return 0xc;
1332 case 11:
return 0x2;
1333 case 22:
return 0x3;
1345 case IEEE80211_CIPHER_WEP:
1347 case IEEE80211_CIPHER_TKIP:
1349 case IEEE80211_CIPHER_AES_CCM:
1352 device_printf(sc->
sc_dev,
"unknown cipher %d\n", cipher);
1359 struct ieee80211_key *
k, uint32_t flags, uint8_t xflags, uint8_t qid,
1360 int hdrlen,
int len,
int rate)
1362 struct ieee80211com *ic = &sc->
sc_ic;
1363 struct wmeParams *wmep = &sc->
wme_params[qid];
1364 uint16_t plcp_length;
1370 if (
k != NULL && !(
k->wk_flags & IEEE80211_KEY_SWCRYPT)) {
1371 const struct ieee80211_cipher *cip =
k->wk_cipher;
1373 len += cip->ic_header + cip->ic_trailer + cip->ic_miclen;
1376 cip->ic_setiv(
k, (uint8_t *)&
desc->iv);
1381 desc->plcp_service = 4;
1383 len += IEEE80211_CRC_LEN;
1384 if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) {
1387 plcp_length =
len & 0xfff;
1388 desc->plcp_length_hi = plcp_length >> 6;
1389 desc->plcp_length_lo = plcp_length & 0x3f;
1393 plcp_length = howmany(16 *
len, rate);
1399 desc->plcp_length_hi = plcp_length >> 8;
1400 desc->plcp_length_lo = plcp_length & 0xff;
1402 if (rate != 2 && (ic->ic_flags & IEEE80211_F_SHPREAMBLE))
1403 desc->plcp_signal |= 0x08;
1406 desc->flags = htole32(flags);
1407 desc->hdrlen = hdrlen;
1408 desc->xflags = xflags;
1418 const struct mbuf *m,
struct ieee80211_node *ni,
int prot,
int rate)
1420 struct ieee80211com *ic = ni->ni_ic;
1423 int protrate, flags;
1427 mprot = ieee80211_alloc_prot(ni, m, rate, prot);
1428 if (mprot == NULL) {
1429 if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1);
1430 device_printf(sc->
sc_dev,
1431 "could not allocate mbuf for protection mode %d\n", prot);
1435 protrate = ieee80211_ctl_rate(ic->ic_rt, rate);
1437 if (prot == IEEE80211_PROT_RTSCTS)
1445 data->ni = ieee80211_ref_node(ni);
1446 data->rate = protrate;
1448 mprot->m_pkthdr.len, protrate);
1458 const struct ieee80211_key *
k)
1460 struct ieee80211vap *vap = ni->ni_vap;
1465 if (!(
k->wk_flags & IEEE80211_KEY_SWCRYPT)) {
1466 cipher =
k->wk_cipher->ic_cipher;
1475 if (!(
k >= &vap->iv_nw_keys[0] &&
1476 k < &vap->iv_nw_keys[IEEE80211_WEP_NKID]))
1483 if (cipher == IEEE80211_CIPHER_TKIP)
1493 const struct ieee80211_txparam *tp = ni->ni_txparms;
1494 struct ieee80211com *ic = &sc->
sc_ic;
1496 struct ieee80211_frame *wh;
1497 struct ieee80211_key *
k = NULL;
1500 uint8_t ac,
type, xflags = 0;
1509 wh = mtod(m0,
struct ieee80211_frame *);
1510 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
1511 hdrlen = ieee80211_anyhdrsize(wh);
1512 ac = M_WME_GETAC(m0);
1514 if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
1515 k = ieee80211_crypto_get_txkey(ni, m0);
1519 if ((
k->wk_flags & IEEE80211_KEY_SWCRYPT) &&
1520 !
k->wk_cipher->ic_encap(
k, m0))
1523 wh = mtod(m0,
struct ieee80211_frame *);
1526 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
1529 dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate,
1530 ic->ic_flags & IEEE80211_F_SHPREAMBLE);
1531 USETW(wh->i_dur, dur);
1534 if (
type == IEEE80211_FC0_TYPE_MGT &&
1535 (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) ==
1536 IEEE80211_FC0_SUBTYPE_PROBE_RESP)
1540 if (
type != IEEE80211_FC0_TYPE_CTL && !IEEE80211_QOS_HAS_SEQ(wh))
1548 data->rate = tp->mgmtrate;
1551 m0->m_pkthdr.len, tp->mgmtrate);
1553 DPRINTFN(10,
"sending mgt frame len=%d rate=%d\n",
1564 const struct ieee80211_bpf_params *params)
1566 struct ieee80211com *ic = ni->ni_ic;
1567 struct ieee80211_frame *wh;
1570 uint8_t ac,
type, xflags = 0;
1575 wh = mtod(m0,
struct ieee80211_frame *);
1576 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
1578 ac = params->ibp_pri & 3;
1580 rate = params->ibp_rate0;
1581 if (!ieee80211_isratevalid(ic->ic_rt,
rate))
1585 if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0)
1587 if (params->ibp_flags & (IEEE80211_BPF_RTS|IEEE80211_BPF_CTS)) {
1589 params->ibp_flags & IEEE80211_BPF_RTS ?
1590 IEEE80211_PROT_RTSCTS : IEEE80211_PROT_CTSONLY,
1598 if (
type != IEEE80211_FC0_TYPE_CTL && !IEEE80211_QOS_HAS_SEQ(wh))
1611 m0->m_pkthdr.len,
rate);
1613 DPRINTFN(10,
"sending raw frame len=%u rate=%u\n",
1614 m0->m_pkthdr.len,
rate);
1625 struct ieee80211vap *vap = ni->ni_vap;
1626 struct ieee80211com *ic = &sc->
sc_ic;
1628 struct ieee80211_frame *wh;
1629 const struct ieee80211_txparam *tp = ni->ni_txparms;
1630 struct ieee80211_key *
k = NULL;
1633 uint8_t ac,
type, qos, xflags = 0;
1634 int error, hdrlen, rate;
1638 wh = mtod(m0,
struct ieee80211_frame *);
1639 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
1640 hdrlen = ieee80211_anyhdrsize(wh);
1642 if (IEEE80211_QOS_HAS_SEQ(wh))
1643 qos = ((
const struct ieee80211_qosframe *)wh)->i_qos[0];
1646 ac = M_WME_GETAC(m0);
1648 if (m0->m_flags & M_EAPOL)
1649 rate = tp->mgmtrate;
1650 else if (IEEE80211_IS_MULTICAST(wh->i_addr1))
1651 rate = tp->mcastrate;
1652 else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
1653 rate = tp->ucastrate;
1655 (void) ieee80211_ratectl_rate(ni, NULL, 0);
1656 rate = ni->ni_txrate;
1659 if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
1660 k = ieee80211_crypto_get_txkey(ni, m0);
1665 if ((
k->wk_flags & IEEE80211_KEY_SWCRYPT) &&
1666 !
k->wk_cipher->ic_encap(
k, m0)) {
1672 wh = mtod(m0,
struct ieee80211_frame *);
1675 if (
type != IEEE80211_FC0_TYPE_CTL && !IEEE80211_QOS_HAS_SEQ(wh))
1678 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
1679 int prot = IEEE80211_PROT_NONE;
1680 if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold)
1681 prot = IEEE80211_PROT_RTSCTS;
1682 else if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
1683 ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM)
1684 prot = ic->ic_protmode;
1685 if (prot != IEEE80211_PROT_NONE) {
1706 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
1708 if (!qos || (qos & IEEE80211_QOS_ACKPOLICY) !=
1709 IEEE80211_QOS_ACKPOLICY_NOACK)
1712 dur = ieee80211_ack_duration(ic->ic_rt, rate,
1713 ic->ic_flags & IEEE80211_F_SHPREAMBLE);
1714 USETW(wh->i_dur, dur);
1718 m0->m_pkthdr.len, rate);
1720 DPRINTFN(10,
"sending frame len=%d rate=%d\n",
1754 struct ieee80211_node *ni;
1763 (m = mbufq_dequeue(&sc->
sc_snd)) != NULL) {
1764 ni = (
struct ieee80211_node *) m->m_pkthdr.rcvif;
1766 if_inc_counter(ni->ni_vap->iv_ifp,
1767 IFCOUNTER_OERRORS, 1);
1768 ieee80211_free_node(ni);
1778 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
1787 if (ic->ic_nrunning > 0) {
1789 ieee80211_start_all(ic);
1791 ieee80211_stop(vap);
1810 device_printf(sc->
sc_dev,
"could not read EEPROM: %s\n",
1822 return le32toh(
val);
1839 device_printf(sc->
sc_dev,
1840 "could not multi read MAC register: %s\n",
1848 uint32_t tmp = htole32(
val);
1871 device_printf(sc->
sc_dev,
1872 "could not multi write MAC register: %s\n",
1904 for (ntries = 0; ntries < 100; ntries++) {
1921 DPRINTFN(2,
"reg=0x%08x\n",
reg);
1924 device_printf(sc->
sc_dev,
"could not write to BBP\n");
1938 DPRINTFN(2,
"reg=0x%08x\n",
reg);
1941 device_printf(sc->
sc_dev,
"could not read BBP\n");
1948 for (ntries = 0; ntries < 100; ntries++) {
1956 device_printf(sc->
sc_dev,
"could not read BBP\n");
1966 for (ntries = 0; ntries < 100; ntries++) {
1972 if (ntries == 100) {
1973 device_printf(sc->
sc_dev,
"could not write to RF\n");
1984 DPRINTFN(15,
"RF R[%u] <- 0x%05x\n",
reg & 3,
val & 0xfffff);
1990 uint8_t bbp4, bbp77;
2015 struct ieee80211com *ic = &sc->
sc_ic;
2017 if (!IEEE80211_IS_CHAN_5GHZ(ic->ic_bsschan)) {
2029 struct ieee80211com *ic = &sc->
sc_ic;
2031 if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)
2040 struct ieee80211com *ic = &sc->
sc_ic;
2043 if (ic->ic_curmode == IEEE80211_MODE_11B) {
2046 }
else if (IEEE80211_IS_CHAN_5GHZ(ic->ic_bsschan)) {
2062 uint8_t bbp17, bbp35, bbp96, bbp97, bbp98, bbp104;
2065 bbp17 = 0x20; bbp96 = 0x48; bbp104 = 0x2c;
2066 bbp35 = 0x50; bbp97 = 0x48; bbp98 = 0x48;
2067 if (IEEE80211_IS_CHAN_5GHZ(c)) {
2068 bbp17 += 0x08; bbp96 += 0x10; bbp104 += 0x0c;
2069 bbp35 += 0x10; bbp97 += 0x10; bbp98 += 0x10;
2073 bbp17 += 0x10; bbp96 += 0x10; bbp104 += 0x10;
2092 if (IEEE80211_IS_CHAN_2GHZ(c)) {
2104 struct ieee80211com *ic = &sc->
sc_ic;
2110 chan = ieee80211_chan2ieee(ic, c);
2111 if (
chan == 0 ||
chan == IEEE80211_CHAN_ANY)
2121 power = sc->
txpow[i];
2125 }
else if (power > 31) {
2126 bbp94 += power - 31;
2134 if (c->ic_flags != ic->ic_curchan->ic_flags) {
2160 bbp3 &= ~RT2573_SMART_MODE;
2176 struct ieee80211_node *ni = vap->iv_bss;
2177 const struct ieee80211_txparam *tp = ni->ni_txparms;
2180 rvp->
maxretry = MIN(tp->maxretry, 0xf);
2194 struct ieee80211com *ic = &sc->
sc_ic;
2195 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
2199 if (vap->iv_opmode != IEEE80211_M_STA) {
2211 bintval = vap->iv_bss->ni_intval;
2212 tmp |= bintval * 16;
2215 switch (vap->iv_opmode) {
2216 case IEEE80211_M_STA:
2223 case IEEE80211_M_IBSS:
2231 case IEEE80211_M_HOSTAP:
2237 device_printf(sc->
sc_dev,
2238 "Enabling TSF failed. undefined opmode %d\n",
2272 struct ieee80211com *ic = &sc->
sc_ic;
2275 slottime = IEEE80211_GET_SLOTTIME(ic);
2279 DPRINTF(
"setting slot time to %uus\n", slottime);
2291 struct chanAccParams chp;
2292 const struct wmeParams *chanp;
2296 ieee80211_wme_ic_getparams(ic, &chp);
2297 chanp = chp.cap_wmeParams;
2301 chanp[WME_AC_VO].wmep_aifsn << 12 |
2302 chanp[WME_AC_VI].wmep_aifsn << 8 |
2303 chanp[WME_AC_BK].wmep_aifsn << 4 |
2304 chanp[WME_AC_BE].wmep_aifsn);
2308 chanp[WME_AC_VO].wmep_logcwmin << 12 |
2309 chanp[WME_AC_VI].wmep_logcwmin << 8 |
2310 chanp[WME_AC_BK].wmep_logcwmin << 4 |
2311 chanp[WME_AC_BE].wmep_logcwmin);
2315 chanp[WME_AC_VO].wmep_logcwmax << 12 |
2316 chanp[WME_AC_VI].wmep_logcwmax << 8 |
2317 chanp[WME_AC_BK].wmep_logcwmax << 4 |
2318 chanp[WME_AC_BE].wmep_logcwmax);
2322 chanp[WME_AC_BK].wmep_txopLimit << 16 |
2323 chanp[WME_AC_BE].wmep_txopLimit);
2327 chanp[WME_AC_VO].wmep_txopLimit << 16 |
2328 chanp[WME_AC_VI].wmep_txopLimit);
2332 memcpy(sc->
wme_params, chanp,
sizeof(*chanp) * WME_NUM_AC);
2337 device_printf(sc->
sc_dev,
"%s: WME update failed, error %d\n",
2349 bssid[0] | bssid[1] << 8 | bssid[2] << 16 | bssid[3] << 24);
2361 addr[4] |
addr[5] << 8 | 0xff << 16);
2367 struct ieee80211com *ic = &sc->
sc_ic;
2369 if (ic->ic_promisc == 0)
2374 DPRINTF(
"%s promiscuous mode\n", ic->ic_promisc > 0 ?
2375 "entering" :
"leaving");
2403 default:
return "unknown";
2433 DPRINTF(
"External 2GHz LNA=%d\nExternal 5GHz LNA=%d\n",
2438 if ((
val & 0xff) != 0xff)
2447 if ((
val & 0xff) != 0xff)
2459 DPRINTF(
"RSSI 2GHz corr=%d\nRSSI 5GHz corr=%d\n",
2464 if ((
val & 0xff) != 0xff)
2472 memset(sc->
txpow + 14, 24, sizeof (sc->
txpow) - 14);
2474 for (i = 0; i < 14; i++)
2475 DPRINTF(
"Channel=%d Tx power=%d\n", i + 1, sc->
txpow[i]);
2481 for (i = 0; i < 14; i++) {
2493 unsigned int ntries;
2495 for (ntries = 0; ntries < 100; ntries++) {
2502 if (ntries == 100) {
2503 device_printf(sc->
sc_dev,
2504 "timeout waiting for BBP/RF to wakeup\n");
2517 for (ntries = 0; ntries < 100; ntries++) {
2519 if (
val != 0 &&
val != 0xff)
2524 if (ntries == 100) {
2525 device_printf(sc->
sc_dev,
"timeout waiting for BBP\n");
2534 for (i = 0; i < 16; i++) {
2554 struct ieee80211com *ic = &sc->
sc_ic;
2555 struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
2613 if (ic->ic_opmode != IEEE80211_M_MONITOR) {
2616 if (ic->ic_opmode != IEEE80211_M_HOSTAP)
2618 if (ic->ic_promisc == 0)
2672 for (;
size >= 4;
reg += 4, ucode += 4,
size -= 4) {
2676 device_printf(sc->
sc_dev,
"Firmware load "
2677 "failure! (ignored)\n");
2684 device_printf(sc->
sc_dev,
"could not run firmware: %s\n",
2695 struct ieee80211com *ic = &sc->
sc_ic;
2701 exp = ic->ic_lintval / bintval;
2702 delay = ic->ic_lintval % bintval;
2718 sc->
sc_sleep_time = IEEE80211_TU_TO_TICKS(exp * bintval + delay);
2726 struct ieee80211com *ic = vap->iv_ic;
2727 struct ieee80211_node *ni;
2732 case IEEE80211_IOC_POWERSAVE:
2733 case IEEE80211_IOC_PROTMODE:
2734 case IEEE80211_IOC_RTSTHRESHOLD:
2737 case IEEE80211_IOC_POWERSAVESLEEP:
2738 ni = ieee80211_ref_node(vap->iv_bss);
2742 if (vap->iv_state == IEEE80211_S_SLEEP) {
2750 ieee80211_free_node(ni);
2763 struct ieee80211com *ic = vap->iv_ic;
2766 const struct ieee80211_txparam *tp;
2773 if (ic->ic_bsschan == IEEE80211_CHAN_ANYC)
2776 tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_bsschan)];
2787 mtod(m, uint8_t *), m->m_pkthdr.len) != 0)
2797 struct ieee80211_node *ni = vap->iv_bss;
2800 if (ni->ni_chan == IEEE80211_CHAN_ANYC)
2803 m = ieee80211_beacon_alloc(ni);
2819 struct ieee80211vap *vap =
data->vap;
2827 struct ieee80211com *ic = vap->iv_ic;
2830 struct ieee80211_beacon_offsets *bo = &vap->iv_bcn_off;
2831 struct ieee80211_node *ni = vap->iv_bss;
2837 m = ieee80211_beacon_alloc(ni);
2839 device_printf(sc->
sc_dev,
2840 "%s: could not allocate beacon frame\n", __func__);
2848 case IEEE80211_BEACON_ERP:
2851 case IEEE80211_BEACON_TIM:
2859 setbit(bo->bo_flags, item);
2860 ieee80211_beacon_update(ni, m, mcast);
2873 if (
k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP) {
2889 struct ieee80211_key *
k = &
data->key;
2901 DPRINTFN(1,
"setting group key %d for vap %d, mode %d "
2902 "(tx %s, rx %s)\n",
k->wk_keyix, rvp_id, mode,
2903 (
k->wk_flags & IEEE80211_KEY_XMIT) ?
"on" :
"off",
2904 (
k->wk_flags & IEEE80211_KEY_RECV) ?
"on" :
"off");
2925 device_printf(sc->
sc_dev,
"%s: cannot set group key %d for vap %d\n",
2926 __func__,
k->wk_keyix, rvp_id);
2933 struct ieee80211_key *
k = &
data->key;
2935 DPRINTF(
"%s: removing group key %d for vap %d\n", __func__,
2936 k->wk_keyix, rvp_id);
2948 struct ieee80211_key *
k = &
data->key;
2949 uint8_t buf[IEEE80211_ADDR_LEN + 1];
2956 DPRINTFN(1,
"setting pairwise key %d for vap %d, mode %d "
2957 "(tx %s, rx %s)\n",
k->wk_keyix, rvp_id, mode,
2958 (
k->wk_flags & IEEE80211_KEY_XMIT) ?
"on" :
"off",
2959 (
k->wk_flags & IEEE80211_KEY_RECV) ?
"on" :
"off");
2965 IEEE80211_ADDR_COPY(buf,
k->wk_macaddr);
2966 buf[IEEE80211_ADDR_LEN] = mode;
2970 buf,
sizeof buf) != 0)
2981 1 << (
k->wk_keyix % 32)) != 0)
2987 device_printf(sc->
sc_dev,
2988 "%s: cannot set pairwise key %d, vap %d\n", __func__,
k->wk_keyix,
2996 struct ieee80211_key *
k = &
data->key;
2998 DPRINTF(
"%s: removing key %d\n", __func__,
k->wk_keyix);
3000 1 << (
k->wk_keyix % 32));
3008 ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix)
3010 struct rum_softc *sc = vap->iv_ic->ic_softc;
3013 if (!(&vap->iv_nw_keys[0] <=
k &&
3014 k < &vap->iv_nw_keys[IEEE80211_WEP_NKID])) {
3015 if (!(
k->wk_flags & IEEE80211_KEY_SWCRYPT)) {
3018 if ((sc->
keys_bmap & (1ULL << i)) == 0) {
3026 device_printf(sc->
sc_dev,
3027 "%s: no free space in the key table\n",
3034 *keyix = ieee80211_crypto_get_key_wepidx(vap,
k);
3043 struct rum_softc *sc = vap->iv_ic->ic_softc;
3046 if (
k->wk_flags & IEEE80211_KEY_SWCRYPT) {
3051 group =
k >= &vap->iv_nw_keys[0] &&
k < &vap->iv_nw_keys[IEEE80211_WEP_NKID];
3060 struct rum_softc *sc = vap->iv_ic->ic_softc;
3063 if (
k->wk_flags & IEEE80211_KEY_SWCRYPT) {
3068 group =
k >= &vap->iv_nw_keys[0] &&
k < &vap->iv_nw_keys[IEEE80211_WEP_NKID];
3076 const struct ieee80211_bpf_params *params)
3078 struct rum_softc *sc = ni->ni_ic->ic_softc;
3092 if (params == NULL) {
3104 if ((ret =
rum_tx_raw(sc, m, ni, params)) != 0)
3119 struct ieee80211vap *vap = ni->ni_vap;
3132 struct ieee80211vap *vap = &rvp->
vap;
3133 struct ieee80211com *ic = vap->iv_ic;
3142 struct ieee80211vap *vap = &rvp->
vap;
3143 struct rum_softc *sc = vap->iv_ic->ic_softc;
3144 struct ieee80211_ratectl_tx_stats *txs = &sc->
sc_txs;
3151 ok[0] = (le32toh(sc->
sta[4]) & 0xffff);
3152 ok[1] = (le32toh(sc->
sta[4]) >> 16);
3153 ok[2] = (le32toh(sc->
sta[5]) & 0xffff);
3154 fail = (le32toh(sc->
sta[5]) >> 16);
3156 txs->flags = IEEE80211_RATECTL_TX_STATS_RETRIES;
3157 txs->nframes = ok[0] + ok[1] + ok[2] +
fail;
3158 txs->nsuccess = txs->nframes -
fail;
3160 txs->nretries = ok[1] + ok[2] * 2 +
fail * (rvp->
maxretry + 1);
3162 if (txs->nframes != 0)
3163 ieee80211_ratectl_tx_update(vap, txs);
3166 if_inc_counter(vap->iv_ifp, IFCOUNTER_OERRORS,
fail);
3189 if (ic->ic_flags_ext & IEEE80211_FEXT_BGSCAN) {
3191 if (ic->ic_opmode != IEEE80211_M_AHDEMO)
3212 int maxchans,
int *nchans,
struct ieee80211_channel chans[])
3215 uint8_t bands[IEEE80211_MODE_BYTES];
3217 memset(bands, 0,
sizeof(bands));
3218 setbit(bands, IEEE80211_MODE_11B);
3219 setbit(bands, IEEE80211_MODE_11G);
3220 ieee80211_add_channels_default_2ghz(chans, maxchans, nchans, bands, 0);
3223 setbit(bands, IEEE80211_MODE_11A);
3224 ieee80211_add_channel_list_5ghz(chans, maxchans, nchans,
3232 struct ieee80211com *ic = &sc->
sc_ic;
3235 lna = (
raw >> 5) & 0x3;
3250 if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) {
static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB DWC OTG")
SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN, &dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2/3 - ULPI/HSIC/INTERNAL/UTMI+")
static void rum_select_antenna(struct rum_softc *)
static const uint8_t rum_chan_5ghz[]
static driver_t rum_driver
static void rum_getradiocaps(struct ieee80211com *, int, int *, struct ieee80211_channel[])
static uint8_t rum_plcp_signal(int rate)
static usb_error_t rum_write_multi(struct rum_softc *, uint16_t, void *, size_t)
static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *)
static int rum_tx_data(struct rum_softc *, struct mbuf *, struct ieee80211_node *)
static usb_error_t rum_clrbits(struct rum_softc *, uint16_t, uint32_t)
static void rum_reset_tx_list(struct rum_softc *, struct ieee80211vap *)
static void rum_set_txpreamble(struct rum_softc *)
static void rum_read_eeprom(struct rum_softc *)
static void rum_eeprom_read(struct rum_softc *, uint16_t, void *, int)
static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t)
static const struct @98 rum_def_mac[]
static void rum_set_maxretry(struct rum_softc *, struct ieee80211vap *)
static int rum_set_sleep_time(struct rum_softc *, uint16_t)
static void rum_scan_start(struct ieee80211com *)
static int rum_bbp_init(struct rum_softc *)
static void rum_parent(struct ieee80211com *)
static device_detach_t rum_detach
static void rum_group_key_del_cb(struct rum_softc *, union sec_param *, uint8_t)
static void rum_set_basicrates(struct rum_softc *)
static const struct usb_config rum_config[RUM_N_TRANSFER]
static int rum_set_beacon(struct rum_softc *, struct ieee80211vap *)
static const char * rum_get_rf(int)
static const struct rfprog rum_rf5225[]
static void rum_set_macaddr(struct rum_softc *, const uint8_t *)
static usb_error_t rum_modbits(struct rum_softc *, uint16_t, uint32_t, uint32_t)
static void rum_update_slot_cb(struct rum_softc *, union sec_param *, uint8_t)
static uint32_t rum_tx_crypto_flags(struct rum_softc *, struct ieee80211_node *, const struct ieee80211_key *)
static void rum_ratectl_task(void *, int)
static void rum_group_key_set_cb(struct rum_softc *, union sec_param *, uint8_t)
static usb_error_t rum_write(struct rum_softc *, uint16_t, uint32_t)
static void rum_read_multi(struct rum_softc *, uint16_t, void *, int)
static int rum_pause(struct rum_softc *, int)
static void rum_setpromisc(struct rum_softc *)
static void rum_enable_tsf(struct rum_softc *)
static device_attach_t rum_attach
static void rum_rf_write(struct rum_softc *, uint8_t, uint32_t)
static int rum_reset(struct ieee80211vap *, u_long)
static void rum_update_promisc(struct ieee80211com *)
static void rum_setup_tx_desc(struct rum_softc *, struct rum_tx_desc *, struct ieee80211_key *, uint32_t, uint8_t, uint8_t, int, int, int)
static void rum_load_microcode(struct rum_softc *, const uint8_t *, size_t)
static int rum_sendprot(struct rum_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate)
static const struct rfprog rum_rf5226[]
static void rum_cmdq_cb(void *, int)
static usb_error_t rum_setbits(struct rum_softc *, uint16_t, uint32_t)
static int rum_cmd_sleepable(struct rum_softc *, const void *, size_t, uint8_t, CMD_FUNC_PROTO)
static int rum_init(struct rum_softc *)
static void rum_sta_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *, int, int)
static usb_callback_t rum_bulk_read_callback
static void rum_update_slot(struct ieee80211com *)
DRIVER_MODULE(rum, uhub, rum_driver, rum_devclass, NULL, 0)
static void rum_clr_shkey_regs(struct rum_softc *)
static int rum_wme_update(struct ieee80211com *)
static int rum_key_set(struct ieee80211vap *, const struct ieee80211_key *)
static void rum_enable_mrr(struct rum_softc *)
static int rum_get_rssi(struct rum_softc *, uint8_t)
static int rum_newstate(struct ieee80211vap *, enum ieee80211_state, int)
static void rum_start(struct rum_softc *)
static void rum_update_beacon(struct ieee80211vap *, int)
static void rum_tx_free(struct rum_tx_data *, int)
static uint32_t rum_read(struct rum_softc *, uint16_t)
static uint8_t rum_crypto_mode(struct rum_softc *, u_int, int)
static const STRUCT_USB_HOST_ID rum_devs[]
static void rum_vap_delete(struct ieee80211vap *)
static int rum_key_delete(struct ieee80211vap *, const struct ieee80211_key *)
static void rum_select_band(struct rum_softc *, struct ieee80211_channel *)
static int rum_set_power_state(struct rum_softc *, int)
static void rum_update_beacon_cb(struct rum_softc *, union sec_param *, uint8_t)
static device_probe_t rum_match
MODULE_DEPEND(rum, wlan, 1, 1, 1)
static void rum_unsetup_tx_list(struct rum_softc *)
static usb_error_t rum_do_request(struct rum_softc *sc, struct usb_device_request *req, void *data)
static uint8_t rum_bbp_read(struct rum_softc *, uint8_t)
static void rum_set_chan(struct rum_softc *, struct ieee80211_channel *)
static const struct @99 rum_def_bbp[]
static devclass_t rum_devclass
static void rum_set_channel(struct ieee80211com *)
static void rum_ratectl_start(struct rum_softc *, struct ieee80211_node *)
static void rum_stop(struct rum_softc *)
static int rum_key_alloc(struct ieee80211vap *, struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *)
static usb_error_t rum_do_mcu_request(struct rum_softc *sc, int)
USB_PNP_HOST_INFO(rum_devs)
static int rum_common_key_set(struct rum_softc *, struct ieee80211_key *, uint16_t)
static void rum_ratectl_timeout(void *)
static int rum_alloc_beacon(struct rum_softc *, struct ieee80211vap *)
static void rum_set_bssid(struct rum_softc *, const uint8_t *)
static void rum_update_mcast(struct ieee80211com *)
static int rum_bbp_busy(struct rum_softc *)
static int rum_bbp_wakeup(struct rum_softc *)
static void rum_get_tsf(struct rum_softc *, uint64_t *)
static void rum_pair_key_set_cb(struct rum_softc *, union sec_param *, uint8_t)
static device_method_t rum_methods[]
static int rum_tx_raw(struct rum_softc *, struct mbuf *, struct ieee80211_node *, const struct ieee80211_bpf_params *)
static int rum_tx_mgt(struct rum_softc *, struct mbuf *, struct ieee80211_node *)
static void rum_scan_end(struct ieee80211com *)
static struct ieee80211vap * rum_vap_create(struct ieee80211com *, const char[IFNAMSIZ], int, enum ieee80211_opmode, int, const uint8_t[IEEE80211_ADDR_LEN], const uint8_t[IEEE80211_ADDR_LEN])
static void rum_abort_tsf_sync(struct rum_softc *)
static void rum_beacon_miss(struct ieee80211vap *)
static void rum_setup_tx_list(struct rum_softc *)
static void rum_pair_key_del_cb(struct rum_softc *, union sec_param *, uint8_t)
static usb_callback_t rum_bulk_write_callback
static int rum_enable_tsf_sync(struct rum_softc *)
static int rum_transmit(struct ieee80211com *, struct mbuf *)
static const uint8_t rt2573_ucode[]
#define RT2573_TX_IFS_SIFS
#define RT2573_RX_KEY_ERROR
#define RT2573_RX_CIP_MASK
#define RT2573_MODE_WEP40
#define RT2573_SKEY(vap, kidx)
#define RT2573_LONG_RETRY(max)
#define RT2573_EEPROM_RSSI_5GHZ_OFFSET
#define RT2573_RX_MIC_ERROR
#define RT2573_NUM_BSSID_MSK(n)
#define RT2573_TBTT_TIMER_EN
#define RT2573_MRR_CCK_FALLBACK
#define RT2573_TX_CIP_MODE(m)
#define RT2573_PLCP_LENGEXT
#define RT2573_WRITE_MULTI_MAC
#define RT2573_MRR_ENABLED
#define RT2573_AUTO_WAKEUP
#define RT2573_MCU_WAKEUP
#define RT2573_SHORT_RETRY_MASK
#define RT2573_TSF_SYNC_MODE_DIS
#define RT2573_TSF_SYNC_MODE_STA
#define RT2573_RX_DESC_SIZE
#define RT2573_TX_KEY_PAIR
#define RT2573_RX_CRC_ERROR
#define RT2573_TSF_SYNC_MODE_HOSTAP
#define RT2573_HOST_READY
#define RT2573_TBCN_EXP(n)
#define RT2573_NOISE_FLOOR
#define RT2573_DROP_ACKCTS
#define RT2573_TXOP23_CSR
#define RT2573_LOGCWMIN(v)
#define RT2573_DISABLE_RX
#define RT2573_TBCN_EXP_MAX
#define RT2573_SHORT_RETRY(max)
#define RT2573_TXRX_CSR15
#define RT2573_TX_LONG_RETRY
#define RT2573_MODE_WEP104
#define RT2573_EEPROM_BBP_BASE
#define RT2573_TX_TKIPMIC
#define RT2573_SHORT_PREAMBLE
#define RT2573_TSF_SYNC_MODE_IBSS
#define RT2573_TX_TIMESTAMP
#define RT2573_READ_MULTI_MAC
#define RT2573_IFACE_INDEX
#define RT2573_PA_PE_2GHZ
#define RT2573_DROP_CRC_ERROR
#define RT2573_DROP_NOT_TO_ME
#define RT2573_DROP_VER_ERROR
#define RT2573_EEPROM_ANTENNA
#define RT2573_DROP_PHY_ERROR
#define RT2573_SMART_MODE
#define RT2573_TXRX_CSR10
#define RT2573_MODE_NOSEC
#define RT2573_RX_CIP_MODE(m)
#define RT2573_MCU_CODE_BASE
#define RT2573_HW_BCN_BASE(id)
#define RT2573_LONG_RETRY_MASK
#define RT2573_EEPROM_FREQ_OFFSET
#define RT2573_TXOP01_CSR
#define RT2573_EEPROM_RSSI_2GHZ_OFFSET
#define RT2573_RX_DEC_MASK
#define RT2573_ADDR_ENTRY(id)
#define RT2573_TSF_SYNC_MODE(x)
#define RT2573_TX_KEY_ID(id)
#define RT2573_TX_DESC_SIZE
#define RT2573_EEPROM_CONFIG2
#define RT2573_RESET_ASIC
#define RT2573_TBCN_DELAY_MAX
#define RT2573_ACKCTS_PWRMGT
#define RT2573_BBPR94_DEFAULT
#define RT2573_EEPROM_TXPOWER
#define RT2573_READ_EEPROM
#define RT2573_EEPROM_ADDRESS
#define RT2573_TBCN_DELAY(t)
#define RT2573_TXRX_CSR12
#define RT2573_MODE_AES_CCMP
#define RT2573_TSF_TIMER_EN
#define RT2573_LOGCWMAX(v)
#define RT2573_RX_IV_ERROR
#define RT2573_PA_PE_5GHZ
#define RT2573_TX_NEED_ACK
#define RUM_LOCK_INIT(sc)
#define RUM_CMDQ_LOCK(sc)
#define RUM_CMDQ_LOCK_INIT(sc)
#define RUM_LOCK_DESTROY(sc)
#define RT2573_RX_RADIOTAP_PRESENT
#define RUM_CMDQ_LOCK_DESTROY(sc)
#define RUM_LOCK_ASSERT(sc)
#define RUM_CMDQ_UNLOCK(sc)
#define RUM_TX_LIST_COUNT
#define RT2573_TX_RADIOTAP_PRESENT
struct ieee80211_ratectl_tx_stats sc_txs
struct wmeParams wme_params[WME_NUM_AC]
struct rum_rx_desc sc_rx_desc
struct rum_rx_radiotap_header sc_rxtap
struct rum_tx_data tx_data[RUM_TX_LIST_COUNT]
struct rum_cmdq cmdq[RUM_CMDQ_SIZE]
struct ieee80211com sc_ic
struct usb_device * sc_udev
struct rum_softc::@101 bbp_prom[16]
struct rum_tx_radiotap_header sc_txtap
uint8_t sc_bssid[IEEE80211_ADDR_LEN]
struct usb_xfer * sc_xfer[RUM_N_TRANSFER]
struct ieee80211_node * ni
struct usb_callout ratectl_ch
void(* recv_mgmt)(struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *, int, int)
void(* bmiss)(struct ieee80211vap *)
int(* newstate)(struct ieee80211vap *, enum ieee80211_state, int)
enum usb_hc_mode usb_mode
struct usbd_lookup_info info
struct usb_device * device
struct usb_xfer_flags flags
#define UT_WRITE_VENDOR_DEVICE
#define UT_READ_VENDOR_DEVICE
void usbd_copy_in(struct usb_page_cache *cache, usb_frlength_t offset, const void *ptr, usb_frlength_t len)
void usbd_copy_out(struct usb_page_cache *cache, usb_frlength_t offset, void *ptr, usb_frlength_t len)
struct usb_endpoint_descriptor desc
const char * usbd_errstr(usb_error_t err)
int usbd_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id, struct usb_attach_arg *uaa)
usb_error_t usbd_do_request_flags(struct usb_device *udev, struct mtx *mtx, struct usb_device_request *req, void *data, uint16_t flags, uint16_t *actlen, usb_timeout_t timeout)
void usbd_transfer_submit(struct usb_xfer *xfer)
void * usbd_xfer_get_priv(struct usb_xfer *xfer)
void usbd_transfer_unsetup(struct usb_xfer **pxfer, uint16_t n_setup)
void usbd_xfer_set_frame_len(struct usb_xfer *xfer, usb_frcount_t frindex, usb_frlength_t len)
struct usb_page_cache * usbd_xfer_get_frame(struct usb_xfer *xfer, usb_frcount_t frindex)
usb_error_t usbd_transfer_setup(struct usb_device *udev, const uint8_t *ifaces, struct usb_xfer **ppxfer, const struct usb_config *setup_start, uint16_t n_setup, void *priv_sc, struct mtx *xfer_mtx)
void usbd_transfer_start(struct usb_xfer *xfer)
void usbd_xfer_set_priv(struct usb_xfer *xfer, void *ptr)
void usbd_transfer_drain(struct usb_xfer *xfer)
void * usbd_xfer_softc(struct usb_xfer *xfer)
void usbd_xfer_set_stall(struct usb_xfer *xfer)
void usbd_xfer_status(struct usb_xfer *xfer, int *actlen, int *sumlen, int *aframes, int *nframes)
usb_frlength_t usbd_xfer_max_len(struct usb_xfer *xfer)
void device_set_usb_desc(device_t dev)
void usb_pause_mtx(struct mtx *mtx, int timo)
#define usb_callout_init_mtx(c, m, f)
#define usb_callout_reset(c,...)
@ USB_ERR_NORMAL_COMPLETION
#define usb_callout_drain(c)
#define USB_ST_TRANSFERRED
void usbd_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset, struct mbuf *m, usb_size_t src_offset, usb_frlength_t src_len)
void() usb_callback_t(struct usb_xfer *, usb_error_t)
#define STRUCT_USB_HOST_ID
#define usb_callout_stop(c)
#define USB_GET_STATE(xfer)