Changeset 239eea41 in mainline for uspace/lib/usbhost/src/ddf_helpers.c
- Timestamp:
- 2018-02-05T02:04:58Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc3dfe6d
- Parents:
- af16ebe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/ddf_helpers.c
raf16ebe r239eea41 271 271 * @return Error code. 272 272 */ 273 static errno_t transfer(ddf_fun_t *fun, usb_target_t target, 274 usb_direction_t dir, uint64_t setup_data, char *data, size_t size, 273 static errno_t transfer(ddf_fun_t *fun, const usbhc_iface_transfer_request_t *req, 275 274 usbhc_iface_transfer_callback_t callback, void *arg) 276 275 { … … 279 278 assert(dev); 280 279 281 target.address = dev->address; 280 const usb_target_t target = {{ 281 .address = dev->address, 282 .endpoint = req->endpoint, 283 .stream = req->stream, 284 }}; 282 285 283 286 if (!usb_target_is_valid(&target)) 284 287 return EINVAL; 285 288 286 if ( size > 0 && data== NULL)289 if (req->size > 0 && req->base == NULL) 287 290 return EBADMEM; 288 291 … … 290 293 return EBADMEM; 291 294 292 const char *name = (dir == USB_DIRECTION_IN) ? "READ" : "WRITE"; 293 294 return bus_device_send_batch(dev, target, dir, 295 (char *) data, size, setup_data, 295 const char *name = (req->dir == USB_DIRECTION_IN) ? "READ" : "WRITE"; 296 297 char *buffer = req->base + req->offset; 298 299 return bus_device_send_batch(dev, target, req->dir, 300 buffer, req->size, req->setup, 296 301 callback, arg, name); 297 302 }
Note:
See TracChangeset
for help on using the changeset viewer.