Subject: ioctl parameters
To: None <port-arm32@NetBSD.ORG>
From: Peter Berg <Peter.Berg@ww.tu-freiberg.de>
List: port-arm32
Date: 02/23/1997 11:51:09
Hi,

how can I pass the address of a structure to a device driver ?

On the kernel side I do a

int spdifioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
{
  int unit = minor(dev);
  struct spdif_softc *sc = spdif_cd.cd_devs[unit];
  struct spdif_ctrl *spdif_control = (struct spdif_ctrl *)data;

where spdif_ctrl is the pointer to the structrure. The pointer is read from the
data variable (not shure about that, I've copied this behavior from the beep 
device).

But how do I realize it on the client side ?? I've not yet understand how the 
parameters will be encoded before they will be passed to the call. If someone 
could give me an example in source (the calling line is enough) this would 
help me.
I have to pass a command and the address of the structure to the call.



Ciao, Peter

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
|                                                                          |
|                            >>> FutureGroove <<<                          |
|                                                                          |
| Peter Berg                                       Music production &      |
|                                                  softwaredevelopment     |
| w3: http://www.ww.tu-freiberg.de/~pberg                                  |
| email: Peter.Berg@ww.tu-freiberg.de                                      |
|                                           part time system administrator |
|                                                   at *.ww.tu-freiberg.de |
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/