07/08/2010 1:02 AM
Utility for accessing EEPROM connected to SMSC 9500.
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;
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 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...