From owner-p4-projects@FreeBSD.ORG Thu May 1 04:22:07 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 541B91065670; Thu, 1 May 2008 04:22:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1666D1065675 for ; Thu, 1 May 2008 04:22:07 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id F3C9F8FC26 for ; Thu, 1 May 2008 04:22:06 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m414M6xZ047536 for ; Thu, 1 May 2008 04:22:06 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m414M6V3047534 for perforce@freebsd.org; Thu, 1 May 2008 04:22:06 GMT (envelope-from thompsa@freebsd.org) Date: Thu, 1 May 2008 04:22:06 GMT Message-Id: <200805010422.m414M6V3047534@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 140963 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2008 04:22:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=140963 Change 140963 by thompsa@thompsa_burger on 2008/05/01 04:21:26 Split ndis_ioctl, the latest net80211 changes would be too unweildly with 'if (sc->ndis_80211) ...'. Affected files ... .. //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#16 edit Differences ... ==== //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#16 (text+ko) ==== @@ -147,6 +147,7 @@ static void ndis_resettask (device_object *, void *); static void ndis_inputtask (device_object *, void *); static int ndis_ioctl (struct ifnet *, u_long, caddr_t); +static int ndis_ioctl_80211 (struct ifnet *, u_long, caddr_t); static int ndis_newstate (struct ieee80211vap *, enum ieee80211_state, int); static int ndis_nettype_chan (uint32_t); @@ -714,6 +715,7 @@ device_get_nameunit(dev)); TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc); + ifp->if_ioctl = ndis_ioctl_80211; ic->ic_ifp = ifp; ic->ic_opmode = IEEE80211_M_STA; ic->ic_phytype = IEEE80211_T_DS; @@ -2705,11 +2707,7 @@ caddr_t data; { struct ndis_softc *sc = ifp->if_softc; - struct ieee80211com *ic = ifp->if_l2com; struct ifreq *ifr = (struct ifreq *) data; - struct ndis_oid_data oid; - struct ndis_evt evt; - void *oidbuf; int i, error = 0; /*NDIS_LOCK(sc);*/ @@ -2751,10 +2749,7 @@ break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: - if (sc->ndis_80211) - error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, command); - else - error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); + error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, command); break; case SIOCSIFCAP: ifp->if_capenable = ifr->ifr_reqcap; @@ -2764,6 +2759,46 @@ ifp->if_hwassist = 0; ndis_set_offload(sc); break; + default: + error = ether_ioctl(ifp, command, data); + break; + } + + /*NDIS_UNLOCK(sc);*/ + + return(error); +} + +static int +ndis_ioctl_80211(ifp, command, data) + struct ifnet *ifp; + u_long command; + caddr_t data; +{ + struct ndis_softc *sc = ifp->if_softc; + struct ieee80211com *ic = ifp->if_l2com; + struct ifreq *ifr = (struct ifreq *) data; + struct ndis_oid_data oid; + struct ndis_evt evt; + void *oidbuf; + int error = 0; + + switch(command) { + case SIOCSIFFLAGS: + /*NDIS_LOCK(sc);*/ + if (ifp->if_flags & IFF_UP) { + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + ndis_init(sc); + ieee80211_start_all(ic); + } + } else { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + ndis_stop(sc); + } + sc->ndis_if_flags = ifp->if_flags; + error = 0; + /*NDIS_UNLOCK(sc);*/ + break; case SIOCGDRVSPEC: if ((error = priv_check(curthread, PRIV_DRIVER))) break; @@ -2863,13 +2898,16 @@ NDIS_EVTINC(sc->ndis_evtcidx); NDIS_UNLOCK(sc); break; + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, command); + break; + case SIOCGIFADDR: + error = ether_ioctl(ifp, command, data); + break; default: - error = ether_ioctl(ifp, command, data); + error = EINVAL; break; } - - /*NDIS_UNLOCK(sc);*/ - return(error); }