Changeset a76b01b4 in mainline
- Timestamp:
- 2012-02-24T19:11:23Z (11 years ago)
- Branches:
- lfn, master, serial
- Children:
- a2bd8822
- Parents:
- 76fbd9a
- Location:
- uspace/lib
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_usb.c
r76fbd9a ra76b01b4 65 65 return ret; 66 66 } 67 /*----------------------------------------------------------------------------*/ 67 68 68 /** Tell interface number given device can use. 69 69 * @param[in] exch IPC communication exchange … … 83 83 return ret; 84 84 } 85 /*----------------------------------------------------------------------------*/ 85 86 86 /** Tell devman handle of device host controller. 87 87 * @param[in] exch IPC communication exchange … … 121 121 }; 122 122 123 /*----------------------------------------------------------------------------*/ 123 124 124 void remote_usb_get_my_address(ddf_fun_t *fun, void *iface, 125 125 ipc_callid_t callid, ipc_call_t *call) … … 140 140 } 141 141 } 142 /*----------------------------------------------------------------------------*/ 142 143 143 void remote_usb_get_my_interface(ddf_fun_t *fun, void *iface, 144 144 ipc_callid_t callid, ipc_call_t *call) … … 159 159 } 160 160 } 161 /*----------------------------------------------------------------------------*/ 161 162 162 void remote_usb_get_hc_handle(ddf_fun_t *fun, void *iface, 163 163 ipc_callid_t callid, ipc_call_t *call) -
uspace/lib/drv/generic/remote_usbhc.c
r76fbd9a ra76b01b4 173 173 return ret; 174 174 } 175 /*----------------------------------------------------------------------------*/ 175 176 176 int usbhc_bind_address(async_exch_t *exch, usb_address_t address, 177 177 devman_handle_t handle) … … 182 182 IPC_M_USBHC_BIND_ADDRESS, address, handle); 183 183 } 184 /*----------------------------------------------------------------------------*/ 184 185 185 int usbhc_get_handle(async_exch_t *exch, usb_address_t address, 186 186 devman_handle_t *handle) … … 195 195 return ret; 196 196 } 197 /*----------------------------------------------------------------------------*/ 197 198 198 int usbhc_release_address(async_exch_t *exch, usb_address_t address) 199 199 { … … 203 203 IPC_M_USBHC_RELEASE_ADDRESS, address); 204 204 } 205 /*----------------------------------------------------------------------------*/ 205 206 206 int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address, 207 207 usb_endpoint_t endpoint, usb_transfer_type_t type, … … 220 220 #undef _PACK2 221 221 } 222 /*----------------------------------------------------------------------------*/ 222 223 223 int usbhc_unregister_endpoint(async_exch_t *exch, usb_address_t address, 224 224 usb_endpoint_t endpoint, usb_direction_t direction) … … 229 229 IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction); 230 230 } 231 /*----------------------------------------------------------------------------*/ 231 232 232 int usbhc_read(async_exch_t *exch, usb_address_t address, 233 233 usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size, … … 285 285 return EOK; 286 286 } 287 /*----------------------------------------------------------------------------*/ 287 288 288 int usbhc_write(async_exch_t *exch, usb_address_t address, 289 289 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size) … … 321 321 return (int) opening_request_rc; 322 322 } 323 /*----------------------------------------------------------------------------*/ 323 324 324 325 325 static void remote_usbhc_request_address(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *); … … 386 386 return trans; 387 387 } 388 /*----------------------------------------------------------------------------*/ 388 389 389 void remote_usbhc_request_address(ddf_fun_t *fun, void *iface, 390 390 ipc_callid_t callid, ipc_call_t *call) … … 408 408 } 409 409 } 410 /*----------------------------------------------------------------------------*/ 410 411 411 void remote_usbhc_bind_address(ddf_fun_t *fun, void *iface, 412 412 ipc_callid_t callid, ipc_call_t *call) … … 425 425 async_answer_0(callid, ret); 426 426 } 427 /*----------------------------------------------------------------------------*/ 427 428 428 void remote_usbhc_get_handle(ddf_fun_t *fun, void *iface, 429 429 ipc_callid_t callid, ipc_call_t *call) … … 446 446 } 447 447 } 448 /*----------------------------------------------------------------------------*/ 448 449 449 void remote_usbhc_release_address(ddf_fun_t *fun, void *iface, 450 450 ipc_callid_t callid, ipc_call_t *call) … … 462 462 async_answer_0(callid, ret); 463 463 } 464 /*----------------------------------------------------------------------------*/ 464 465 465 static void callback_out(ddf_fun_t *fun, 466 466 int outcome, void *arg) … … 472 472 async_transaction_destroy(trans); 473 473 } 474 /*----------------------------------------------------------------------------*/ 474 475 475 static void callback_in(ddf_fun_t *fun, 476 476 int outcome, size_t actual_size, void *arg) … … 496 496 async_transaction_destroy(trans); 497 497 } 498 /*----------------------------------------------------------------------------*/ 498 499 499 void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface, 500 500 ipc_callid_t callid, ipc_call_t *call) … … 596 596 } 597 597 } 598 /*----------------------------------------------------------------------------*/ 598 599 599 void remote_usbhc_write( 600 600 ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call) -
uspace/lib/usb/src/hc.c
r76fbd9a ra76b01b4 59 59 return EOK; 60 60 } 61 /*----------------------------------------------------------------------------*/ 61 62 62 static int usb_hc_connection_del_ref(usb_hc_connection_t *connection) 63 63 { … … 125 125 return rc; 126 126 } 127 /*----------------------------------------------------------------------------*/ 127 128 128 void usb_hc_connection_deinitialize(usb_hc_connection_t *connection) 129 129 { … … 140 140 fibril_mutex_unlock(&connection->guard); 141 141 } 142 /*----------------------------------------------------------------------------*/ 142 143 143 /** Open connection to host controller. 144 144 * … … 150 150 return usb_hc_connection_add_ref(connection); 151 151 } 152 /*----------------------------------------------------------------------------*/ 152 153 153 /** Close connection to the host controller. 154 154 * … … 160 160 return usb_hc_connection_del_ref(connection); 161 161 } 162 /*----------------------------------------------------------------------------*/ 162 163 163 /** Ask host controller for free address assignment. 164 164 * … … 182 182 return ret == EOK ? address : ret; 183 183 } 184 /*----------------------------------------------------------------------------*/ 184 185 185 int usb_hc_bind_address(usb_hc_connection_t * connection, 186 186 usb_address_t address, devman_handle_t handle) … … 194 194 return ret; 195 195 } 196 /*----------------------------------------------------------------------------*/ 196 197 197 /** Get handle of USB device with given address. 198 198 * … … 213 213 return ret; 214 214 } 215 /*----------------------------------------------------------------------------*/ 215 216 216 int usb_hc_release_address(usb_hc_connection_t *connection, 217 217 usb_address_t address) … … 225 225 return ret; 226 226 } 227 /*----------------------------------------------------------------------------*/ 227 228 228 int usb_hc_register_endpoint(usb_hc_connection_t *connection, 229 229 usb_address_t address, usb_endpoint_t endpoint, usb_transfer_type_t type, … … 239 239 return ret; 240 240 } 241 /*----------------------------------------------------------------------------*/ 241 242 242 int usb_hc_unregister_endpoint(usb_hc_connection_t *connection, 243 243 usb_address_t address, usb_endpoint_t endpoint, usb_direction_t direction) … … 252 252 return ret; 253 253 } 254 /*----------------------------------------------------------------------------*/ 254 255 255 int usb_hc_read(usb_hc_connection_t *connection, usb_address_t address, 256 256 usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size, … … 266 266 return ret; 267 267 } 268 /*----------------------------------------------------------------------------*/ 268 269 269 int usb_hc_write(usb_hc_connection_t *connection, usb_address_t address, 270 270 usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size) -
uspace/lib/usbdev/include/usb/dev/usb_device_connection.h
r76fbd9a ra76b01b4 72 72 return EOK; 73 73 } 74 /*----------------------------------------------------------------------------*/ 74 75 75 /** Register endpoint on the device. 76 76 * @param instance device connection structure to use. … … 91 91 instance->address, ep, type, direction, packet_size, interval); 92 92 } 93 /*----------------------------------------------------------------------------*/ 93 94 94 /** Unregister endpoint on the device. 95 95 * @param instance device connection structure … … 105 105 instance->address, ep, dir); 106 106 } 107 /*----------------------------------------------------------------------------*/ 107 108 108 /** Get data from the device. 109 109 * @param[in] instance device connection structure to use. … … 122 122 instance->address, ep, setup, data, size, rsize); 123 123 } 124 /*----------------------------------------------------------------------------*/ 124 125 125 /** Send data to the device. 126 126 * @param instance device connection structure to use. … … 138 138 instance->address, ep, setup, data, size); 139 139 } 140 /*----------------------------------------------------------------------------*/ 140 141 141 /** Wrapper for read calls with no setup stage. 142 142 * @param[in] instance device connection structure. … … 153 153 return usb_device_control_read(instance, ep, 0, data, size, real_size); 154 154 } 155 /*----------------------------------------------------------------------------*/ 155 156 156 /** Wrapper for write calls with no setup stage. 157 157 * @param instance device connection structure. -
uspace/lib/usbdev/src/devdrv.c
r76fbd9a ra76b01b4 74 74 return ddf_driver_main(&generic_driver); 75 75 } 76 /*----------------------------------------------------------------------------*/ 76 77 77 /** Count number of pipes the driver expects. 78 78 * … … 87 87 return count; 88 88 } 89 /*----------------------------------------------------------------------------*/ 89 90 90 /** Callback when a new device is supposed to be controlled by this driver. 91 91 * … … 124 124 return rc; 125 125 } 126 /*----------------------------------------------------------------------------*/ 126 127 127 /** Callback when a device is supposed to be removed from the system. 128 128 * … … 146 146 return EOK; 147 147 } 148 /*----------------------------------------------------------------------------*/ 148 149 149 /** Callback when a device was removed from the system. 150 150 * … … 167 167 return ret; 168 168 } 169 /*----------------------------------------------------------------------------*/ 169 170 170 /** Destroy existing pipes of a USB device. 171 171 * … … 178 178 dev->pipes_count = 0; 179 179 } 180 /*----------------------------------------------------------------------------*/ 180 181 181 /** Change interface setting of a device. 182 182 * This function selects new alternate setting of an interface by issuing -
uspace/lib/usbdev/src/pipes.c
r76fbd9a ra76b01b4 54 54 return usb_hc_connection_open(pipe->wire->hc_connection); 55 55 } 56 /*----------------------------------------------------------------------------*/ 56 57 57 /** Terminate a long transfer on a pipe. 58 58 * @param pipe Pipe where to end the long transfer. … … 67 67 return usb_hc_connection_close(pipe->wire->hc_connection); 68 68 } 69 /*----------------------------------------------------------------------------*/ 69 70 70 /** Try to clear endpoint halt of default control pipe. 71 71 * … … 85 85 pipe->auto_reset_halt = true; 86 86 } 87 /*----------------------------------------------------------------------------*/ 87 88 88 /** Request a control read transfer on an endpoint pipe. 89 89 * … … 135 135 return rc; 136 136 } 137 /*----------------------------------------------------------------------------*/ 137 138 138 /** Request a control write transfer on an endpoint pipe. 139 139 * … … 182 182 return rc; 183 183 } 184 /*----------------------------------------------------------------------------*/ 184 185 185 /** Request a read (in) transfer on an endpoint pipe. 186 186 * … … 227 227 return rc; 228 228 } 229 /*----------------------------------------------------------------------------*/ 229 230 230 /** Request a write (out) transfer on an endpoint pipe. 231 231 * … … 259 259 pipe->endpoint_no, buffer, size); 260 260 } 261 /*----------------------------------------------------------------------------*/ 261 262 262 /** Initialize USB endpoint pipe. 263 263 * … … 287 287 return EOK; 288 288 } 289 /*----------------------------------------------------------------------------*/ 289 290 290 /** Initialize USB endpoint pipe as the default zero control pipe. 291 291 * … … 307 307 return rc; 308 308 } 309 /*----------------------------------------------------------------------------*/ 309 310 310 /** Register endpoint with the host controller. 311 311 * … … 323 323 pipe->direction, pipe->max_packet_size, interval); 324 324 } 325 /*----------------------------------------------------------------------------*/ 325 326 326 /** Revert endpoint registration with the host controller. 327 327 * -
uspace/lib/usbhid/include/usb/hid/hid_report_items.h
r76fbd9a ra76b01b4 38 38 #include <stdint.h> 39 39 40 /*---------------------------------------------------------------------------*/ 40 41 41 /* 42 42 * Item prefix … … 56 56 #define USB_HID_ITEM_IS_LONG(data) (data == 0xFE) 57 57 58 /*---------------------------------------------------------------------------*/ 58 59 59 /* 60 60 * Extended usage macros … … 70 70 #define USB_HID_EXTENDED_USAGE(usage) (usage & 0xFFFF) 71 71 72 /*---------------------------------------------------------------------------*/ 72 73 73 /* 74 74 * Input/Output/Feature Item flags … … 142 142 #define USB_HID_ITEM_FLAG_BUFFERED(flags) ((flags & 0x100) == 0x100) 143 143 144 /*---------------------------------------------------------------------------*/ 144 145 145 146 146 /* MAIN ITEMS */ … … 185 185 #define USB_HID_REPORT_TAG_END_COLLECTION 0xC 186 186 187 /*---------------------------------------------------------------------------*/ 187 188 188 189 189 /* GLOBAL ITEMS */ … … 272 272 #define USB_HID_REPORT_TAG_POP 0xB 273 273 274 /*---------------------------------------------------------------------------*/ 274 275 275 276 276 /* LOCAL ITEMS */ … … 347 347 #define USB_HID_REPORT_TAG_DELIMITER 0xA 348 348 349 /*---------------------------------------------------------------------------*/ 349 350 350 351 351 #endif -
uspace/lib/usbhid/include/usb/hid/hidpath.h
r76fbd9a ra76b01b4 41 41 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Flags of usage paths comparison modes. … … 73 73 #define USB_HID_PATH_COMPARE_ANYWHERE 8 74 74 75 /*----------------------------------------------------------------------------*/ 75 76 76 /** 77 77 * Item of usage path structure. Last item of linked list describes one item … … 93 93 94 94 95 /*---------------------------------------------------------------------------*/ 95 96 96 /** 97 97 * USB HID usage path structure. … … 112 112 } usb_hid_report_path_t; 113 113 114 /*---------------------------------------------------------------------------*/ 114 115 115 usb_hid_report_path_t *usb_hid_report_path(void); 116 116 -
uspace/lib/usbhid/include/usb/hid/hidtypes.h
r76fbd9a ra76b01b4 39 39 #include <adt/list.h> 40 40 41 /*---------------------------------------------------------------------------*/ 41 42 42 43 43 /** … … 69 69 (((x) < 0 ) ? ((1 << (size)) + (x)) : (x)) 70 70 71 /*---------------------------------------------------------------------------*/ 71 72 72 73 73 /** … … 86 86 } usb_hid_report_type_t; 87 87 88 /*---------------------------------------------------------------------------*/ 88 89 89 90 90 /** … … 111 111 112 112 } usb_hid_report_t; 113 /*---------------------------------------------------------------------------*/ 113 114 114 115 115 /** … … 135 135 link_t reports_link; 136 136 } usb_hid_report_description_t; 137 /*---------------------------------------------------------------------------*/ 137 138 138 139 139 /** … … 202 202 } usb_hid_report_field_t; 203 203 204 /*---------------------------------------------------------------------------*/ 204 205 205 206 206 /** … … 287 287 int in_delimiter; 288 288 } usb_hid_report_item_t; 289 /*---------------------------------------------------------------------------*/ 289 290 290 /** 291 291 * Enum of the keyboard modifiers … … 314 314 USB_HID_MOD_RGUI 315 315 }; 316 /*---------------------------------------------------------------------------*/ 316 317 317 318 318 -
uspace/lib/usbhid/include/usb/hid/request.h
r76fbd9a ra76b01b4 42 42 #include <usb/dev/pipes.h> 43 43 44 /*----------------------------------------------------------------------------*/ 44 45 45 46 46 int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no, … … 61 61 int usbhid_req_get_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t *duration); 62 62 63 /*----------------------------------------------------------------------------*/ 63 64 64 65 65 #endif /* USB_KBD_HIDREQ_H_ */ -
uspace/lib/usbhid/src/hiddescriptor.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Constants defining current parsing mode for correct parsing of the set of … … 61 61 #define INSIDE_DELIMITER_SET 2 62 62 63 /*---------------------------------------------------------------------------*/ 63 64 64 65 65 /** The new report item flag. Used to determine when the item is completly … … 78 78 #define USB_HID_UNKNOWN_TAG -99 79 79 80 /*---------------------------------------------------------------------------*/ 80 81 81 /** 82 82 * Checks if given collection path is already present in report structure and … … 124 124 } 125 125 126 /*---------------------------------------------------------------------------*/ 126 127 127 /** 128 128 * Initialize the report descriptor parser structure … … 147 147 } 148 148 149 /*---------------------------------------------------------------------------*/ 149 150 150 151 151 /** … … 314 314 return EOK; 315 315 } 316 /*---------------------------------------------------------------------------*/ 316 317 317 /** 318 318 * Finds description of report with given report_id and of given type in … … 348 348 return NULL; 349 349 } 350 /*---------------------------------------------------------------------------*/ 350 351 351 352 352 /** Parse HID report descriptor. … … 536 536 } 537 537 538 /*---------------------------------------------------------------------------*/ 538 539 539 540 540 /** … … 871 871 return EOK; 872 872 } 873 /*---------------------------------------------------------------------------*/ 873 874 874 875 875 /** … … 892 892 return result; 893 893 } 894 /*---------------------------------------------------------------------------*/ 894 895 895 896 896 /** … … 941 941 942 942 } 943 /*---------------------------------------------------------------------------*/ 943 944 944 945 945 /** … … 972 972 } 973 973 } 974 /*---------------------------------------------------------------------------*/ 974 975 975 976 976 … … 1022 1022 return; 1023 1023 } 1024 /*---------------------------------------------------------------------------*/ 1024 1025 1025 1026 1026 /** -
uspace/lib/usbhid/src/hidparser.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Data translation private functions … … 52 52 int32_t value); 53 53 54 /*---------------------------------------------------------------------------*/ 54 55 55 56 56 static int usb_pow(int a, int b) … … 68 68 } 69 69 } 70 /*---------------------------------------------------------------------------*/ 70 71 71 72 72 /** Returns size of report of specified report id and type in items … … 117 117 } 118 118 } 119 /*---------------------------------------------------------------------------*/ 119 120 120 121 121 /** Parse and act upon a HID report. … … 192 192 } 193 193 194 /*---------------------------------------------------------------------------*/ 194 195 195 /** 196 196 * Translate data from the report as specified in report descriptor item … … 274 274 } 275 275 276 /*---------------------------------------------------------------------------*/ 276 277 277 /* OUTPUT API */ 278 278 … … 431 431 } 432 432 433 /*---------------------------------------------------------------------------*/ 433 434 434 /** 435 435 * Translate given data for putting them into the outoput report … … 476 476 } 477 477 478 /*---------------------------------------------------------------------------*/ 478 479 479 /** 480 480 * Clones given state table … … 497 497 } 498 498 499 /*---------------------------------------------------------------------------*/ 499 500 500 /** 501 501 * Function for sequence walking through the report. Returns next field in the … … 552 552 } 553 553 554 /*---------------------------------------------------------------------------*/ 554 555 555 /** 556 556 * Returns next report_id of report of specified type. If zero is given than … … 600 600 } 601 601 602 /*---------------------------------------------------------------------------*/ 602 603 603 /** 604 604 * Reset all local items in given state table -
uspace/lib/usbhid/src/hidpath.c
r76fbd9a ra76b01b4 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /** 45 45 * Compares two usages if they are same or not or one of the usages is not … … 63 63 ((page1 == page2) || (page1 == 0) || (page2 == 0)) 64 64 65 /*---------------------------------------------------------------------------*/ 65 66 66 /** 67 67 * Appends one item (couple of usage_path and usage) into the usage path … … 93 93 } 94 94 95 /*---------------------------------------------------------------------------*/ 95 96 96 /** 97 97 * Removes last item from the usage path structure … … 114 114 } 115 115 116 /*---------------------------------------------------------------------------*/ 116 117 117 /** 118 118 * Nulls last item of the usage path structure. … … 133 133 } 134 134 135 /*---------------------------------------------------------------------------*/ 135 136 136 /** 137 137 * Modifies last item of usage path structure by given usage page or usage … … 164 164 } 165 165 166 /*---------------------------------------------------------------------------*/ 166 167 167 /** 168 168 * … … 188 188 } 189 189 190 /*---------------------------------------------------------------------------*/ 190 191 191 /** 192 192 * Compares two usage paths structures … … 354 354 } 355 355 356 /*---------------------------------------------------------------------------*/ 356 357 357 /** 358 358 * Allocates and initializes new usage path structure. … … 376 376 } 377 377 378 /*---------------------------------------------------------------------------*/ 378 379 379 /** 380 380 * Releases given usage path structure. … … 395 395 } 396 396 397 /*---------------------------------------------------------------------------*/ 397 398 398 /** 399 399 * Clone content of given usage path to the new one … … 441 441 } 442 442 443 /*---------------------------------------------------------------------------*/ 443 444 444 /** 445 445 * Sets report id in usage path structure -
uspace/lib/usbhid/src/hidreport.c
r76fbd9a ra76b01b4 161 161 } 162 162 163 /*----------------------------------------------------------------------------*/ 163 164 164 165 165 int usb_hid_process_report_descriptor(usb_device_t *dev, -
uspace/lib/usbhid/src/hidreq.c
r76fbd9a ra76b01b4 45 45 #include <usb/hid/request.h> 46 46 47 /*----------------------------------------------------------------------------*/ 47 48 48 /** 49 49 * Send Set Report request to the HID device. … … 97 97 } 98 98 99 /*----------------------------------------------------------------------------*/ 99 100 100 /** 101 101 * Send Set Protocol request to the HID device. … … 145 145 } 146 146 147 /*----------------------------------------------------------------------------*/ 147 148 148 /** 149 149 * Send Set Idle request to the HID device. … … 195 195 } 196 196 197 /*----------------------------------------------------------------------------*/ 197 198 198 /** 199 199 * Send Get Report request to the HID device. … … 251 251 } 252 252 253 /*----------------------------------------------------------------------------*/ 253 254 254 /** 255 255 * Send Get Protocol request to the HID device. … … 310 310 } 311 311 312 /*----------------------------------------------------------------------------*/ 312 313 313 /** 314 314 * Send Get Idle request to the HID device. … … 373 373 } 374 374 375 /*----------------------------------------------------------------------------*/ 375 376 376 377 377 /** -
uspace/lib/usbhost/include/usb/host/hcd.h
r76fbd9a ra76b01b4 61 61 void (*ep_remove_hook)(hcd_t *, endpoint_t *); 62 62 }; 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Initialize hcd_t structure. 65 65 * Initializes device and endpoint managers. Sets data and hook pointer to NULL. … … 79 79 hcd->ep_remove_hook = NULL; 80 80 } 81 /*----------------------------------------------------------------------------*/ 81 82 82 /** Check registered endpoints and reset toggle bit if necessary. 83 83 * @param hcd hcd_t structure, non-null. … … 92 92 &hcd->ep_manager, target, (const uint8_t *)setup_data); 93 93 } 94 /*----------------------------------------------------------------------------*/ 94 95 95 /** Data retrieve wrapper. 96 96 * @param fun ddf function, non-null. … … 102 102 return fun->driver_data; 103 103 } 104 /*----------------------------------------------------------------------------*/ 104 105 105 extern usbhc_iface_t hcd_iface; 106 106 -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
r76fbd9a ra76b01b4 115 115 void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance, 116 116 const void* data, size_t size, int error); 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** Finish batch using stored error value and transferred size. 119 119 * … … 128 128 instance, data, instance->transfered_size, instance->error); 129 129 } 130 /*----------------------------------------------------------------------------*/ 130 131 131 /** Determine batch direction based on the callbacks present 132 132 * @param[in] instance Batch structure to use, non-null. -
uspace/lib/usbhost/src/endpoint.c
r76fbd9a ra76b01b4 72 72 return instance; 73 73 } 74 /*----------------------------------------------------------------------------*/ 74 75 75 /** Properly dispose of endpoint_t structure. 76 76 * @param instance endpoint_t structure. … … 84 84 free(instance); 85 85 } 86 /*----------------------------------------------------------------------------*/ 86 87 87 /** Set device specific data and hooks. 88 88 * @param instance endpoint_t structure. … … 101 101 fibril_mutex_unlock(&instance->guard); 102 102 } 103 /*----------------------------------------------------------------------------*/ 103 104 104 /** Clear device specific data and hooks. 105 105 * @param instance endpoint_t structure. … … 115 115 fibril_mutex_unlock(&instance->guard); 116 116 } 117 /*----------------------------------------------------------------------------*/ 117 118 118 /** Mark the endpoint as active and block access for further fibrils. 119 119 * @param instance endpoint_t structure. … … 128 128 fibril_mutex_unlock(&instance->guard); 129 129 } 130 /*----------------------------------------------------------------------------*/ 130 131 131 /** Mark the endpoint as inactive and allow access for further fibrils. 132 132 * @param instance endpoint_t structure. … … 140 140 fibril_condvar_signal(&instance->avail); 141 141 } 142 /*----------------------------------------------------------------------------*/ 142 143 143 /** Get the value of toggle bit. 144 144 * @param instance endpoint_t structure. … … 156 156 return ret; 157 157 } 158 /*----------------------------------------------------------------------------*/ 158 159 159 /** Set the value of toggle bit. 160 160 * @param instance endpoint_t structure. -
uspace/lib/usbhost/src/iface.c
r76fbd9a ra76b01b4 98 98 return ret; 99 99 } 100 /*----------------------------------------------------------------------------*/ 100 101 101 /** Calls ep_add_hook upon endpoint registration. 102 102 * @param ep Endpoint to be registered. … … 113 113 return EOK; 114 114 } 115 /*----------------------------------------------------------------------------*/ 115 116 116 /** Calls ep_remove_hook upon endpoint removal. 117 117 * @param ep Endpoint to be unregistered. … … 126 126 hcd->ep_remove_hook(hcd, ep); 127 127 } 128 /*----------------------------------------------------------------------------*/ 128 129 129 /** Calls ep_remove_hook upon endpoint removal. Prints warning. 130 130 * @param ep Endpoint to be unregistered. … … 141 141 hcd->ep_remove_hook(hcd, ep); 142 142 } 143 /*----------------------------------------------------------------------------*/ 143 144 144 /** Request address interface function. 145 145 * … … 164 164 &hcd->dev_manager, address, strict, speed); 165 165 } 166 /*----------------------------------------------------------------------------*/ 166 167 167 /** Bind address interface function. 168 168 * … … 183 183 &hcd->dev_manager, address, handle); 184 184 } 185 /*----------------------------------------------------------------------------*/ 185 186 186 /** Find device handle by address interface function. 187 187 * … … 200 200 &hcd->dev_manager, address, handle, NULL); 201 201 } 202 /*----------------------------------------------------------------------------*/ 202 203 203 /** Release address interface function. 204 204 * … … 218 218 return EOK; 219 219 } 220 /*----------------------------------------------------------------------------*/ 220 221 221 /** Register endpoint interface function. 222 222 * @param fun DDF function. … … 254 254 register_helper, hcd); 255 255 } 256 /*----------------------------------------------------------------------------*/ 256 257 257 /** Unregister endpoint interface function. 258 258 * @param fun DDF function. … … 274 274 endpoint, direction, unregister_helper, hcd); 275 275 } 276 /*----------------------------------------------------------------------------*/ 276 277 277 /** Inbound communication interface function. 278 278 * @param fun DDF function. … … 292 292 setup_data, callback, NULL, arg, "READ"); 293 293 } 294 /*----------------------------------------------------------------------------*/ 294 295 295 /** Outbound communication interface function. 296 296 * @param fun DDF function. … … 310 310 setup_data, NULL, callback, arg, "WRITE"); 311 311 } 312 /*----------------------------------------------------------------------------*/ 312 313 313 /** usbhc Interface implementation using hcd_t from libusbhost library. */ 314 314 usbhc_iface_t hcd_iface = { -
uspace/lib/usbhost/src/usb_device_manager.c
r76fbd9a ra76b01b4 61 61 return new_address; 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Initialize device manager structure. 65 65 * … … 82 82 fibril_mutex_initialize(&instance->guard); 83 83 } 84 /*----------------------------------------------------------------------------*/ 84 85 85 /** Request USB address. 86 86 * @param instance usb_device_manager … … 124 124 return EOK; 125 125 } 126 /*----------------------------------------------------------------------------*/ 126 127 127 /** Bind USB address to devman handle. 128 128 * … … 156 156 return EOK; 157 157 } 158 /*----------------------------------------------------------------------------*/ 158 159 159 /** Release used USB address. 160 160 * … … 182 182 return EOK; 183 183 } 184 /*----------------------------------------------------------------------------*/ 184 185 185 /** Find USB address associated with the device. 186 186 * … … 205 205 return ENOENT; 206 206 } 207 /*----------------------------------------------------------------------------*/ 207 208 208 /** Find devman handle and speed assigned to USB address. 209 209 * -
uspace/lib/usbhost/src/usb_endpoint_manager.c
r76fbd9a ra76b01b4 61 61 && (address == ep->address); 62 62 } 63 /*----------------------------------------------------------------------------*/ 63 64 64 /** Get list that holds endpoints for given address. 65 65 * @param instance usb_endpoint_manager structure, non-null. … … 73 73 return &instance->endpoint_lists[addr % ENDPOINT_LIST_COUNT]; 74 74 } 75 /*----------------------------------------------------------------------------*/ 75 76 76 /** Internal search function, works on locked structure. 77 77 * @param instance usb_endpoint_manager structure, non-null. … … 97 97 return NULL; 98 98 } 99 /*----------------------------------------------------------------------------*/ 99 100 100 /** Calculate bandwidth that needs to be reserved for communication with EP. 101 101 * Calculation follows USB 1.1 specification. … … 145 145 } 146 146 } 147 /*----------------------------------------------------------------------------*/ 147 148 148 /** Initialize to default state. 149 149 * You need to provide valid bw_count function if you plan to use … … 168 168 return EOK; 169 169 } 170 /*----------------------------------------------------------------------------*/ 170 171 171 /** Check setup packet data for signs of toggle reset. 172 172 * … … 227 227 } 228 228 } 229 /*----------------------------------------------------------------------------*/ 229 230 230 /** Register endpoint structure. 231 231 * Checks for duplicates. … … 262 262 return EOK; 263 263 } 264 /*----------------------------------------------------------------------------*/ 264 265 265 /** Unregister endpoint structure. 266 266 * Checks for duplicates. … … 286 286 return EOK; 287 287 } 288 /*----------------------------------------------------------------------------*/ 288 289 289 /** Find endpoint_t representing the given communication route. 290 290 * @param instance usb_endpoint_manager, non-null. … … 301 301 return ep; 302 302 } 303 /*----------------------------------------------------------------------------*/ 303 304 304 /** Create and register new endpoint_t structure. 305 305 * @param instance usb_endpoint_manager structure, non-null. … … 364 364 return EOK; 365 365 } 366 /*----------------------------------------------------------------------------*/ 366 367 367 /** Unregister and destroy endpoint_t structure representing given route. 368 368 * @param instance usb_endpoint_manager structure, non-null. … … 395 395 return EOK; 396 396 } 397 /*----------------------------------------------------------------------------*/ 397 398 398 /** Unregister and destroy all endpoints using given address. 399 399 * @param instance usb_endpoint_manager structure, non-null. -
uspace/lib/usbhost/src/usb_transfer_batch.c
r76fbd9a ra76b01b4 96 96 return instance; 97 97 } 98 /*----------------------------------------------------------------------------*/ 98 99 99 /** Correctly dispose all used data structures. 100 100 * … … 116 116 free(instance); 117 117 } 118 /*----------------------------------------------------------------------------*/ 118 119 119 /** Prepare data and call the right callback. 120 120 *
Note: See TracChangeset
for help on using the changeset viewer.