Lines 447-452
Link Here
|
447 |
ic->ic_caps = |
447 |
ic->ic_caps = |
448 |
IEEE80211_C_STA /* station mode supported */ |
448 |
IEEE80211_C_STA /* station mode supported */ |
449 |
| IEEE80211_C_IBSS /* IBSS mode supported */ |
449 |
| IEEE80211_C_IBSS /* IBSS mode supported */ |
|
|
450 |
| IEEE80211_C_HOSTAP /* Host access point mode */ |
450 |
| IEEE80211_C_MONITOR /* monitor mode supported */ |
451 |
| IEEE80211_C_MONITOR /* monitor mode supported */ |
451 |
| IEEE80211_C_AHDEMO /* adhoc demo mode */ |
452 |
| IEEE80211_C_AHDEMO /* adhoc demo mode */ |
452 |
| IEEE80211_C_BGSCAN /* capable of bg scanning */ |
453 |
| IEEE80211_C_BGSCAN /* capable of bg scanning */ |
Lines 454-462
Link Here
|
454 |
| IEEE80211_C_SHSLOT /* short slot time supported */ |
455 |
| IEEE80211_C_SHSLOT /* short slot time supported */ |
455 |
| IEEE80211_C_WPA /* 802.11i */ |
456 |
| IEEE80211_C_WPA /* 802.11i */ |
456 |
| IEEE80211_C_SHPREAMBLE /* short preamble supported */ |
457 |
| IEEE80211_C_SHPREAMBLE /* short preamble supported */ |
457 |
#if 0 |
|
|
458 |
| IEEE80211_C_HOSTAP /* Host access point mode */ |
459 |
#endif |
460 |
| IEEE80211_C_WME /* 802.11e */ |
458 |
| IEEE80211_C_WME /* 802.11e */ |
461 |
| IEEE80211_C_PMGT /* Station-side power mgmt */ |
459 |
| IEEE80211_C_PMGT /* Station-side power mgmt */ |
462 |
; |
460 |
; |
Lines 624-630
Link Here
|
624 |
vap = &wvp->wv_vap; |
622 |
vap = &wvp->wv_vap; |
625 |
ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); |
623 |
ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); |
626 |
|
624 |
|
627 |
if (opmode == IEEE80211_M_IBSS) { |
625 |
if (opmode == IEEE80211_M_IBSS || opmode == IEEE80211_M_HOSTAP) { |
628 |
WPI_VAP_LOCK_INIT(wvp); |
626 |
WPI_VAP_LOCK_INIT(wvp); |
629 |
wpi_init_beacon(wvp); |
627 |
wpi_init_beacon(wvp); |
630 |
} |
628 |
} |
Lines 635-640
Link Here
|
635 |
wvp->wv_newstate = vap->iv_newstate; |
633 |
wvp->wv_newstate = vap->iv_newstate; |
636 |
vap->iv_newstate = wpi_newstate; |
634 |
vap->iv_newstate = wpi_newstate; |
637 |
vap->iv_update_beacon = wpi_update_beacon; |
635 |
vap->iv_update_beacon = wpi_update_beacon; |
|
|
636 |
vap->iv_max_aid = WPI_ID_IBSS_MAX - WPI_ID_IBSS_MIN + 1; |
638 |
|
637 |
|
639 |
ieee80211_ratectl_init(vap); |
638 |
ieee80211_ratectl_init(vap); |
640 |
/* Complete setup. */ |
639 |
/* Complete setup. */ |
Lines 654-660
Link Here
|
654 |
ieee80211_ratectl_deinit(vap); |
653 |
ieee80211_ratectl_deinit(vap); |
655 |
ieee80211_vap_detach(vap); |
654 |
ieee80211_vap_detach(vap); |
656 |
|
655 |
|
657 |
if (opmode == IEEE80211_M_IBSS) { |
656 |
if (opmode == IEEE80211_M_IBSS || opmode == IEEE80211_M_HOSTAP) { |
658 |
if (bcn->m != NULL) |
657 |
if (bcn->m != NULL) |
659 |
m_freem(bcn->m); |
658 |
m_freem(bcn->m); |
660 |
|
659 |
|
Lines 1382-1387
Link Here
|
1382 |
nflags |= IEEE80211_CHAN_NOADHOC; |
1381 |
nflags |= IEEE80211_CHAN_NOADHOC; |
1383 |
} |
1382 |
} |
1384 |
|
1383 |
|
|
|
1384 |
/* XXX HOSTAP uses WPI_MODE_IBSS */ |
1385 |
if (nflags & IEEE80211_CHAN_NOADHOC) |
1386 |
nflags |= IEEE80211_CHAN_NOHOSTAP; |
1387 |
|
1385 |
return nflags; |
1388 |
return nflags; |
1386 |
} |
1389 |
} |
1387 |
|
1390 |
|
Lines 1650-1658
Link Here
|
1650 |
WPI_LOCK(sc); |
1653 |
WPI_LOCK(sc); |
1651 |
switch (nstate) { |
1654 |
switch (nstate) { |
1652 |
case IEEE80211_S_SCAN: |
1655 |
case IEEE80211_S_SCAN: |
1653 |
if ((vap->iv_opmode == IEEE80211_M_IBSS || |
1656 |
if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && |
1654 |
vap->iv_opmode == IEEE80211_M_AHDEMO) && |
1657 |
vap->iv_opmode != IEEE80211_M_STA) { |
1655 |
(sc->rxon.filter & htole32(WPI_FILTER_BSS))) { |
|
|
1656 |
sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); |
1658 |
sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); |
1657 |
if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { |
1659 |
if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { |
1658 |
device_printf(sc->sc_dev, |
1660 |
device_printf(sc->sc_dev, |
Lines 3321-3329
Link Here
|
3321 |
wpi_set_promisc(struct wpi_softc *sc) |
3323 |
wpi_set_promisc(struct wpi_softc *sc) |
3322 |
{ |
3324 |
{ |
3323 |
struct ifnet *ifp = sc->sc_ifp; |
3325 |
struct ifnet *ifp = sc->sc_ifp; |
|
|
3326 |
struct ieee80211com *ic = ifp->if_l2com; |
3327 |
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); |
3324 |
uint32_t promisc_filter; |
3328 |
uint32_t promisc_filter; |
3325 |
|
3329 |
|
3326 |
promisc_filter = WPI_FILTER_PROMISC | WPI_FILTER_CTL; |
3330 |
promisc_filter = WPI_FILTER_CTL; |
|
|
3331 |
if (vap != NULL && vap->iv_opmode != IEEE80211_M_HOSTAP) |
3332 |
promisc_filter |= WPI_FILTER_PROMISC; |
3327 |
|
3333 |
|
3328 |
if (ifp->if_flags & IFF_PROMISC) |
3334 |
if (ifp->if_flags & IFF_PROMISC) |
3329 |
sc->rxon.filter |= htole32(promisc_filter); |
3335 |
sc->rxon.filter |= htole32(promisc_filter); |
Lines 3730-3738
Link Here
|
3730 |
sc->rxon.mode = WPI_MODE_IBSS; |
3736 |
sc->rxon.mode = WPI_MODE_IBSS; |
3731 |
sc->rxon.filter |= WPI_FILTER_BEACON; |
3737 |
sc->rxon.filter |= WPI_FILTER_BEACON; |
3732 |
break; |
3738 |
break; |
3733 |
/* XXX workaround for passive channels selection */ |
3739 |
case IEEE80211_M_HOSTAP: |
|
|
3740 |
/* XXX workaround for beaconing */ |
3741 |
sc->rxon.mode = WPI_MODE_IBSS; |
3742 |
sc->rxon.filter |= WPI_FILTER_ASSOC | WPI_FILTER_PROMISC; |
3743 |
break; |
3734 |
case IEEE80211_M_AHDEMO: |
3744 |
case IEEE80211_M_AHDEMO: |
3735 |
case IEEE80211_M_HOSTAP: |
3745 |
/* XXX workaround for passive channels selection */ |
3736 |
sc->rxon.mode = WPI_MODE_HOSTAP; |
3746 |
sc->rxon.mode = WPI_MODE_HOSTAP; |
3737 |
break; |
3747 |
break; |
3738 |
case IEEE80211_M_MONITOR: |
3748 |
case IEEE80211_M_MONITOR: |
Lines 4275-4281
Link Here
|
4275 |
return error; |
4285 |
return error; |
4276 |
} |
4286 |
} |
4277 |
|
4287 |
|
4278 |
if (vap->iv_opmode == IEEE80211_M_IBSS) { |
4288 |
if (vap->iv_opmode == IEEE80211_M_IBSS || |
|
|
4289 |
vap->iv_opmode == IEEE80211_M_HOSTAP) { |
4279 |
if ((error = wpi_setup_beacon(sc, ni)) != 0) { |
4290 |
if ((error = wpi_setup_beacon(sc, ni)) != 0) { |
4280 |
device_printf(sc->sc_dev, |
4291 |
device_printf(sc->sc_dev, |
4281 |
"%s: could not setup beacon, error %d\n", __func__, |
4292 |
"%s: could not setup beacon, error %d\n", __func__, |
Lines 4533-4538
Link Here
|
4533 |
|
4544 |
|
4534 |
case IEEE80211_M_IBSS: |
4545 |
case IEEE80211_M_IBSS: |
4535 |
case IEEE80211_M_AHDEMO: |
4546 |
case IEEE80211_M_AHDEMO: |
|
|
4547 |
case IEEE80211_M_HOSTAP: |
4536 |
ni = ieee80211_find_vap_node(&ic->ic_sta, vap, k->wk_macaddr); |
4548 |
ni = ieee80211_find_vap_node(&ic->ic_sta, vap, k->wk_macaddr); |
4537 |
if (ni == NULL) |
4549 |
if (ni == NULL) |
4538 |
return 0; /* should not happen */ |
4550 |
return 0; /* should not happen */ |