Changes in uspace/drv/uhci-hcd/iface.c [1ae51ae:357a302] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r1ae51ae r357a302 32 32 * @brief UHCI driver 33 33 */ 34 #include <d df/driver.h>34 #include <driver.h> 35 35 #include <remote_usbhc.h> 36 36 … … 41 41 #include "iface.h" 42 42 #include "uhci.h" 43 #include "utils/device_keeper.h"44 43 45 44 /*----------------------------------------------------------------------------*/ 46 static int reserve_default_address(d df_fun_t *fun, usb_speed_t speed)45 static int reserve_default_address(device_t *dev, usb_speed_t speed) 47 46 { 48 assert( fun);49 uhci_t *hc = fun_to_uhci(fun);47 assert(dev); 48 uhci_t *hc = dev_to_uhci(dev); 50 49 assert(hc); 51 usb_log_debug("Default address request with speed %d.\n", speed); 52 device_keeper_reserve_default(&hc->device_manager, speed); 50 usb_address_keeping_reserve_default(&hc->address_manager); 53 51 return EOK; 54 52 } 55 53 /*----------------------------------------------------------------------------*/ 56 static int release_default_address(d df_fun_t *fun)54 static int release_default_address(device_t *dev) 57 55 { 58 assert( fun);59 uhci_t *hc = fun_to_uhci(fun);56 assert(dev); 57 uhci_t *hc = dev_to_uhci(dev); 60 58 assert(hc); 61 usb_log_debug("Default address release.\n"); 62 device_keeper_release_default(&hc->device_manager); 59 usb_address_keeping_release_default(&hc->address_manager); 63 60 return EOK; 64 61 } 65 62 /*----------------------------------------------------------------------------*/ 66 static int request_address(d df_fun_t *fun, usb_speed_t speed,63 static int request_address(device_t *dev, usb_speed_t speed, 67 64 usb_address_t *address) 68 65 { 69 assert( fun);70 uhci_t *hc = fun_to_uhci(fun);66 assert(dev); 67 uhci_t *hc = dev_to_uhci(dev); 71 68 assert(hc); 72 assert(address); 73 74 usb_log_debug("Address request with speed %d.\n", speed); 75 *address = device_keeper_request(&hc->device_manager, speed); 76 usb_log_debug("Address request with result: %d.\n", *address); 69 *address = usb_address_keeping_request(&hc->address_manager); 77 70 if (*address <= 0) 78 71 return *address; … … 81 74 /*----------------------------------------------------------------------------*/ 82 75 static int bind_address( 83 d df_fun_t *fun, usb_address_t address, devman_handle_t handle)76 device_t *dev, usb_address_t address, devman_handle_t handle) 84 77 { 85 assert( fun);86 uhci_t *hc = fun_to_uhci(fun);78 assert(dev); 79 uhci_t *hc = dev_to_uhci(dev); 87 80 assert(hc); 88 usb_log_debug("Address bind %d-%d.\n", address, handle); 89 device_keeper_bind(&hc->device_manager, address, handle); 81 usb_address_keeping_devman_bind(&hc->address_manager, address, handle); 90 82 return EOK; 91 83 } 92 84 /*----------------------------------------------------------------------------*/ 93 static int release_address(d df_fun_t *fun, usb_address_t address)85 static int release_address(device_t *dev, usb_address_t address) 94 86 { 95 assert( fun);96 uhci_t *hc = fun_to_uhci(fun);87 assert(dev); 88 uhci_t *hc = dev_to_uhci(dev); 97 89 assert(hc); 98 usb_log_debug("Address release %d.\n", address); 99 device_keeper_release(&hc->device_manager, address); 90 usb_address_keeping_release_default(&hc->address_manager); 100 91 return EOK; 101 92 } 102 93 /*----------------------------------------------------------------------------*/ 103 static int interrupt_out(ddf_fun_t *fun, usb_target_t target, 104 size_t max_packet_size, void *data, size_t size, 94 static int interrupt_out(device_t *dev, usb_target_t target, 95 size_t max_packet_size, 96 void *data, size_t size, 105 97 usbhc_iface_transfer_out_callback_t callback, void *arg) 106 98 { 107 assert(fun); 108 uhci_t *hc = fun_to_uhci(fun); 109 assert(hc); 110 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 99 dev_speed_t speed = FULL_SPEED; 111 100 112 usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n", 113 target.address, target.endpoint, size, max_packet_size); 114 115 batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT, 101 batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT, 116 102 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg); 117 103 if (!batch) … … 121 107 } 122 108 /*----------------------------------------------------------------------------*/ 123 static int interrupt_in(ddf_fun_t *fun, usb_target_t target, 124 size_t max_packet_size, void *data, size_t size, 109 static int interrupt_in(device_t *dev, usb_target_t target, 110 size_t max_packet_size, 111 void *data, size_t size, 125 112 usbhc_iface_transfer_in_callback_t callback, void *arg) 126 113 { 127 assert(fun); 128 uhci_t *hc = fun_to_uhci(fun); 129 assert(hc); 130 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 131 usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n", 132 target.address, target.endpoint, size, max_packet_size); 114 dev_speed_t speed = FULL_SPEED; 133 115 134 batch_t *batch = batch_get( fun, target, USB_TRANSFER_INTERRUPT,116 batch_t *batch = batch_get(dev, target, USB_TRANSFER_INTERRUPT, 135 117 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg); 136 118 if (!batch) … … 140 122 } 141 123 /*----------------------------------------------------------------------------*/ 142 static int control_write(d df_fun_t *fun, usb_target_t target,124 static int control_write(device_t *dev, usb_target_t target, 143 125 size_t max_packet_size, 144 126 void *setup_data, size_t setup_size, void *data, size_t size, 145 127 usbhc_iface_transfer_out_callback_t callback, void *arg) 146 128 { 147 assert(fun); 148 uhci_t *hc = fun_to_uhci(fun); 149 assert(hc); 150 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 151 usb_log_debug("Control WRITE %d:%d %zu(%zu).\n", 152 target.address, target.endpoint, size, max_packet_size); 129 dev_speed_t speed = FULL_SPEED; 153 130 154 batch_t *batch = batch_get( fun, target, USB_TRANSFER_CONTROL,131 batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL, 155 132 max_packet_size, speed, data, size, setup_data, setup_size, 156 133 NULL, callback, arg); … … 161 138 } 162 139 /*----------------------------------------------------------------------------*/ 163 static int control_read(d df_fun_t *fun, usb_target_t target,140 static int control_read(device_t *dev, usb_target_t target, 164 141 size_t max_packet_size, 165 142 void *setup_data, size_t setup_size, void *data, size_t size, 166 143 usbhc_iface_transfer_in_callback_t callback, void *arg) 167 144 { 168 assert(fun); 169 uhci_t *hc = fun_to_uhci(fun); 170 assert(hc); 171 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 145 dev_speed_t speed = FULL_SPEED; 172 146 173 usb_log_debug("Control READ %d:%d %zu(%zu).\n", 174 target.address, target.endpoint, size, max_packet_size); 175 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 147 batch_t *batch = batch_get(dev, target, USB_TRANSFER_CONTROL, 176 148 max_packet_size, speed, data, size, setup_data, setup_size, callback, 177 149 NULL, arg);
Note:
See TracChangeset
for help on using the changeset viewer.