Hi,

recently LEGO brought out version 2.0 of their Robotics Invention
System, which contains a so-called USB Tower to communicate with
the programmable brick (called RCX) via infrared at 2400 baud.
Now obviously we need a Linux USB driver for this beast,
to make all those people buying RIS 2.0 happy and avoid
that they turn to some other OS ;-)

Currently we are two (Brendan and me) who have started
thinking about it.

Our problem is that this device uses interrupt transfers 
instead of bulk transfers to communicate, and there doesn't
seem to be an obvious other driver to adapt.  Especially
for sending data via interrupt transfers there seems to be
no example, the other devices use bulk transfers there.

Apart from that it seems very simple, the data transferred
is exactly the data that get sent via IR, no funny encoding
or the like.  As I understand it the Linux driver must
interface to either the file or the tty interface above and
to the USB interface below, and basically hand through the
data with minimal extra complications.

Specific questions:

- Is there anybody else working on this?
- What would be the best existing driver(s) to start from?
- Is there documentation somewhere on the USB driver interface?
  The file/tty interfaces (apart from the man pages for read,...)?
- What about packets longer than the limit specified in
  the configuration (8 bytes here), who's responsible
  for splitting larger data packets?  Can the USB core do it?
- Is the file interface ok for this, or will we need the
  flow control in the more complicated tty interface?
- Are IOCTLs the right thing to switch between configurations?
  Here we have four, two speeds (RCX/VLL) times two power levels
  (low/high).
- Is the first configuration enabled by default (* in /proc/usb/devices)?
  That would already make it work for most people.

FYI, here is what /proc/usb/devices says:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB UHCI-alt Root Hub
S:  SerialNumber=fce0
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=ff(vend.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  4
P:  Vendor=0694 ProdID=0001 Rev= 1.00
S:  Manufacturer=LEGO Group
S:  Product=LEGO USB Tower
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=  1ms
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=  1ms
C:  #Ifs= 1 Cfg#= 2 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=  1ms
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=  1ms
C:  #Ifs= 1 Cfg#= 3 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl= 10ms
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl= 10ms
C:  #Ifs= 1 Cfg#= 4 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=ff Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl= 10ms
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl= 10ms

Here's a typical snippet from a log:

00011399        318.44869120    >>>>>>> URB 496 going down...   
00011400        318.44873120    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011401        318.44875920      PipeHandle           = c1554f8c       
00011402        318.44880960      TransferFlags        = 00000000 
(USBD_TRANSFER_DIRECTION_OUT, ~USBD_SHORT_TRANSFER_OK)        
00011403        318.44883840      TransferBufferLength = 0000000d       
00011404        318.44886400      TransferBuffer       = 035508d0       
00011405        318.44889520      TransferBufferMDL    = 00000000       
00011406        318.44890960            
00011407        318.44892080        0000:       
00011408        318.44906720     55 ff 00 63 9c b0 4f c8 37 01 fe dc 23 
00011409        318.44909200      UrbLink              = 00000000       
00011410        318.45130960            
00011411        318.45131840    <<<<<<< URB 496 coming back...  
00011412        318.45136880    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011413        318.45139600      PipeHandle           = c1554f8c       
00011414        318.45144800      TransferFlags        = 00000000 
(USBD_TRANSFER_DIRECTION_OUT, ~USBD_SHORT_TRANSFER_OK)        
00011415        318.45147200      TransferBufferLength = 0000000d       
00011416        318.45149920      TransferBuffer       = 035508d0       
00011417        318.45152560      TransferBufferMDL    = c15c2da0       
00011418        318.45154960      UrbLink              = 00000000       
00011419        318.52193680            
00011420        318.52194560    <<<<<<< URB 495 coming back...  
00011421        318.52198880    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011422        318.52201680      PipeHandle           = c1554f78       
00011423        318.52206000      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011424        318.52208400      TransferBufferLength = 00000001       
00011425        318.52211040      TransferBuffer       = c15aabd8       
00011426        318.52214160      TransferBufferMDL    = c15bd220       
00011427        318.52215680            
00011428        318.52216640        0000:       
00011429        318.52218560     55     
00011430        318.52220960      UrbLink              = 00000000       
00011431        318.52227680    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011432        318.52230080            
00011433        318.52230720    >>>>>>> URB 497 going down...   
00011434        318.52234160    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011435        318.52236880      PipeHandle           = c1554f78       
00011436        318.52241280      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011437        318.52244400      TransferBufferLength = 00000008       
00011438        318.52247040      TransferBuffer       = c15aabd8       
00011439        318.52249360      TransferBufferMDL    = 00000000       
00011440        318.52251760      UrbLink              = 00000000       
00011441        318.52669520            
00011442        318.52670160    <<<<<<< URB 497 coming back...  
00011443        318.52675120    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011444        318.52677920      PipeHandle           = c1554f78       
00011445        318.52682240      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011446        318.52684720      TransferBufferLength = 00000001       
00011447        318.52687280      TransferBuffer       = c15aabd8       
00011448        318.52690400      TransferBufferMDL    = c15bd220       
00011449        318.52691840            
00011450        318.52692960        0000:       
00011451        318.52694880     ff     
00011452        318.52697280      UrbLink              = 00000000       
00011453        318.52703600    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011454        318.52706080            
00011455        318.52706720    >>>>>>> URB 498 going down...   
00011456        318.52709840    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011457        318.52712480      PipeHandle           = c1554f78       
00011458        318.52716800      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011459        318.52719200      TransferBufferLength = 00000008       
00011460        318.52721760      TransferBuffer       = c15aabd8       
00011461        318.52724160      TransferBufferMDL    = 00000000       
00011462        318.52727040      UrbLink              = 00000000       
00011463        318.53050320            
00011464        318.53050960    <<<<<<< URB 498 coming back...  
00011465        318.53054720    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011466        318.53058560      PipeHandle           = c1554f78       
00011467        318.53062880      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011468        318.53065360      TransferBufferLength = 00000001       
00011469        318.53067920      TransferBuffer       = c15aabd8       
00011470        318.53070640      TransferBufferMDL    = c15bd220       
00011471        318.53072640            
00011472        318.53073440        0000:       
00011473        318.53075600     00     
00011474        318.53078000      UrbLink              = 00000000       
00011475        318.53084240    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011476        318.53086800            
00011477        318.53087360    >>>>>>> URB 499 going down...   
00011478        318.53090640    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011479        318.53093280      PipeHandle           = c1554f78       
00011480        318.53097600      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011481        318.53099920      TransferBufferLength = 00000008       
00011482        318.53102640      TransferBuffer       = c15aabd8       
00011483        318.53105040      TransferBufferMDL    = 00000000       
00011484        318.53107920      UrbLink              = 00000000       
00011485        318.53528080            
00011486        318.53528720    <<<<<<< URB 499 coming back...  
00011487        318.53531920    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011488        318.53536080      PipeHandle           = c1554f78       
00011489        318.53540880      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011490        318.53543360      TransferBufferLength = 00000001       
00011491        318.53545920      TransferBuffer       = c15aabd8       
00011492        318.53548640      TransferBufferMDL    = c15bd220       
00011493        318.53550080            
00011494        318.53550640        0000:       
00011495        318.53552560     9c     
00011496        318.53554880      UrbLink              = 00000000       
00011497        318.53561120    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011498        318.53563520            
00011499        318.53564080    >>>>>>> URB 500 going down...   
00011500        318.53567520    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011501        318.53570240      PipeHandle           = c1554f78       
00011502        318.53574480      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011503        318.53576880      TransferBufferLength = 00000008       
00011504        318.53580000      TransferBuffer       = c15aabd8       
00011505        318.53582320      TransferBufferMDL    = 00000000       
00011506        318.53584720      UrbLink              = 00000000       
00011507        318.53909040            
00011508        318.53909680    <<<<<<< URB 500 coming back...  
00011509        318.53913360    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011510        318.53916880      PipeHandle           = c1554f78       
00011511        318.53921840      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011512        318.53924320      TransferBufferLength = 00000001       
00011513        318.53926880      TransferBuffer       = c15aabd8       
00011514        318.53929520      TransferBufferMDL    = c15bd220       
00011515        318.53930960            
00011516        318.53931520        0000:       
00011517        318.53933440     63     
00011518        318.53935840      UrbLink              = 00000000       
00011519        318.53942000    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011520        318.53944400            
00011521        318.53945040    >>>>>>> URB 501 going down...   
00011522        318.53948400    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011523        318.53951040      PipeHandle           = c1554f78       
00011524        318.53955280      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011525        318.53957680      TransferBufferLength = 00000008       
00011526        318.53960880      TransferBuffer       = c15aabd8       
00011527        318.53963200      TransferBufferMDL    = 00000000       
00011528        318.53965600      UrbLink              = 00000000       
00011529        318.54387200            
00011530        318.54387920    <<<<<<< URB 501 coming back...  
00011531        318.54392240    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011532        318.54395040      PipeHandle           = c1554f78       
00011533        318.54399360      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011534        318.54402400      TransferBufferLength = 00000001       
00011535        318.54404960      TransferBuffer       = c15aabd8       
00011536        318.54407600      TransferBufferMDL    = c15bd220       
00011537        318.54409040            
00011538        318.54409520        0000:       
00011539        318.54411440     01     
00011540        318.54413840      UrbLink              = 00000000       
00011541        318.54420160    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011542        318.54422640            
00011543        318.54423200    >>>>>>> URB 502 going down...   
00011544        318.54426560    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011545        318.54429200      PipeHandle           = c1554f78       
00011546        318.54433440      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011547        318.54435840      TransferBufferLength = 00000008       
00011548        318.54438560      TransferBuffer       = c15aabd8       
00011549        318.54441440      TransferBufferMDL    = 00000000       
00011550        318.54443760      UrbLink              = 00000000       
00011551        318.54864480            
00011552        318.54865600    <<<<<<< URB 502 coming back...  
00011553        318.54870000    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011554        318.54872720      PipeHandle           = c1554f78       
00011555        318.54877040      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011556        318.54879600      TransferBufferLength = 00000001       
00011557        318.54882160      TransferBuffer       = c15aabd8       
00011558        318.54885280      TransferBufferMDL    = c15bd220       
00011559        318.54887280            
00011560        318.54887760        0000:       
00011561        318.54889680     fe     
00011562        318.54892080      UrbLink              = 00000000       
00011563        318.54898400    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011564        318.54900880            
00011565        318.54901520    >>>>>>> URB 503 going down...   
00011566        318.54904560    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011567        318.54907280      PipeHandle           = c1554f78       
00011568        318.54911520      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011569        318.54913920      TransferBufferLength = 00000008       
00011570        318.54916640      TransferBuffer       = c15aabd8       
00011571        318.54918960      TransferBufferMDL    = 00000000       
00011572        318.54921920      UrbLink              = 00000000       
00011573        318.55247920            
00011574        318.55249040    <<<<<<< URB 503 coming back...  
00011575        318.55254000    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011576        318.55256880      PipeHandle           = c1554f78       
00011577        318.55262240      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011578        318.55264880      TransferBufferLength = 00000001       
00011579        318.55267440      TransferBuffer       = c15aabd8       
00011580        318.55270560      TransferBufferMDL    = c15bd220       
00011581        318.55272480            
00011582        318.55273040        0000:       
00011583        318.55274880     9d     
00011584        318.55277280      UrbLink              = 00000000       
00011585        318.55284640    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011586        318.55287600            
00011587        318.55288240    >>>>>>> URB 504 going down...   
00011588        318.55291200    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011589        318.55294480      PipeHandle           = c1554f78       
00011590        318.55299280      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011591        318.55301680      TransferBufferLength = 00000008       
00011592        318.55304240      TransferBuffer       = c15aabd8       
00011593        318.55307120      TransferBufferMDL    = 00000000       
00011594        318.55309520      UrbLink              = 00000000       
00011595        318.55725120            
00011596        318.55725840    <<<<<<< URB 504 coming back...  
00011597        318.55730640    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011598        318.55733920      PipeHandle           = c1554f78       
00011599        318.55738240      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011600        318.55740960      TransferBufferLength = 00000001       
00011601        318.55743520      TransferBuffer       = c15aabd8       
00011602        318.55746640      TransferBufferMDL    = c15bd220       
00011603        318.55748080            
00011604        318.55749120        0000:       
00011605        318.55751040     62     
00011606        318.55753360      UrbLink              = 00000000       
00011607        318.55759600    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00011608        318.55761920            
00011609        318.55762560    >>>>>>> URB 505 going down...   
00011610        318.55765440    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:     
00011611        318.55768560      PipeHandle           = c1554f78       
00011612        318.55773280      TransferFlags        = 00000003 
(USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)  
00011613        318.55775680      TransferBufferLength = 00000008       
00011614        318.55778240      TransferBuffer       = c15aabd8       
00011615        318.55781200      TransferBufferMDL    = 00000000       
00011616        318.55783600      UrbLink              = 00000000       
00011617        318.68465280    UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        


We'd be grateful for any hints/comments/help/...

J�rgen

-- 
J�rgen Stuber <[EMAIL PROTECTED]>
http://www.loria.fr/~stuber/

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to