Changes in uspace/lib/usbdev/src/devpoll.c [b77931d:160b75e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devpoll.c
rb77931d r160b75e 73 73 74 74 usb_pipe_t *pipe 75 = &polling_data->dev->pipes[polling_data->pipe_index].pipe;75 = polling_data->dev->pipes[polling_data->pipe_index].pipe; 76 76 77 77 if (polling_data->debug > 0) { … … 208 208 return EINVAL; 209 209 } 210 if ((dev->pipes[pipe_index].pipe .transfer_type != USB_TRANSFER_INTERRUPT)211 || (dev->pipes[pipe_index].pipe .direction != USB_DIRECTION_IN)) {210 if ((dev->pipes[pipe_index].pipe->transfer_type != USB_TRANSFER_INTERRUPT) 211 || (dev->pipes[pipe_index].pipe->direction != USB_DIRECTION_IN)) { 212 212 return EINVAL; 213 213 } 214 214 215 const usb_device_auto_polling_t auto_polling = { 216 .debug = 1, 217 .auto_clear_halt = true, 218 .delay = 0, 219 .max_failures = MAX_FAILED_ATTEMPTS, 220 .on_data = callback, 221 .on_polling_end = terminated_callback, 222 .on_error = NULL, 223 }; 224 225 return usb_device_auto_polling(dev, pipe_index, &auto_polling, 215 usb_device_auto_polling_t *auto_polling 216 = malloc(sizeof(usb_device_auto_polling_t)); 217 if (auto_polling == NULL) { 218 return ENOMEM; 219 } 220 221 auto_polling->debug = 1; 222 auto_polling->auto_clear_halt = true; 223 auto_polling->delay = 0; 224 auto_polling->max_failures = MAX_FAILED_ATTEMPTS; 225 auto_polling->on_data = callback; 226 auto_polling->on_polling_end = terminated_callback; 227 auto_polling->on_error = NULL; 228 229 int rc = usb_device_auto_polling(dev, pipe_index, auto_polling, 226 230 request_size, arg); 231 232 free(auto_polling); 233 234 return rc; 227 235 } 228 236 … … 245 253 */ 246 254 int usb_device_auto_polling(usb_device_t *dev, size_t pipe_index, 247 constusb_device_auto_polling_t *polling,255 usb_device_auto_polling_t *polling, 248 256 size_t request_size, void *arg) 249 257 { … … 254 262 return EINVAL; 255 263 } 256 if ((dev->pipes[pipe_index].pipe .transfer_type != USB_TRANSFER_INTERRUPT)257 || (dev->pipes[pipe_index].pipe .direction != USB_DIRECTION_IN)) {264 if ((dev->pipes[pipe_index].pipe->transfer_type != USB_TRANSFER_INTERRUPT) 265 || (dev->pipes[pipe_index].pipe->direction != USB_DIRECTION_IN)) { 258 266 return EINVAL; 259 267 }
Note:
See TracChangeset
for help on using the changeset viewer.