Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/an/if_an.c
Show First 20 Lines • Show All 1,928 Lines • ▼ Show 20 Lines | case SIOCGIFMEDIA: | ||||
error = ifmedia_ioctl(ifp, ifr, &sc->an_ifmedia, command); | error = ifmedia_ioctl(ifp, ifr, &sc->an_ifmedia, command); | ||||
break; | break; | ||||
case SIOCADDMULTI: | case SIOCADDMULTI: | ||||
case SIOCDELMULTI: | case SIOCDELMULTI: | ||||
/* The Aironet has no multicast filter. */ | /* The Aironet has no multicast filter. */ | ||||
error = 0; | error = 0; | ||||
break; | break; | ||||
case SIOCGAIRONET: | case SIOCGAIRONET: | ||||
error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); | error = copyin(ifr_data_get_ptr(ifr), &sc->areq, | ||||
sizeof(sc->areq)); | |||||
if (error != 0) | if (error != 0) | ||||
break; | break; | ||||
AN_LOCK(sc); | AN_LOCK(sc); | ||||
#ifdef ANCACHE | #ifdef ANCACHE | ||||
if (sc->areq.an_type == AN_RID_ZERO_CACHE) { | if (sc->areq.an_type == AN_RID_ZERO_CACHE) { | ||||
error = priv_check(td, PRIV_DRIVER); | error = priv_check(td, PRIV_DRIVER); | ||||
if (error) | if (error) | ||||
break; | break; | ||||
Show All 12 Lines | #ifdef ANCACHE | ||||
} else | } else | ||||
#endif | #endif | ||||
if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { | if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { | ||||
AN_UNLOCK(sc); | AN_UNLOCK(sc); | ||||
error = EINVAL; | error = EINVAL; | ||||
break; | break; | ||||
} | } | ||||
AN_UNLOCK(sc); | AN_UNLOCK(sc); | ||||
error = copyout(&sc->areq, ifr->ifr_data, sizeof(sc->areq)); | error = copyout(&sc->areq, ifr_data_get_ptr(ifr), | ||||
sizeof(sc->areq)); | |||||
break; | break; | ||||
case SIOCSAIRONET: | case SIOCSAIRONET: | ||||
if ((error = priv_check(td, PRIV_DRIVER))) | if ((error = priv_check(td, PRIV_DRIVER))) | ||||
goto out; | goto out; | ||||
AN_LOCK(sc); | AN_LOCK(sc); | ||||
error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq)); | error = copyin(ifr_data_get_ptr(ifr), &sc->areq, | ||||
sizeof(sc->areq)); | |||||
if (error != 0) | if (error != 0) | ||||
break; | break; | ||||
an_setdef(sc, &sc->areq); | an_setdef(sc, &sc->areq); | ||||
AN_UNLOCK(sc); | AN_UNLOCK(sc); | ||||
break; | break; | ||||
case SIOCGPRIVATE_0: /* used by Cisco client utility */ | case SIOCGPRIVATE_0: /* used by Cisco client utility */ | ||||
if ((error = priv_check(td, PRIV_DRIVER))) | if ((error = priv_check(td, PRIV_DRIVER))) | ||||
goto out; | goto out; | ||||
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); | error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, | ||||
sizeof(l_ioctl)); | |||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
mode = l_ioctl.command; | mode = l_ioctl.command; | ||||
AN_LOCK(sc); | AN_LOCK(sc); | ||||
if (mode >= AIROGCAP && mode <= AIROGSTATSD32) { | if (mode >= AIROGCAP && mode <= AIROGSTATSD32) { | ||||
error = readrids(ifp, &l_ioctl); | error = readrids(ifp, &l_ioctl); | ||||
} else if (mode >= AIROPCAP && mode <= AIROPLEAPUSR) { | } else if (mode >= AIROPCAP && mode <= AIROPLEAPUSR) { | ||||
error = writerids(ifp, &l_ioctl); | error = writerids(ifp, &l_ioctl); | ||||
} else if (mode >= AIROFLSHRST && mode <= AIRORESTART) { | } else if (mode >= AIROFLSHRST && mode <= AIRORESTART) { | ||||
error = flashcard(ifp, &l_ioctl); | error = flashcard(ifp, &l_ioctl); | ||||
} else { | } else { | ||||
error =-1; | error =-1; | ||||
} | } | ||||
AN_UNLOCK(sc); | AN_UNLOCK(sc); | ||||
if (!error) { | if (!error) { | ||||
/* copy out the updated command info */ | /* copy out the updated command info */ | ||||
error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl)); | error = copyout(&l_ioctl, ifr_data_get_ptr(ifr), | ||||
sizeof(l_ioctl)); | |||||
} | } | ||||
break; | break; | ||||
case SIOCGPRIVATE_1: /* used by Cisco client utility */ | case SIOCGPRIVATE_1: /* used by Cisco client utility */ | ||||
if ((error = priv_check(td, PRIV_DRIVER))) | if ((error = priv_check(td, PRIV_DRIVER))) | ||||
goto out; | goto out; | ||||
error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl)); | error = copyin(ifr_data_get_ptr(ifr), &l_ioctl, | ||||
sizeof(l_ioctl)); | |||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
l_ioctl.command = 0; | l_ioctl.command = 0; | ||||
error = AIROMAGIC; | error = AIROMAGIC; | ||||
(void) copyout(&error, l_ioctl.data, sizeof(error)); | (void) copyout(&error, l_ioctl.data, sizeof(error)); | ||||
error = 0; | error = 0; | ||||
break; | break; | ||||
case SIOCG80211: | case SIOCG80211: | ||||
▲ Show 20 Lines • Show All 1,799 Lines • Show Last 20 Lines |