Date: Thu, 30 Mar 2006 08:16:36 -0600 From: "Scot Hetzel" <swhetzel@gmail.com> To: freebsd-current@freebsd.org Cc: wpaul@freebsd.org, sam@freebsd.org Subject: wpa_supplicant fails to find the NDIS adapter names Message-ID: <790a9fff0603300616y62afae4cp50b448b53112de8c@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
In setting up my laptop (FreeBSD/amd64 6.1-BETA), I needed to use the NDIS driver, since FreeBSD doesn't have a driver for my Broadcom card. I added ifconfig_ndis0=3D"WPA DHCP", created a /etc/wpa_supplicant.conf and restarted the network (/etc/rc.d/netif stop|start). Except I received this error: NDIS: Failed to get adapter list (PacketGetAdapterNames) Failed to initialize driver interface Running wpa_supplicant manually with the following command, resulted in the same error. # wpa_supplicant -B -q -i ndis0 -D ndis -c /etc/wpa_supplicant.conf -P /var/run/wpa_supplicant/ndis0.pid Searching the sources, I found this routine being used in src/contrib/wpa_supplicant/driver_ndis.c (wpa_driver_ndis_get_names). In this section of source code: =09res =3D PacketGetAdapterNames(names, &len); =09if (!res && len > 8192) { =09=09free(names); =09=09names =3D malloc(len); =09=09if (names =3D=3D NULL) =09=09=09return -1; =09=09memset(names, 0, len); =09=09res =3D PacketGetAdapterNames(names, &len); =09} =09if (!res) { =09=09wpa_printf(MSG_ERROR, "NDIS: Failed to get adapter list " =09=09=09 "(PacketGetAdapterNames)"); =09=09free(names); =09=09return -1; =09} I had added a couple of wpa_printf(MSG_DEBUG..); that printed the value of res and names. This indicated that PacketGetAdapterNames was returning with the name of the ndis interface and that res was being set to zero. The problem is that PacketGetAdapterNames is returning with a zero value, which causes wpa_driver_ndis_get_names to print ths error message and return with a -1. I then found PacketGetAdapterNames routine in usr.sbin/wpa/wpa_supplicant/Packet32.c. After replacing 'return(0)' with 'return(1)', then recompiling and installing the new wpa_supplicant, I was able to get wpa_supplicant to use the ndis0 interface. I also noticed that PacketGetAdapterNames is returning with EIO, ENOMEM, ENOSPC, since wpa_driver_ndis_get_names expects a boolean value for the return code from PacketGetAdapterNames, should these return values be changed to a zero also? The only thing I have tested right now is that wpa_supplicant can find the ndis0 interface. As I won't be near a wireless network until tomorrow. If someone can test if replacing the return value in Packet32.c works for them with the ndis driver. NOTE: This problem affects both RELENG_6 and CURRENT since the import and MFC of wpa_supplicant to version 0.4.8. The only thing I'm not sure about is if my /etc/wpa_supplicant.conf file is set up properly for this wireless network: ctrl_interface=3D/var/run/wpa_supplicant ctrl_intreface_group=3Dwheel network=3D{ ssid=3D"campuswpa" key_mgmt=3DWPA-EAP pairwise=3DTKIP group=3DTKIP eap=3DPEAP identity=3D"<username>" password=3D"<password>" # phase1=3D"peaplabel=3D1" phase2=3D"auth=3DMSCHAPV2" priority=3D1 } When I connect to this network thru Windows XP, the setup is as follows: Network Authentication: WPA Data encryption: TKIP EAP Type: Protected EAP (PEAP) Authentication Method: Secured password (EAP-MSCHAP v2) Fast Reconnect: Enabled Validate server certificate: Unchecked Scot -- DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0603300616y62afae4cp50b448b53112de8c>