Changeset b9fa0a9 in mainline for uspace/drv/uhci-hcd/iface.c
- Timestamp:
- 2011-03-21T23:33:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 87644b4
- Parents:
- 1c6a45f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r1c6a45f rb9fa0a9 78 78 * @return Error code. 79 79 */ 80 static int request_address( ddf_fun_t *fun, usb_speed_t speed,81 usb_address_t *address)80 static int request_address( 81 ddf_fun_t *fun, usb_speed_t speed, usb_address_t *address) 82 82 { 83 83 assert(fun); … … 139 139 * @return Error code. 140 140 */ 141 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 142 size_t max_packet_size, void *data, size_t size, 143 usbhc_iface_transfer_out_callback_t callback, void *arg) 144 { 145 assert(fun); 146 hc_t *hc = fun_to_hc(fun); 147 assert(hc); 148 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 141 static int interrupt_out( 142 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data, 143 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 144 { 145 assert(fun); 146 hc_t *hc = fun_to_hc(fun); 147 assert(hc); 148 usb_speed_t speed = 149 usb_device_keeper_get_speed(&hc->manager, target.address); 149 150 150 151 usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n", 151 152 target.address, target.endpoint, size, max_packet_size); 152 153 153 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,154 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,155 &hc->manager);154 usb_transfer_batch_t *batch = 155 batch_get(fun, target, USB_TRANSFER_INTERRUPT, max_packet_size, 156 speed, data, size, NULL, 0, NULL, callback, arg, &hc->manager); 156 157 if (!batch) 157 158 return ENOMEM; … … 160 161 if (ret != EOK) { 161 162 batch_dispose(batch); 162 return ret; 163 } 164 return EOK; 163 } 164 return ret; 165 165 } 166 166 /*----------------------------------------------------------------------------*/ … … 176 176 * @return Error code. 177 177 */ 178 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 179 size_t max_packet_size, void *data, size_t size, 180 usbhc_iface_transfer_in_callback_t callback, void *arg) 181 { 182 assert(fun); 183 hc_t *hc = fun_to_hc(fun); 184 assert(hc); 185 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 178 static int interrupt_in( 179 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data, 180 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 181 { 182 assert(fun); 183 hc_t *hc = fun_to_hc(fun); 184 assert(hc); 185 usb_speed_t speed = 186 usb_device_keeper_get_speed(&hc->manager, target.address); 186 187 usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n", 187 188 target.address, target.endpoint, size, max_packet_size); 188 189 189 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,190 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,191 &hc->manager);190 usb_transfer_batch_t *batch = 191 batch_get(fun, target, USB_TRANSFER_INTERRUPT, max_packet_size, 192 speed, data, size, NULL, 0, callback, NULL, arg, &hc->manager); 192 193 if (!batch) 193 194 return ENOMEM; … … 196 197 if (ret != EOK) { 197 198 batch_dispose(batch); 198 return ret; 199 } 200 return EOK; 199 } 200 return ret; 201 201 } 202 202 /*----------------------------------------------------------------------------*/ … … 212 212 * @return Error code. 213 213 */ 214 static int bulk_out(ddf_fun_t *fun, usb_target_t target, 215 size_t max_packet_size, void *data, size_t size, 216 usbhc_iface_transfer_out_callback_t callback, void *arg) 217 { 218 assert(fun); 219 hc_t *hc = fun_to_hc(fun); 220 assert(hc); 221 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 214 static int bulk_out( 215 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data, 216 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 217 { 218 assert(fun); 219 hc_t *hc = fun_to_hc(fun); 220 assert(hc); 221 usb_speed_t speed = 222 usb_device_keeper_get_speed(&hc->manager, target.address); 222 223 223 224 usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n", 224 225 target.address, target.endpoint, size, max_packet_size); 225 226 226 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,227 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,228 &hc->manager);227 usb_transfer_batch_t *batch = 228 batch_get(fun, target, USB_TRANSFER_BULK, max_packet_size, speed, 229 data, size, NULL, 0, NULL, callback, arg, &hc->manager); 229 230 if (!batch) 230 231 return ENOMEM; … … 233 234 if (ret != EOK) { 234 235 batch_dispose(batch); 235 return ret; 236 } 237 return EOK; 236 } 237 return ret; 238 238 } 239 239 /*----------------------------------------------------------------------------*/ … … 249 249 * @return Error code. 250 250 */ 251 static int bulk_in(ddf_fun_t *fun, usb_target_t target, 252 size_t max_packet_size, void *data, size_t size, 253 usbhc_iface_transfer_in_callback_t callback, void *arg) 254 { 255 assert(fun); 256 hc_t *hc = fun_to_hc(fun); 257 assert(hc); 258 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 251 static int bulk_in( 252 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data, 253 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 254 { 255 assert(fun); 256 hc_t *hc = fun_to_hc(fun); 257 assert(hc); 258 usb_speed_t speed = 259 usb_device_keeper_get_speed(&hc->manager, target.address); 259 260 usb_log_debug("Bulk IN %d:%d %zu(%zu).\n", 260 261 target.address, target.endpoint, size, max_packet_size); 261 262 262 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,263 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,264 &hc->manager);263 usb_transfer_batch_t *batch = 264 batch_get(fun, target, USB_TRANSFER_BULK, max_packet_size, speed, 265 data, size, NULL, 0, callback, NULL, arg, &hc->manager); 265 266 if (!batch) 266 267 return ENOMEM; … … 269 270 if (ret != EOK) { 270 271 batch_dispose(batch); 271 return ret; 272 } 273 return EOK; 272 } 273 return ret; 274 274 } 275 275 /*----------------------------------------------------------------------------*/ … … 287 287 * @return Error code. 288 288 */ 289 static int control_write( ddf_fun_t *fun, usb_target_t target,290 size_t max_packet_size,289 static int control_write( 290 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, 291 291 void *setup_data, size_t setup_size, void *data, size_t size, 292 292 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 295 295 hc_t *hc = fun_to_hc(fun); 296 296 assert(hc); 297 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 297 usb_speed_t speed = 298 usb_device_keeper_get_speed(&hc->manager, target.address); 298 299 usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n", 299 300 speed, target.address, target.endpoint, size, max_packet_size); … … 302 303 return EINVAL; 303 304 304 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 305 max_packet_size, speed, data, size, setup_data, setup_size, 306 NULL, callback, arg, &hc->manager); 305 usb_transfer_batch_t *batch = 306 batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed, 307 data, size, setup_data, setup_size, NULL, callback, arg, 308 &hc->manager); 307 309 if (!batch) 308 310 return ENOMEM; … … 312 314 if (ret != EOK) { 313 315 batch_dispose(batch); 314 return ret; 315 } 316 return EOK; 316 } 317 return ret; 317 318 } 318 319 /*----------------------------------------------------------------------------*/ … … 330 331 * @return Error code. 331 332 */ 332 static int control_read( ddf_fun_t *fun, usb_target_t target,333 size_t max_packet_size,333 static int control_read( 334 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, 334 335 void *setup_data, size_t setup_size, void *data, size_t size, 335 336 usbhc_iface_transfer_in_callback_t callback, void *arg) … … 338 339 hc_t *hc = fun_to_hc(fun); 339 340 assert(hc); 340 usb_speed_t speed = usb_device_keeper_get_speed(&hc->manager, target.address); 341 usb_speed_t speed = 342 usb_device_keeper_get_speed(&hc->manager, target.address); 341 343 342 344 usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n", 343 345 speed, target.address, target.endpoint, size, max_packet_size); 344 usb_transfer_batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 345 max_packet_size, speed, data, size, setup_data, setup_size, callback, 346 NULL, arg, &hc->manager); 346 usb_transfer_batch_t *batch = 347 batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed, 348 data, size, setup_data, setup_size, callback, NULL, arg, 349 &hc->manager); 347 350 if (!batch) 348 351 return ENOMEM; … … 351 354 if (ret != EOK) { 352 355 batch_dispose(batch); 353 return ret; 354 } 355 return EOK; 356 } 357 return ret; 356 358 } 357 359 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.