Changes in uspace/drv/bus/usb/usbmast/main.c [faba839:721d4b6e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/main.c
rfaba839 r721d4b6e 55 55 #define GET_BULK_OUT(dev) ((dev)->pipes[BULK_OUT_EP].pipe) 56 56 57 static constusb_endpoint_description_t bulk_in_ep = {57 static usb_endpoint_description_t bulk_in_ep = { 58 58 .transfer_type = USB_TRANSFER_BULK, 59 59 .direction = USB_DIRECTION_IN, … … 63 63 .flags = 0 64 64 }; 65 static constusb_endpoint_description_t bulk_out_ep = {65 static usb_endpoint_description_t bulk_out_ep = { 66 66 .transfer_type = USB_TRANSFER_BULK, 67 67 .direction = USB_DIRECTION_OUT, … … 72 72 }; 73 73 74 static constusb_endpoint_description_t *mast_endpoints[] = {74 usb_endpoint_description_t *mast_endpoints[] = { 75 75 &bulk_in_ep, 76 76 &bulk_out_ep, … … 106 106 } 107 107 108 /** Callback when a device is about to be removed.109 *110 * @param dev Representation of USB device.111 * @return Error code.112 */113 static int usbmast_device_remove(usb_device_t *dev)114 {115 //TODO: flush buffers, or whatever.116 //TODO: remove device117 return ENOTSUP;118 }119 120 108 /** Callback when new device is attached and recognized as a mass storage. 121 109 * 122 * @param dev Representation of USB device.110 * @param dev Representation of a the USB device. 123 111 * @return Error code. 124 112 */ … … 140 128 141 129 usb_log_info("Initializing mass storage `%s'.\n", dev->ddf_dev->name); 142 usb_log_debug(" Bulk in endpoint: %d [%zuB].\n",143 dev->pipes[BULK_IN_EP].pipe .endpoint_no,144 dev->pipes[BULK_IN_EP].pipe.max_packet_size);130 usb_log_debug(" Bulk in endpoint: %d [%zuB].\n", 131 dev->pipes[BULK_IN_EP].pipe->endpoint_no, 132 (size_t) dev->pipes[BULK_IN_EP].descriptor->max_packet_size); 145 133 usb_log_debug("Bulk out endpoint: %d [%zuB].\n", 146 dev->pipes[BULK_OUT_EP].pipe .endpoint_no,147 dev->pipes[BULK_OUT_EP].pipe.max_packet_size);134 dev->pipes[BULK_OUT_EP].pipe->endpoint_no, 135 (size_t) dev->pipes[BULK_OUT_EP].descriptor->max_packet_size); 148 136 149 137 usb_log_debug("Get LUN count...\n"); … … 300 288 return; 301 289 } 302 303 (void) async_share_out_finalize(callid, &comm_buf);304 if (comm_buf == AS_MAP_FAILED) {290 291 comm_buf = as_get_mappable_page(comm_size); 292 if (comm_buf == NULL) { 305 293 async_answer_0(callid, EHANGUP); 306 294 return; 307 295 } 308 296 297 (void) async_share_out_finalize(callid, comm_buf); 298 309 299 mfun = (usbmast_fun_t *) ((ddf_fun_t *)arg)->driver_data; 310 300 … … 346 336 347 337 /** USB mass storage driver ops. */ 348 static constusb_driver_ops_t usbmast_driver_ops = {338 static usb_driver_ops_t usbmast_driver_ops = { 349 339 .device_add = usbmast_device_add, 350 .device_rem = usbmast_device_remove,351 340 .device_gone = usbmast_device_gone, 352 341 }; 353 342 354 343 /** USB mass storage driver. */ 355 static constusb_driver_t usbmast_driver = {344 static usb_driver_t usbmast_driver = { 356 345 .name = NAME, 357 346 .ops = &usbmast_driver_ops,
Note:
See TracChangeset
for help on using the changeset viewer.