Changeset 962ce100 in mainline
- Timestamp:
- 2011-02-14T10:30:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 28cb8bf7
- Parents:
- d15809b4
- Location:
- uspace
- Files:
-
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/conn.h
rd15809b4 r962ce100 37 37 38 38 #include <usb/usb.h> 39 #include <usb/hcdhubd.h>40 39 #include <usbhc_iface.h> 41 40 #include "vhcd.h" … … 44 43 void connection_handler_host(sysarg_t); 45 44 46 usb_hcd_transfer_ops_t vhc_transfer_ops;47 45 usbhc_iface_t vhc_iface; 48 46 -
uspace/lib/usb/Makefile
rd15809b4 r962ce100 39 39 src/drvpsync.c \ 40 40 src/dump.c \ 41 src/hcdhubd.c \42 src/hcdrv.c \43 41 src/hidparser.c \ 44 src/localdrv.c \45 42 src/pipes.c \ 46 43 src/pipesinit.c \ 47 44 src/recognise.c \ 48 src/remotedrv.c \49 45 src/request.c \ 50 46 src/usb.c \ -
uspace/lib/usb/include/usb/hcdhubd.h
rd15809b4 r962ce100 65 65 } usb_hcd_attached_device_info_t; 66 66 67 68 /** Host controller device. */69 typedef struct usb_hc_device usb_hc_device_t;70 71 /** Callback for OUT transfers. */72 typedef void (*usb_hcd_transfer_callback_out_t)73 (usb_hc_device_t *, usb_transaction_outcome_t, void *);74 75 /** Callback for IN transfers. */76 typedef void (*usb_hcd_transfer_callback_in_t)77 (usb_hc_device_t *, size_t, usb_transaction_outcome_t, void *);78 79 80 /** Transfer functions provided by each USB host controller driver. */81 typedef struct {82 /** OUT transfer.83 * @param hc Host controller that shall enqueue the transfer.84 * @param dev Target device.85 * @param ep Target endpoint.86 * @param buffer Buffer to be sent.87 * @param size Buffer size.88 * @param callback Callback after transfer was processed by hardware.89 * @param arg Callback argument.90 */91 int (*transfer_out)(usb_hc_device_t *hc,92 usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *ep,93 void *buffer, size_t size,94 usb_hcd_transfer_callback_out_t callback, void *arg);95 96 /** SETUP transfer. */97 int (*transfer_setup)(usb_hc_device_t *,98 usb_hcd_attached_device_info_t *, usb_hc_endpoint_info_t *,99 void *, size_t,100 usb_hcd_transfer_callback_out_t, void *);101 102 /** IN transfer. */103 int (*transfer_in)(usb_hc_device_t *,104 usb_hcd_attached_device_info_t *, usb_hc_endpoint_info_t *,105 void *, size_t,106 usb_hcd_transfer_callback_in_t, void *);107 } usb_hcd_transfer_ops_t;108 109 /**110 * @brief structure holding information about free and used addresses111 *112 * This structure should not be used outside usb hcd driver.113 * You better consider it to be 'private'.114 */115 typedef struct {116 /** lower bound included in the interval */117 usb_address_t lower_bound;118 119 /** upper bound, excluded from the interval */120 usb_address_t upper_bound;121 122 /** */123 link_t link;124 }usb_address_list_t;125 126 struct usb_hc_device {127 /** Transfer operations. */128 usb_hcd_transfer_ops_t *transfer_ops;129 130 /** Custom HC data. */131 void *data;132 133 /** Generic device entry (read-only). */134 device_t *generic;135 136 /** List of attached devices. */137 link_t attached_devices;138 139 /** List of hubs operating from this HC. */140 link_t hubs;141 142 /** Structure with free and used addresses */143 link_t addresses;144 145 /** Link to other driven HCs. */146 link_t link;147 };148 149 /** Host controller driver. */150 typedef struct {151 /** Driver name. */152 const char *name;153 /** Callback when device (host controller) is added. */154 int (*add_hc)(usb_hc_device_t *device);155 } usb_hc_driver_t;156 157 158 int usb_hcd_main(usb_hc_driver_t *);159 int usb_hcd_add_root_hub(device_t *dev);160 161 /**162 * find first not yet used address on this host controller and use it163 * @param this_hcd164 * @return number in the range of allowed usb addresses or165 * a negative number if not succesful166 */167 usb_address_t usb_use_free_address(usb_hc_device_t * this_hcd);168 169 /**170 * @brief free the address in the address space of this hcd.171 *172 * if address is not used, nothing happens173 * @param this_hcd174 * @param addr175 */176 void usb_free_used_address(usb_hc_device_t * this_hcd, usb_address_t addr );177 178 179 /*180 * Functions to be used by drivers within same task as the HC driver.181 * This will probably include only hub drivers.182 */183 184 device_t *usb_hc_connect(device_t *);185 186 int usb_hc_async_interrupt_out(usb_hc_device_t *, usb_target_t,187 void *, size_t, usb_handle_t *);188 int usb_hc_async_interrupt_in(usb_hc_device_t *, usb_target_t,189 void *, size_t, size_t *, usb_handle_t *);190 191 int usb_hc_async_control_write_setup(usb_hc_device_t *, usb_target_t,192 void *, size_t, usb_handle_t *);193 int usb_hc_async_control_write_data(usb_hc_device_t *, usb_target_t,194 void *, size_t, usb_handle_t *);195 int usb_hc_async_control_write_status(usb_hc_device_t *, usb_target_t,196 usb_handle_t *);197 198 int usb_hc_async_control_read_setup(usb_hc_device_t *, usb_target_t,199 void *, size_t, usb_handle_t *);200 int usb_hc_async_control_read_data(usb_hc_device_t *, usb_target_t,201 void *, size_t, size_t *, usb_handle_t *);202 int usb_hc_async_control_read_status(usb_hc_device_t *, usb_target_t,203 usb_handle_t *);204 205 int usb_hc_async_wait_for(usb_handle_t);206 207 int usb_hc_add_child_device(device_t *, const char *, const char *, bool);208 209 210 67 /** 211 68 * @}
Note:
See TracChangeset
for help on using the changeset viewer.