Changeset 7c10198 in mainline


Ignore:
Timestamp:
2013-08-02T11:27:51Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9d15d1b
Parents:
fdec59b
Message:

libdrv: Remove usb enpoint register/unregister from usb hc iface

nothing is using this, and nothing should

Location:
uspace/lib/drv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_usbhc.c

    rfdec59b r7c10198  
    8484 */
    8585typedef enum {
    86         /** Register endpoint attributes at host controller.
    87          * This is used to reserve portion of USB bandwidth.
    88          * When speed is invalid, speed of the device is used.
    89          * Parameters:
    90          * - USB address + endpoint number
    91          *   - packed as ADDR << 16 + EP
    92          * - speed + transfer type + direction
    93          *   - packed as ( SPEED << 8 + TYPE ) << 8 + DIR
    94          * - maximum packet size + interval (in milliseconds)
    95          *   - packed as MPS << 16 + INT
    96          * Answer:
    97          * - EOK - reservation successful
    98          * - ELIMIT - not enough bandwidth to satisfy the request
    99          */
    100         IPC_M_USBHC_REGISTER_ENDPOINT,
    101 
    102         /** Revert endpoint registration.
    103          * Parameters:
    104          * - USB address
    105          * - endpoint number
    106          * - data direction
    107          * Answer:
    108          * - EOK - endpoint unregistered
    109          * - ENOENT - unknown endpoint
    110          */
    111         IPC_M_USBHC_UNREGISTER_ENDPOINT,
    112 
    11386        /** Get data from device.
    11487         * See explanation at usb_iface_funcs_t (IN transaction).
     
    12194        IPC_M_USBHC_WRITE,
    12295} usbhc_iface_funcs_t;
    123 
    124 int usbhc_register_endpoint(async_exch_t *exch, usb_address_t address,
    125     usb_endpoint_t endpoint, usb_transfer_type_t type,
    126     usb_direction_t direction, size_t mps, unsigned interval)
    127 {
    128         if (!exch)
    129                 return EBADMEM;
    130         const usb_target_t target =
    131             {{ .address = address, .endpoint = endpoint }};
    132 #define _PACK2(high, low) (((high & 0xffff) << 16) | (low & 0xffff))
    133 
    134         return async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    135             IPC_M_USBHC_REGISTER_ENDPOINT, target.packed,
    136             _PACK2(type, direction), _PACK2(mps, interval));
    137 
    138 #undef _PACK2
    139 }
    140 
    141 int usbhc_unregister_endpoint(async_exch_t *exch, usb_address_t address,
    142     usb_endpoint_t endpoint, usb_direction_t direction)
    143 {
    144         if (!exch)
    145                 return EBADMEM;
    146         return async_req_4_0(exch, DEV_IFACE_ID(USBHC_DEV_IFACE),
    147             IPC_M_USBHC_UNREGISTER_ENDPOINT, address, endpoint, direction);
    148 }
    14996
    15097int usbhc_read(async_exch_t *exch, usb_address_t address,
     
    240187}
    241188
    242 
    243 static void remote_usbhc_register_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    244 static void remote_usbhc_unregister_endpoint(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    245189static void remote_usbhc_read(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    246190static void remote_usbhc_write(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    247 //static void remote_usbhc(ddf_fun_t *, void *, ipc_callid_t, ipc_call_t *);
    248191
    249192/** Remote USB host controller interface operations. */
    250193static remote_iface_func_ptr_t remote_usbhc_iface_ops[] = {
    251         [IPC_M_USBHC_REGISTER_ENDPOINT] = remote_usbhc_register_endpoint,
    252         [IPC_M_USBHC_UNREGISTER_ENDPOINT] = remote_usbhc_unregister_endpoint,
    253 
    254194        [IPC_M_USBHC_READ] = remote_usbhc_read,
    255195        [IPC_M_USBHC_WRITE] = remote_usbhc_write,
     
    328268}
    329269
    330 void remote_usbhc_register_endpoint(ddf_fun_t *fun, void *iface,
    331     ipc_callid_t callid, ipc_call_t *call)
    332 {
    333         usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    334 
    335         if (!usb_iface->register_endpoint) {
    336                 async_answer_0(callid, ENOTSUP);
    337                 return;
    338         }
    339 
    340 #define _INIT_FROM_HIGH_DATA2(type, var, arg_no) \
    341         type var = (type) (DEV_IPC_GET_ARG##arg_no(*call) >> 16)
    342 #define _INIT_FROM_LOW_DATA2(type, var, arg_no) \
    343         type var = (type) (DEV_IPC_GET_ARG##arg_no(*call) & 0xffff)
    344 
    345         const usb_target_t target = { .packed = DEV_IPC_GET_ARG1(*call) };
    346 
    347         _INIT_FROM_HIGH_DATA2(usb_transfer_type_t, transfer_type, 2);
    348         _INIT_FROM_LOW_DATA2(usb_direction_t, direction, 2);
    349 
    350         _INIT_FROM_HIGH_DATA2(size_t, max_packet_size, 3);
    351         _INIT_FROM_LOW_DATA2(unsigned int, interval, 3);
    352 
    353 #undef _INIT_FROM_HIGH_DATA2
    354 #undef _INIT_FROM_LOW_DATA2
    355 
    356         int rc = usb_iface->register_endpoint(fun, target.address,
    357             target.endpoint, transfer_type, direction, max_packet_size, interval);
    358 
    359         async_answer_0(callid, rc);
    360 }
    361 
    362 void remote_usbhc_unregister_endpoint(ddf_fun_t *fun, void *iface,
    363     ipc_callid_t callid, ipc_call_t *call)
    364 {
    365         usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    366 
    367         if (!usb_iface->unregister_endpoint) {
    368                 async_answer_0(callid, ENOTSUP);
    369                 return;
    370         }
    371 
    372         usb_address_t address = (usb_address_t) DEV_IPC_GET_ARG1(*call);
    373         usb_endpoint_t endpoint = (usb_endpoint_t) DEV_IPC_GET_ARG2(*call);
    374         usb_direction_t direction = (usb_direction_t) DEV_IPC_GET_ARG3(*call);
    375 
    376         int rc = usb_iface->unregister_endpoint(fun,
    377             address, endpoint, direction);
    378 
    379         async_answer_0(callid, rc);
    380 }
    381 
    382270void remote_usbhc_read(
    383271    ddf_fun_t *fun, void *iface, ipc_callid_t callid, ipc_call_t *call)
  • uspace/lib/drv/include/usbhc_iface.h

    rfdec59b r7c10198  
    4444#include <stdbool.h>
    4545
    46 int usbhc_register_endpoint(async_exch_t *, usb_address_t, usb_endpoint_t,
    47     usb_transfer_type_t, usb_direction_t, size_t, unsigned int);
    48 int usbhc_unregister_endpoint(async_exch_t *, usb_address_t, usb_endpoint_t,
    49     usb_direction_t);
    5046int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
    5147    uint64_t, void *, size_t, size_t *);
     
    6157/** USB host controller communication interface. */
    6258typedef struct {
    63         int (*register_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t,
    64             usb_transfer_type_t, usb_direction_t, size_t, unsigned int);
    65         int (*unregister_endpoint)(ddf_fun_t *, usb_address_t, usb_endpoint_t,
    66             usb_direction_t);
    67 
    6859        int (*read)(ddf_fun_t *, usb_target_t, uint64_t, uint8_t *, size_t,
    6960            usbhc_iface_transfer_in_callback_t, void *);
Note: See TracChangeset for help on using the changeset viewer.