Changeset 361e61b in mainline for uspace/drv/uhci-hcd/iface.c
- Timestamp:
- 2011-03-21T14:23:15Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 55e388a1
- Parents:
- c32688d (diff), 48fe0c9 (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
rc32688d r361e61b 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" 43 #include "utils/device_keeper.h" 42 #include "uhci_hc.h" 44 43 45 44 /** Reserve default address interface function … … 53 52 { 54 53 assert(fun); 55 uhci_ t *hc = fun_to_uhci(fun);54 uhci_hc_t *hc = fun_to_uhci_hc(fun); 56 55 assert(hc); 57 56 usb_log_debug("Default address request with speed %d.\n", speed); … … 68 67 { 69 68 assert(fun); 70 uhci_ t *hc = fun_to_uhci(fun);69 uhci_hc_t *hc = fun_to_uhci_hc(fun); 71 70 assert(hc); 72 71 usb_log_debug("Default address release.\n"); … … 86 85 { 87 86 assert(fun); 88 uhci_ t *hc = fun_to_uhci(fun);87 uhci_hc_t *hc = fun_to_uhci_hc(fun); 89 88 assert(hc); 90 89 assert(address); … … 109 108 { 110 109 assert(fun); 111 uhci_ t *hc = fun_to_uhci(fun);110 uhci_hc_t *hc = fun_to_uhci_hc(fun); 112 111 assert(hc); 113 112 usb_log_debug("Address bind %d-%d.\n", address, handle); … … 125 124 { 126 125 assert(fun); 127 uhci_ t *hc = fun_to_uhci(fun);126 uhci_hc_t *hc = fun_to_uhci_hc(fun); 128 127 assert(hc); 129 128 usb_log_debug("Address release %d.\n", address); … … 148 147 { 149 148 assert(fun); 150 uhci_ t *hc = fun_to_uhci(fun);149 uhci_hc_t *hc = fun_to_uhci_hc(fun); 151 150 assert(hc); 152 151 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 161 160 return ENOMEM; 162 161 batch_interrupt_out(batch); 162 const int ret = uhci_hc_schedule(hc, batch); 163 if (ret != EOK) { 164 batch_dispose(batch); 165 return ret; 166 } 163 167 return EOK; 164 168 } … … 180 184 { 181 185 assert(fun); 182 uhci_ t *hc = fun_to_uhci(fun);186 uhci_hc_t *hc = fun_to_uhci_hc(fun); 183 187 assert(hc); 184 188 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 192 196 return ENOMEM; 193 197 batch_interrupt_in(batch); 198 const int ret = uhci_hc_schedule(hc, batch); 199 if (ret != EOK) { 200 batch_dispose(batch); 201 return ret; 202 } 194 203 return EOK; 195 204 } … … 211 220 { 212 221 assert(fun); 213 uhci_ t *hc = fun_to_uhci(fun);222 uhci_hc_t *hc = fun_to_uhci_hc(fun); 214 223 assert(hc); 215 224 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 224 233 return ENOMEM; 225 234 batch_bulk_out(batch); 235 const int ret = uhci_hc_schedule(hc, batch); 236 if (ret != EOK) { 237 batch_dispose(batch); 238 return ret; 239 } 226 240 return EOK; 227 241 } … … 243 257 { 244 258 assert(fun); 245 uhci_ t *hc = fun_to_uhci(fun);259 uhci_hc_t *hc = fun_to_uhci_hc(fun); 246 260 assert(hc); 247 261 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); … … 255 269 return ENOMEM; 256 270 batch_bulk_in(batch); 271 const int ret = uhci_hc_schedule(hc, batch); 272 if (ret != EOK) { 273 batch_dispose(batch); 274 return ret; 275 } 257 276 return EOK; 258 277 } … … 277 296 { 278 297 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);298 uhci_hc_t *hc = fun_to_uhci_hc(fun); 299 assert(hc); 300 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 301 usb_log_debug("Control WRITE (%d) %d:%d %zu(%zu).\n", 302 speed, target.address, target.endpoint, size, max_packet_size); 284 303 285 304 if (setup_size != 8) … … 293 312 device_keeper_reset_if_need(&hc->device_manager, target, setup_data); 294 313 batch_control_write(batch); 314 const int ret = uhci_hc_schedule(hc, batch); 315 if (ret != EOK) { 316 batch_dispose(batch); 317 return ret; 318 } 295 319 return EOK; 296 320 } … … 315 339 { 316 340 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);341 uhci_hc_t *hc = fun_to_uhci_hc(fun); 342 assert(hc); 343 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 344 345 usb_log_debug("Control READ(%d) %d:%d %zu(%zu).\n", 346 speed, target.address, target.endpoint, size, max_packet_size); 323 347 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 324 348 max_packet_size, speed, data, size, setup_data, setup_size, callback, … … 327 351 return ENOMEM; 328 352 batch_control_read(batch); 329 return EOK; 330 } 331 /*----------------------------------------------------------------------------*/ 332 usbhc_iface_t uhci_iface = { 353 const int ret = uhci_hc_schedule(hc, batch); 354 if (ret != EOK) { 355 batch_dispose(batch); 356 return ret; 357 } 358 return EOK; 359 } 360 /*----------------------------------------------------------------------------*/ 361 usbhc_iface_t uhci_hc_iface = { 333 362 .reserve_default_address = reserve_default_address, 334 363 .release_default_address = release_default_address,
Note:
See TracChangeset
for help on using the changeset viewer.