Changes in uspace/drv/nic/ar9271/ar9271.c [fe97c5e:8a64320e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/ar9271.c
rfe97c5e r8a64320e 40 40 #include <stdio.h> 41 41 #include <ddf/interrupt.h> 42 #include <errno.h>43 42 #include <nic.h> 44 43 #include <macros.h> … … 772 771 size_t chunk_size = min(remain_size, MAX_TRANSFER_SIZE); 773 772 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, 776 774 USB_REQUEST_TYPE_VENDOR, 777 775 USB_REQUEST_RECIPIENT_DEVICE, … … 800 798 * device side buffer which we will check in htc_check_ready function. 801 799 */ 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, 804 801 USB_REQUEST_TYPE_VENDOR, 805 802 USB_REQUEST_RECIPIENT_DEVICE, … … 831 828 { 832 829 /* 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 833 836 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); 836 840 usb_log_error("Failed to create USB device: %s, " 837 841 "ERR_NUM = %d\n", err_msg, rc); … … 842 846 ar9271_t *ar9271 = calloc(1, sizeof(ar9271_t)); 843 847 if (!ar9271) { 848 free(usb_device); 844 849 usb_log_error("Failed to allocate memory for device " 845 850 "structure.\n"); … … 849 854 ar9271->ddf_dev = dev; 850 855 851 rc = ar9271_init(ar9271, usb_device _get(dev));856 rc = ar9271_init(ar9271, usb_device); 852 857 if (rc != EOK) { 853 858 free(ar9271); 859 free(usb_device); 854 860 usb_log_error("Failed to initialize AR9271 structure: %d\n", 855 861 rc);
Note:
See TracChangeset
for help on using the changeset viewer.