Changes in uspace/drv/uhci-hcd/iface.c [a7e2f0d:17ceb72] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
ra7e2f0d r17ceb72 26 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 27 */ 28 /** @addtogroup usb28 /** @addtogroup drvusbuhcihc 29 29 * @{ 30 30 */ 31 31 /** @file 32 * @brief UHCI driver 32 * @brief UHCI driver hc interface implementation 33 33 */ 34 34 #include <ddf/driver.h> … … 40 40 41 41 #include "iface.h" 42 #include "uhci .h"42 #include "uhci_hc.h" 43 43 #include "utils/device_keeper.h" 44 44 … … 53 53 { 54 54 assert(fun); 55 uhci_ t *hc = fun_to_uhci(fun);55 uhci_hc_t *hc = fun_to_uhci_hc(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_ t *hc = fun_to_uhci(fun);70 uhci_hc_t *hc = fun_to_uhci_hc(fun); 71 71 assert(hc); 72 72 usb_log_debug("Default address release.\n"); … … 86 86 { 87 87 assert(fun); 88 uhci_ t *hc = fun_to_uhci(fun);88 uhci_hc_t *hc = fun_to_uhci_hc(fun); 89 89 assert(hc); 90 90 assert(address); … … 109 109 { 110 110 assert(fun); 111 uhci_ t *hc = fun_to_uhci(fun);111 uhci_hc_t *hc = fun_to_uhci_hc(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_ t *hc = fun_to_uhci(fun);127 uhci_hc_t *hc = fun_to_uhci_hc(fun); 128 128 assert(hc); 129 129 usb_log_debug("Address release %d.\n", address); … … 148 148 { 149 149 assert(fun); 150 uhci_ t *hc = fun_to_uhci(fun);150 uhci_hc_t *hc = fun_to_uhci_hc(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 } 163 168 return EOK; 164 169 } … … 180 185 { 181 186 assert(fun); 182 uhci_ t *hc = fun_to_uhci(fun);187 uhci_hc_t *hc = fun_to_uhci_hc(fun); 183 188 assert(hc); 184 189 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 192 197 return ENOMEM; 193 198 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 } 194 204 return EOK; 195 205 } … … 211 221 { 212 222 assert(fun); 213 uhci_ t *hc = fun_to_uhci(fun);223 uhci_hc_t *hc = fun_to_uhci_hc(fun); 214 224 assert(hc); 215 225 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 224 234 return ENOMEM; 225 235 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 } 226 241 return EOK; 227 242 } … … 243 258 { 244 259 assert(fun); 245 uhci_ t *hc = fun_to_uhci(fun);260 uhci_hc_t *hc = fun_to_uhci_hc(fun); 246 261 assert(hc); 247 262 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 255 270 return ENOMEM; 256 271 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 } 257 277 return EOK; 258 278 } … … 277 297 { 278 298 assert(fun); 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);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); 284 304 285 305 if (setup_size != 8) … … 293 313 device_keeper_reset_if_need(&hc->device_manager, target, setup_data); 294 314 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 } 295 320 return EOK; 296 321 } … … 315 340 { 316 341 assert(fun); 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);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); 323 348 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 324 349 max_packet_size, speed, data, size, setup_data, setup_size, callback, … … 327 352 return ENOMEM; 328 353 batch_control_read(batch); 329 return EOK; 330 } 331 /*----------------------------------------------------------------------------*/ 332 usbhc_iface_t uhci_iface = { 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 = { 333 363 .reserve_default_address = reserve_default_address, 334 364 .release_default_address = release_default_address,
Note:
See TracChangeset
for help on using the changeset viewer.