Changes in uspace/drv/uhci-hcd/iface.c [17ceb72:a7e2f0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r17ceb72 ra7e2f0d 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup drvusbuhcihc28 /** @addtogroup usb 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver hc interface implementation32 * @brief UHCI driver 33 33 */ 34 34 #include <ddf/driver.h> … … 40 40 41 41 #include "iface.h" 42 #include "uhci _hc.h"42 #include "uhci.h" 43 43 #include "utils/device_keeper.h" 44 44 … … 53 53 { 54 54 assert(fun); 55 uhci_ hc_t *hc = fun_to_uhci_hc(fun);55 uhci_t *hc = fun_to_uhci(fun); 56 56 assert(hc); 57 57 usb_log_debug("Default address request with speed %d.\n", speed); … … 68 68 { 69 69 assert(fun); 70 uhci_ hc_t *hc = fun_to_uhci_hc(fun);70 uhci_t *hc = fun_to_uhci(fun); 71 71 assert(hc); 72 72 usb_log_debug("Default address release.\n"); … … 86 86 { 87 87 assert(fun); 88 uhci_ hc_t *hc = fun_to_uhci_hc(fun);88 uhci_t *hc = fun_to_uhci(fun); 89 89 assert(hc); 90 90 assert(address); … … 109 109 { 110 110 assert(fun); 111 uhci_ hc_t *hc = fun_to_uhci_hc(fun);111 uhci_t *hc = fun_to_uhci(fun); 112 112 assert(hc); 113 113 usb_log_debug("Address bind %d-%d.\n", address, handle); … … 125 125 { 126 126 assert(fun); 127 uhci_ hc_t *hc = fun_to_uhci_hc(fun);127 uhci_t *hc = fun_to_uhci(fun); 128 128 assert(hc); 129 129 usb_log_debug("Address release %d.\n", address); … … 148 148 { 149 149 assert(fun); 150 uhci_ hc_t *hc = fun_to_uhci_hc(fun);150 uhci_t *hc = fun_to_uhci(fun); 151 151 assert(hc); 152 152 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 161 161 return ENOMEM; 162 162 batch_interrupt_out(batch); 163 const int ret = uhci_hc_schedule(hc, batch);164 if (ret != EOK) {165 batch_dispose(batch);166 return ret;167 }168 163 return EOK; 169 164 } … … 185 180 { 186 181 assert(fun); 187 uhci_ hc_t *hc = fun_to_uhci_hc(fun);182 uhci_t *hc = fun_to_uhci(fun); 188 183 assert(hc); 189 184 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 197 192 return ENOMEM; 198 193 batch_interrupt_in(batch); 199 const int ret = uhci_hc_schedule(hc, batch);200 if (ret != EOK) {201 batch_dispose(batch);202 return ret;203 }204 194 return EOK; 205 195 } … … 221 211 { 222 212 assert(fun); 223 uhci_ hc_t *hc = fun_to_uhci_hc(fun);213 uhci_t *hc = fun_to_uhci(fun); 224 214 assert(hc); 225 215 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 234 224 return ENOMEM; 235 225 batch_bulk_out(batch); 236 const int ret = uhci_hc_schedule(hc, batch);237 if (ret != EOK) {238 batch_dispose(batch);239 return ret;240 }241 226 return EOK; 242 227 } … … 258 243 { 259 244 assert(fun); 260 uhci_ hc_t *hc = fun_to_uhci_hc(fun);245 uhci_t *hc = fun_to_uhci(fun); 261 246 assert(hc); 262 247 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 270 255 return ENOMEM; 271 256 batch_bulk_in(batch); 272 const int ret = uhci_hc_schedule(hc, batch);273 if (ret != EOK) {274 batch_dispose(batch);275 return ret;276 }277 257 return EOK; 278 258 } … … 297 277 { 298 278 assert(fun); 299 uhci_ hc_t *hc = fun_to_uhci_hc(fun);300 assert(hc); 301 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 302 usb_log_debug("Control WRITE (%d)%d:%d %zu(%zu).\n",303 speed,target.address, target.endpoint, size, max_packet_size);279 uhci_t *hc = fun_to_uhci(fun); 280 assert(hc); 281 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 282 usb_log_debug("Control WRITE %d:%d %zu(%zu).\n", 283 target.address, target.endpoint, size, max_packet_size); 304 284 305 285 if (setup_size != 8) … … 313 293 device_keeper_reset_if_need(&hc->device_manager, target, setup_data); 314 294 batch_control_write(batch); 315 const int ret = uhci_hc_schedule(hc, batch);316 if (ret != EOK) {317 batch_dispose(batch);318 return ret;319 }320 295 return EOK; 321 296 } … … 340 315 { 341 316 assert(fun); 342 uhci_ hc_t *hc = fun_to_uhci_hc(fun);343 assert(hc); 344 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 345 346 usb_log_debug("Control READ (%d)%d:%d %zu(%zu).\n",347 speed,target.address, target.endpoint, size, max_packet_size);317 uhci_t *hc = fun_to_uhci(fun); 318 assert(hc); 319 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 320 321 usb_log_debug("Control READ %d:%d %zu(%zu).\n", 322 target.address, target.endpoint, size, max_packet_size); 348 323 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 349 324 max_packet_size, speed, data, size, setup_data, setup_size, callback, … … 352 327 return ENOMEM; 353 328 batch_control_read(batch); 354 const int ret = uhci_hc_schedule(hc, batch); 355 if (ret != EOK) { 356 batch_dispose(batch); 357 return ret; 358 } 359 return EOK; 360 } 361 /*----------------------------------------------------------------------------*/ 362 usbhc_iface_t uhci_hc_iface = { 329 return EOK; 330 } 331 /*----------------------------------------------------------------------------*/ 332 usbhc_iface_t uhci_iface = { 363 333 .reserve_default_address = reserve_default_address, 364 334 .release_default_address = release_default_address,
Note:
See TracChangeset
for help on using the changeset viewer.