Re: Help with device drivers

2009-08-11 Thread Hans Petter Selasky
On Tuesday 11 August 2009 08:06:26 Krassimir Slavchev wrote: > Hans Petter Selasky wrote: > > On Monday 10 August 2009 13:39:31 Krassimir Slavchev wrote: > >> If I try to open the device from userland with: > >> fd = open("/dev/xxx0", O_RDWR) it fails because open() tries to open the > >> device fo

Re: Help with device drivers

2009-08-10 Thread Krassimir Slavchev
Hans Petter Selasky wrote: > On Monday 10 August 2009 13:39:31 Krassimir Slavchev wrote: >> If I try to open the device from userland with: >> fd = open("/dev/xxx0", O_RDWR) it fails because open() tries to open the >> device for reading first and then for writing. > > There is a bug in the code.

Re: Help with device drivers

2009-08-10 Thread Hans Petter Selasky
On Monday 10 August 2009 13:39:31 Krassimir Slavchev wrote: > If I try to open the device from userland with: > fd = open("/dev/xxx0", O_RDWR) it fails because open() tries to open the > device for reading first and then for writing. There is a bug in the code. If you open using read+write flags,

Help with device drivers

2009-08-10 Thread Krassimir Slavchev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi All, Looking at sys/dev/usb/misc/ufm.c ... static int ufm_open(struct usb_fifo *dev, int fflags) { if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) { return (EACCES); } return (0); } ... and sys/dev/usb