Changeset 77ad86c in mainline for uspace/lib/usbhost
- Timestamp:
- 2012-06-01T19:00:32Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b713ff80
- Parents:
- 4e5dabf
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/hcd.h
r4e5dabf r77ad86c 33 33 * 34 34 */ 35 35 36 #ifndef LIBUSBHOST_HOST_HCD_H 36 37 #define LIBUSBHOST_HOST_HCD_H … … 61 62 void (*ep_remove_hook)(hcd_t *, endpoint_t *); 62 63 }; 63 /*----------------------------------------------------------------------------*/ 64 64 65 /** Initialize hcd_t structure. 65 66 * Initializes device and endpoint managers. Sets data and hook pointer to NULL. … … 79 80 hcd->ep_remove_hook = NULL; 80 81 } 81 /*----------------------------------------------------------------------------*/ 82 82 83 /** Check registered endpoints and reset toggle bit if necessary. 83 84 * @param hcd hcd_t structure, non-null. … … 92 93 &hcd->ep_manager, target, (const uint8_t *)setup_data); 93 94 } 94 /*----------------------------------------------------------------------------*/ 95 95 96 /** Data retrieve wrapper. 96 97 * @param fun ddf function, non-null. … … 102 103 return fun->driver_data; 103 104 } 104 /*----------------------------------------------------------------------------*/ 105 105 106 extern usbhc_iface_t hcd_iface; 106 107 107 108 #endif 109 108 110 /** 109 111 * @} -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r4e5dabf r77ad86c 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup libusbhost 29 30 * @{ … … 32 33 * USB transfer transaction structures. 33 34 */ 35 34 36 #ifndef LIBUSBHOST_HOST_USB_TRANSFER_BATCH_H 35 37 #define LIBUSBHOST_HOST_USB_TRANSFER_BATCH_H … … 115 117 void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance, 116 118 const void* data, size_t size, int error); 117 /*----------------------------------------------------------------------------*/ 119 118 120 /** Finish batch using stored error value and transferred size. 119 121 * … … 128 130 instance, data, instance->transfered_size, instance->error); 129 131 } 130 /*----------------------------------------------------------------------------*/ 132 131 133 /** Determine batch direction based on the callbacks present 132 134 * @param[in] instance Batch structure to use, non-null. … … 153 155 assert(false); 154 156 } 157 155 158 #endif 159 156 160 /** 157 161 * @} -
uspace/lib/usbhost/src/iface.c
r4e5dabf r77ad86c 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 28 29 /** @addtogroup libusbhost 29 30 * @{ … … 32 33 * @brief HCD DDF interface implementation 33 34 */ 35 34 36 #include <ddf/driver.h> 35 37 #include <errno.h> … … 98 100 return ret; 99 101 } 100 /*----------------------------------------------------------------------------*/ 102 101 103 /** Calls ep_add_hook upon endpoint registration. 102 104 * @param ep Endpoint to be registered. … … 113 115 return EOK; 114 116 } 115 /*----------------------------------------------------------------------------*/ 117 116 118 /** Calls ep_remove_hook upon endpoint removal. 117 119 * @param ep Endpoint to be unregistered. … … 126 128 hcd->ep_remove_hook(hcd, ep); 127 129 } 128 /*----------------------------------------------------------------------------*/ 130 129 131 /** Calls ep_remove_hook upon endpoint removal. Prints warning. 130 132 * @param ep Endpoint to be unregistered. … … 141 143 hcd->ep_remove_hook(hcd, ep); 142 144 } 143 /*----------------------------------------------------------------------------*/ 145 144 146 /** Request address interface function. 145 147 * … … 164 166 &hcd->dev_manager, address, strict, speed); 165 167 } 166 /*----------------------------------------------------------------------------*/ 168 167 169 /** Bind address interface function. 168 170 * … … 183 185 &hcd->dev_manager, address, handle); 184 186 } 185 /*----------------------------------------------------------------------------*/ 187 186 188 /** Find device handle by address interface function. 187 189 * … … 200 202 &hcd->dev_manager, address, handle, NULL); 201 203 } 202 /*----------------------------------------------------------------------------*/ 204 203 205 /** Release address interface function. 204 206 * … … 218 220 return EOK; 219 221 } 220 /*----------------------------------------------------------------------------*/ 222 221 223 /** Register endpoint interface function. 222 224 * @param fun DDF function. … … 254 256 register_helper, hcd); 255 257 } 256 /*----------------------------------------------------------------------------*/ 258 257 259 /** Unregister endpoint interface function. 258 260 * @param fun DDF function. … … 274 276 endpoint, direction, unregister_helper, hcd); 275 277 } 276 /*----------------------------------------------------------------------------*/ 278 277 279 /** Inbound communication interface function. 278 280 * @param fun DDF function. … … 292 294 setup_data, callback, NULL, arg, "READ"); 293 295 } 294 /*----------------------------------------------------------------------------*/ 296 295 297 /** Outbound communication interface function. 296 298 * @param fun DDF function. … … 310 312 setup_data, NULL, callback, arg, "WRITE"); 311 313 } 312 /*----------------------------------------------------------------------------*/ 314 313 315 /** usbhc Interface implementation using hcd_t from libusbhost library. */ 314 316 usbhc_iface_t hcd_iface = { … … 324 326 .write = usb_write, 325 327 }; 328 326 329 /** 327 330 * @}
Note:
See TracChangeset
for help on using the changeset viewer.