Skip to contentSkip to conversation

various doubts ......

DISCUSSION joy 2 participants 3 messages Aug 9, 2004 – Aug 11, 2004

lore
Share & tools
lore

joy

author
#0 lore raw

Hello,
I have a few , though unconnected doubts.

1) can a named pipe be locked using normal lockf() or do I have to perform some voodoo?

2) I need to transfer data (protocol not an issue, just raw data) from a usb peripheral(not HDD) to the host comp. can I do this without writing a usb driver myself,
i.e , using some generic or user-space driver (like ppdev)
the peripheral is a texas instruments tusb246b hub.

Thanx in advance,
Joy.M.Monteiro

#1 lore raw

Hi Joy,

Em Mon, 09 Aug 2004 22:50:25 +0530
joy <[email protected]> screveu:

| Hello,
| I  have a few , though unconnected doubts.
| 
| 1) can a named pipe be locked using normal lockf()  or do I have to 
| perform some voodoo?

I think is possible, but take a look at fcntl(2).

| 2) I need to transfer data (protocol not an issue, just raw data) from a 
| usb peripheral(not HDD)
|     to the host comp. can I do this without writing a usb driver myself, 
| i.e , using some generic or user-space driver (like ppdev)
|     the peripheral is a texas instruments tusb246b hub.

If I've understand what you mean: maybe. The question is: there is any driver
for that hub in the kernel ?

As far as I read, in ppdev you do have two things. First, there is the
/dev/lp0, which is the _printer_ driver; second, there is the /dev/parport0, the _parallel port_ driver.

You can write a user-space driver for you printer, because the kernel
already give you a way (driver) to acesses the parallel port, through /dev/parport0.

There is this kind of thing for your USB device ?

hope this helps,

PS: Don't know nothing about printers, so I may be wrong.

Signature · 1 line
Luiz Fernando
author
#2 lore raw
In reply to joy
Quoted 5 lines · joy

Hello,
I have a few , though unconnected doubts.

1) can a named pipe be locked using normal lockf() or do I have to perform some voodoo?

Yes it can! I tried it out with two processes trying to write to the pipe at the same time.One obtains the lock and sleep()s for 10 seconds during which the other process is blocked.

Quoted 12 lines

2) I need to transfer data (protocol not an issue, just raw data) from a usb peripheral(not HDD) to the host comp. can I do this without writing a usb driver
myself, i.e , using some generic or user-space driver (like ppdev)
the peripheral is a texas instruments tusb246b hub.

Thanx in advance,
Joy.M.Monteiro
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html