dev_ioctl()

From: Joerg Eggink (joerg.eggink@ccrle.nec.de)
Date: Tue Jan 22 2002 - 08:55:03 EST


Sorry for bothering you all again.

I ask yesterday for some help with the dev_ioctl function. Because nobody
answered I send it again with the source code of the function which should
read the name from the wireless device. The function is called from another
module with the device_name eth0.
The problem is that sometimes I get "no wireless extension" but if a packet
arrive (e.g. Router solicitation) I can read the wireless settings.

Is there anything I forgot ?
Do I need locking functions or is it not possible to use the dev_ioctl
function from another kernel module ?

void mho_get_wireless_info(char *dev_name)
{
        struct iwreq wrq;
        
        /*set the device name*/
        strncpy(wrq.ifr_name, dev_name, IFNAMSIZ);
                
        if( dev_ioctl(SIOCGIWNAME, &wrq) < 0)
        {
                printk("MHO: No wireless extension. error = %d\n",err);
                return;
        }
        else
        {
                printk("Wireless info: devicename= %s \n",wrq.u.name);
                return;
        }

}

Thank you for all help in advance

Jörg
--------------------------------------------------------
Joerg Eggink
Network Laboratories Heidelberg NEC Europe Ltd.
Adenauerplatz 6
D-69115 Heidelberg, Germany

email: joerg.eggink@ccrle.nec.de
http://www.ccrle.nec.de
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:14 EST