Date: Tue, 15 Apr 2008 21:46:03 GMT From: Andrew Thompson <thompsa@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 140088 for review Message-ID: <200804152146.m3FLk3Mn030259@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=140088 Change 140088 by thompsa@thompsa_burger on 2008/04/15 21:45:19 Add enough goo to get NDIS working, tested with WPA. Affected files ... .. //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#12 edit .. //depot/projects/vap/sys/dev/if_ndis/if_ndisvar.h#9 edit .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#54 edit .. //depot/projects/vap/usr.sbin/wpa/wpa_supplicant/Packet32.c#3 edit Differences ... ==== //depot/projects/vap/sys/dev/if_ndis/if_ndis.c#12 (text+ko) ==== @@ -140,6 +140,8 @@ static void ndis_vap_delete (struct ieee80211vap *); static void ndis_tick (void *); static void ndis_ticktask (device_object *, void *); +static int ndis_raw_xmit (struct ieee80211_node *, struct mbuf *, + const struct ieee80211_bpf_params *); static void ndis_start (struct ifnet *); static void ndis_starttask (device_object *, void *); static void ndis_resettask (device_object *, void *); @@ -713,6 +715,7 @@ TASK_INIT(&sc->ndis_scantask, 0, ndis_scan, sc); ic->ic_ifp = ifp; + ic->ic_opmode = IEEE80211_M_STA; ic->ic_phytype = IEEE80211_T_DS; ic->ic_caps = IEEE80211_C_IBSS; setbit(ic->ic_modecaps, IEEE80211_MODE_AUTO); @@ -895,6 +898,7 @@ ic->ic_caps |= IEEE80211_C_PMGT; bcopy(eaddr, &ic->ic_myaddr, sizeof(eaddr)); ieee80211_ifattach(ic); + ic->ic_raw_xmit = ndis_raw_xmit; ic->ic_scan_start = ndis_scan_start; ic->ic_scan_end = ndis_scan_end; ic->ic_set_channel = ndis_set_channel; @@ -1728,6 +1732,16 @@ return; } +static int +ndis_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ + /* no support; just discard */ + m_freem(m); + ieee80211_free_node(ni); + return 0; +} + static void ndis_starttask(d, arg) device_object *d; @@ -1842,7 +1856,8 @@ * to him. */ - BPF_MTAP(ifp, m); + if (!sc->ndis_80211) /* XXX handle 80211 */ + BPF_MTAP(ifp, m); /* * The array that p0 points to must appear contiguous, ==== //depot/projects/vap/sys/dev/if_ndis/if_ndisvar.h#9 (text+ko) ==== ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#54 (text+ko) ==== @@ -3232,6 +3232,14 @@ break; } break; + /* Pass NDIS ioctls up to the driver */ + case SIOCGDRVSPEC: + case SIOCSDRVSPEC: + case SIOCGPRIVATE_0: { + struct ifnet *parent = vap->iv_ic->ic_ifp; + error = parent->if_ioctl(parent, cmd, data); + break; + } default: error = ether_ioctl(ifp, cmd, data); break; ==== //depot/projects/vap/usr.sbin/wpa/wpa_supplicant/Packet32.c#3 (text+ko) ==== @@ -286,7 +286,7 @@ ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); - if (strnstr(sdl->sdl_data, "ndis", sdl->sdl_nlen)) { + if (strnstr(sdl->sdl_data, "wlan", sdl->sdl_nlen)) { if ((spc + sdl->sdl_nlen) > *len) { free(buf); return(FALSE); @@ -319,7 +319,7 @@ ifm = (struct if_msghdr *)next; if (ifm->ifm_type == RTM_IFINFO) { sdl = (struct sockaddr_dl *)(ifm + 1); - if (strnstr(sdl->sdl_data, "ndis", sdl->sdl_nlen)) { + if (strnstr(sdl->sdl_data, "wlan", sdl->sdl_nlen)) { if ((spc + sdl->sdl_nlen) > *len) { free(buf); return(FALSE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804152146.m3FLk3Mn030259>