Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ioctl operation in sample ethernet driver: (11 Items)
   
ioctl operation in sample ethernet driver  
Hi,
I have added a few new ioctl commands in sam_ioctl function in sample ethernet driver.

For accessing
========
1.I wrote test application to create a s = socket(AF_INET,SOCK_DGRAM,0).
2.update the interface name as sam0 in struct ifreq structure.
3.invoked ioctl function ioctl(s,MY_CMD,&ifreq).

The following error 
===========
#./test
[Operation not Supported ]

Please tell me how to process my ioctl commands.

Regards
K.Senthil


 

Re: ioctl operation in sample ethernet driver  
Rename your executable to sth else, not test, test as a executable name was not supported some time ago.

PKY

> Hi,
> I have added a few new ioctl commands in sam_ioctl function in sample ethernet
>  driver.
> 
> For accessing
> ========
> 1.I wrote test application to create a s = socket(AF_INET,SOCK_DGRAM,0).
> 2.update the interface name as sam0 in struct ifreq structure.
> 3.invoked ioctl function ioctl(s,MY_CMD,&ifreq).
> 
> The following error 
> ===========
> #./test
> [Operation not Supported ]
> 
> Please tell me how to process my ioctl commands.
> 
> Regards
> K.Senthil
> 
> 
>  
> 


Re: ioctl operation in sample ethernet driver  
Hi,
 
I have changed.
but still ..

#./sth
 iotcl failed[Operation not supported]

Regards
K.Senthil
Re: ioctl operation in sample ethernet driver  
Hi,

Can you please respond this mail.

Thanks and Regards
K.Senthil
Re: ioctl operation in sample ethernet driver  
On Tue, Oct 20, 2009 at 06:40:57AM -0400, Senthil K wrote:
> Hi,
> I have added a few new ioctl commands in sam_ioctl function in sample ethernet driver.
> 
> For accessing
> ========
> 1.I wrote test application to create a s = socket(AF_INET,SOCK_DGRAM,0).
> 2.update the interface name as sam0 in struct ifreq structure.
> 3.invoked ioctl function ioctl(s,MY_CMD,&ifreq).
> 
> The following error 
> ===========
> #./test
> [Operation not Supported ]
> 
> Please tell me how to process my ioctl commands.
> 

I suggest firing up the debugger.  Depending
on how MY_CMD is defined it may be handled
higher up the stack.  In general the first
step is do populate the (struct ifnet *)->if_ioctl
callout when registering your driver.

Regards,

-seanb
RE: ioctl operation in sample ethernet driver  
> Depending on how MY_CMD is defined 
> it may be handled higher up the stack

IIRC correctly the flow to the driver ioctl
is something like this:

    startproc()
    tcpip_devctl()
    soo_ioctl()
    ifioctl()

--
aboyd
Re: ioctl operation in sample ethernet driver  
Hi Sean,

#define MY_CMD _IOW('p',1,struct ifreq)

I register the sam_ioctl function in the driver.

strcpy(ifreq.ifr_name,"sam0");
if i do ioctl(s,MY_CMD,&ifreq) function it should call  sam_ioctl function right?

Regards
Senthil

Re: ioctl operation in sample ethernet driver  
On Wed, Oct 21, 2009 at 09:52:01AM -0400, Senthil K wrote:
> Hi Sean,
> 
> #define MY_CMD _IOW('p',1,struct ifreq)
> 
> I register the sam_ioctl function in the driver.
> 
> strcpy(ifreq.ifr_name,"sam0");
> if i do ioctl(s,MY_CMD,&ifreq) function it should call  sam_ioctl function right?

No. 'p' class ioctls hit generic handling
further up and the stack has no knowledge
of this ioctl at that level.

Regards,

-seanb
Re: ioctl operation in sample ethernet driver  
Hi Sean,

Please tell me how can i define MY_CMD.

Regards
Senthil



Re: ioctl operation in sample ethernet driver  
Hi,

Please tell me how to define user commands for ioctl.


Thanks and Regards
Senthil
Re: ioctl operation in sample ethernet driver  
Hi Sean,

Thanks a lot....


I tried #define MY_CMD _IOWR('i',1,struct ifreq)

Its working fine..


Regards
Senthil