Changeset df25ab6 in mainline


Ignore:
Timestamp:
2011-05-08T13:38:46Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5dfee52
Parents:
eb2f7dd
Message:

All HC drivers supports "get handle by address"

Location:
uspace/drv
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ehci-hcd/hc_iface.c

    reb2f7dd rdf25ab6  
    106106}
    107107
     108/** Find device handle by USB address.
     109 *
     110 * @param[in] fun DDF function that was called.
     111 * @param[in] address Address in question.
     112 * @param[out] handle Where to store device handle if found.
     113 * @return Error code.
     114 */
     115static int find_by_address(ddf_fun_t *fun, usb_address_t address,
     116    devman_handle_t *handle)
     117{
     118        UNSUPPORTED("find_by_address");
     119
     120        return ENOTSUP;
     121}
     122
    108123/** Release previously requested address.
    109124 *
     
    321336        .request_address = request_address,
    322337        .bind_address = bind_address,
     338        .find_by_address = find_by_address,
    323339        .release_address = release_address,
    324340
  • uspace/drv/ohci/iface.c

    reb2f7dd rdf25ab6  
    122122        return EOK;
    123123}
     124
     125
     126/** Find device handle by address interface function.
     127 *
     128 * @param[in] fun DDF function that was called.
     129 * @param[in] address Address in question.
     130 * @param[out] handle Where to store device handle if found.
     131 * @return Error code.
     132 */
     133static int find_by_address(ddf_fun_t *fun, usb_address_t address,
     134    devman_handle_t *handle)
     135{
     136        assert(fun);
     137        hc_t *hc = fun_to_hc(fun);
     138        assert(hc);
     139        bool found =
     140            usb_device_keeper_find_by_address(&hc->manager, address, handle);
     141        return found ? EOK : ENOENT;
     142}
     143
    124144/*----------------------------------------------------------------------------*/
    125145/** Release address interface function
     
    402422        .request_address = request_address,
    403423        .bind_address = bind_address,
     424        .find_by_address = find_by_address,
    404425        .release_address = release_address,
    405426
  • uspace/drv/uhci-hcd/iface.c

    reb2f7dd rdf25ab6  
    122122        return EOK;
    123123}
     124
     125/** Find device handle by address interface function.
     126 *
     127 * @param[in] fun DDF function that was called.
     128 * @param[in] address Address in question.
     129 * @param[out] handle Where to store device handle if found.
     130 * @return Error code.
     131 */
     132static int find_by_address(ddf_fun_t *fun, usb_address_t address,
     133    devman_handle_t *handle)
     134{
     135        assert(fun);
     136        hc_t *hc = fun_to_hc(fun);
     137        assert(hc);
     138        bool found =
     139            usb_device_keeper_find_by_address(&hc->manager, address, handle);
     140        return found ? EOK : ENOENT;
     141}
     142
    124143/*----------------------------------------------------------------------------*/
    125144/** Release address interface function
     
    352371        .request_address = request_address,
    353372        .bind_address = bind_address,
     373        .find_by_address = find_by_address,
    354374        .release_address = release_address,
    355375
  • uspace/drv/vhc/connhost.c

    reb2f7dd rdf25ab6  
    9494}
    9595
     96/** Find device handle by address interface function.
     97 *
     98 * @param[in] fun DDF function that was called.
     99 * @param[in] address Address in question.
     100 * @param[out] handle Where to store device handle if found.
     101 * @return Error code.
     102 */
     103static int find_by_address(ddf_fun_t *fun, usb_address_t address,
     104    devman_handle_t *handle)
     105{
     106        VHC_DATA(vhc, fun);
     107        bool found =
     108            usb_device_keeper_find_by_address(&vhc->dev_keeper, address, handle);
     109        return found ? EOK : ENOENT;
     110}
     111
    96112/** Release previously requested address.
    97113 *
     
    444460        .request_address = request_address,
    445461        .bind_address = bind_address,
     462        .find_by_address = find_by_address,
    446463        .release_address = release_address,
    447464
Note: See TracChangeset for help on using the changeset viewer.