Subject: Ioctl size mask

From: Shay Deloya <[email-masked]>
Date: Mon, 16 Apr 2001 13:44:42 +0300

Hi all,

On asm-mips/ioctl.h , there is a mask on the size transfered to the ioctl , 
e.g. : when implementing an ioctl that handles IO , the max size the 
supported in mips is 0xff  as defined in the code below: 

#define _IOWR(type,nr,size) 			
	_IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))                          

and _IOC uses size in this way:

(((size) & _IOC_SLMASK) << _IOC_SIZESHIFT))           // (_IOC_SLMMASK = 0xff)

The limited size causes problems on drivers that use size mask to their 
needs, while officialy the allowed limit is 2^13 ( 8kB) by definition .

Does anyone know the reason for this masking and limit  ? 

Thanks,
Shay Deloya
______________________________________
Software Developer
Jungo - R&D
email: [email-masked]
web: http://www.jungo.com
Phone: 1-877-514-0537(USA)  +972-9-8859365(Worldwide) ext. 221
Fax:   1-877-514-0538(USA)  +972-9-8859366(Worldwide)

---

From: Geert Uytterhoeven <[email-masked]>
Date: Mon, 16 Apr 2001 20:42:41 +0200 (MET DST)

> needs, while officialy the allowed limit is 2^13 ( 8kB) by definition .

This was fixed in the CVS tree some weeks ago.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven ------------- Sony Software Development Center Europe (SDCE)
[email-masked] ------------------- Sint-Stevens-Woluwestraat 55
Voice +32-2-7248626 Fax +32-2-7262686 ---------------- B-1130 Brussels, Belgium

---

From: Keith M Wesolowski <[email-masked]>
Date: Mon, 16 Apr 2001 08:07:24 -0700

> supported in mips is 0xff  as defined in the code below: 
...
> Does anyone know the reason for this masking and limit  ? 

Breakage.  This has recently been fixed at least in cvs; update your
kernel.

-- 
Keith M Wesolowski <[email-masked]> http://foobazco.org/~wesolows
------(( Project Foobazco Coordinator and Network Administrator ))------
	"Nothing motivates a man more than to see his boss put
	 in an honest day's work." -- The fortune file

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 17 Apr 2001 13:39:57 -0300

> This was fixed in the CVS tree some weeks ago.

Small addendum to the fix - while it made some ioctls usable it also did
result in the affected ioctl number changing which may have broken some
software that _appeared_ to be working before.  One example is autofs.
Just recompile against the updated kernel headers and everything will be
ok.

The effect gets more visible on the 64-bit kernel which will spit kernel
messages for unknown ioctls.

  Ralf