--- Begin Message ---
- To: Ravi K <kravi26@yahoo.com>
- Subject: Re: ioctl in kernel
- From: Nickolay Dokovsky <dokovsky@cs.utwente.nl>
- Date: Tue, 16 Oct 2001 12:05:01 +0200
- Organization: University of Twente
- References: <20011015212035.42550.qmail@web12306.mail.yahoo.com>
Ravi K wrote:
Hi,It Dosen't work because dev->do_ioctl is used only for device specific ioctls. When you try to invoke it with normal IOCTL it returns "not supported"
If you have the pointer to net_device (say *dev),
you can call dev->do_ioctl().-Ravi.
--- Nickolay Dokovsky <dokovsky@cs.utwente.nl> wrote:
> Hello,
> May you provide an example how to invoke ioctl on
> device from kernel
> module.
> For instance I have an dev pointer to struct
> net_device and I want to
> make SIOCSIFADDR on it from kernel module.
> Thank you
I saw that devinet_ioctl could be invoked wrapped in getting and setting segments call
like :
mm_segment_t. fs = get_fs();
set_fs(get_ds());
devinet_ioctl(SIOCSIFADDR,&ir);
{
it hangs here .... ????
}
set_fs(fs);
whitout fs functions devinet_ioctl returns "Bad_address" error generated by copy_from_user()
call that is in devinet_ioctl......All this is invoked from a kernel module which registrates network event listener and than invokes notifier_call when an NETDEVICE_GOINGDOWN is receieved.
The idea is when you have two NICs and one is going down than the other to obtain
MAC and IP addresses of the first.Thanks
N. Dokovsky
begin:vcard n:Dokovsky;Nickolay tel;work:+31534893283 x-mozilla-html:FALSE url:http://www.ctit.utwente.nl org:University of Twente;CTIT adr:;;PO BOX 217;Enschede;;7500 AE;Netherlands version:2.1 email;internet:dokvosky@cs.utwente.nl title:Software Developer fn:Nickolay Dokovsky end:vcard--- End Message ---
begin:vcard n:Dokovsky;Nickolay tel;work:+31534893283 x-mozilla-html:FALSE url:http://www.ctit.utwente.nl org:University of Twente;CTIT adr:;;PO BOX 217;Enschede;;7500 AE;Netherlands version:2.1 email;internet:dokvosky@cs.utwente.nl title:Software Developer fn:Nickolay Dokovsky end:vcard