diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-08-13 01:34:21 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2006-08-13 01:34:21 +0000 |
commit | bf605b76d6dc189849824765231f0b3cd2d0dc46 (patch) | |
tree | 5af80dce2a4121454fac3e80e1b51ae53df215ae /sys/dev/ic/acx.c | |
parent | d085f4a8954d48e87666f5a591e0bc5d8ce9c46a (diff) |
Enable hostap mode. Tested with acx100 and acx111.
Diffstat (limited to 'sys/dev/ic/acx.c')
-rw-r--r-- | sys/dev/ic/acx.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c index 23564defd78..24872cb52f2 100644 --- a/sys/dev/ic/acx.c +++ b/sys/dev/ic/acx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acx.c,v 1.38 2006/08/12 10:33:18 mglocker Exp $ */ +/* $OpenBSD: acx.c,v 1.39 2006/08/13 01:34:20 mglocker Exp $ */ /* * Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org> @@ -326,6 +326,7 @@ acx_attach(struct acx_softc *sc) */ ic->ic_caps |= IEEE80211_C_WEP | /* WEP */ IEEE80211_C_IBSS | /* IBSS modes */ + IEEE80211_C_HOSTAP | /* Access Point */ IEEE80211_C_SHPREAMBLE; /* Short preamble */ /* Get station id */ @@ -1867,7 +1868,8 @@ acx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) } break; case IEEE80211_S_RUN: - if (ic->ic_opmode == IEEE80211_M_IBSS) { + if (ic->ic_opmode == IEEE80211_M_IBSS || + ic->ic_opmode == IEEE80211_M_HOSTAP) { struct ieee80211_node *ni; uint8_t chan; @@ -1902,9 +1904,18 @@ acx_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) goto back; } - if (acx_join_bss(sc, ACX_MODE_ADHOC, ni) != 0) { - printf("%s: join IBSS failed\n", ifp->if_xname); - goto back; + if (ic->ic_opmode == IEEE80211_M_IBSS) { + if (acx_join_bss(sc, ACX_MODE_ADHOC, ni) != 0) { + printf("%s: join IBSS failed\n", + ifp->if_xname); + goto back; + } + } else { + if (acx_join_bss(sc, ACX_MODE_AP, ni) != 0) { + printf("%s: join HOSTAP failed\n", + ifp->if_xname); + goto back; + } } DPRINTF(("%s: join IBSS\n", sc->sc_dev.dv_xname)); |