when to return -EOPNOTSUPP in _ioctl in a driver

devendra.aaru devendra.aaru at gmail.com
Thu Oct 4 03:29:36 EDT 2012


On Tue, Oct 2, 2012 at 4:07 PM, Luis R. Rodriguez
<mcgrof at do-not-panic.com> wrote:
>> 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,



More information about the Kernelnewbies mailing list