dev_ioctl()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
: 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


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux