Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lll-winken!lll-lcc!rmark From: rmark@lll-lcc.UUCP (Richard Mark) Newsgroups: comp.unix.ultrix Subject: DEVIOCGET question Keywords: Ultrix, UNIBUS, device driver, DEVIOCGET, ioctl Message-ID: <2772@lll-lcc.UUCP> Date: 23 Mar 90 03:23:58 GMT Organization: Lawrence Livermore Labs, LCC, Livermore Ca Lines: 48 I have a question about DEVIOCGET. First the background: VAX 11/750, Ultrix 2.0-1 What routines or what actions cause an ioctl(DEVIOCGET) call? What devices need to handle an ioctl(DEVIOCGET) call? We have a specialized UNIBUS device (HSPI) which we are trying to get connected and running on our system. I added the device in the config file, made the appropriate entries in files.vax, placed the driver sources in /sys/vaxuba, added the appropriate stuff in the cdevsw table of the conf.c file and made the appropriate /dev/hspi0 node with the correct access rights (crw-rw-rw). I completed reconfiguring, rebuilding and rebooting the new system without problems. I had problems opening I had problems opening the device for reading and writing but no problems when opening for just reading. To debug my problem I put printfs in the driver code (in the hspiopen() and hspiioclt() routines) When I open("/dev/hspi0",O_RDONLY) it called hspiopen() which calls hspiioctl(cmd=START) returns from hspiioctl() successfully, then returns from hspiopen() successfully and the open() returns successfully. When I open("/dev/hspi0",O_RDWR) it called hspiopen() which calls hspiioctl(cmd=START) returns from hspiioctl() successfully, then returns from hspiopen() successfully THEN it calls hspiioctl(cmd=DEVIOCGET) and the open() returns unsuccessfully. Although hspiioctl() does not handle that case, there is a default case which doesn't do anything and still returns from hspiioctl() successfully. To repeat my original questions: What routines or what actions cause an ioctl(DEVIOCGET) call? What devices need to handle an ioctl(DEVIOCGET) call? And now some more questions: Is this specific to a certain version of Ultrix? Where can I find out what values I should put in the devget struct? Where is any of this documented? I have probably left out some details or not explained somethings clearly enough but hopefully someone will have some clue about my problem. If you need more info, drop me a note. Thanks, Rich rmark@lll-lcc.llnl.gov