[comp.sys.hp] Reply to GPIO Driver Problem

ckw@hpcupt1.HP.COM (Chick Webb) (02/25/88)

What If, HP support types read comp.sys.hp?  Maybe things like this
would happen:

>Einar Kjartansson				eik@geysir.UUCP
>Orkustofnun					eik@OS.IS
>(National Energy Authority of Iceland)		mcvax!hafro!geysir!eik
>Grensasvegi 9					geysir!eik@hafro.uucp
>IS-105 Reykjvik, Iceland
>Telephone: 354-1-83600 or 354-1-16407

>Does anyone know of a way to get exclusive use of the 27114A general purpose 
>interface on HP 9000/840?

>I have tried several ways, such as
>	afi = open("/dev/gpio0", O_CREAT,O_EXCL)

If this is indeed what you are typing, then the problem is that the
open flags (O_CREAT and O_EXCL) should be 'or'ed together, not
listed:  
	afi = open("/dev/gpio0", O_CREAT | O_EXCL)

You could also open the diagnostic device file, which will automatically
lock the interface, giving you exclusive access.

>and
>	gpio_control.type = GPIO_LOCK;
>	ioctl(afi,IO_CONTROL &gpio_control);

The above should work if given the proper argument (which I do not see above).
If gpio_control.arg[0] is 0, then the interface is unlocked, otherwise
it is locked.  So, what will work is:

	gpio_control.type = GPIO_LOCK;
	gpio_control.arg[0] = 1;
	ioctl(afi,IO_CONTROL, &gpio_control);

>According to my reading of the manuals either method should do the job, but
>neither makes any difference.

Maybe we need to read the manuals a little more closely? :-)

>I have also been unable to get the interface to function in 8 bit mode...

This is a driver bug. :-(  The LDM handles 8 bit mode correctly, but the 
DAM/DM does not.  This will be fixed in a future release. :-)

>With this as well as the numerous other software errors that we have run into, 
>talking to HP support has been a waste of time.  The symptoms did not change
>when we upgraded from HP-UX 1.04 to 1.20.

I guess I don't understand what problems you've been having with our
support organization, Einar.  Here at HP, we're proud of our reputation
in the area of customer support.  HP is consistently rated very highly
in this area.  If you have specific suggestions regarding ways in which
we can improve our support, I would be happy to hear them, and I urge
you to contact me.  Until that time, I hope that the information above
satisfies your needs.

Chick Webb
ITG HP-UX Technical Support
Hewlett-Packard Company
Cupertino, CA
408-447-5138
{ucbvax, etc.}!hpda!ckw

P.S. Thanks to the anonymous labbie who provided most of the above. :-)