Thread (5 messages) 5 messages, 2 authors, 2012-10-04

when to return -EOPNOTSUPP in _ioctl in a driver

From: devendra.aaru <hidden>
Date: 2012-10-04 07:29:36

On Tue, Oct 2, 2012 at 4:07 PM, Luis R. Rodriguez
[off-list ref] wrote:
quoted
do we actually need to specify a pointer to the ioctl callback, if the
driver doesn't support ioctl?
What type of driver? For networking if you do not have
ops->ndo_do_ioctl then -EOPNOTSUPP is returned. See dev_ifsioc() and
prior to that dev_ioctl() on net/core/dev.c.

  Luis

Hi Luis,

Thanks for the reply,

actually i see it in drivers/staging/csr/

this is in netdev.c

here they do the below way

csr_xxx_ioctl(....)
{
          int ret;

          ret = -EOPNOTSUPP;

          return ret;
}

if the ioctl just needs to say that i am not going to support ioctl,
then why we give the function address in the netdev_ops?

as i understood from your reply that the dev_ioctl returns -EOPNOTSUPP
when theres' no ioctl pointer registered in netdev_ops

am i right?


sorry for late reply,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help