Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/iface.c

    r17ceb72 ra7e2f0d  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcihc
     28/** @addtogroup usb
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI driver hc interface implementation
     32 * @brief UHCI driver
    3333 */
    3434#include <ddf/driver.h>
     
    4040
    4141#include "iface.h"
    42 #include "uhci_hc.h"
     42#include "uhci.h"
    4343#include "utils/device_keeper.h"
    4444
     
    5353{
    5454        assert(fun);
    55         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     55        uhci_t *hc = fun_to_uhci(fun);
    5656        assert(hc);
    5757        usb_log_debug("Default address request with speed %d.\n", speed);
     
    6868{
    6969        assert(fun);
    70         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     70        uhci_t *hc = fun_to_uhci(fun);
    7171        assert(hc);
    7272        usb_log_debug("Default address release.\n");
     
    8686{
    8787        assert(fun);
    88         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     88        uhci_t *hc = fun_to_uhci(fun);
    8989        assert(hc);
    9090        assert(address);
     
    109109{
    110110        assert(fun);
    111         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     111        uhci_t *hc = fun_to_uhci(fun);
    112112        assert(hc);
    113113        usb_log_debug("Address bind %d-%d.\n", address, handle);
     
    125125{
    126126        assert(fun);
    127         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     127        uhci_t *hc = fun_to_uhci(fun);
    128128        assert(hc);
    129129        usb_log_debug("Address release %d.\n", address);
     
    148148{
    149149        assert(fun);
    150         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     150        uhci_t *hc = fun_to_uhci(fun);
    151151        assert(hc);
    152152        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     
    161161                return ENOMEM;
    162162        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         }
    168163        return EOK;
    169164}
     
    185180{
    186181        assert(fun);
    187         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     182        uhci_t *hc = fun_to_uhci(fun);
    188183        assert(hc);
    189184        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     
    197192                return ENOMEM;
    198193        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         }
    204194        return EOK;
    205195}
     
    221211{
    222212        assert(fun);
    223         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     213        uhci_t *hc = fun_to_uhci(fun);
    224214        assert(hc);
    225215        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     
    234224                return ENOMEM;
    235225        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         }
    241226        return EOK;
    242227}
     
    258243{
    259244        assert(fun);
    260         uhci_hc_t *hc = fun_to_uhci_hc(fun);
     245        uhci_t *hc = fun_to_uhci(fun);
    261246        assert(hc);
    262247        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     
    270255                return ENOMEM;
    271256        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         }
    277257        return EOK;
    278258}
     
    297277{
    298278        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);
    304284
    305285        if (setup_size != 8)
     
    313293        device_keeper_reset_if_need(&hc->device_manager, target, setup_data);
    314294        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         }
    320295        return EOK;
    321296}
     
    340315{
    341316        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);
    348323        batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    349324            max_packet_size, speed, data, size, setup_data, setup_size, callback,
     
    352327                return ENOMEM;
    353328        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/*----------------------------------------------------------------------------*/
     332usbhc_iface_t uhci_iface = {
    363333        .reserve_default_address = reserve_default_address,
    364334        .release_default_address = release_default_address,
Note: See TracChangeset for help on using the changeset viewer.