diff options
Diffstat (limited to 'sys/net80211/ieee80211_ioctl.c')
-rw-r--r-- | sys/net80211/ieee80211_ioctl.c | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 2798d80..6b668cb 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_inet.h" +#include "opt_ipx.h" #include "opt_wlan.h" #include <sys/endian.h> @@ -43,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <net/if.h> -#include <net/if_var.h> #include <net/if_dl.h> #include <net/if_media.h> #include <net/ethernet.h> @@ -53,6 +53,11 @@ __FBSDID("$FreeBSD$"); #include <netinet/if_ether.h> #endif +#ifdef IPX +#include <netipx/ipx.h> +#include <netipx/ipx_if.h> +#endif + #include <net80211/ieee80211_var.h> #include <net80211/ieee80211_ioctl.h> #include <net80211/ieee80211_regdomain.h> @@ -602,7 +607,7 @@ ieee80211_ioctl_getcurchan(struct ieee80211vap *vap, struct ieee80211req *ireq) * in use. When in RUN state report the vap-specific channel. * Otherwise return curchan. */ - if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) + if (vap->iv_state == IEEE80211_S_RUN) c = vap->iv_bss->ni_chan; else c = ic->ic_curchan; @@ -920,7 +925,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, case IEEE80211_IOC_BSSID: if (ireq->i_len != IEEE80211_ADDR_LEN) return EINVAL; - if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) { + if (vap->iv_state == IEEE80211_S_RUN) { error = copyout(vap->iv_opmode == IEEE80211_M_WDS ? vap->iv_bss->ni_macaddr : vap->iv_bss->ni_bssid, ireq->i_data, ireq->i_len); @@ -1026,7 +1031,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, case IEEE80211_IOC_AMPDU_LIMIT: if (vap->iv_opmode == IEEE80211_M_HOSTAP) ireq->i_val = vap->iv_ampdu_rxmax; - else if (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) + else if (vap->iv_state == IEEE80211_S_RUN) ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); else @@ -1034,7 +1039,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, break; case IEEE80211_IOC_AMPDU_DENSITY: if (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) + vap->iv_state == IEEE80211_S_RUN) ireq->i_val = MS(vap->iv_bss->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); else @@ -1108,7 +1113,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, break; case IEEE80211_IOC_SMPS: if (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) { + vap->iv_state == IEEE80211_S_RUN) { if (vap->iv_bss->ni_flags & IEEE80211_NODE_MIMO_RTS) ireq->i_val = IEEE80211_HTCAP_SMPS_DYNAMIC; else if (vap->iv_bss->ni_flags & IEEE80211_NODE_MIMO_PS) @@ -1120,7 +1125,7 @@ ieee80211_ioctl_get80211(struct ieee80211vap *vap, u_long cmd, break; case IEEE80211_IOC_RIFS: if (vap->iv_opmode == IEEE80211_M_STA && - (vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP)) + vap->iv_state == IEEE80211_S_RUN) ireq->i_val = (vap->iv_bss->ni_flags & IEEE80211_NODE_RIFS) != 0; else @@ -1949,7 +1954,7 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_channel *c) if (IEEE80211_IS_CHAN_NOADHOC(c)) return EINVAL; } - if ((vap->iv_state == IEEE80211_S_RUN || vap->iv_state == IEEE80211_S_SLEEP) && + if (vap->iv_state == IEEE80211_S_RUN && vap->iv_bss->ni_chan == c) return 0; /* NB: nothing to do */ } @@ -3414,6 +3419,24 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) arp_ifinit(ifp, ifa); break; #endif +#ifdef IPX + /* + * XXX - This code is probably wrong, + * but has been copied many times. + */ + case AF_IPX: { + struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr); + + if (ipx_nullhost(*ina)) + ina->x_host = *(union ipx_host *) + IF_LLADDR(ifp); + else + bcopy((caddr_t) ina->x_host.c_host, + (caddr_t) IF_LLADDR(ifp), + ETHER_ADDR_LEN); + /* fall thru... */ + } +#endif default: if ((ifp->if_flags & IFF_UP) == 0) { ifp->if_flags |= IFF_UP; |