Changeset a76b01b4 in mainline for uspace/lib/usbhost/src
- Timestamp:
- 2012-02-24T19:11:23Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a2bd8822
- Parents:
- 76fbd9a
- Location:
- uspace/lib/usbhost/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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.