Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211_freebsd.c
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
static int ieee80211_debug = 0; | static int ieee80211_debug = 0; | ||||
SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug, | SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug, | ||||
0, "debugging printfs"); | 0, "debugging printfs"); | ||||
#endif | #endif | ||||
static const char wlanname[] = "wlan"; | static const char wlanname[] = "wlan"; | ||||
static struct if_clone *wlan_cloner; | static struct if_clone *wlan_cloner; | ||||
/* | |||||
* priv(9) NET80211 checks. | |||||
* Return 0 if operation is allowed, E* (usually EPERM) otherwise. | |||||
*/ | |||||
int | |||||
ieee80211_priv_check_vap_getkey(u_long cmd __unused, | |||||
struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) | |||||
{ | |||||
return (priv_check(curthread, PRIV_NET80211_VAP_GETKEY)); | |||||
} | |||||
int | |||||
ieee80211_priv_check_vap_manage(u_long cmd __unused, | |||||
struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) | |||||
{ | |||||
return (priv_check(curthread, PRIV_NET80211_VAP_MANAGE)); | |||||
} | |||||
int | |||||
ieee80211_priv_check_vap_setmac(u_long cmd __unused, | |||||
struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) | |||||
{ | |||||
return (priv_check(curthread, PRIV_NET80211_VAP_SETMAC)); | |||||
} | |||||
int | |||||
ieee80211_priv_check_create_vap(u_long cmd __unused, | |||||
struct ieee80211vap *vap __unused, struct ifnet *ifp __unused) | |||||
{ | |||||
return (priv_check(curthread, PRIV_NET80211_CREATE_VAP)); | |||||
} | |||||
static int | static int | ||||
wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) | wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) | ||||
{ | { | ||||
struct ieee80211_clone_params cp; | struct ieee80211_clone_params cp; | ||||
struct ieee80211vap *vap; | struct ieee80211vap *vap; | ||||
struct ieee80211com *ic; | struct ieee80211com *ic; | ||||
int error; | int error; | ||||
error = priv_check(curthread, PRIV_NET80211_CREATE_VAP); | error = ieee80211_priv_check_create_vap(0, NULL, NULL); | ||||
if (error) | if (error) | ||||
return error; | return error; | ||||
error = copyin(params, &cp, sizeof(cp)); | error = copyin(params, &cp, sizeof(cp)); | ||||
if (error) | if (error) | ||||
return error; | return error; | ||||
ic = ieee80211_find_com(cp.icp_parent); | ic = ieee80211_find_com(cp.icp_parent); | ||||
if (ic == NULL) | if (ic == NULL) | ||||
▲ Show 20 Lines • Show All 1,055 Lines • Show Last 20 Lines |