I want to be able to send IOCTL commands to standard devices (fdd,cdrom,kbd) from my 
kernel driver. Whereas I can do reads and writes using the vn_rdwr commands, how do I 
do IOCTLS? VOP_IOCTL keeps giving me EINVAL when I try to send the DIOCGDINFO IOCTL.

My code is basically

NDINIT(&_VdFloppyND, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/fd0", p);

vn_open(&_VdFloppyND, FREAD, 0);

osError = VOP_IOCTL(_VdFloppyND.ni_vp,
                    DIOCGDINFO,
                    (caddr_t)&dl,
                    0,              // fflags ???
                    p->p_ucred,
                    p);

Questions:
1) Is there something I am doing wrong?
2) Should I use something else other than vn_open/vn_rdwr/VOP_*?

The error occurs regardless whether the floppy is mounted or not.
_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to