I have a newbie question :-)

I would like to have to threads: 1 reading process and one writing
process...

For the moment as soon I write to device, I begin to read the answer but it
is not very efficient because the iso7816 don't give a real way to know if
the write is finish or if the read will give an answer...

In the usb-serial classical implementation, the bulk read return all
incoming characters and the callback function permit to write those
characters into the tty device. In my case, the problem is the next one: to
read character I must send a command to the device with a bulk write.. In
the read call back, may I use the port stored in the context to call a bul
write function to ask to the device to read ?

Second problem, the protocol of the device works like this: To read
character, I must ( as I said before ) , send a command to read ( a bulk
write message ) , after try to read one byte to know how much byte are
waiting in the device buffer and finally bulk read the len given at the
previous step...

So ideally, a thread dedicated to this sequence is the solution to the
latency observed in the current implementation ( the smart routine is not
magic and the cases to stop waiting are limited ) because the function wait
during 200 round to be sure to read all datas...

Thanks for you propositions...

Alain


-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de
[EMAIL PROTECTED]
Envoyé : jeudi 19 juillet 2007 9:11
À : 'Oliver Neukum'
Cc : linux-usb-devel@lists.sourceforge.net
Objet : Re: [linux-usb-devel] [PATCH] iuu_phoenix new driver proposal 2
fixed

OOps ;-)

2 missing characters...

Now it compile without warning or error



-----Message d'origine-----
De : [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] De la part de Oliver
Neukum Envoyé : jeudi 19 juillet 2007 8:22 À :
linux-usb-devel@lists.sourceforge.net
Cc : Alain Degreffe
Objet : Re: [linux-usb-devel] [PATCH] iuu_phoenix new driver proposal 2

Am Mittwoch 18 Juli 2007 schrieb Alain Degreffe:


+static int iuu_tiocmget(struct usb_serial_port *port, struct file 
+*file) {
+       u8 *st;
+       int status ;
+       st = kmalloc(sizeof(u8), GFP_KERNEL);
+       if (!st)
+               return -ENOMEM ;
+       iuu_status(port, st);
+
+       dbg("%s (%d) msg ", __FUNCTION__, port->number);
+       if (st[0] & IUU_FULLCARD_IN) {
+               dbg("%s  card present ! value returned %i ", __FUNCTION__,
+                   TIOCM_CD);
+               status = 0 ;
+       } else {
+               status TIOCM_CD;

Could you make the code compileable and resubmit it?

        Regards
                Oliver


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express Download DB2 Express C - the
FREE version of DB2 express and take control of your XML. No limits. Just
data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to