wireless stats in ad hoc mode

Jean Tourrilhes jt
Wed Jul 23 09:08:37 PDT 2003


JAMES KABA wrote :
> 
> >        You will need to use iwspy. Unfortunately for you, with the
> > HostAP driver iwspy functionality is only available with WE-16 (which
> > means spending time with the patches on my web page).
> >       Good luck...
> ...well, iswpy alone doesn't do it since I currently need access to the
> stats from a kernel module

	The good news is that since WE-13, all the Wireless Extension
can be called from kernel space.
	This is how to do it :
--------------------------------------------
	iw_handler handler;
	struct iw_request_info		info;
	struct iwreq	iwr;
	char buffer[IW_MAX_SPY * (sizeof(struct sockaddr) +
				  sizeof(struct iw_quality))];

	handler = dev->wireless_handlers->standard[SIOCGIWSPY - SIOCIWFIRST];
	info.cmd = SIOCGIWSPY;
	info.flags = 0;
	iwr.data.length = IW_MAX_SPY;
	iwr.data.flags = 0;

	/* Call the handler */
	ret = handler(dev, &info, &(iwr.u), buffer);
--------------------------------------------
	Of course, this is untested, and you better verify that
handler is not null and dev->wireless_handlers->num_standard.

	This is applicable to all WE, so you can do the same for
SIOCSIWSPY to set the relevant MAC addresses (or any other command of
the list).

> In any case, I temporarily kludged some code to suit my short
> term needs (it looks like a car wreck between wireless_spy and
> get_wireless_stats)

	Tell me if the above works for you or not. This should be the
clean way for you to do it.

> ....but the question reamins:
>   why would get_rid(....COMMSQUALITY...) not return valid data...?

	What would be the semantic of this in Ad-Hoc mode ? In managed
mode, it's clear, it's the quality of the link to the AP. But in
Ad-Hoc mode ?
	This is exactly the reason why I invented iwspy, and the
semantic of iwspy is clearly defined.

	Good luck...

	Jean




More information about the Hostap mailing list