[Prism54-devel] Re: iwspy - latest CVS

Aurelien slts@free.fr
Fri, 19 Mar 2004 11:51:36 +0100


No, this comment is about private ioctls. We are using sub-ioctls. The 
relevant code is in iwlib.c (wireless tools 27pre) :

/* Some driver may return a very large number of ioctls. Some
    * others a very small number. We now use a dynamic allocation
    * of the array to satisfy everybody. Of course, as we don't know
    * in advance the size of the array, we try various increasing
    * sizes. Jean II */

int			maxpriv = 16;
...
do
     {
       /* (Re)allocate the buffer */
       newpriv = realloc(priv, maxpriv * sizeof(priv[0]));...
...
...
     }
   while(maxpriv < 1000);



	...And justice for all

Margit Schubert-While wrote:
> Aurelien scribe :
>  >> version pre27 seems to support at least 512.
> 
> You sure ?; Here's a snip from wireless.h (same in kernel and
> wireless tools) :
> 
> ----------------- snip --------------------
> /* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
> 
> /* These 16 ioctl are wireless device private.
>  * Each driver is free to use them for whatever purpose it chooses,
>  * however the driver *must* export the description of those ioctls
>  * with SIOCGIWPRIV and *must* use arguments as defined below.
>  * If you don't follow those rules, DaveM is going to hate you (reason :
>  * it make mixed 32/64bit operation impossible).
>  */
> #define SIOCIWFIRSTPRIV 0x8BE0
> #define SIOCIWLASTPRIV  0x8BFF
> /* Previously, we were using SIOCDEVPRIVATE, but we now have our
>  * separate range because of collisions with other tools such as
>  * 'mii-tool'.
>  * We now have 32 commands, so a bit more space ;-).
>  * Also, all 'odd' commands are only usable by root and don't return the
>  * content of ifr/iwr to user (but you are not obliged to use the set/get
>  * convention, just use every other two command).
>  * And I repeat : you are not obliged to use them with iwspy, but you
>  * must be compliant with it.
>  */
> ------------------ end snip ----------------------------------
> 
> Aurelien also scribeth :
>  > are probably debugging stuff. The iwpriv system should work.
> 
> Err, No, here's the code in net/core/wireless.c
> 
> /* Check if there is enough buffer up there */
> if(iwr->u.data.length < dev->wireless_handlers->num_private_args) {
>    printk(KERN_ERR "%s (WE) : Buffer for request SIOCGIWPRIV too small 
> (%d<%d)\n",
>   dev->name, iwr->u.data.length, dev->wireless_handlers->num_private_args);
>                 return -E2BIG;
> }
> 
> 
> 
> Margit
> 
> 
> _______________________________________________
> Prism54-devel mailing list
> Prism54-devel@prism54.org
> http://prism54.org/mailman/listinfo/prism54-devel
> 
>