Subject: Re: sending a struct of size more than 0x1fff to ioctl()
To: Eshanye <esha@sharada.ncore.soft.net>
From: Stefan Grefen <grefen@hprc.tandem.com>
List: tech-kern
Date: 12/11/1998 15:43:45
In message <3670F30A.3A05F46A@sharada.ncore.soft.net> Eshanye wrote:
> Hi,
>
> I'm using syscall ioctl() to download parameters to EPLD. So as a ' in'
> parameter i'm sending a structure which contains the EPLD file along
> with some other information. The size of the structure is 65560
> (0x10018). But the cmd of ioctl() has only at most 13 bits to encode
> the size of the parameter. So i'm not able to send the structure without
> which my card wont work at all. How do you solve this problem ?
1) You pass in the pointer to the download-data instead of
the download data. Than you do a copy{in|out} from that pointer.
There is no size-limit in that (besides size_t :-)).
2) You use IOC_VOID (use _IO instead of _IO{R|W|WR}. You get than
a pointer to that structure in userspace and have to do copy{in|out}.
Stefan
>
> Thanx
> Esha
>
--
Stefan Grefen Tandem Computers Europe Inc.
grefen@hprc.tandem.com High Performance Research Center
--- Hacking's just another word for nothing left to kludge. ---