Need help. Trying to get a new driver work.

Dan Williams dcbw at redhat.com
Wed Oct 3 10:30:15 EDT 2007


On Wed, 2007-10-03 at 19:45 +0530, Sriharsha Vedurmudi wrote:
> Dear Friends,
>  I am writing a new driver for a new chip (currently in last stage of
> design) and have trouble testing the WPA-PSK functionality of the chip
> under Linux, using wpa_supplicant.
> 
> In the ioctl handler for SIOCGIWSCAN, I am re-constructing the WPA IE
> (since my driver parses this IE and populates my private structure
> during scanning a beacon/probe response) and adding the event using
> the function iwe_stream_add_point( ) (as done in other drivers like
> airo.c).
> But when I issue the command sequence:
> $ ifconfig wlan0 up
> $ wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
> 
>  For the second command, after the initial stuff, it is showing me the
> list of APs (currently active), but is failing to see any WPA info in
> them.

A few things.  In your GIWRANGE handler, make sure you are doing the
following:

1) Setting range->we_version_source = 19 or higher; as long as you
provide WPA support you should advertise 19 or higher

2) Setting range->enc_capa correctly:

		range->enc_capa =   IW_ENC_CAPA_WPA
		                  | IW_ENC_CAPA_WPA2
		                  | IW_ENC_CAPA_CIPHER_TKIP
		                  | IW_ENC_CAPA_CIPHER_CCMP;

   (of course, if you don't support CCMP or RSN don't put those there)

3) In your GIWSCAN handler, are you adding the WPA IEs correctly?  Don't
use EVCUSTOM; use EVGENIE like so:

	memset(&iwe, 0, sizeof(iwe));
	if (bss->rsn_ie_len) {
		char buf[MAX_WPA_IE_LEN];
		memcpy(buf, bss->rsn_ie, bss->rsn_ie_len);
		iwe.cmd = IWEVGENIE;
		iwe.u.data.length = bss->rsn_ie_len;
		start = iwe_stream_add_point(start, stop, &iwe, buf);
	}

Without wpa_supplicant, what does a scan result look like, from the
output of 'iwlist wlan0 scan' for an AP you know is broadcasting an IE?
iwlist will print out the IE information if your driver correctly
handles it.

Also, thanks for using driver_wext.c; the more wireless drivers that use
WEXT the easier it is for Linux applications to work with your driver.

Dan


>  Also surprising is that none of the printk's that I put in the ioctl
> handler functions are getting displayed.
>  Since wpa_supplicant is not seeing any wpa ie, it is not issuing the
> associate command. I am unable to figure out whats going wrong. Can
> somebody help me with the correct sequence that is needed and also the
> correct way to pass the WPA IE to wpa_supplicant (through
> driver_wext.c, since Im using Linux 2.6.19-2 with W.E ver 21).
> 
> Thanks in advance,
> 
> Best regards,
> Sriharsha.
> _______________________________________________
> HostAP mailing list
> HostAP at shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap




More information about the HostAP mailing list