Changeset 5a6cc679 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c


Ignore:
Timestamp:
2018-01-31T02:21:24Z (6 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0a9cc2
Parents:
132ab5d1
Message:

Merge commit '50f19b7ee8e94570b5c63896736c4eb49cfa18db' into forwardport

Not all ints are converted to errno_t in xhci tree yet, however it compiles and works :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/usbhub.c

    r132ab5d1 r5a6cc679  
    9999};
    100100
    101 static int usb_set_first_configuration(usb_device_t *);
    102 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *);
     101static errno_t usb_set_first_configuration(usb_device_t *);
     102static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *);
    103103static void usb_hub_over_current(const usb_hub_dev_t *, usb_hub_status_t);
    104 static int usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *);
     104static errno_t usb_hub_polling_init(usb_hub_dev_t *, usb_endpoint_mapping_t *);
    105105static void usb_hub_global_interrupt(const usb_hub_dev_t *);
    106106
    107107static bool usb_hub_polling_error_callback(usb_device_t *dev,
    108         int err_code, void *arg)
     108        errno_t err_code, void *arg)
    109109{
    110110        assert(dev);
     
    125125 * @return error code
    126126 */
    127 int usb_hub_device_add(usb_device_t *usb_dev)
     127errno_t usb_hub_device_add(usb_device_t *usb_dev)
    128128{
    129129        int err;
     
    198198}
    199199
    200 static int usb_hub_cleanup(usb_hub_dev_t *hub)
     200static errno_t usb_hub_cleanup(usb_hub_dev_t *hub)
    201201{
    202202        free(hub->polling.buffer);
     
    228228 * @return error code
    229229 */
    230 int usb_hub_device_remove(usb_device_t *usb_dev)
     230errno_t usb_hub_device_remove(usb_device_t *usb_dev)
    231231{
    232232        assert(usb_dev);
     
    249249 * @return error code
    250250 */
    251 int usb_hub_device_gone(usb_device_t *usb_dev)
     251errno_t usb_hub_device_gone(usb_device_t *usb_dev)
    252252{
    253253        assert(usb_dev);
     
    270270 * @param mapping The mapping of Status Change Endpoint
    271271 */
    272 static int usb_hub_polling_init(usb_hub_dev_t *hub_dev,
     272static errno_t usb_hub_polling_init(usb_hub_dev_t *hub_dev,
    273273        usb_endpoint_mapping_t *mapping)
    274274{
    275         int err;
     275        errno_t err;
    276276        usb_polling_t *polling = &hub_dev->polling;
    277277
     
    369369 * @return error code
    370370 */
    371 static int usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)
     371static errno_t usb_hub_process_hub_specific_info(usb_hub_dev_t *hub_dev)
    372372{
    373373        assert(hub_dev);
     
    382382        usb_hub_descriptor_header_t descriptor;
    383383        size_t received_size;
    384         int opResult = usb_request_get_descriptor(control_pipe,
     384        errno_t opResult = usb_request_get_descriptor(control_pipe,
    385385            USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_DEVICE,
    386386            desc_type, 0, 0, &descriptor,
     
    436436 * @return error code
    437437 */
    438 static int usb_set_first_configuration(usb_device_t *usb_device)
     438static errno_t usb_set_first_configuration(usb_device_t *usb_device)
    439439{
    440440        assert(usb_device);
     
    462462        /* Set configuration. Use the configuration that was in
    463463         * usb_device->descriptors.configuration i.e. The first one. */
    464         int opResult = usb_request_set_configuration(
     464        errno_t opResult = usb_request_set_configuration(
    465465            usb_device_get_default_pipe(usb_device),
    466466            config_descriptor->configuration_number);
     
    500500        /* Over-current condition is gone, it is safe to turn the ports on. */
    501501        for (size_t port = 0; port < hub_dev->port_count; ++port) {
    502                 const int ret = usb_hub_set_port_feature(hub_dev, port,
     502                const errno_t ret = usb_hub_set_port_feature(hub_dev, port,
    503503                    USB_HUB_FEATURE_PORT_POWER);
    504504                if (ret != EOK) {
     
    637637        /* NOTE: We can't use standard USB GET_STATUS request, because
    638638         * hubs reply is 4byte instead of 2 */
    639         const int opResult = usb_pipe_control_read(control_pipe,
     639        const errno_t opResult = usb_pipe_control_read(control_pipe,
    640640            &get_hub_status_request, sizeof(get_hub_status_request),
    641641            &status, sizeof(usb_hub_status_t), &rcvd_size);
     
    655655                usb_hub_over_current(hub_dev, status);
    656656                /* Ack change in hub OC flag */
    657                 const int ret = usb_request_clear_feature(
     657                const errno_t ret = usb_request_clear_feature(
    658658                    control_pipe, USB_REQUEST_TYPE_CLASS,
    659659                    USB_REQUEST_RECIPIENT_DEVICE,
     
    679679                 * Just ACK the change.
    680680                 */
    681                 const int ret = usb_request_clear_feature(
     681                const errno_t ret = usb_request_clear_feature(
    682682                    control_pipe, USB_REQUEST_TYPE_CLASS,
    683683                    USB_REQUEST_RECIPIENT_DEVICE,
Note: See TracChangeset for help on using the changeset viewer.