Lines 1875-1880
an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
Link Here
|
1875 |
int len; |
1875 |
int len; |
1876 |
int i, max; |
1876 |
int i, max; |
1877 |
struct an_softc *sc; |
1877 |
struct an_softc *sc; |
|
|
1878 |
struct an_req *areq; |
1878 |
struct ifreq *ifr; |
1879 |
struct ifreq *ifr; |
1879 |
struct thread *td = curthread; |
1880 |
struct thread *td = curthread; |
1880 |
struct ieee80211req *ireq; |
1881 |
struct ieee80211req *ireq; |
Lines 1934-1950
an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
Link Here
|
1934 |
error = 0; |
1935 |
error = 0; |
1935 |
break; |
1936 |
break; |
1936 |
case SIOCGAIRONET: |
1937 |
case SIOCGAIRONET: |
1937 |
error = copyin(ifr_data_get_ptr(ifr), &sc->areq, |
1938 |
error = priv_check(td, PRIV_DRIVER); |
1938 |
sizeof(sc->areq)); |
1939 |
if (error) |
1939 |
if (error != 0) |
|
|
1940 |
break; |
1940 |
break; |
|
|
1941 |
areq = malloc(sizeof(*areq), M_TEMP, M_WAITOK); |
1942 |
error = copyin(ifr_data_get_ptr(ifr), areq, sizeof(*areq)); |
1943 |
if (error != 0) { |
1944 |
free(areq, M_TEMP); |
1945 |
break; |
1946 |
} |
1941 |
AN_LOCK(sc); |
1947 |
AN_LOCK(sc); |
|
|
1948 |
memcpy(&sc->areq, areq, sizeof(sc->areq)); |
1942 |
#ifdef ANCACHE |
1949 |
#ifdef ANCACHE |
1943 |
if (sc->areq.an_type == AN_RID_ZERO_CACHE) { |
1950 |
if (sc->areq.an_type == AN_RID_ZERO_CACHE) { |
1944 |
error = priv_check(td, PRIV_DRIVER); |
|
|
1945 |
if (error) |
1946 |
break; |
1947 |
sc->an_sigitems = sc->an_nextitem = 0; |
1951 |
sc->an_sigitems = sc->an_nextitem = 0; |
|
|
1952 |
free(areq, M_TEMP); |
1948 |
break; |
1953 |
break; |
1949 |
} else if (sc->areq.an_type == AN_RID_READ_CACHE) { |
1954 |
} else if (sc->areq.an_type == AN_RID_READ_CACHE) { |
1950 |
char *pt = (char *)&sc->areq.an_val; |
1955 |
char *pt = (char *)&sc->areq.an_val; |
Lines 1960-1971
an_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
Link Here
|
1960 |
#endif |
1965 |
#endif |
1961 |
if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { |
1966 |
if (an_read_record(sc, (struct an_ltv_gen *)&sc->areq)) { |
1962 |
AN_UNLOCK(sc); |
1967 |
AN_UNLOCK(sc); |
|
|
1968 |
free(areq, M_TEMP); |
1963 |
error = EINVAL; |
1969 |
error = EINVAL; |
1964 |
break; |
1970 |
break; |
1965 |
} |
1971 |
} |
|
|
1972 |
memcpy(areq, &sc->areq, sizeof(*areq)); |
1966 |
AN_UNLOCK(sc); |
1973 |
AN_UNLOCK(sc); |
1967 |
error = copyout(&sc->areq, ifr_data_get_ptr(ifr), |
1974 |
error = copyout(areq, ifr_data_get_ptr(ifr), sizeof(*areq)); |
1968 |
sizeof(sc->areq)); |
1975 |
free(areq, M_TEMP); |
1969 |
break; |
1976 |
break; |
1970 |
case SIOCSAIRONET: |
1977 |
case SIOCSAIRONET: |
1971 |
if ((error = priv_check(td, PRIV_DRIVER))) |
1978 |
if ((error = priv_check(td, PRIV_DRIVER))) |