This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Bugs in the at91 USB driver


Hi,

I was reading through the AT91 USB driver code and spotted two bugs, but am unsure what to do with them.

1. The "usbs_at91_control_setup_get_status()" function needs to queue up a value to send back to the host, but the function sets the endpoint buffer variables (pbegin, etc) to the address of a local variable, 'word', which disappears when the function returns (before the buffer is shipped to the host).

I assume the return value can be placed into ep0's "control_buffer" for return to the host. Or a tx buffer can be declared and used for such purposes. Which would be better?


2. The "usbs_state_notify()" function sends the wrong value to the state change callback function. Instead of sending a value of a "usbs_state_change" enumeration (like USBS_STATE_CHANGE_RESET) for the third parameter, it sends the new state (like USBS_STATE_POWERED).


On one hand, this needs to be fixed so that class drivers and examples can work with the AT91 driver, but on the other hand, fixing it could break existing applications that were written to use the incorrect values being emitted by the driver. It's especially confusing because the two enumerations are very close and the "state change" values are an eCos invention and not that well defined.

What to do?

Frank Pagliughi

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]