Hello,

I am trying to write driver (but now not kernel module, only user mode) for 
Motorola C380/C650 Mobile phone. After plug in in Linux (Kernel 2.6.10), it 
works as ACM modem (cdc-acm module). I send "AT+MODE=8" AT command. Phone 
change's Product id, so it became not ACM device. Here is output of lsusb -a:

-------------------------------------------------------
Bus 003 Device 003: ID 22b8:4901 Motorola PCS
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x22b8 Motorola PCS
  idProduct          0x4901
  bcdDevice            0.01
  iManufacturer           1 Motorola Inc.
  iProduct                2 Motorola Phone (C380)
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           43
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration         23 MCU Logging+test cmd+accy
    bmAttributes         0xc0
      Self Powered
    MaxPower               20mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        5
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      1
      bInterfaceProtocol    255
      iInterface             11 Motorola Accessory
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        6
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      2
      bInterfaceProtocol    255
      iInterface             12 Motorola MCU Data Logger
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  bytes 32 once
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        8
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      3
      bInterfaceProtocol    255
      iInterface             13 Motorola Test Command

-------------------------------------------------------

I have some information about protocol. (I get it via UsbSnoop in M$). Windows 
program use Interface Number 8 (Motorola Test Command), which has no 
endpoints (except standart). So, it must use only CONTROL TRANSFER. Now i use 
libusb and try to create user mode program. Here is one of packet (UsbSnoop):

--------------------------------------
00000002        11:02:45        >>>>>>> URB 18 going down...    
00000003        11:02:45        -- URB_FUNCTION_VENDOR_INTERFACE:       
00000004        11:02:45          TransferFlags          = 00000002 
(USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK)       
00000005        11:02:45          TransferBufferLength = 00000008       
00000006        11:02:45          TransferBuffer       = 81752ff0       
00000007        11:02:45          TransferBufferMDL    = 00000000       
00000008        11:02:45                
00000009        11:02:45            0000:       
00000010        11:02:45         00     
00000011        11:02:45         07     
00000012        11:02:45         00     
00000013        11:02:45         22     
00000014        11:02:45         00     
00000015        11:02:45         00     
00000016        11:02:45         00     
00000017        11:02:45         00     
00000018        11:02:45                
00000019        11:02:45          UrbLink                 = 00000000    
00000020        11:02:45          RequestTypeReservedBits = 00  
00000021        11:02:45          Request                 = 02  
00000022        11:02:45          Value                   = 0000        
00000023        11:02:45          Index                   = 0008        
00000024        11:02:45                
00000025        11:02:45        <<<<<<< URB 18 coming back...   
00000026        11:02:45        -- URB_FUNCTION_CONTROL_TRANSFER:       
00000027        11:02:45          PipeHandle           = ffa86c00       
00000028        11:02:45          TransferFlags        = 0000000a 
(USBD_TRANSFER_DIRECTION_OUT, USBD_SHORT_TRANSFER_OK) 
00000029        11:02:45          TransferBufferLength = 00000008       
00000030        11:02:45          TransferBuffer       = 81752ff0       
00000031        11:02:45          TransferBufferMDL    = 817ac150       
00000032        11:02:45          UrbLink              = 00000000       
00000033        11:02:45          SetupPacket          :        
00000034        11:02:45         41     
00000035        11:02:45         02     
00000036        11:02:45         00     
00000037        11:02:45         00     
00000038        11:02:45         08     
00000039        11:02:45         00     
00000040        11:02:45         08     
00000041        11:02:45         00     
00000042        11:02:45                
00000043        11:02:45        UsbSnoop - IRP_MJ_INTERNAL_DEVICE_CONTROL, 
IOCTL_INTERNAL_USB_SUBMIT_URB        
00000044        11:02:45  
-----------------------------------------

Have you any idea, how can i send same packet with libusb or another way.

I try to use usb_control_msg function:

int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int 
value, int index, char *bytes, int size, int timeout);

requesttype is 00, request=0x02, value=0, index=0x8. bytes is array of {00 07 
00 22 00 00 00 00}. But phone don't accept this packet. libusb says, that 
pipe is broken. 

Can i send this packet this way?

-- 
##################################################
 Dmitry Nezhevenko   (dion)     <[EMAIL PROTECTED]>
 GnuPG Key 0xB5BCA66C    Sun Jan 30 02:38:08 2005
##################################################

Reply via email to