Comtrol eCos User Manual
Page 734
Advertising
Initializing the USB-ethernet Package
The call to
usbs_eth_init
should normally happen after the enumeration data has been provided but before the
underlying USB device driver has been started. If the USB device were to be started first then a connection between
host and peripheral could be established immediately, and the host-side device driver would attempt to contact the
USB-ethernet package for information such as the MAC address.
int
main(int argc, char** argv)
{
unsigned char host_MAC[6] = { 0x40, 0x5d, 0x90, 0xa9, 0xbc, 0x02 };
usbs_sa11x0_ep0.enumeration_data
= &usb_enum_data;
...
usbs_eth_init(&usbs_eth0, &usbs_sa11x0_ep0, &usbs_sa11x0_ep1, &usbs_sa11x0_ep2, host_MAC);
...
usbs_start(&usbs_sa11x0_ep0);
...
}
630
Advertising