Changeset 1b973dc in mainline for uspace/lib/drv/include


Ignore:
Timestamp:
2013-12-31T21:41:45Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1bb9833
Parents:
4c14b88 (diff), 8a84484 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge libdrv cleanup

Location:
uspace/lib/drv/include
Files:
7 edited
4 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/ahci_iface.h

    r4c14b88 r1b973dc  
    4141#include <async.h>
    4242
     43extern async_sess_t* ahci_get_sess(devman_handle_t, char **);
     44
     45extern int ahci_get_sata_device_name(async_sess_t *, size_t, char *);
     46extern int ahci_get_num_blocks(async_sess_t *, uint64_t *);
     47extern int ahci_get_block_size(async_sess_t *, size_t *);
     48extern int ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
     49extern int ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
     50
    4351/** AHCI device communication interface. */
    4452typedef struct {
  • uspace/lib/drv/include/battery_iface.h

    r4c14b88 r1b973dc  
    3333 */
    3434
    35 #ifndef LIBC_DEVICE_BATTERY_DEV_H_
    36 #define LIBC_DEVICE_BATTERY_DEV_H_
     35#ifndef LIBDRV_BATTERY_IFACE_H_
     36#define LIBDRV_BATTERY_IFACE_H_
    3737
    3838#include <async.h>
  • uspace/lib/drv/include/char_dev_iface.h

    r4c14b88 r1b973dc  
    3333 */
    3434
    35 #ifndef LIBC_DEVICE_CHAR_DEV_H_
    36 #define LIBC_DEVICE_CHAR_DEV_H_
     35#ifndef LIBDRV_CHAR_DEV_IFACE_H_
     36#define LIBDRV_CHAR_DEV_IFACE_H_
    3737
    3838#include <async.h>
  • uspace/lib/drv/include/ddf/driver.h

    r4c14b88 r1b973dc  
    116116#endif
    117117
    118 extern int ddf_driver_main(driver_t *);
     118extern int ddf_driver_main(const driver_t *);
    119119
    120120extern void *ddf_dev_data_alloc(ddf_dev_t *, size_t);
  • uspace/lib/drv/include/ddf/interrupt.h

    r4c14b88 r1b973dc  
    6767extern void interrupt_init(void);
    6868extern int register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,
    69     irq_code_t *);
     69    const irq_code_t *);
    7070extern int unregister_interrupt_handler(ddf_dev_t *, int);
    7171
  • uspace/lib/drv/include/dev_iface.h

    r4c14b88 r1b973dc  
    5555
    5656typedef struct {
    57         size_t method_count;
    58         remote_iface_func_ptr_t *methods;
     57        const size_t method_count;
     58        const remote_iface_func_ptr_t *methods;
    5959} remote_iface_t;
    6060
    6161typedef struct {
    62         remote_iface_t *ifaces[DEV_IFACE_COUNT];
     62        const remote_iface_t *ifaces[DEV_IFACE_COUNT];
    6363} iface_dipatch_table_t;
    6464
    65 extern remote_iface_t *get_remote_iface(int);
    66 extern remote_iface_func_ptr_t get_remote_method(remote_iface_t *, sysarg_t);
     65extern const remote_iface_t *get_remote_iface(int);
     66extern remote_iface_func_ptr_t get_remote_method(const remote_iface_t *, sysarg_t);
    6767
    6868
  • uspace/lib/drv/include/graph_iface.h

    r4c14b88 r1b973dc  
    3838#include <async.h>
    3939
    40 typedef enum {
    41         GRAPH_DEV_CONNECT = 0
    42 } graph_dev_method_t;
    43 
    4440extern int graph_dev_connect(async_sess_t *);
    4541
  • uspace/lib/drv/include/nic_iface.h

    r4c14b88 r1b973dc  
    3333 */
    3434
    35 #ifndef LIBC_DEVICE_NIC_H_
    36 #define LIBC_DEVICE_NIC_H_
     35#ifndef LIBDRV_NIC_IFACE_H_
     36#define LIBDRV_NIC_IFACE_H_
    3737
    3838#include <async.h>
     
    4040#include <ipc/common.h>
    4141
    42 typedef enum {
    43         NIC_SEND_MESSAGE = 0,
    44         NIC_CALLBACK_CREATE,
    45         NIC_GET_STATE,
    46         NIC_SET_STATE,
    47         NIC_GET_ADDRESS,
    48         NIC_SET_ADDRESS,
    49         NIC_GET_STATS,
    50         NIC_GET_DEVICE_INFO,
    51         NIC_GET_CABLE_STATE,
    52         NIC_GET_OPERATION_MODE,
    53         NIC_SET_OPERATION_MODE,
    54         NIC_AUTONEG_ENABLE,
    55         NIC_AUTONEG_DISABLE,
    56         NIC_AUTONEG_PROBE,
    57         NIC_AUTONEG_RESTART,
    58         NIC_GET_PAUSE,
    59         NIC_SET_PAUSE,
    60         NIC_UNICAST_GET_MODE,
    61         NIC_UNICAST_SET_MODE,
    62         NIC_MULTICAST_GET_MODE,
    63         NIC_MULTICAST_SET_MODE,
    64         NIC_BROADCAST_GET_MODE,
    65         NIC_BROADCAST_SET_MODE,
    66         NIC_DEFECTIVE_GET_MODE,
    67         NIC_DEFECTIVE_SET_MODE,
    68         NIC_BLOCKED_SOURCES_GET,
    69         NIC_BLOCKED_SOURCES_SET,
    70         NIC_VLAN_GET_MASK,
    71         NIC_VLAN_SET_MASK,
    72         NIC_VLAN_SET_TAG,
    73         NIC_WOL_VIRTUE_ADD,
    74         NIC_WOL_VIRTUE_REMOVE,
    75         NIC_WOL_VIRTUE_PROBE,
    76         NIC_WOL_VIRTUE_LIST,
    77         NIC_WOL_VIRTUE_GET_CAPS,
    78         NIC_WOL_LOAD_INFO,
    79         NIC_OFFLOAD_PROBE,
    80         NIC_OFFLOAD_SET,
    81         NIC_POLL_GET_MODE,
    82         NIC_POLL_SET_MODE,
    83         NIC_POLL_NOW
    84 } nic_funcs_t;
    8542
    8643typedef enum {
  • uspace/lib/drv/include/ops/battery_dev.h

    r4c14b88 r1b973dc  
    3737
    3838#include "../ddf/driver.h"
    39 #include "device/battery_dev.h"
     39#include "battery_iface.h"
    4040
    4141typedef struct {
  • uspace/lib/drv/include/pci_dev_iface.h

    r4c14b88 r1b973dc  
    4040#include "ddf/driver.h"
    4141
    42 typedef enum {
    43         IPC_M_CONFIG_SPACE_READ_8,
    44         IPC_M_CONFIG_SPACE_READ_16,
    45         IPC_M_CONFIG_SPACE_READ_32,
     42#define PCI_DEVICE_ID  0x02
    4643
    47         IPC_M_CONFIG_SPACE_WRITE_8,
    48         IPC_M_CONFIG_SPACE_WRITE_16,
    49         IPC_M_CONFIG_SPACE_WRITE_32
    50 } pci_dev_iface_funcs_t;
     44extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
     45extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
     46extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
     47
     48extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
     49extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
     50extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
    5151
    5252/** PCI device communication interface. */
  • uspace/lib/drv/include/usbhid_iface.h

    r4c14b88 r1b973dc  
    4040#include <usb/usb.h>
    4141
    42 /** IPC methods for USB HID device interface. */
    43 typedef enum {
    44         /** Get number of events reported in single burst.
    45          * Parameters: none
    46          * Answer:
    47          * - Size of one report in bytes.
    48          */
    49         IPC_M_USBHID_GET_EVENT_LENGTH,
    50         /** Get single event from the HID device.
    51          * The word single refers to set of individual events that were
    52          * available at particular point in time.
    53          * Parameters:
    54          * - flags
    55          * The call is followed by data read expecting two concatenated
    56          * arrays.
    57          * Answer:
    58          * - EOK - events returned
    59          * - EAGAIN - no event ready (only in non-blocking mode)
    60          *
    61          * It is okay if the client requests less data. Extra data must
    62          * be truncated by the driver.
    63          *
    64          * @todo Change this comment.
    65          */
    66         IPC_M_USBHID_GET_EVENT,
    67        
    68         /** Get the size of the report descriptor from the HID device.
    69          *
    70          * Parameters:
    71          * - none
    72          * Answer:
    73          * - EOK - method is implemented (expected always)
    74          * Parameters of the answer:
    75          * - Size of the report in bytes.
    76          */
    77         IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH,
    78        
    79         /** Get the report descriptor from the HID device.
    80          *
    81          * Parameters:
    82          * - none
    83          * The call is followed by data read expecting the descriptor itself.
    84          * Answer:
    85          * - EOK - report descriptor returned.
    86          */
    87         IPC_M_USBHID_GET_REPORT_DESCRIPTOR
    88 } usbhid_iface_funcs_t;
    89 
    90 /** USB HID interface flag - return immediately if no data are available. */
    91 #define USBHID_IFACE_FLAG_NON_BLOCKING (1 << 0)
     42extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
     43extern int usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
     44    int *, unsigned int);
     45extern int usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
     46extern int usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
     47    size_t *);
    9248
    9349/** USB HID device communication interface. */
Note: See TracChangeset for help on using the changeset viewer.