Ignore:
Timestamp:
2011-11-10T11:29:10Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54464f6a, c2245a3, c6f189f7
Parents:
2e1b9dc (diff), 2d1ba51 (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.

Interface changes:

  • GET_ADDRESS has been renamed to GET_MY_ADDRESS and the handle parameter was dropped. Tis call no longer cascades up to the root hub, but it is answered in the first place the information is available (nearest hub)
  • Reintroduced address reservation for USB_DEFAULT_ADDRESS. The interface now enables device drivers to request specific address on initialization and either insists on that address or accept any other if the address is not available. Note that it is not possible to get the default address if the driver does not insist.
  • Any endpoint registered is removed when address is released and a warning is produced if there were any such endpoints.
  • It is no longer necessary or possible to pass device speed information when registering endpoints.

Driver fixes: memory leaks and crashes (not only) in error paths.
Fixes or removes flaky device_remove implementation in device drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/driver.h

    r2e1b9dc r747ef72  
    7272/** USB device structure. */
    7373typedef struct {
     74        /** Connection backing the pipes.
     75         * Typically, you will not need to use this attribute at all.
     76         */
     77        usb_device_connection_t wire;
    7478        /** The default control pipe. */
    7579        usb_pipe_t ctrl_pipe;
     
    8791        int interface_no;
    8892
    89         /** Alternative interfaces.
    90          * Set to NULL when the driver controls whole device
    91          * (i.e. more (or any) interfaces).
    92          */
    93         usb_alternate_interfaces_t *alternate_interfaces;
     93        /** Alternative interfaces. */
     94        usb_alternate_interfaces_t alternate_interfaces;
    9495
    9596        /** Some useful descriptors. */
    9697        usb_device_descriptors_t descriptors;
    9798
    98         /** Generic DDF device backing this one. RO: DO NOT TOUCH!*/
     99        /** Generic DDF device backing this one. DO NOT TOUCH! */
    99100        ddf_dev_t *ddf_dev;
    100101        /** Custom driver data.
     
    103104         */
    104105        void *driver_data;
    105 
    106         /** Connection backing the pipes.
    107          * Typically, you will not need to use this attribute at all.
    108          */
    109         usb_device_connection_t wire;
    110106} usb_device_t;
    111107
     
    163159int usb_driver_main(const usb_driver_t *);
    164160
     161int usb_device_init(usb_device_t *, ddf_dev_t *,
     162    const usb_endpoint_description_t **, const char **);
     163void usb_device_deinit(usb_device_t *);
     164
    165165int usb_device_select_interface(usb_device_t *, uint8_t,
    166166    const usb_endpoint_description_t **);
    167167
    168168int usb_device_retrieve_descriptors(usb_pipe_t *, usb_device_descriptors_t *);
     169void usb_device_release_descriptors(usb_device_descriptors_t *);
     170
    169171int usb_device_create_pipes(const ddf_dev_t *, usb_device_connection_t *,
    170172    const usb_endpoint_description_t **, const uint8_t *, size_t, int, int,
    171173    usb_endpoint_mapping_t **, size_t *);
    172174int usb_device_destroy_pipes(const ddf_dev_t *, usb_endpoint_mapping_t *, size_t);
    173 int usb_device_init(usb_device_t *, ddf_dev_t *,
    174     const usb_endpoint_description_t **, const char **);
    175 void usb_device_deinit(usb_device_t *);
    176175
    177176void * usb_device_data_alloc(usb_device_t *, size_t);
    178177
    179178size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);
    180 int usb_alternate_interfaces_create(const uint8_t *, size_t, int,
    181     usb_alternate_interfaces_t **);
    182 void usb_alternate_interfaces_destroy(usb_alternate_interfaces_t *);
     179int usb_alternate_interfaces_init(usb_alternate_interfaces_t *,
     180    const uint8_t *, size_t, int);
     181void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *);
    183182#endif
    184183/**
Note: See TracChangeset for help on using the changeset viewer.