Changeset a0487a2 in mainline for uspace/lib/usbdev/src/devpoll.c
- Timestamp:
- 2011-12-14T16:04:52Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5dd4294b
- Parents:
- 6e3c005
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devpoll.c
r6e3c005 ra0487a2 57 57 /** Data buffer. */ 58 58 uint8_t *buffer; 59 /** Argument to pass to callbacks. */60 void *custom_arg;61 59 } polling_data_t; 62 60 … … 125 123 ++failed_attempts; 126 124 const bool cont = (params->on_error == NULL) ? true : 127 params->on_error(data->dev, rc, data->custom_arg);125 params->on_error(data->dev, rc, params->arg); 128 126 if (!cont) { 129 127 failed_attempts = params->max_failures; … … 135 133 assert(params->on_data); 136 134 const bool carry_on = params->on_data( 137 data->dev, data->buffer, actual_size, data->custom_arg);135 data->dev, data->buffer, actual_size, params->arg); 138 136 139 137 if (!carry_on) { … … 155 153 156 154 if (params->on_polling_end != NULL) { 157 params->on_polling_end(data->dev, failed, data->custom_arg);155 params->on_polling_end(data->dev, failed, params->arg); 158 156 } 159 157 … … 205 203 .on_polling_end = terminated_callback, 206 204 .on_error = NULL, 205 .arg = arg, 207 206 }; 208 207 209 208 return usb_device_auto_polling(dev, pipe_index, &auto_polling, 210 request_size , arg);209 request_size); 211 210 } 212 211 … … 230 229 int usb_device_auto_polling(usb_device_t *dev, size_t pipe_index, 231 230 const usb_device_auto_polling_t *polling, 232 size_t request_size , void *arg)231 size_t request_size) 233 232 { 234 233 if ((dev == NULL) || (polling == NULL) || (polling->on_data == NULL)) { … … 258 257 polling_data->dev = dev; 259 258 polling_data->pipe_index = pipe_index; 260 polling_data->custom_arg = arg;261 259 262 260 /* Copy provided settings. */
Note:
See TracChangeset
for help on using the changeset viewer.