Hi everbody,

Here is the Output of usbsnoopy when i'm doing datatransfer to my usbdevice.
I'm trying to do the same with linux using the usbstress and a control
message
/snip
00006167        2.12604080      -- URB_FUNCTION_CLASS_INTERFACE:        
00006168        2.12606080        TransferFlags          = 00000000
(USBD_TRANSFER_DIRECTION_OUT, ~USBD_SHORT_TRANSFER_OK)  
00006169        2.12607120        TransferBufferLength = 00000002       
00006170        2.12608160        TransferBuffer       = d4429fc1       
00006171        2.12609200        TransferBufferMDL    = 00000000       
00006172        2.12609840              
00006173        2.12610320          0000:       
00006174        2.12611440       0a 00  
00006175        2.12612480        UrbLink                 = 00000000    
00006176        2.12613520        RequestTypeReservedBits = 22  
00006177        2.12614480        Request                 = 09  
00006178        2.12615520        Value                   = 0200        
00006179        2.12616640        Index                   = 0000        
00006180        2.12923520              
00006181        2.12924000      <<<<<<< URB 41667 coming back...        
00006182        2.12925360      -- URB_FUNCTION_CONTROL_TRANSFER:       
00006183        2.12926720        PipeHandle           = d5f9ac2c       
00006184        2.12928480        TransferFlags        = 00000002
(USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK)   
00006185        2.12929600        TransferBufferLength = 00000002       
00006186        2.12930640        TransferBuffer       = d4429fc1       
00006187        2.12931760        TransferBufferMDL    = d5e99a80       
00006188        2.12932720        UrbLink              = 00000000       
00006189        2.12936640        SetupPacket          : 21 09 00 02 00 00 02 00
/snip end

With the information of this thread
http://www.geocrawler.com/mail/msg.php3?msg_id=5195912&list=2571
i build an controlmessage which should do the same.


/* CONTROL MESSAGE */

int usb_control_msg(unsigned char requesttype, unsigned char request,
                    unsigned short value, unsigned short index, unsigned short length, 
                    void *data, unsigned int timeout)
{
        struct usbdevfs_ctrltransfer ctrl;
        int i;
        ctrl = (struct usbdevfs_ctrltransfer){ requesttype, request, value, index,
length, timeout, data };
        i = ioctl(dev->fd, USBDEVFS_CONTROL, &ctrl);
        printf("Control Ioctl: %d\n",i);
        if(i < 0)
          printf("USBDEVFS_CONTROL(rqt=0x%x rq=0x%x val=%u idx=%u len=%u) error
%s\n",
                requesttype, request, value, index, length, strerror(errno));
        return i;
}


ret = usb_control_msg(0x21, 0x09, 0x0200,0x0 , 0x0,&buf,timeout);

Before i did the control message i opened the device, claimed it and set the
configuration(0). Everything successfull.

Here is the output of my program:
Control Ioctl: -1
USBDEVFS_CONTROL(rqt=0x21 rq=0x9 val=512 idx=0 len=0) error Connection timed
out

Does anybody know why the ioctl wont do it? 
Can somebody give me some debug starting points? 


Thanks Hendrik

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to