Ignore:
Timestamp:
2011-09-16T14:50:20Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
432a269, d1e18573
Parents:
47fecbb (diff), 82a31261 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge USB changes from bzr://krabicka.net/orome/helenos/usb/

  • Move common HC code from uhci/ohci drivers to libusbhost
  • Rewrite USB HC interface to have common read/write functions for all transfer types.
  • Restructure hc drivers to avoid some hooks and void* casts
  • Cleanup the code and remove unnecessary mallocs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h

    r47fecbb rfd07e526  
    6969#define TD_STATUS_ACTLEN_MASK 0x7ff
    7070
    71         /* double word with USB device specific info */
     71        /** Double word with USB device specific info */
    7272        volatile uint32_t device;
    7373#define TD_DEVICE_MAXLEN_POS 21
     
    8787        /* According to UHCI design guide, there is 16 bytes of
    8888         * data available here.
    89          * According to linux kernel the hardware does not care,
    90          * it just needs to be aligned. We don't use it anyway.
     89         * According to Linux kernel the hardware does not care,
     90         * memory just needs to be aligned. We don't use it anyway.
    9191         */
    9292} __attribute__((packed)) td_t;
     
    9595void td_init(td_t *instance, int error_count, size_t size, bool toggle,
    9696    bool iso, bool low_speed, usb_target_t target, usb_packet_id pid,
    97     void *buffer, td_t *next);
     97    const void *buffer, const td_t *next);
    9898
    99 int td_status(td_t *instance);
     99int td_status(const td_t *instance);
    100100
    101 void td_print_status(td_t *instance);
     101void td_print_status(const td_t *instance);
    102102/*----------------------------------------------------------------------------*/
    103103/** Helper function for parsing actual size out of TD.
     
    106106 * @return Parsed actual size.
    107107 */
    108 static inline size_t td_act_size(td_t *instance)
     108static inline size_t td_act_size(const td_t *instance)
    109109{
    110110        assert(instance);
    111111        const uint32_t s = instance->status;
     112        /* Actual size is encoded as n-1 (UHCI design guide p. 23) */
    112113        return ((s >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK;
    113114}
     
    119120 * false otherwise.
    120121 */
    121 static inline bool td_is_short(td_t *instance)
     122static inline bool td_is_short(const td_t *instance)
    122123{
    123124        const size_t act_size = td_act_size(instance);
     
    134135 * @return Toggle bit value.
    135136 */
    136 static inline int td_toggle(td_t *instance)
     137static inline int td_toggle(const td_t *instance)
    137138{
    138139        assert(instance);
     
    145146 * @return Active bit value.
    146147 */
    147 static inline bool td_is_active(td_t *instance)
     148static inline bool td_is_active(const td_t *instance)
    148149{
    149150        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.