Jump to ID:
BSPs and Drivers

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - Utility for accessing EEPROM connected to SMSC 9500.: Page 1 of 2 (2 Items)
   
 
 
Utility for accessing EEPROM connected to SMSC 9500.  
Hi,

I'm working on a utility for accessing the EEPROM connected to the SMSC 9500 USB Ethernet controller.

See all the realted documents for this usb eth in below location;

http://www.smsc.com/index.php?show_files=1&s=LAN9500i

Unfortunately none of these doc talks about the USB vendor command details, but still i can proceed ahead using the 
linux driver which smsc folks have provided us; bascically this driver uses the ioctls for accessing the EEPROM (via USB
 vendor commands). Now my problem is for QnX we have below API, for setting up the urb for vendor cmds;

int usbd_setup_vendor( struct usbd_urb *urb,
                       _uint32 flags,
                       _uint16 request, 
                       _uint16 rtype,
                       _uint16 value,
                       _uint16 index,
                       void *addr, 
                       _uint32 len );

Here unfortunately the _uint16 value & _uint16 index fields acn hold only 16 bits where as in Linux code SMSC 9500 
vendor commands have bits in the range of 32bits.

 eg. In Linux driver to write to eeprom we do the following 

#define	E2P_CMD_BUSY_ 0x80000000UL

    //Issue write/erase enable command
    dwValue = E2P_CMD_BUSY_ | E2P_CMD_EWEN;

    /* below func  internally uses usb_control_msg() and index & value as E2P_CMD, dwValue respectively */
    smsc9500_write_reg(dev, E2P_CMD, dwValue); 
   
    pl note that in linux driver dwvalue is int32 and it can very well hold E2P_CMD_BUSY, But in QNX as shown above 
usbd_setup_vendor() api's "value" & "index" can hold only 16 bits :( here index is still okay as it accomodates all the 
values for SMSC but the "value" field will give issues.....

Please help me with any ideas/suggesssion for solving this problem... 

Regards,
Lavin