what does iwpriv do?

Jamon Camisso jamon.camisso-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Sat Jul 3 17:45:21 UTC 2010


On 07/03/2010 12:53 PM, Matt Price wrote:
> hi folks,
> 
> so, i have a faulty third-party wireless driver from realtek that causes
> kernel panics on my ubuntu lucid machine.  The crash can be triggered
> manually by running iwpriv -a as root; when running as a normal user, it
> fails to trigger the crash. I include the output in my latest comment on the
> bug report, here:
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/585938/comments/18 ;
> it's pretty simple though really:
> 
> lo no private ioctls.
> eth0 no private ioctls.
> wlan0 Available read-only private ioctl :
> wlan0 firm_ver:63
> Kernel Panic [etc...]
> 
> here's my question:  how do i figure out what iwpriv is actually doing to
> trigger this issue -- and is there anything i can do to stop this from
> happening at othertimes?

strace is a start, you can see various calls that a given binary makes
and start to narrow down the cause of the panic. Here's an excerpt from
"strace iwlist wlan0 scan":

ioctl(3, SIOCGIWRANGE, 0x7fff60bb8230)  = 0
ioctl(3, SIOCSIWSCAN, 0x7fff60bb8840)   = 0
select(0, [], NULL, NULL, {0, 250000})  = 0 (Timeout)
brk(0)                                  = 0x1c5f000
brk(0x1c81000)                          = 0x1c81000
<snip>
select(0, [], NULL, NULL, {0, 100000})  = 0 (Timeout)
ioctl(3, SIOCGIWSCAN, 0x7fff60bb8840)   = -1 E2BIG (Argument list too long)
ioctl(3, SIOCGIWSCAN, 0x7fff60bb8840)   = 0

Then there a bunch of write calls that spit out the list of wireless
access points in my vicinity.

So you can see that iwlist is calling ioctl, which, via the SIOCGIWSCAN
event, asks the wireless driver to return its list of wireless signals.
I believe that each driver has its own implementation of calls that are
made for SIOCGIWSCAN events depending on the wireless firmware/hardware.

Jamon
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list