Changeset cb59f787 in mainline


Ignore:
Timestamp:
2010-11-21T09:22:41Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3f8c1f7
Parents:
32eceb4f
Message:

Rename USB interface to USBHC

USB devices themselves could have their own interface for some
general querying. This name thus seems more apropriate.

Location:
uspace/lib
Files:
5 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/dev_iface.h

    r32eceb4f rcb59f787  
    3838        HW_RES_DEV_IFACE = 0,   
    3939        CHAR_DEV_IFACE,
    40         USB_DEV_IFACE,
     40
     41        /** Interface provided by USB host controller. */
     42        USBHC_DEV_IFACE,
     43
    4144        // TODO add more interfaces
    4245        DEV_IFACE_MAX
  • uspace/lib/drv/Makefile

    r32eceb4f rcb59f787  
    3636        generic/dev_iface.c \
    3737        generic/remote_res.c \
    38         generic/remote_usb.c \
     38        generic/remote_usbhc.c \
    3939        generic/remote_char.c
    4040
  • uspace/lib/drv/generic/dev_iface.c

    r32eceb4f rcb59f787  
    3939#include "remote_res.h"
    4040#include "remote_char.h"
    41 #include "remote_usb.h"
     41#include "remote_usbhc.h"
    4242
    4343static iface_dipatch_table_t remote_ifaces = {
     
    4545                &remote_res_iface,
    4646                &remote_char_iface,
    47                 &remote_usb_iface
     47                &remote_usbhc_iface
    4848        }
    4949};
  • uspace/lib/drv/generic/remote_usbhc.c

    r32eceb4f rcb59f787  
    3737#include <errno.h>
    3838
    39 #include "usb_iface.h"
     39#include "usbhc_iface.h"
    4040#include "driver.h"
    4141
    4242#define USB_MAX_PAYLOAD_SIZE 1020
    4343
    44 static void remote_usb_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *);
    45 static void remote_usb_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
    46 static void remote_usb_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
     44static void remote_usbhc_get_buffer(device_t *, void *, ipc_callid_t, ipc_call_t *);
     45static void remote_usbhc_interrupt_out(device_t *, void *, ipc_callid_t, ipc_call_t *);
     46static void remote_usbhc_interrupt_in(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4747//static void remote_usb(device_t *, void *, ipc_callid_t, ipc_call_t *);
    4848
    4949/** Remote USB interface operations. */
    50 static remote_iface_func_ptr_t remote_usb_iface_ops [] = {
    51         &remote_usb_get_buffer,
    52         &remote_usb_interrupt_out,
    53         &remote_usb_interrupt_in
     50static remote_iface_func_ptr_t remote_usbhc_iface_ops [] = {
     51        &remote_usbhc_get_buffer,
     52        &remote_usbhc_interrupt_out,
     53        &remote_usbhc_interrupt_in
    5454};
    5555
    5656/** Remote USB interface structure.
    5757 */
    58 remote_iface_t remote_usb_iface = {
    59         .method_count = sizeof(remote_usb_iface_ops) /
    60             sizeof(remote_usb_iface_ops[0]),
    61         .methods = remote_usb_iface_ops
     58remote_iface_t remote_usbhc_iface = {
     59        .method_count = sizeof(remote_usbhc_iface_ops) /
     60            sizeof(remote_usbhc_iface_ops[0]),
     61        .methods = remote_usbhc_iface_ops
    6262};
    6363
     
    6969
    7070
    71 void remote_usb_get_buffer(device_t *device, void *iface,
     71void remote_usbhc_get_buffer(device_t *device, void *iface,
    7272    ipc_callid_t callid, ipc_call_t *call)
    7373{
     
    125125}
    126126
    127 void remote_usb_interrupt_out(device_t *device, void *iface,
     127void remote_usbhc_interrupt_out(device_t *device, void *iface,
    128128            ipc_callid_t callid, ipc_call_t *call)
    129129{
    130         usb_iface_t *usb_iface = (usb_iface_t *) iface;
     130        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    131131
    132132        size_t expected_len = IPC_GET_ARG3(*call);
     
    168168}
    169169
    170 void remote_usb_interrupt_in(device_t *device, void *iface,
     170void remote_usbhc_interrupt_in(device_t *device, void *iface,
    171171            ipc_callid_t callid, ipc_call_t *call)
    172172{
    173         usb_iface_t *usb_iface = (usb_iface_t *) iface;
     173        usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;
    174174
    175175        size_t len = IPC_GET_ARG3(*call);
  • uspace/lib/drv/include/remote_usbhc.h

    r32eceb4f rcb59f787  
    3333 */
    3434
    35 #ifndef LIBDRV_REMOTE_USB_H_
    36 #define LIBDRV_REMOTE_USB_H_
     35#ifndef LIBDRV_REMOTE_USBHC_H_
     36#define LIBDRV_REMOTE_USBHC_H_
    3737
    38 remote_iface_t remote_usb_iface;
     38remote_iface_t remote_usbhc_iface;
    3939
    4040#endif
  • uspace/lib/drv/include/usbhc_iface.h

    r32eceb4f rcb59f787  
    3434 */
    3535
    36 #ifndef LIBDRV_USB_IFACE_H_
    37 #define LIBDRV_USB_IFACE_H_
     36#ifndef LIBDRV_USBHC_IFACE_H_
     37#define LIBDRV_USBHC_IFACE_H_
    3838
    3939#include "driver.h"
     
    4646 *
    4747 * Methods for sending data to device (OUT transactions)
    48  * - e.g. IPC_M_USB_INTERRUPT_OUT -
     48 * - e.g. IPC_M_USBHC_INTERRUPT_OUT -
    4949 * always use the same semantics:
    5050 * - first, IPC call with given method is made
     
    5959 *
    6060 * Methods for retrieving data from device (IN transactions)
    61  * - e.g. IPC_M_USB_INTERRUPT_IN -
     61 * - e.g. IPC_M_USBHC_INTERRUPT_IN -
    6262 * also use the same semantics:
    6363 * - first, IPC call with given method is made
     
    7676 * The mentioned data retrieval can be done any time after receiving EOK
    7777 * answer to IN method.
    78  * This retrieval is done using the IPC_M_USB_GET_BUFFER where
     78 * This retrieval is done using the IPC_M_USBHC_GET_BUFFER where
    7979 * the first argument is buffer hash from call answer.
    8080 * This call must be immediately followed by data read-in and after the
    81  * data are transferred, the initial call (IPC_M_USB_GET_BUFFER)
     81 * data are transferred, the initial call (IPC_M_USBHC_GET_BUFFER)
    8282 * is answered. Each buffer can be retrieved only once.
    8383 *
     
    9797         * as it is handled by the remote part itself.
    9898         */
    99         IPC_M_USB_GET_BUFFER,
     99        IPC_M_USBHC_GET_BUFFER,
    100100
    101101
     
    103103         * See explanation at usb_iface_funcs_t (OUT transaction).
    104104         */
    105         IPC_M_USB_INTERRUPT_OUT,
     105        IPC_M_USBHC_INTERRUPT_OUT,
    106106
    107107        /** Get interrupt data from device.
    108108         * See explanation at usb_iface_funcs_t (IN transaction).
    109109         */
    110         IPC_M_USB_INTERRUPT_IN,
     110        IPC_M_USBHC_INTERRUPT_IN,
    111111
    112112
     
    114114         * See explanation at usb_iface_funcs_t (OUT transaction).
    115115         */
    116         IPC_M_USB_CONTROL_WRITE_SETUP,
     116        IPC_M_USBHC_CONTROL_WRITE_SETUP,
    117117
    118118        /** Send control-transfer data to device.
    119119         * See explanation at usb_iface_funcs_t (OUT transaction).
    120120         */
    121         IPC_M_USB_CONTROL_WRITE_DATA,
     121        IPC_M_USBHC_CONTROL_WRITE_DATA,
    122122
    123123        /** Terminate WRITE control transfer.
    124124         * See explanation at usb_iface_funcs_t (NO-DATA transaction).
    125125         */
    126         IPC_M_USB_CONTROL_WRITE_STATUS,
     126        IPC_M_USBHC_CONTROL_WRITE_STATUS,
    127127
    128128
     
    131131         * See explanation at usb_iface_funcs_t (OUT transaction).
    132132         */
    133         IPC_M_USB_CONTROL_READ_SETUP,
     133        IPC_M_USBHC_CONTROL_READ_SETUP,
    134134
    135135        /** Get control-transfer data from device.
    136136         * See explanation at usb_iface_funcs_t (IN transaction).
    137137         */
    138         IPC_M_USB_CONTROL_READ_DATA,
     138        IPC_M_USBHC_CONTROL_READ_DATA,
    139139
    140140        /** Terminate READ control transfer.
    141141         * See explanation at usb_iface_funcs_t (NO-DATA transaction).
    142142         */
    143         IPC_M_USB_CONTROL_READ_STATUS,
     143        IPC_M_USBHC_CONTROL_READ_STATUS,
    144144
    145145
    146146        /* IPC_M_USB_ */
    147 } usb_iface_funcs_t;
     147} usbhc_iface_funcs_t;
    148148
    149149/** Callback for outgoing transfer. */
    150 typedef void (*usb_iface_transfer_out_callback_t)(device_t *,
     150typedef void (*usbhc_iface_transfer_out_callback_t)(device_t *,
    151151    usb_transaction_outcome_t, void *);
    152152
    153153/** Callback for incoming transfer. */
    154 typedef void (*usb_iface_transfer_in_callback_t)(device_t *,
     154typedef void (*usbhc_iface_transfer_in_callback_t)(device_t *,
    155155    usb_transaction_outcome_t, size_t, void *);
    156156
     
    159159        int (*interrupt_out)(device_t *, usb_target_t,
    160160            void *, size_t,
    161             usb_iface_transfer_out_callback_t, void *);
     161            usbhc_iface_transfer_out_callback_t, void *);
    162162        int (*interrupt_in)(device_t *, usb_target_t,
    163163            void *, size_t,
    164             usb_iface_transfer_in_callback_t, void *);
    165 } usb_iface_t;
     164            usbhc_iface_transfer_in_callback_t, void *);
     165} usbhc_iface_t;
    166166
    167167
  • uspace/lib/usb/src/hcdhubd.c

    r32eceb4f rcb59f787  
    3434 */
    3535#include <usb/hcdhubd.h>
    36 #include <usb_iface.h>
     36#include <usbhc_iface.h>
    3737#include <driver.h>
    3838#include <bool.h>
     
    4545static usb_hc_driver_t *hc_driver = NULL;
    4646
    47 static usb_iface_t usb_interface = {
     47static usbhc_iface_t usb_interface = {
    4848        .interrupt_out = NULL,
    4949        .interrupt_in = NULL
     
    5151
    5252static device_ops_t usb_device_ops = {
    53         .interfaces[USB_DEV_IFACE] = &usb_interface
     53        .interfaces[USBHC_DEV_IFACE] = &usb_interface
    5454};
    5555
  • uspace/lib/usb/src/usbdrv.c

    r32eceb4f rcb59f787  
    3434 */
    3535#include <usb/usbdrv.h>
    36 #include <usb_iface.h>
     36#include <usbhc_iface.h>
    3737#include <errno.h>
    3838
     
    121121
    122122        transfer->request = async_send_4(phone,
    123             DEV_IFACE_ID(USB_DEV_IFACE),
     123            DEV_IFACE_ID(USBHC_DEV_IFACE),
    124124            method,
    125125            target.address, target.endpoint,
     
    184184
    185185        transfer->request = async_send_4(phone,
    186             DEV_IFACE_ID(USB_DEV_IFACE),
     186            DEV_IFACE_ID(USBHC_DEV_IFACE),
    187187            method,
    188188            target.address, target.endpoint,
     
    214214
    215215        req = async_send_2(phone,
    216             DEV_IFACE_ID(USB_DEV_IFACE),
    217             IPC_M_USB_GET_BUFFER,
     216            DEV_IFACE_ID(USBHC_DEV_IFACE),
     217            IPC_M_USBHC_GET_BUFFER,
    218218            hash,
    219219            &answer_data);
     
    305305{
    306306        return async_send_buffer(phone,
    307             IPC_M_USB_INTERRUPT_OUT,
     307            IPC_M_USBHC_INTERRUPT_OUT,
    308308            target,
    309309            buffer, size,
     
    317317{
    318318        return async_recv_buffer(phone,
    319             IPC_M_USB_INTERRUPT_IN,
     319            IPC_M_USBHC_INTERRUPT_IN,
    320320            target,
    321321            buffer, size, actual_size,
Note: See TracChangeset for help on using the changeset viewer.