Changes in uspace/lib/usbdev/src/devpoll.c [9dbfd288:a0487a2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devpoll.c
r9dbfd288 ra0487a2 46 46 /** Data needed for polling. */ 47 47 typedef struct { 48 /** Parameters for automated polling. */ 48 49 usb_device_auto_polling_t auto_polling; 49 50 51 /** USB device to poll. */ 50 52 usb_device_t *dev; 53 /** Device pipe to use for polling. */ 51 54 size_t pipe_index; 55 /** Size of the recieved data. */ 52 56 size_t request_size; 57 /** Data buffer. */ 53 58 uint8_t *buffer; 54 void *custom_arg;55 59 } polling_data_t; 56 60 … … 119 123 ++failed_attempts; 120 124 const bool cont = (params->on_error == NULL) ? true : 121 params->on_error(data->dev, rc, data->custom_arg);125 params->on_error(data->dev, rc, params->arg); 122 126 if (!cont) { 123 127 failed_attempts = params->max_failures; … … 129 133 assert(params->on_data); 130 134 const bool carry_on = params->on_data( 131 data->dev, data->buffer, actual_size, data->custom_arg);135 data->dev, data->buffer, actual_size, params->arg); 132 136 133 137 if (!carry_on) { … … 149 153 150 154 if (params->on_polling_end != NULL) { 151 params->on_polling_end(data->dev, failed, data->custom_arg);155 params->on_polling_end(data->dev, failed, params->arg); 152 156 } 153 157 … … 199 203 .on_polling_end = terminated_callback, 200 204 .on_error = NULL, 205 .arg = arg, 201 206 }; 202 207 203 208 return usb_device_auto_polling(dev, pipe_index, &auto_polling, 204 request_size , arg);209 request_size); 205 210 } 206 211 … … 224 229 int usb_device_auto_polling(usb_device_t *dev, size_t pipe_index, 225 230 const usb_device_auto_polling_t *polling, 226 size_t request_size , void *arg)231 size_t request_size) 227 232 { 228 233 if ((dev == NULL) || (polling == NULL) || (polling->on_data == NULL)) { … … 252 257 polling_data->dev = dev; 253 258 polling_data->pipe_index = pipe_index; 254 polling_data->custom_arg = arg;255 259 256 260 /* Copy provided settings. */
Note:
See TracChangeset
for help on using the changeset viewer.