Changeset 3e23316 in mainline for uspace/drv/bus/usb/usbmast/main.c


Ignore:
Timestamp:
2013-01-26T22:17:49Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb70637
Parents:
a6a5b25
Message:

usbmast: Don't access mapped endpoints directly.

Use provided functions.

File:
1 edited

Legend:

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

    ra6a5b25 r3e23316  
    150150        unsigned i;
    151151
     152        usb_endpoint_mapping_t *epm_in =
     153            usb_device_get_mapped_ep_desc(dev, &bulk_in_ep);
     154        usb_endpoint_mapping_t *epm_out =
     155            usb_device_get_mapped_ep_desc(dev, &bulk_out_ep);
     156        if (!epm_in || !epm_out || !epm_in->present || !epm_out->present) {
     157                usb_log_error("Required EPs were not mapped.\n");
     158                return ENOENT;
     159        }
     160
    152161        /* Allocate softstate */
    153162        mdev = usb_device_data_alloc(dev, sizeof(usbmast_dev_t));
     
    162171            usb_device_get_name(dev));
    163172        usb_log_debug("Bulk in endpoint: %d [%zuB].\n",
    164             dev->pipes[BULK_IN_EP].pipe.endpoint_no,
    165             dev->pipes[BULK_IN_EP].pipe.max_packet_size);
     173            epm_in->pipe.endpoint_no, epm_in->pipe.max_packet_size);
    166174        usb_log_debug("Bulk out endpoint: %d [%zuB].\n",
    167             dev->pipes[BULK_OUT_EP].pipe.endpoint_no,
    168             dev->pipes[BULK_OUT_EP].pipe.max_packet_size);
     175            epm_out->pipe.endpoint_no, epm_out->pipe.max_packet_size);
    169176
    170177        usb_log_debug("Get LUN count...\n");
     
    182189                        goto error;
    183190        }
     191        mdev->bulk_in_pipe = &epm_in->pipe;
     192        mdev->bulk_out_pipe = &epm_out->pipe;
    184193
    185194        return EOK;
Note: See TracChangeset for help on using the changeset viewer.