netdev
[Top] [All Lists]

dev_ioctl() question ?

To: netdev@xxxxxxxxxxx
Subject: dev_ioctl() question ?
From: Joerg Eggink <joerg.eggink@xxxxxxxxxxxx>
Date: Tue, 22 Jan 2002 18:53:10 +0100
Organization: NEC Europe Ltd.
Sender: owner-netdev@xxxxxxxxxxx
Hello all

I have a problem with reading or setting the wireless settings. I want to use 
the function dev_ioctl(). (defined in core/dev.c )

For this I write my own function integrated in a kernel module. 
The function is now called  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 ?

Or has anybody another idea to read or set the wireless settings (e.g. the 
frequency or channel).

*****************************************************************************
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@xxxxxxxxxxxx
http://www.ccrle.nec.de

-------------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>
  • dev_ioctl() question ?, Joerg Eggink <=