Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/include/ddf/driver.h

    r2a770a35 r609243f4  
    3737#define DDF_DRIVER_H_
    3838
     39#include <async.h>
    3940#include <ipc/devman.h>
    4041#include <ipc/dev_iface.h>
    41 
    4242#include "../dev_iface.h"
    4343
     
    8181         */
    8282        devman_handle_t handle;
     83        /** Reference count */
     84        atomic_t refcnt;
    8385       
    8486        /**
    85          * Phone to the parent device driver (if it is different from this
     87         * Session to the parent device driver (if it is different from this
    8688         * driver)
    8789         */
    88         int parent_phone;
     90        async_sess_t *parent_sess;
    8991       
    9092        /** Device name */
     
    104106        /** Function indentifier (asigned by device manager) */
    105107        devman_handle_t handle;
     108        /** Reference count */
     109        atomic_t refcnt;
    106110       
    107111        /** Device which this function belogs to */
     
    118122        /** Implementation of operations provided by this function */
    119123        ddf_dev_ops_t *ops;
     124        /** Connection handler or @c NULL to use the DDF default handler. */
     125        async_client_conn_t conn_handler;
    120126       
    121127        /** Link in the list of functions handled by the driver */
     
    130136typedef struct driver_ops {
    131137        /** Callback method for passing a new device to the device driver */
    132         int (*add_device)(ddf_dev_t *dev);
    133         /* TODO: add other generic driver operations */
     138        int (*add_device)(ddf_dev_t *);
     139        /**
     140         * Notification that the device was succesfully added.
     141         * The driver can do any blocking operation without
     142         * blocking the device manager.
     143         */
     144        void (*device_added)(ddf_dev_t *dev);
     145        /** Ask driver to remove a device */
     146        int (*dev_remove)(ddf_dev_t *);
     147        /** Inform driver a device disappeared */
     148        int (*dev_gone)(ddf_dev_t *);
     149        /** Ask driver to online a specific function */
     150        int (*fun_online)(ddf_fun_t *);
     151        /** Ask driver to offline a specific function */
     152        int (*fun_offline)(ddf_fun_t *);
    134153} driver_ops_t;
    135154
     
    144163extern int ddf_driver_main(driver_t *);
    145164
     165extern void *ddf_dev_data_alloc(ddf_dev_t *, size_t);
    146166extern ddf_fun_t *ddf_fun_create(ddf_dev_t *, fun_type_t, const char *);
    147167extern void ddf_fun_destroy(ddf_fun_t *);
     168extern void *ddf_fun_data_alloc(ddf_fun_t *, size_t);
    148169extern int ddf_fun_bind(ddf_fun_t *);
     170extern int ddf_fun_unbind(ddf_fun_t *);
     171extern int ddf_fun_online(ddf_fun_t *);
     172extern int ddf_fun_offline(ddf_fun_t *);
    149173extern int ddf_fun_add_match_id(ddf_fun_t *, const char *, int);
    150174
    151 extern int ddf_fun_add_to_class(ddf_fun_t *, const char *);
     175extern int ddf_fun_add_to_category(ddf_fun_t *, const char *);
    152176
    153177#endif
Note: See TracChangeset for help on using the changeset viewer.