Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/nic/ar9271/ar9271.c

    rfe97c5e r8a64320e  
    4040#include <stdio.h>
    4141#include <ddf/interrupt.h>
    42 #include <errno.h>
    4342#include <nic.h>
    4443#include <macros.h>
     
    772771                size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE);
    773772                memcpy(buffer, current_data, chunk_size);
    774                 usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
    775                 int rc = usb_control_request_set(ctrl_pipe,
     773                int rc = usb_control_request_set(&usb_device->ctrl_pipe,
    776774                    USB_REQUEST_TYPE_VENDOR,
    777775                    USB_REQUEST_RECIPIENT_DEVICE,
     
    800798         * device side buffer which we will check in htc_check_ready function.
    801799        */
    802         usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
    803         int rc = usb_control_request_set(ctrl_pipe,
     800        int rc = usb_control_request_set(&usb_device->ctrl_pipe,
    804801            USB_REQUEST_TYPE_VENDOR,
    805802            USB_REQUEST_RECIPIENT_DEVICE,
     
    831828{
    832829        /* USB framework initialization. */
     830        usb_device_t *usb_device = calloc(1, sizeof(usb_device_t));
     831        if (usb_device == NULL) {
     832                usb_log_error("USB device structure allocation failed.\n");
     833                return NULL;
     834        }
     835       
    833836        const char *err_msg = NULL;
    834         int rc = usb_device_create_ddf(dev, endpoints, &err_msg);
    835         if (rc != EOK) {
     837        int rc = usb_device_init(usb_device, dev, endpoints, &err_msg);
     838        if (rc != EOK) {
     839                free(usb_device);
    836840                usb_log_error("Failed to create USB device: %s, "
    837841                    "ERR_NUM = %d\n", err_msg, rc);
     
    842846        ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t));
    843847        if (!ar9271) {
     848                free(usb_device);
    844849                usb_log_error("Failed to allocate memory for device "
    845850                    "structure.\n");
     
    849854        ar9271->ddf_dev = dev;
    850855       
    851         rc = ar9271_init(ar9271, usb_device_get(dev));
     856        rc = ar9271_init(ar9271, usb_device);
    852857        if (rc != EOK) {
    853858                free(ar9271);
     859                free(usb_device);
    854860                usb_log_error("Failed to initialize AR9271 structure: %d\n",
    855861                    rc);
Note: See TracChangeset for help on using the changeset viewer.