Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmast/main.c

    rfaba839 r721d4b6e  
    5555#define GET_BULK_OUT(dev) ((dev)->pipes[BULK_OUT_EP].pipe)
    5656
    57 static const usb_endpoint_description_t bulk_in_ep = {
     57static usb_endpoint_description_t bulk_in_ep = {
    5858        .transfer_type = USB_TRANSFER_BULK,
    5959        .direction = USB_DIRECTION_IN,
     
    6363        .flags = 0
    6464};
    65 static const usb_endpoint_description_t bulk_out_ep = {
     65static usb_endpoint_description_t bulk_out_ep = {
    6666        .transfer_type = USB_TRANSFER_BULK,
    6767        .direction = USB_DIRECTION_OUT,
     
    7272};
    7373
    74 static const usb_endpoint_description_t *mast_endpoints[] = {
     74usb_endpoint_description_t *mast_endpoints[] = {
    7575        &bulk_in_ep,
    7676        &bulk_out_ep,
     
    106106}
    107107
    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 
    120108/** Callback when new device is attached and recognized as a mass storage.
    121109 *
    122  * @param dev Representation of USB device.
     110 * @param dev Representation of a the USB device.
    123111 * @return Error code.
    124112 */
     
    140128
    141129        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);
    145133        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);
    148136
    149137        usb_log_debug("Get LUN count...\n");
     
    300288                return;
    301289        }
    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) {
    305293                async_answer_0(callid, EHANGUP);
    306294                return;
    307295        }
    308        
     296
     297        (void) async_share_out_finalize(callid, comm_buf);
     298
    309299        mfun = (usbmast_fun_t *) ((ddf_fun_t *)arg)->driver_data;
    310300
     
    346336
    347337/** USB mass storage driver ops. */
    348 static const usb_driver_ops_t usbmast_driver_ops = {
     338static usb_driver_ops_t usbmast_driver_ops = {
    349339        .device_add = usbmast_device_add,
    350         .device_rem = usbmast_device_remove,
    351340        .device_gone = usbmast_device_gone,
    352341};
    353342
    354343/** USB mass storage driver. */
    355 static const usb_driver_t usbmast_driver = {
     344static usb_driver_t usbmast_driver = {
    356345        .name = NAME,
    357346        .ops = &usbmast_driver_ops,
Note: See TracChangeset for help on using the changeset viewer.