Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Oct 2001 09:03:54 -0600
From:      Warner Losh <imp@harmony.village.org>
To:        Yar Tikhiy <yar@FreeBSD.ORG>
Cc:        net@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: Some thoughts on if_ioctl() 
Message-ID:  <200110081503.f98F3s759159@harmony.village.org>
In-Reply-To: Your message of "Mon, 08 Oct 2001 11:32:14 %2B0400." <20011008113214.A68390@snark.rinet.ru> 
References:  <20011008113214.A68390@snark.rinet.ru>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20011008113214.A68390@snark.rinet.ru> Yar Tikhiy writes:
: First, the current implementation of the utility function
: ether_ioctl(), which can do good job common to ethernet drivers,
: won't indicate the situation when an ioctl command is unsupported
: by it. It will return 0 in this case. Wouldn't it be better to
: return EINVAL so the driver can do something about that?
: Now each driver using ether_ioctl() has to maintain painfully the
: list of the ioctl commands that may be passed to ether_ioctl(), or
: the kernel will be likely to panic in copyout() dereferencing a
: NULL pointer.

Actaully, it should return ENOTTY rather than EINVAL.  ENOTTY means
that the ioctl isn't understood.  I've had to fix several drivers at
work that didn't follow this convention due to ignorance on the part
of the driver writer.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200110081503.f98F3s759159>