Date: Mon, 9 May 2005 16:17:17 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 76752 for review Message-ID: <200505091617.j49GHHhv077821@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=76752 Change 76752 by sam@sam_ebb on 2005/05/09 16:16:16 dump compatibility baggage Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#8 edit .. //depot/projects/vap/sys/net80211/ieee80211_var.h#9 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#8 (text+ko) ==== @@ -93,378 +93,7 @@ ieee80211_init_scan(&vap->iv_if, 0); } -/* - * XXX - * Wireless LAN specific configuration interface, which is compatible - * with wicontrol(8). - */ - -struct wi_read_ap_args { - int i; /* result count */ - struct wi_apinfo *ap; /* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211com *ic; -}; - -static void -wi_read_ap_result(void *arg, const struct ieee80211_scan_entry *se) -{ - struct wi_read_ap_args *sa = arg; - struct ieee80211com *ic = sa->ic; - struct wi_apinfo *ap = sa->ap; - int j; - - if ((caddr_t)(ap + 1) > sa->max) - return; - memset(ap, 0, sizeof(struct wi_apinfo)); - IEEE80211_ADDR_COPY(ap->bssid, se->se_bssid); - ap->namelen = se->se_ssid[1]; - if (ap->namelen) - memcpy(ap->name, se->se_ssid+2, ap->namelen); - ap->channel = ieee80211_chan2ieee(ic, se->se_chan); - ap->signal = se->se_rssi; - ap->capinfo = se->se_capinfo; - ap->interval = se->se_intval; - for (j = 0; j < se->se_rates[1]; j++) { - if (se->se_rates[j] & IEEE80211_RATE_BASIC) { - ap->rate = (se->se_rates[j] & - IEEE80211_RATE_VAL) * 5; /* XXX */ - } - } - for (j = 0; j < se->se_xrates[1]; j++) { - if (se->se_xrates[j] & IEEE80211_RATE_BASIC) { - ap->rate = (se->se_xrates[j] & - IEEE80211_RATE_VAL) * 5; /* XXX */ - } - } - sa->i++; - sa->ap++; -} - -struct wi_read_prism2_args { - int i; /* result count */ - struct wi_scan_res *res;/* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211com *ic; -}; - -static void -wi_read_prism2_result(void *arg, const struct ieee80211_scan_entry *se) -{ - struct wi_read_prism2_args *sa = arg; - struct ieee80211com *ic = sa->ic; - struct wi_scan_res *res = sa->res; - int nr, nxr; - - if ((caddr_t)(res + 1) > sa->max) - return; - res->wi_chan = ieee80211_chan2ieee(ic, se->se_chan); - res->wi_noise = 0; - res->wi_signal = se->se_rssi; - IEEE80211_ADDR_COPY(res->wi_bssid, se->se_bssid); - res->wi_interval = se->se_intval; - res->wi_capinfo = se->se_capinfo; - res->wi_ssid_len = se->se_ssid[1]; - memcpy(res->wi_ssid, se->se_ssid+2, IEEE80211_NWID_LEN); - /* NB: assumes wi_srates holds <= ni->ni_rates */ - nr = se->se_rates[1]; - memcpy(res->wi_srates, se->se_rates+2, nr); - nxr = se->se_xrates[1]; - memcpy(res->wi_srates+nr, se->se_xrates+2, nxr); - if (nr+nxr < 10) - res->wi_srates[nr+nxr] = 0; - res->wi_rate = 0; /* XXX no current rate */ - res->wi_rsvd = 0; - - sa->i++; - sa->res++; -} - -struct wi_read_sigcache_args { - int i; /* result count */ - struct wi_sigcache *wsc;/* current entry in result buffer */ - caddr_t max; /* result buffer bound */ - struct ieee80211vap *vap; -}; - -static void -wi_read_sigcache(void *arg, struct ieee80211_node *ni) -{ - struct wi_read_sigcache_args *sa = arg; - struct wi_sigcache *wsc = sa->wsc; - - if ((caddr_t)(wsc + 1) > sa->max) - return; - if (ni->ni_vap != sa->vap) - return; - memset(wsc, 0, sizeof(struct wi_sigcache)); - IEEE80211_ADDR_COPY(wsc->macsrc, ni->ni_macaddr); - wsc->signal = sa->vap->iv_ic->ic_node_getrssi(ni); - - sa->wsc++; - sa->i++; -} - -int -ieee80211_cfgget(struct ifnet *ifp, u_long cmd, caddr_t data) -{ - struct ieee80211vap *vap = ifp->if_softc; - struct ieee80211com *ic = vap->iv_ic; - int i, j, error; - struct ifreq *ifr = (struct ifreq *)data; - struct wi_req wreq; - struct wi_ltv_keys *keys; - - error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); - if (error) - return error; - wreq.wi_len = 0; - switch (wreq.wi_type) { - case WI_RID_SERIALNO: - /* nothing appropriate */ - break; - case WI_RID_NODENAME: - strcpy((char *)&wreq.wi_val[1], hostname); - wreq.wi_val[0] = htole16(strlen(hostname)); - wreq.wi_len = (1 + strlen(hostname) + 1) / 2; - break; - case WI_RID_CURRENT_SSID: - if (vap->iv_state != IEEE80211_S_RUN) { - wreq.wi_val[0] = 0; - wreq.wi_len = 1; - break; - } - wreq.wi_val[0] = htole16(vap->iv_bss->ni_esslen); - memcpy(&wreq.wi_val[1], vap->iv_bss->ni_essid, - vap->iv_bss->ni_esslen); - wreq.wi_len = (1 + vap->iv_bss->ni_esslen + 1) / 2; - break; - case WI_RID_OWN_SSID: - case WI_RID_DESIRED_SSID: - wreq.wi_val[0] = htole16(vap->iv_des_esslen); - memcpy(&wreq.wi_val[1], vap->iv_des_essid, vap->iv_des_esslen); - wreq.wi_len = (1 + vap->iv_des_esslen + 1) / 2; - break; - case WI_RID_CURRENT_BSSID: - if (vap->iv_state == IEEE80211_S_RUN) - IEEE80211_ADDR_COPY(wreq.wi_val, vap->iv_bss->ni_bssid); - else - memset(wreq.wi_val, 0, IEEE80211_ADDR_LEN); - wreq.wi_len = IEEE80211_ADDR_LEN / 2; - break; - case WI_RID_CHANNEL_LIST: - memset(wreq.wi_val, 0, sizeof(wreq.wi_val)); - /* - * Since channel 0 is not available for DS, channel 1 - * is assigned to LSB on WaveLAN. - */ - if (ic->ic_phytype == IEEE80211_T_DS) - i = 1; - else - i = 0; - for (j = 0; i <= IEEE80211_CHAN_MAX; i++, j++) - if (isset(ic->ic_chan_avail, i)) { - setbit((u_int8_t *)wreq.wi_val, j); - wreq.wi_len = j / 16 + 1; - } - break; - case WI_RID_OWN_CHNL: - wreq.wi_val[0] = htole16( - ieee80211_chan2ieee(ic, ic->ic_bsschan)); - wreq.wi_len = 1; - break; - case WI_RID_CURRENT_CHAN: - wreq.wi_val[0] = htole16( - ieee80211_chan2ieee(ic, ic->ic_curchan)); - wreq.wi_len = 1; - break; - case WI_RID_COMMS_QUALITY: - wreq.wi_val[0] = 0; /* quality */ - wreq.wi_val[1] = htole16(ic->ic_node_getrssi(vap->iv_bss)); - wreq.wi_val[2] = 0; /* noise */ - wreq.wi_len = 3; - break; - case WI_RID_PROMISC: - wreq.wi_val[0] = htole16((ifp->if_flags & IFF_PROMISC) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_PORTTYPE: - wreq.wi_val[0] = htole16(vap->iv_opmode); - wreq.wi_len = 1; - break; - case WI_RID_MAC_NODE: - IEEE80211_ADDR_COPY(wreq.wi_val, vap->iv_myaddr); - wreq.wi_len = IEEE80211_ADDR_LEN / 2; - break; - case WI_RID_TX_RATE: - if (vap->iv_fixed_rate != -1 && - ic->ic_bsschan != IEEE80211_CHAN_ANYC) { - i = ieee80211_chan2mode(ic->ic_bsschan); - j = ic->ic_sup_rates[i].rs_rates[vap->iv_fixed_rate] & IEEE80211_RATE_VAL; - wreq.wi_val[0] = htole16(j / 2); - } else - wreq.wi_val[0] = 0; /* auto */ - wreq.wi_len = 1; - break; - case WI_RID_CUR_TX_RATE: - wreq.wi_val[0] = htole16( - (vap->iv_bss->ni_rates.rs_rates[vap->iv_bss->ni_txrate] & - IEEE80211_RATE_VAL) / 2); - wreq.wi_len = 1; - break; - case WI_RID_RTS_THRESH: - wreq.wi_val[0] = htole16(vap->iv_rtsthreshold); - wreq.wi_len = 1; - break; - case WI_RID_CREATE_IBSS: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_IBSSON) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_MICROWAVE_OVEN: - wreq.wi_val[0] = 0; /* no ... not supported */ - wreq.wi_len = 1; - break; - case WI_RID_ROAMING_MODE: - wreq.wi_val[0] = htole16(ic->ic_roaming); /* XXX map */ - wreq.wi_len = 1; - break; - case WI_RID_SYSTEM_SCALE: - wreq.wi_val[0] = htole16(1); /* low density ... not supp */ - wreq.wi_len = 1; - break; - case WI_RID_PM_ENABLED: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_PMGTON) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_MAX_SLEEP: - wreq.wi_val[0] = htole16(ic->ic_lintval); - wreq.wi_len = 1; - break; - case WI_RID_CUR_BEACON_INT: - wreq.wi_val[0] = htole16(vap->iv_bss->ni_intval); - wreq.wi_len = 1; - break; - case WI_RID_WEP_AVAIL: - wreq.wi_val[0] = htole16(1); /* always available */ - wreq.wi_len = 1; - break; - case WI_RID_CNFAUTHMODE: - wreq.wi_val[0] = htole16(1); /* TODO: open system only */ - wreq.wi_len = 1; - break; - case WI_RID_ENCRYPTION: - wreq.wi_val[0] = - htole16((vap->iv_flags & IEEE80211_F_PRIVACY) ? 1 : 0); - wreq.wi_len = 1; - break; - case WI_RID_TX_CRYPT_KEY: - wreq.wi_val[0] = htole16(vap->iv_def_txkey); - wreq.wi_len = 1; - break; - case WI_RID_DEFLT_CRYPT_KEYS: - keys = (struct wi_ltv_keys *)&wreq; - /* do not show keys to non-root user */ - error = suser(curthread); - if (error) { - memset(keys, 0, sizeof(*keys)); - error = 0; - break; - } - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - keys->wi_keys[i].wi_keylen = - htole16(vap->iv_nw_keys[i].wk_keylen); - memcpy(keys->wi_keys[i].wi_keydat, - vap->iv_nw_keys[i].wk_key, - vap->iv_nw_keys[i].wk_keylen); - } - wreq.wi_len = sizeof(*keys) / 2; - break; - case WI_RID_MAX_DATALEN: - wreq.wi_val[0] = htole16(vap->iv_fragthreshold); - wreq.wi_len = 1; - break; - case WI_RID_IFACE_STATS: - /* XXX: should be implemented in lower drivers */ - break; - case WI_RID_READ_APS: - /* - * Don't return results until active scan completes. - */ - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { - struct wi_read_ap_args args; - - args.i = 0; - args.ap = (void *)((char *)wreq.wi_val + sizeof(i)); - args.max = (void *)(&wreq + 1); - args.ic = ic; - ieee80211_scan_iterate(ic, wi_read_ap_result, &args); - memcpy(wreq.wi_val, &args.i, sizeof(args.i)); - wreq.wi_len = (sizeof(int) + - sizeof(struct wi_apinfo) * args.i) / 2; - } else - error = EINPROGRESS; - break; - case WI_RID_PRISM2: - /* NB: we lie so WI_RID_SCAN_RES can include rates */ - wreq.wi_val[0] = 1; - wreq.wi_len = sizeof(u_int16_t) / 2; - break; - case WI_RID_SCAN_RES: /* compatibility interface */ - if ((ic->ic_flags & IEEE80211_F_SCAN) == 0) { - struct wi_read_prism2_args args; - struct wi_scan_p2_hdr *p2; - - /* NB: use Prism2 format so we can include rate info */ - p2 = (struct wi_scan_p2_hdr *)wreq.wi_val; - args.i = 0; - args.res = (void *)&p2[1]; - args.max = (void *)(&wreq + 1); - args.ic = ic; - ieee80211_scan_iterate(ic, wi_read_prism2_result,&args); - p2->wi_rsvd = 0; - p2->wi_reason = args.i; - wreq.wi_len = (sizeof(*p2) + - sizeof(struct wi_scan_res) * args.i) / 2; - } else - error = EINPROGRESS; - break; - case WI_RID_READ_CACHE: { - struct wi_read_sigcache_args args; - args.i = 0; - args.wsc = (struct wi_sigcache *) wreq.wi_val; - args.max = (void *)(&wreq + 1); - args.vap = vap; - ieee80211_iterate_nodes(&ic->ic_sta, wi_read_sigcache, &args); - wreq.wi_len = sizeof(struct wi_sigcache) * args.i / 2; - break; - } - default: - error = EINVAL; - break; - } - if (error == 0) { - wreq.wi_len++; - error = copyout(&wreq, ifr->ifr_data, sizeof(wreq)); - } - return error; -} - static int -findrate(struct ieee80211com *ic, enum ieee80211_phymode mode, int rate) -{ -#define IEEERATE(_ic,_m,_i) \ - ((_ic)->ic_sup_rates[_m].rs_rates[_i] & IEEE80211_RATE_VAL) - int i, nrates = ic->ic_sup_rates[mode].rs_nrates; - for (i = 0; i < nrates; i++) - if (IEEERATE(ic, mode, i) == rate) - return i; - return -1; -#undef IEEERATE -} - -static int find11gchannel(struct ieee80211com *ic, int i, int freq) { for (; i < ic->ic_nchans; i++) { @@ -600,312 +229,6 @@ return 0; } -int -ieee80211_cfgset(struct ifnet *ifp, u_long cmd, caddr_t data) -{ - struct ieee80211vap *vap = ifp->if_softc; - struct ieee80211com *ic = vap->iv_ic; - int i, j, len, error, rate; - struct ifreq *ifr = (struct ifreq *)data; - struct wi_ltv_keys *keys; - struct wi_req wreq; - - error = copyin(ifr->ifr_data, &wreq, sizeof(wreq)); - if (error) - return error; - len = wreq.wi_len ? (wreq.wi_len - 1) * 2 : 0; - switch (wreq.wi_type) { - case WI_RID_SERIALNO: - case WI_RID_NODENAME: - return EPERM; - case WI_RID_CURRENT_SSID: - return EPERM; - case WI_RID_OWN_SSID: - case WI_RID_DESIRED_SSID: - if (le16toh(wreq.wi_val[0]) * 2 > len || - le16toh(wreq.wi_val[0]) > IEEE80211_NWID_LEN) { - error = ENOSPC; - break; - } - memset(vap->iv_des_essid, 0, sizeof(vap->iv_des_essid)); - vap->iv_des_esslen = le16toh(wreq.wi_val[0]) * 2; - memcpy(vap->iv_des_essid, &wreq.wi_val[1], vap->iv_des_esslen); - error = ENETRESET; - break; - case WI_RID_CURRENT_BSSID: - return EPERM; - case WI_RID_OWN_CHNL: - case WI_RID_CURRENT_CHAN: - if (len != 2) - return EINVAL; - error = ieee80211_setchannel(vap, le16toh(wreq.wi_val[0])); - break; - case WI_RID_COMMS_QUALITY: - return EPERM; - case WI_RID_PROMISC: - if (len != 2) - return EINVAL; - if (ifp->if_flags & IFF_PROMISC) { - if (wreq.wi_val[0] == 0) { - ifp->if_flags &= ~IFF_PROMISC; - error = ENETRESET; - } - } else { - if (wreq.wi_val[0] != 0) { - ifp->if_flags |= IFF_PROMISC; - error = ENETRESET; - } - } - break; - case WI_RID_PORTTYPE: - return EINVAL; -#if 0 - case WI_RID_MAC_NODE: - if (len != IEEE80211_ADDR_LEN) - return EINVAL; - IEEE80211_ADDR_COPY(LLADDR(ifp->if_sadl), wreq.wi_val); - /* if_init will copy lladdr into ic_myaddr */ - error = ENETRESET; - break; -#endif - case WI_RID_TX_RATE: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] == 0) { - /* auto */ - vap->iv_fixed_rate = -1; - break; - } - rate = 2 * le16toh(wreq.wi_val[0]); - if (ic->ic_curmode == IEEE80211_MODE_AUTO) { - /* - * In autoselect mode search for the rate. We take - * the first instance which may not be right, but we - * are limited by the interface. Note that we also - * lock the mode to insure the rate is meaningful - * when it is used. - */ - for (j = IEEE80211_MODE_11A; - j < IEEE80211_MODE_MAX; j++) { - if ((ic->ic_modecaps & (1<<j)) == 0) - continue; - i = findrate(ic, j, rate); - if (i != -1) { - /* lock mode too */ - ic->ic_curmode = j; - goto setrate; - } - } - } else { - i = findrate(ic, ic->ic_curmode, rate); - if (i != -1) - goto setrate; - } - return EINVAL; - setrate: - vap->iv_fixed_rate = i; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_CUR_TX_RATE: - return EPERM; - case WI_RID_RTS_THRESH: - if (len != 2) - return EINVAL; - if (le16toh(wreq.wi_val[0]) != IEEE80211_MAX_LEN) - return EINVAL; /* TODO: RTS */ - break; - case WI_RID_CREATE_IBSS: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_IBSS) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_IBSSON) == 0) { - vap->iv_flags |= IEEE80211_F_IBSSON; - if (vap->iv_opmode == IEEE80211_M_IBSS && - vap->iv_state == IEEE80211_S_SCAN) - error = IS_UP_AUTO(vap) ? ENETRESET : 0; - } - } else { - if (vap->iv_flags & IEEE80211_F_IBSSON) { - vap->iv_flags &= ~IEEE80211_F_IBSSON; - if (vap->iv_flags & IEEE80211_F_SIBSS) { - vap->iv_flags &= ~IEEE80211_F_SIBSS; - error = IS_UP_AUTO(vap) ? ENETRESET : 0; - } - } - } - break; - case WI_RID_MICROWAVE_OVEN: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) - return EINVAL; /* not supported */ - break; - case WI_RID_ROAMING_MODE: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i > IEEE80211_ROAMING_MANUAL) - return EINVAL; /* not supported */ - vap->iv_ic->ic_roaming = i; - break; - case WI_RID_SYSTEM_SCALE: - if (len != 2) - return EINVAL; - if (le16toh(wreq.wi_val[0]) != 1) - return EINVAL; /* not supported */ - break; - case WI_RID_PM_ENABLED: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_PMGT) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_PMGTON) == 0) { - vap->iv_flags |= IEEE80211_F_PMGTON; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - } - } else { - if (vap->iv_flags & IEEE80211_F_PMGTON) { - vap->iv_flags &= ~IEEE80211_F_PMGTON; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - } - } - break; - case WI_RID_MAX_SLEEP: - if (len != 2) - return EINVAL; - ic->ic_lintval = le16toh(wreq.wi_val[0]); - if (vap->iv_flags & IEEE80211_F_PMGTON) - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_CUR_BEACON_INT: - return EPERM; - case WI_RID_WEP_AVAIL: - return EPERM; - case WI_RID_CNFAUTHMODE: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i > IEEE80211_AUTH_WPA) - return EINVAL; - vap->iv_bss->ni_authmode = i; /* XXX ENETRESET? */ - error = ENETRESET; - break; - case WI_RID_ENCRYPTION: - if (len != 2) - return EINVAL; - if (wreq.wi_val[0] != 0) { - if ((vap->iv_caps & IEEE80211_C_WEP) == 0) - return EINVAL; - if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { - vap->iv_flags |= IEEE80211_F_PRIVACY; - error = ENETRESET; - } - } else { - if (vap->iv_flags & IEEE80211_F_PRIVACY) { - vap->iv_flags &= ~IEEE80211_F_PRIVACY; - error = ENETRESET; - } - } - break; - case WI_RID_TX_CRYPT_KEY: - if (len != 2) - return EINVAL; - i = le16toh(wreq.wi_val[0]); - if (i >= IEEE80211_WEP_NKID) - return EINVAL; - vap->iv_def_txkey = i; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_DEFLT_CRYPT_KEYS: - if (len != sizeof(struct wi_ltv_keys)) - return EINVAL; - keys = (struct wi_ltv_keys *)&wreq; - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - len = le16toh(keys->wi_keys[i].wi_keylen); - if (len != 0 && len < IEEE80211_WEP_KEYLEN) - return EINVAL; - if (len > IEEE80211_KEYBUF_SIZE) - return EINVAL; - } - for (i = 0; i < IEEE80211_WEP_NKID; i++) { - struct ieee80211_key *k = &vap->iv_nw_keys[i]; - - len = le16toh(keys->wi_keys[i].wi_keylen); - k->wk_keylen = len; - k->wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; - memset(k->wk_key, 0, sizeof(k->wk_key)); - memcpy(k->wk_key, keys->wi_keys[i].wi_keydat, len); -#if 0 - k->wk_type = IEEE80211_CIPHER_WEP; -#endif - } - error = ENETRESET; - break; - case WI_RID_MAX_DATALEN: - if (len != 2) - return EINVAL; - len = le16toh(wreq.wi_val[0]); - if (len < 350 /* ? */ || len > IEEE80211_MAX_LEN) - return EINVAL; - vap->iv_fragthreshold = len; - error = IS_UP(vap) ? ic->ic_reset(ifp) : 0; - break; - case WI_RID_IFACE_STATS: - error = EPERM; - break; - case WI_RID_SCAN_REQ: /* XXX wicontrol */ - ieee80211_start_scan(vap, - IEEE80211_SCAN_NOPICK | IEEE80211_SCAN_ACTIVE); - break; - case WI_RID_SCAN_APS: - len--; /* XXX: tx rate? */ - /* FALLTHRU */ - case WI_RID_CHANNEL_LIST: -#if 0 -/* XXX fill in scan list */ - memset(chanlist, 0, sizeof(chanlist)); - /* - * Since channel 0 is not available for DS, channel 1 - * is assigned to LSB on WaveLAN. - */ - if (ic->ic_phytype == IEEE80211_T_DS) - i = 1; - else - i = 0; - for (j = 0; i <= IEEE80211_CHAN_MAX; i++, j++) { - if ((j / 8) >= len) - break; - if (isclr((u_int8_t *)wreq.wi_val, j)) - continue; - if (isclr(ic->ic_chan_active, i)) { - if (wreq.wi_type != WI_RID_CHANNEL_LIST) - continue; - if (isclr(ic->ic_chan_avail, i)) - return EPERM; - } - setbit(chanlist, i); - } - error = ieee80211_setupscan(vap, chanlist); - if (wreq.wi_type == WI_RID_CHANNEL_LIST) { - /* NB: ignore error from ieee80211_setupscan */ - error = ENETRESET; - } else if (error == 0) -#endif - ieee80211_start_scan(vap, - IEEE80211_SCAN_NOPICK | IEEE80211_SCAN_ACTIVE); - break; - default: - error = EINVAL; - break; - } - if (error == ENETRESET && !IS_UP_AUTO(vap)) - error = 0; - return error; -} - static int cap2cipher(int flag) { @@ -2573,15 +1896,6 @@ (struct ieee80211req *) data); } break; - case SIOCGIFGENERIC: - error = ieee80211_cfgget(ifp, cmd, data); - break; - case SIOCSIFGENERIC: - error = suser(curthread); - if (error) - break; - error = ieee80211_cfgset(ifp, cmd, data); - break; case SIOCG80211STATS: ifr = (struct ifreq *)data; copyout(&vap->iv_stats, ifr->ifr_data, sizeof (vap->iv_stats)); ==== //depot/projects/vap/sys/net80211/ieee80211_var.h#9 (text+ko) ==== @@ -374,8 +374,6 @@ int ieee80211_media_change(struct ifnet *); void ieee80211_media_status(struct ifnet *, struct ifmediareq *); int ieee80211_ioctl(struct ifnet *, u_long, caddr_t); -int ieee80211_cfgget(struct ifnet *, u_long, caddr_t); -int ieee80211_cfgset(struct ifnet *, u_long, caddr_t); int ieee80211_rate2media(struct ieee80211com *, int, enum ieee80211_phymode); int ieee80211_media2rate(int);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505091617.j49GHHhv077821>