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