Changeset 7dfc06fa in mainline
- Timestamp:
- 2011-04-08T18:08:46Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c6cb76d
- Parents:
- c1b1944
- Location:
- uspace
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ehci-hcd/hc_iface.c
rc1b1944 r7dfc06fa 165 165 * @param[in] fun Device function the action was invoked on. 166 166 * @param[in] target Target pipe (address and endpoint number) specification. 167 * @param[in] max_packet_size Max packet size for the transfer.168 167 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 169 168 * by the caller). … … 174 173 */ 175 174 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 176 size_t max_packet_size,void *data, size_t size,175 void *data, size_t size, 177 176 usbhc_iface_transfer_out_callback_t callback, void *arg) 178 177 { … … 191 190 * @param[in] fun Device function the action was invoked on. 192 191 * @param[in] target Target pipe (address and endpoint number) specification. 193 * @param[in] max_packet_size Max packet size for the transfer.194 192 * @param[in] data Buffer where to store the data (in USB endianess, 195 193 * allocated and deallocated by the caller). … … 200 198 */ 201 199 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 202 size_t max_packet_size,void *data, size_t size,200 void *data, size_t size, 203 201 usbhc_iface_transfer_in_callback_t callback, void *arg) 204 202 { … … 217 215 * @param[in] fun Device function the action was invoked on. 218 216 * @param[in] target Target pipe (address and endpoint number) specification. 219 * @param[in] max_packet_size Max packet size for the transfer.220 217 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 221 218 * by the caller). … … 226 223 */ 227 224 static int bulk_out(ddf_fun_t *fun, usb_target_t target, 228 size_t max_packet_size,void *data, size_t size,225 void *data, size_t size, 229 226 usbhc_iface_transfer_out_callback_t callback, void *arg) 230 227 { … … 243 240 * @param[in] fun Device function the action was invoked on. 244 241 * @param[in] target Target pipe (address and endpoint number) specification. 245 * @param[in] max_packet_size Max packet size for the transfer.246 242 * @param[in] data Buffer where to store the data (in USB endianess, 247 243 * allocated and deallocated by the caller). … … 252 248 */ 253 249 static int bulk_in(ddf_fun_t *fun, usb_target_t target, 254 size_t max_packet_size,void *data, size_t size,250 void *data, size_t size, 255 251 usbhc_iface_transfer_in_callback_t callback, void *arg) 256 252 { … … 269 265 * @param[in] fun Device function the action was invoked on. 270 266 * @param[in] target Target pipe (address and endpoint number) specification. 271 * @param[in] max_packet_size Max packet size for the transfer.272 267 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 273 268 * and deallocated by the caller). … … 281 276 */ 282 277 static int control_write(ddf_fun_t *fun, usb_target_t target, 283 size_t max_packet_size,284 278 void *setup_packet, size_t setup_packet_size, 285 279 void *data_buffer, size_t data_buffer_size, … … 300 294 * @param[in] fun Device function the action was invoked on. 301 295 * @param[in] target Target pipe (address and endpoint number) specification. 302 * @param[in] max_packet_size Max packet size for the transfer.303 296 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 304 297 * and deallocated by the caller). … … 312 305 */ 313 306 static int control_read(ddf_fun_t *fun, usb_target_t target, 314 size_t max_packet_size,315 307 void *setup_packet, size_t setup_packet_size, 316 308 void *data_buffer, size_t data_buffer_size, -
uspace/drv/ohci/iface.c
rc1b1944 r7dfc06fa 196 196 * @param[in] fun Device function the action was invoked on. 197 197 * @param[in] target Target pipe (address and endpoint number) specification. 198 * @param[in] max_packet_size Max packet size for the transfer.199 198 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 200 199 * by the caller). … … 205 204 */ 206 205 static int interrupt_out( 207 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,206 ddf_fun_t *fun, usb_target_t target, void *data, 208 207 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 209 208 { 210 209 assert(fun); 210 211 // FIXME: get from endpoint manager 212 size_t max_packet_size = 8; 213 211 214 hc_t *hc = fun_to_hc(fun); 212 215 assert(hc); … … 239 242 * @param[in] fun Device function the action was invoked on. 240 243 * @param[in] target Target pipe (address and endpoint number) specification. 241 * @param[in] max_packet_size Max packet size for the transfer.242 244 * @param[in] data Buffer where to store the data (in USB endianess, 243 245 * allocated and deallocated by the caller). … … 248 250 */ 249 251 static int interrupt_in( 250 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,252 ddf_fun_t *fun, usb_target_t target, void *data, 251 253 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 252 254 { 253 255 assert(fun); 256 257 // FIXME: get from endpoint manager 258 size_t max_packet_size = 8; 259 254 260 hc_t *hc = fun_to_hc(fun); 255 261 assert(hc); … … 281 287 * @param[in] fun Device function the action was invoked on. 282 288 * @param[in] target Target pipe (address and endpoint number) specification. 283 * @param[in] max_packet_size Max packet size for the transfer.284 289 * @param[in] data Data to be sent (in USB endianess, allocated and deallocated 285 290 * by the caller). … … 290 295 */ 291 296 static int bulk_out( 292 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,297 ddf_fun_t *fun, usb_target_t target, void *data, 293 298 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 294 299 { 295 300 assert(fun); 301 302 // FIXME: get from endpoint manager 303 size_t max_packet_size = 8; 304 296 305 hc_t *hc = fun_to_hc(fun); 297 306 assert(hc); … … 324 333 * @param[in] fun Device function the action was invoked on. 325 334 * @param[in] target Target pipe (address and endpoint number) specification. 326 * @param[in] max_packet_size Max packet size for the transfer.327 335 * @param[in] data Buffer where to store the data (in USB endianess, 328 336 * allocated and deallocated by the caller). … … 333 341 */ 334 342 static int bulk_in( 335 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,343 ddf_fun_t *fun, usb_target_t target, void *data, 336 344 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 337 345 { 338 346 assert(fun); 347 348 // FIXME: get from endpoint manager 349 size_t max_packet_size = 8; 350 339 351 hc_t *hc = fun_to_hc(fun); 340 352 assert(hc); … … 366 378 * @param[in] fun Device function the action was invoked on. 367 379 * @param[in] target Target pipe (address and endpoint number) specification. 368 * @param[in] max_packet_size Max packet size for the transfer.369 380 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 370 381 * and deallocated by the caller). … … 378 389 */ 379 390 static int control_write( 380 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,391 ddf_fun_t *fun, usb_target_t target, 381 392 void *setup_data, size_t setup_size, void *data, size_t size, 382 393 usbhc_iface_transfer_out_callback_t callback, void *arg) 383 394 { 384 395 assert(fun); 396 397 // FIXME: get from endpoint manager 398 size_t max_packet_size = 8; 399 385 400 hc_t *hc = fun_to_hc(fun); 386 401 assert(hc); … … 417 432 * @param[in] fun Device function the action was invoked on. 418 433 * @param[in] target Target pipe (address and endpoint number) specification. 419 * @param[in] max_packet_size Max packet size for the transfer.420 434 * @param[in] setup_packet Setup packet buffer (in USB endianess, allocated 421 435 * and deallocated by the caller). … … 429 443 */ 430 444 static int control_read( 431 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,445 ddf_fun_t *fun, usb_target_t target, 432 446 void *setup_data, size_t setup_size, void *data, size_t size, 433 447 usbhc_iface_transfer_in_callback_t callback, void *arg) 434 448 { 435 449 assert(fun); 450 451 // FIXME: get from endpoint manager 452 size_t max_packet_size = 8; 453 436 454 hc_t *hc = fun_to_hc(fun); 437 455 assert(hc); -
uspace/drv/uhci-hcd/iface.c
rc1b1944 r7dfc06fa 204 204 * @param[in] fun DDF function that was called. 205 205 * @param[in] target USB device to write to. 206 * @param[in] max_packet_size maximum size of data packet the device accepts207 206 * @param[in] data Source of data. 208 207 * @param[in] size Size of data source. … … 212 211 */ 213 212 static int interrupt_out( 214 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,213 ddf_fun_t *fun, usb_target_t target, void *data, 215 214 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 216 215 { … … 219 218 assert(hc); 220 219 221 usb_log_debug("Interrupt OUT %d:%d %zu (%zu).\n",222 target.address, target.endpoint, size , max_packet_size);220 usb_log_debug("Interrupt OUT %d:%d %zu.\n", 221 target.address, target.endpoint, size); 223 222 224 223 size_t res_bw; … … 241 240 assert(ep->speed == 242 241 usb_device_keeper_get_speed(&hc->manager, target.address)); 243 assert(ep->max_packet_size == max_packet_size);244 242 assert(ep->transfer_type == USB_TRANSFER_INTERRUPT); 245 243 … … 261 259 * @param[in] fun DDF function that was called. 262 260 * @param[in] target USB device to write to. 263 * @param[in] max_packet_size maximum size of data packet the device accepts264 261 * @param[out] data Data destination. 265 262 * @param[in] size Size of data source. … … 269 266 */ 270 267 static int interrupt_in( 271 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,268 ddf_fun_t *fun, usb_target_t target, void *data, 272 269 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 273 270 { … … 276 273 assert(hc); 277 274 278 usb_log_debug("Interrupt IN %d:%d %zu (%zu).\n",279 target.address, target.endpoint, size , max_packet_size);275 usb_log_debug("Interrupt IN %d:%d %zu.\n", 276 target.address, target.endpoint, size); 280 277 281 278 size_t res_bw; … … 299 296 assert(ep->speed == 300 297 usb_device_keeper_get_speed(&hc->manager, target.address)); 301 assert(ep->max_packet_size == max_packet_size);302 298 assert(ep->transfer_type == USB_TRANSFER_INTERRUPT); 303 299 … … 319 315 * @param[in] fun DDF function that was called. 320 316 * @param[in] target USB device to write to. 321 * @param[in] max_packet_size maximum size of data packet the device accepts322 317 * @param[in] data Source of data. 323 318 * @param[in] size Size of data source. … … 327 322 */ 328 323 static int bulk_out( 329 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,324 ddf_fun_t *fun, usb_target_t target, void *data, 330 325 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg) 331 326 { … … 334 329 assert(hc); 335 330 336 usb_log_debug("Bulk OUT %d:%d %zu (%zu).\n",337 target.address, target.endpoint, size , max_packet_size);331 usb_log_debug("Bulk OUT %d:%d %zu.\n", 332 target.address, target.endpoint, size); 338 333 339 334 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager, … … 346 341 assert(ep->speed == 347 342 usb_device_keeper_get_speed(&hc->manager, target.address)); 348 assert(ep->max_packet_size == max_packet_size);349 343 assert(ep->transfer_type == USB_TRANSFER_BULK); 350 344 … … 366 360 * @param[in] fun DDF function that was called. 367 361 * @param[in] target USB device to write to. 368 * @param[in] max_packet_size maximum size of data packet the device accepts369 362 * @param[out] data Data destination. 370 363 * @param[in] size Size of data source. … … 374 367 */ 375 368 static int bulk_in( 376 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,void *data,369 ddf_fun_t *fun, usb_target_t target, void *data, 377 370 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg) 378 371 { … … 380 373 hc_t *hc = fun_to_hc(fun); 381 374 assert(hc); 382 usb_log_debug("Bulk IN %d:%d %zu (%zu).\n",383 target.address, target.endpoint, size , max_packet_size);375 usb_log_debug("Bulk IN %d:%d %zu.\n", 376 target.address, target.endpoint, size); 384 377 385 378 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager, … … 392 385 assert(ep->speed == 393 386 usb_device_keeper_get_speed(&hc->manager, target.address)); 394 assert(ep->max_packet_size == max_packet_size);395 387 assert(ep->transfer_type == USB_TRANSFER_BULK); 396 388 … … 412 404 * @param[in] fun DDF function that was called. 413 405 * @param[in] target USB device to write to. 414 * @param[in] max_packet_size maximum size of data packet the device accepts.415 406 * @param[in] setup_data Data to send with SETUP transfer. 416 407 * @param[in] setup_size Size of data to send with SETUP transfer (always 8B). … … 422 413 */ 423 414 static int control_write( 424 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,415 ddf_fun_t *fun, usb_target_t target, 425 416 void *setup_data, size_t setup_size, void *data, size_t size, 426 417 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 431 422 usb_speed_t speed = 432 423 usb_device_keeper_get_speed(&hc->manager, target.address); 433 usb_log_debug("Control WRITE (%d) %d:%d %zu (%zu).\n",434 speed, target.address, target.endpoint, size , max_packet_size);424 usb_log_debug("Control WRITE (%d) %d:%d %zu.\n", 425 speed, target.address, target.endpoint, size); 435 426 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager, 436 427 target.address, target.endpoint, USB_DIRECTION_BOTH, NULL); … … 444 435 445 436 usb_transfer_batch_t *batch = 446 batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,437 batch_get(fun, target, USB_TRANSFER_CONTROL, ep->max_packet_size, speed, 447 438 data, size, setup_data, setup_size, NULL, callback, arg, ep); 448 439 if (!batch) … … 461 452 * @param[in] fun DDF function that was called. 462 453 * @param[in] target USB device to write to. 463 * @param[in] max_packet_size maximum size of data packet the device accepts.464 454 * @param[in] setup_data Data to send with SETUP packet. 465 455 * @param[in] setup_size Size of data to send with SETUP packet (should be 8B). … … 471 461 */ 472 462 static int control_read( 473 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,463 ddf_fun_t *fun, usb_target_t target, 474 464 void *setup_data, size_t setup_size, void *data, size_t size, 475 465 usbhc_iface_transfer_in_callback_t callback, void *arg) … … 481 471 usb_device_keeper_get_speed(&hc->manager, target.address); 482 472 483 usb_log_debug("Control READ(%d) %d:%d %zu (%zu).\n",484 speed, target.address, target.endpoint, size , max_packet_size);473 usb_log_debug("Control READ(%d) %d:%d %zu.\n", 474 speed, target.address, target.endpoint, size); 485 475 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager, 486 476 target.address, target.endpoint, USB_DIRECTION_BOTH, NULL); … … 490 480 } 491 481 usb_transfer_batch_t *batch = 492 batch_get(fun, target, USB_TRANSFER_CONTROL, max_packet_size, speed,482 batch_get(fun, target, USB_TRANSFER_CONTROL, ep->max_packet_size, speed, 493 483 data, size, setup_data, setup_size, callback, NULL, arg, ep); 494 484 if (!batch) -
uspace/drv/vhc/connhost.c
rc1b1944 r7dfc06fa 257 257 258 258 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 259 size_t max_packet_size,260 259 void *data, size_t size, 261 260 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 267 266 268 267 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 269 size_t max_packet_size,270 268 void *data, size_t size, 271 269 usbhc_iface_transfer_in_callback_t callback, void *arg) … … 277 275 278 276 static int control_write(ddf_fun_t *fun, usb_target_t target, 279 size_t max_packet_size,280 277 void *setup_packet, size_t setup_packet_size, 281 278 void *data, size_t data_size, … … 295 292 296 293 static int control_read(ddf_fun_t *fun, usb_target_t target, 297 size_t max_packet_size,298 294 void *setup_packet, size_t setup_packet_size, 299 295 void *data, size_t data_size, -
uspace/lib/drv/generic/remote_usbhc.c
rc1b1944 r7dfc06fa 270 270 } 271 271 272 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);273 272 usb_target_t target = { 274 273 .address = DEV_IPC_GET_ARG1(*call), … … 300 299 trans->size = len; 301 300 302 rc = transfer_func(fun, target, max_packet_size,301 rc = transfer_func(fun, target, 303 302 buffer, len, 304 303 callback_out, trans); … … 326 325 } 327 326 328 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);329 327 usb_target_t target = { 330 328 .address = DEV_IPC_GET_ARG1(*call), … … 348 346 trans->size = len; 349 347 350 int rc = transfer_func(fun, target, max_packet_size,348 int rc = transfer_func(fun, target, 351 349 trans->buffer, len, 352 350 callback_in, trans); … … 414 412 }; 415 413 size_t data_buffer_len = DEV_IPC_GET_ARG3(*call); 416 size_t max_packet_size = DEV_IPC_GET_ARG4(*call);417 414 418 415 int rc; … … 450 447 trans->size = data_buffer_len; 451 448 452 rc = usb_iface->control_write(fun, target, max_packet_size,449 rc = usb_iface->control_write(fun, target, 453 450 setup_packet, setup_packet_len, 454 451 data_buffer, data_buffer_len, … … 477 474 .endpoint = DEV_IPC_GET_ARG2(*call) 478 475 }; 479 size_t max_packet_size = DEV_IPC_GET_ARG3(*call);480 476 481 477 int rc; … … 515 511 } 516 512 517 rc = usb_iface->control_read(fun, target, max_packet_size,513 rc = usb_iface->control_read(fun, target, 518 514 setup_packet, setup_packet_len, 519 515 trans->buffer, trans->size, -
uspace/lib/drv/include/usbhc_iface.h
rc1b1944 r7dfc06fa 66 66 * - argument #1 is target address 67 67 * - argument #2 is target endpoint 68 * - argument #3 is max packet size of the endpoint69 68 * - this call is immediately followed by IPC data read (async version) 70 69 * - the call is not answered until the device returns some data (or until … … 202 201 203 202 /** Out transfer processing function prototype. */ 204 typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t, size_t,203 typedef int (*usbhc_iface_transfer_out_t)(ddf_fun_t *, usb_target_t, 205 204 void *, size_t, 206 205 usbhc_iface_transfer_out_callback_t, void *); … … 210 209 211 210 /** In transfer processing function prototype. */ 212 typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t, size_t,211 typedef int (*usbhc_iface_transfer_in_t)(ddf_fun_t *, usb_target_t, 213 212 void *, size_t, 214 213 usbhc_iface_transfer_in_callback_t, void *); … … 234 233 235 234 int (*control_write)(ddf_fun_t *, usb_target_t, 236 size_t,237 235 void *, size_t, void *, size_t, 238 236 usbhc_iface_transfer_out_callback_t, void *); 239 237 240 238 int (*control_read)(ddf_fun_t *, usb_target_t, 241 size_t,242 239 void *, size_t, void *, size_t, 243 240 usbhc_iface_transfer_in_callback_t, void *);
Note:
See TracChangeset
for help on using the changeset viewer.