klaptopdaemon
driver_ops.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _LINUX_DRIVER_OPS_H
00020 #define _LINUX_DRIVER_OPS_H
00021
00022 #ifndef DEV_NAME_LEN
00023 #define DEV_NAME_LEN 32
00024 #endif
00025
00026 #ifdef __KERNEL__
00027
00028 typedef struct dev_node_t {
00029 char dev_name[DEV_NAME_LEN];
00030 u_short major, minor;
00031 struct dev_node_t *next;
00032 } dev_node_t;
00033
00034 typedef struct dev_locator_t {
00035 enum { LOC_ISA, LOC_PCI } bus;
00036 union {
00037 struct {
00038 u_short io_base_1, io_base_2;
00039 u_long mem_base;
00040 u_char irq, dma;
00041 } isa;
00042 struct {
00043 u_char bus;
00044 u_char devfn;
00045 } pci;
00046 } b;
00047 } dev_locator_t;
00048
00049 typedef struct driver_operations {
00050 char *name;
00051 dev_node_t *(*attach) (dev_locator_t *loc);
00052 void (*suspend) (dev_node_t *dev);
00053 void (*resume) (dev_node_t *dev);
00054 void (*detach) (dev_node_t *dev);
00055 } driver_operations;
00056
00057 int register_driver(struct driver_operations *ops);
00058 void unregister_driver(struct driver_operations *ops);
00059
00060 #ifdef __BEOS__
00061 #define CB_ENABLER_MODULE_NAME "bus_managers/cb_enabler/v1"
00062 typedef struct cb_enabler_module_info {
00063 bus_manager_info binfo;
00064 int (*register_driver)(struct driver_operations *ops);
00065 void (*unregister_driver)(struct driver_operations *ops);
00066 } cb_enabler_module_info;
00067 #endif
00068
00069 #endif
00070
00071 #endif