Changeset 960bee9 in mainline for uspace/drv/uhci-hcd/iface.c
- Timestamp:
- 2011-03-07T16:51:59Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 97ff14d
- Parents:
- a6add7a (diff), d4beec3 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
ra6add7a r960bee9 114 114 115 115 batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT, 116 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg); 116 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg, 117 &hc->device_manager); 117 118 if (!batch) 118 119 return ENOMEM; … … 133 134 134 135 batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT, 135 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg); 136 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg, 137 &hc->device_manager); 136 138 if (!batch) 137 139 return ENOMEM; 138 140 batch_interrupt_in(batch); 141 return EOK; 142 } 143 /*----------------------------------------------------------------------------*/ 144 static int bulk_out(ddf_fun_t *fun, usb_target_t target, 145 size_t max_packet_size, void *data, size_t size, 146 usbhc_iface_transfer_out_callback_t callback, void *arg) 147 { 148 assert(fun); 149 uhci_t *hc = fun_to_uhci(fun); 150 assert(hc); 151 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 152 153 usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n", 154 target.address, target.endpoint, size, max_packet_size); 155 156 batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK, 157 max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg, 158 &hc->device_manager); 159 if (!batch) 160 return ENOMEM; 161 batch_bulk_out(batch); 162 return EOK; 163 } 164 /*----------------------------------------------------------------------------*/ 165 static int bulk_in(ddf_fun_t *fun, usb_target_t target, 166 size_t max_packet_size, void *data, size_t size, 167 usbhc_iface_transfer_in_callback_t callback, void *arg) 168 { 169 assert(fun); 170 uhci_t *hc = fun_to_uhci(fun); 171 assert(hc); 172 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 173 usb_log_debug("Bulk IN %d:%d %zu(%zu).\n", 174 target.address, target.endpoint, size, max_packet_size); 175 176 batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK, 177 max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg, 178 &hc->device_manager); 179 if (!batch) 180 return ENOMEM; 181 batch_bulk_in(batch); 139 182 return EOK; 140 183 } … … 152 195 target.address, target.endpoint, size, max_packet_size); 153 196 197 if (setup_size != 8) 198 return EINVAL; 199 154 200 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 155 201 max_packet_size, speed, data, size, setup_data, setup_size, 156 NULL, callback, arg); 157 if (!batch) 158 return ENOMEM; 202 NULL, callback, arg, &hc->device_manager); 203 if (!batch) 204 return ENOMEM; 205 device_keeper_reset_if_need(&hc->device_manager, target, setup_data); 159 206 batch_control_write(batch); 160 207 return EOK; … … 175 222 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 176 223 max_packet_size, speed, data, size, setup_data, setup_size, callback, 177 NULL, arg );224 NULL, arg, &hc->device_manager); 178 225 if (!batch) 179 226 return ENOMEM; … … 181 228 return EOK; 182 229 } 183 184 185 230 /*----------------------------------------------------------------------------*/ 186 231 usbhc_iface_t uhci_iface = { … … 194 239 .interrupt_in = interrupt_in, 195 240 241 .bulk_in = bulk_in, 242 .bulk_out = bulk_out, 243 196 244 .control_read = control_read, 197 245 .control_write = control_write,
Note:
See TracChangeset
for help on using the changeset viewer.