[haiku-development] kernel debugging for wpa_supplicant

  • From: Alexander Botero-Lowry <alex.boterolowry@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 30 May 2010 23:14:24 -0700

Howdy,

I've been avoiding this for a couple of weeks now.. I was able to get
wpa_supplicant compiled with a custom driver for haiku based on the
FreeBSD driver and a pcap driver based on the static pcap library from
tcpdump and a bit of messing around. It starts up successfully, scans
for networks, detects the network i configured it to connect to, and
attempts to associate! So far so good, except this is where things fall
apart.

The ioctl to do the association IEEE80211_IOC_MLME fails with a  -1
return value, which one expects of an ioctl fail, but also errno is
set to -1. So I don't exactly know what failed. I dug deeper into this,
and found IEEE80211_IOC_DELKEY also fails with identicial behavior. Both
of these ioctls go through the wpa_supplicant driver's set80211var
function. set80211var seems to be used when wanting to pass a void*-able
value into the kernel, so I believe something is going wrong when trying
to copyout the struct/pointer. 

To be honest, I'm pretty out of my element at this point, but I figured
I  would try to dig into the wifi stack where the copying is being done
and see if I can at least localize where in the kernel it is failing. I
read the KDL article which was pretty interesting, but didn't really
cover if it's possible to set break points in the kernel using KDL, or
as an alternative if there is a way to hook gdb on another host up to
the kernel for doing debugging. I thought about doing printf debugging,
but since I need a wifi device to test, the debug cycle would be pretty
infuriating with all the reboots.

I apologize if I missed some obvious article on how to do this stuff :)

I'll also package up the wpa_supplicant wifi stack and and pcap driver
changes I made if anyone else wants to look into this once I'm back
home.

tia,
alex

Other related posts: