Changeset b4b534ac in mainline for uspace/drv/nic/ar9271/ar9271.c


Ignore:
Timestamp:
2016-07-22T08:24:47Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f76d2c2
Parents:
5b18137 (diff), 8351f9a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

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

    r5b18137 rb4b534ac  
    4040#include <stdio.h>
    4141#include <ddf/interrupt.h>
     42#include <errno.h>
    4243#include <nic.h>
    4344#include <macros.h>
     
    771772                size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE);
    772773                memcpy(buffer, current_data, chunk_size);
    773                 int rc = usb_control_request_set(&usb_device->ctrl_pipe,
     774                usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
     775                int rc = usb_control_request_set(ctrl_pipe,
    774776                    USB_REQUEST_TYPE_VENDOR,
    775777                    USB_REQUEST_RECIPIENT_DEVICE,
     
    798800         * device side buffer which we will check in htc_check_ready function.
    799801        */
    800         int rc = usb_control_request_set(&usb_device->ctrl_pipe,
     802        usb_pipe_t *ctrl_pipe = usb_device_get_default_pipe(usb_device);
     803        int rc = usb_control_request_set(ctrl_pipe,
    801804            USB_REQUEST_TYPE_VENDOR,
    802805            USB_REQUEST_RECIPIENT_DEVICE,
     
    828831{
    829832        /* 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        
    836833        const char *err_msg = NULL;
    837         int rc = usb_device_init(usb_device, dev, endpoints, &err_msg);
    838         if (rc != EOK) {
    839                 free(usb_device);
     834        int rc = usb_device_create_ddf(dev, endpoints, &err_msg);
     835        if (rc != EOK) {
    840836                usb_log_error("Failed to create USB device: %s, "
    841837                    "ERR_NUM = %d\n", err_msg, rc);
     
    846842        ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t));
    847843        if (!ar9271) {
    848                 free(usb_device);
    849844                usb_log_error("Failed to allocate memory for device "
    850845                    "structure.\n");
     
    854849        ar9271->ddf_dev = dev;
    855850       
    856         rc = ar9271_init(ar9271, usb_device);
     851        rc = ar9271_init(ar9271, usb_device_get(dev));
    857852        if (rc != EOK) {
    858853                free(ar9271);
    859                 free(usb_device);
    860854                usb_log_error("Failed to initialize AR9271 structure: %d\n",
    861855                    rc);
Note: See TracChangeset for help on using the changeset viewer.