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


Ignore:
Timestamp:
2015-06-28T17:11:59Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dca8fe5
Parents:
fb1007ef
Message:

ar9271: Adapt to new usb api

File:
1 edited

Legend:

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

    rfb1007ef rfe97c5e  
    772772                size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE);
    773773                memcpy(buffer, current_data, chunk_size);
    774                 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,
    775776                    USB_REQUEST_TYPE_VENDOR,
    776777                    USB_REQUEST_RECIPIENT_DEVICE,
     
    799800         * device side buffer which we will check in htc_check_ready function.
    800801        */
    801         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,
    802804            USB_REQUEST_TYPE_VENDOR,
    803805            USB_REQUEST_RECIPIENT_DEVICE,
     
    829831{
    830832        /* USB framework initialization. */
    831         usb_device_t *usb_device = calloc(1, sizeof(usb_device_t));
    832         if (usb_device == NULL) {
    833                 usb_log_error("USB device structure allocation failed.\n");
    834                 return NULL;
    835         }
    836        
    837833        const char *err_msg = NULL;
    838         int rc = usb_device_init(usb_device, dev, endpoints, &err_msg);
    839         if (rc != EOK) {
    840                 free(usb_device);
     834        int rc = usb_device_create_ddf(dev, endpoints, &err_msg);
     835        if (rc != EOK) {
    841836                usb_log_error("Failed to create USB device: %s, "
    842837                    "ERR_NUM = %d\n", err_msg, rc);
     
    847842        ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t));
    848843        if (!ar9271) {
    849                 free(usb_device);
    850844                usb_log_error("Failed to allocate memory for device "
    851845                    "structure.\n");
     
    855849        ar9271->ddf_dev = dev;
    856850       
    857         rc = ar9271_init(ar9271, usb_device);
     851        rc = ar9271_init(ar9271, usb_device_get(dev));
    858852        if (rc != EOK) {
    859853                free(ar9271);
    860                 free(usb_device);
    861854                usb_log_error("Failed to initialize AR9271 structure: %d\n",
    862855                    rc);
Note: See TracChangeset for help on using the changeset viewer.