Changeset b0beee82 in mainline for uspace/drv/ohci/iface.c


Ignore:
Timestamp:
2011-03-21T11:19:30Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a6d1bc1
Parents:
bab71635
Message:

Implement address reservation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/iface.c

    rbab71635 rb0beee82  
    6767  return EOK;
    6868}
    69 
     69/*----------------------------------------------------------------------------*/
    7070/** Release default address.
    7171 *
     
    7575static int release_default_address(ddf_fun_t *fun)
    7676{
    77         UNSUPPORTED("release_default_address");
    78 
    79         return ENOTSUP;
    80 }
    81 
     77  assert(fun);
     78  hc_t *hc = fun_to_hc(fun);
     79  assert(hc);
     80  usb_log_debug("Default address release.\n");
     81  device_keeper_release_default(&hc->manager);
     82  return EOK;
     83}
     84/*----------------------------------------------------------------------------*/
    8285/** Found free USB address.
    8386 *
     
    9093    usb_address_t *address)
    9194{
    92         UNSUPPORTED("request_address");
    93 
    94         return ENOTSUP;
    95 }
    96 
     95  assert(fun);
     96  hc_t *hc = fun_to_hc(fun);
     97  assert(hc);
     98  assert(address);
     99
     100  usb_log_debug("Address request with speed %d.\n", speed);
     101  *address = device_keeper_request(&hc->manager, speed);
     102  usb_log_debug("Address request with result: %d.\n", *address);
     103  if (*address <= 0)
     104    return *address;
     105  return EOK;
     106}
     107/*----------------------------------------------------------------------------*/
    97108/** Bind USB address with device devman handle.
    98109 *
     
    105116    usb_address_t address, devman_handle_t handle)
    106117{
    107         UNSUPPORTED("bind_address");
    108 
    109         return ENOTSUP;
    110 }
    111 
     118  assert(fun);
     119  hc_t *hc = fun_to_hc(fun);
     120  assert(hc);
     121  usb_log_debug("Address bind %d-%d.\n", address, handle);
     122  device_keeper_bind(&hc->manager, address, handle);
     123  return EOK;
     124}
     125/*----------------------------------------------------------------------------*/
    112126/** Release previously requested address.
    113127 *
     
    118132static int release_address(ddf_fun_t *fun, usb_address_t address)
    119133{
    120         UNSUPPORTED("release_address");
    121 
    122         return ENOTSUP;
     134  assert(fun);
     135  hc_t *hc = fun_to_hc(fun);
     136  assert(hc);
     137  usb_log_debug("Address release %d.\n", address);
     138  device_keeper_release(&hc->manager, address);
     139  return EOK;
    123140}
    124141
Note: See TracChangeset for help on using the changeset viewer.