FreeBSD Bugzilla – Attachment 154368 Details for
Bug 197143
[wpi] [patch]: sync with iwn / OpenBSD wpi
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add (experimental) HOSTAP mode support
patch-wpi56.diff (text/plain), 4.18 KB, created by
Andriy Voskoboinyk
on 2015-03-15 13:52:03 UTC
(
hide
)
Description:
Add (experimental) HOSTAP mode support
Filename:
MIME Type:
Creator:
Andriy Voskoboinyk
Created:
2015-03-15 13:52:03 UTC
Size:
4.18 KB
patch
obsolete
>Index: sys/dev/wpi/if_wpi.c >=================================================================== >--- sys/dev/wpi/if_wpi.c (revision 279775) >+++ sys/dev/wpi/if_wpi.c (working copy) >@@ -447,6 +447,7 @@ > ic->ic_caps = > IEEE80211_C_STA /* station mode supported */ > | IEEE80211_C_IBSS /* IBSS mode supported */ >+ | IEEE80211_C_HOSTAP /* Host access point mode */ > | IEEE80211_C_MONITOR /* monitor mode supported */ > | IEEE80211_C_AHDEMO /* adhoc demo mode */ > | IEEE80211_C_BGSCAN /* capable of bg scanning */ >@@ -454,9 +455,6 @@ > | IEEE80211_C_SHSLOT /* short slot time supported */ > | IEEE80211_C_WPA /* 802.11i */ > | IEEE80211_C_SHPREAMBLE /* short preamble supported */ >-#if 0 >- | IEEE80211_C_HOSTAP /* Host access point mode */ >-#endif > | IEEE80211_C_WME /* 802.11e */ > | IEEE80211_C_PMGT /* Station-side power mgmt */ > ; >@@ -624,7 +622,7 @@ > vap = &wvp->wv_vap; > ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac); > >- if (opmode == IEEE80211_M_IBSS) { >+ if (opmode == IEEE80211_M_IBSS || opmode == IEEE80211_M_HOSTAP) { > WPI_VAP_LOCK_INIT(wvp); > wpi_init_beacon(wvp); > } >@@ -635,6 +633,7 @@ > wvp->wv_newstate = vap->iv_newstate; > vap->iv_newstate = wpi_newstate; > vap->iv_update_beacon = wpi_update_beacon; >+ vap->iv_max_aid = WPI_ID_IBSS_MAX - WPI_ID_IBSS_MIN + 1; > > ieee80211_ratectl_init(vap); > /* Complete setup. */ >@@ -654,7 +653,7 @@ > ieee80211_ratectl_deinit(vap); > ieee80211_vap_detach(vap); > >- if (opmode == IEEE80211_M_IBSS) { >+ if (opmode == IEEE80211_M_IBSS || opmode == IEEE80211_M_HOSTAP) { > if (bcn->m != NULL) > m_freem(bcn->m); > >@@ -1382,6 +1381,10 @@ > nflags |= IEEE80211_CHAN_NOADHOC; > } > >+ /* XXX HOSTAP uses WPI_MODE_IBSS */ >+ if (nflags & IEEE80211_CHAN_NOADHOC) >+ nflags |= IEEE80211_CHAN_NOHOSTAP; >+ > return nflags; > } > >@@ -1650,9 +1653,8 @@ > WPI_LOCK(sc); > switch (nstate) { > case IEEE80211_S_SCAN: >- if ((vap->iv_opmode == IEEE80211_M_IBSS || >- vap->iv_opmode == IEEE80211_M_AHDEMO) && >- (sc->rxon.filter & htole32(WPI_FILTER_BSS))) { >+ if ((sc->rxon.filter & htole32(WPI_FILTER_BSS)) && >+ vap->iv_opmode != IEEE80211_M_STA) { > sc->rxon.filter &= ~htole32(WPI_FILTER_BSS); > if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { > device_printf(sc->sc_dev, >@@ -3321,9 +3323,13 @@ > wpi_set_promisc(struct wpi_softc *sc) > { > struct ifnet *ifp = sc->sc_ifp; >+ struct ieee80211com *ic = ifp->if_l2com; >+ struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); > uint32_t promisc_filter; > >- promisc_filter = WPI_FILTER_PROMISC | WPI_FILTER_CTL; >+ promisc_filter = WPI_FILTER_CTL; >+ if (vap != NULL && vap->iv_opmode != IEEE80211_M_HOSTAP) >+ promisc_filter |= WPI_FILTER_PROMISC; > > if (ifp->if_flags & IFF_PROMISC) > sc->rxon.filter |= htole32(promisc_filter); >@@ -3730,9 +3736,13 @@ > sc->rxon.mode = WPI_MODE_IBSS; > sc->rxon.filter |= WPI_FILTER_BEACON; > break; >- /* XXX workaround for passive channels selection */ >+ case IEEE80211_M_HOSTAP: >+ /* XXX workaround for beaconing */ >+ sc->rxon.mode = WPI_MODE_IBSS; >+ sc->rxon.filter |= WPI_FILTER_ASSOC | WPI_FILTER_PROMISC; >+ break; > case IEEE80211_M_AHDEMO: >- case IEEE80211_M_HOSTAP: >+ /* XXX workaround for passive channels selection */ > sc->rxon.mode = WPI_MODE_HOSTAP; > break; > case IEEE80211_M_MONITOR: >@@ -4275,7 +4285,8 @@ > return error; > } > >- if (vap->iv_opmode == IEEE80211_M_IBSS) { >+ if (vap->iv_opmode == IEEE80211_M_IBSS || >+ vap->iv_opmode == IEEE80211_M_HOSTAP) { > if ((error = wpi_setup_beacon(sc, ni)) != 0) { > device_printf(sc->sc_dev, > "%s: could not setup beacon, error %d\n", __func__, >@@ -4533,6 +4544,7 @@ > > case IEEE80211_M_IBSS: > case IEEE80211_M_AHDEMO: >+ case IEEE80211_M_HOSTAP: > ni = ieee80211_find_vap_node(&ic->ic_sta, vap, k->wk_macaddr); > if (ni == NULL) > return 0; /* should not happen */ >Index: sys/dev/wpi/if_wpireg.h >=================================================================== >--- sys/dev/wpi/if_wpireg.h (revision 279775) >+++ sys/dev/wpi/if_wpireg.h (working copy) >@@ -375,6 +375,7 @@ > #define WPI_FILTER_NODECRYPT (1 << 3) > #define WPI_FILTER_BSS (1 << 5) > #define WPI_FILTER_BEACON (1 << 6) >+#define WPI_FILTER_ASSOC (1 << 7) /* Accept associaton requests. */ > > uint8_t chan; > uint16_t reserved5;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197143
:
152282
|
152662
|
152977
|
153911
|
153977
|
153983
|
153985
|
153999
|
154000
|
154002
|
154006
|
154007
|
154009
|
154010
|
154011
|
154013
|
154015
|
154016
|
154017
|
154019
|
154020
|
154021
|
154022
|
154024
|
154026
|
154030
|
154032
|
154033
|
154328
|
154329
|
154330
|
154332
|
154334
|
154335
|
154336
|
154337
|
154338
|
154340
|
154341
|
154343
|
154346
|
154347
|
154348
|
154349
|
154350
|
154351
|
154352
|
154353
|
154354
|
154355
|
154356
|
154357
|
154358
|
154359
|
154360
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366
| 154368 |
154369
|
154370
|
154371
|
154372
|
154373
|
154374
|
154375
|
154378
|
154379
|
154380
|
154381
|
154382
|
154383
|
154384
|
155332
|
155333
|
156164
|
156165
|
156166
|
156167
|
156168
|
156169
|
156170
|
156171
|
156172
|
156173
|
156174
|
156175
|
156176
|
156177
|
156178
|
156179
|
156180
|
156181
|
156182
|
156183
|
156184
|
156185
|
156186
|
156187
|
156188
|
156189
|
156190
|
156191
|
156192
|
156193
|
156194
|
156195