[Prism54-devel] handling of -EINPROGRESS
Jean Tourrilhes
jt@hpl.hp.com
Mon, 23 Feb 2004 10:17:50 -0800
On Mon, Feb 23, 2004 at 11:32:53AM -0500, Luis R. Rodriguez wrote:
>
> Attention to: Jean Tourrilhes <jt@bougret.hpl.hp.com>
>
> On Sun, Feb 22, 2004 at 03:01:41PM -0500, Luis R. Rodriguez wrote:
> > On Sun, Feb 22, 2004 at 08:43:05PM +0200, Denis Vlasenko wrote:
> > > I can't locate code which should "Call commit handler".
> > > I tracked ioctl to wireless.c and dev.c, it seems to me it must
> > > propagate error code all the way to userspace, but obviosly
> > > it doesn't...
> > >
> > > What am I missing here?
> >
> > I don't remember exactly, but I think that use of -EINPROGRESS came from
> > modeling our ioctl by what others do. ie, see airo.c airo_set_freq
> > which sets:
> >
> > int rc = -EINPROGRESS; /* Call commit handler */
> >
> > Looking through wireless.c I see call_commit_handler and I see it called
> > only in ioctl_standard_call:
> >
> > if(ret == -EIWCOMMIT)
> > ret = call_commit_handler(dev);
> >
> > So perhaps we should be returning EIWCOMMIT instead.
> >
> > Luis
> >
>
> Jean,
>
> can you tell us what we should return to force a commit? I see in
> current kernel code EIWCOMMIT but some drivers are using EINPROGRESS.
>
> Luis
First, from .../include/net/iw_handler.h :
-------------------------------------------------------
/* Special error message for the driver to indicate that we
* should do a commit after return from the iw_handler */
#define EIWCOMMIT EINPROGRESS
-------------------------------------------------------
Then, from .../net/core/wireless.c (line 634) :
------------------------------------------
/* Call commit handler if needed and defined */
if(ret == -EIWCOMMIT)
ret = call_commit_handler(dev);
------------------------------------------
You can really use both, as they are the same. Note that the
commit handler will be called only if the card is 'up'.
You may want to check the return value of your handler.
Jean