00001 /** 00002 * 00003 00004 * ddi.h Define the structure for linking in I/O drivers into the 00005 * operating system kernel. This method is currently only 00006 * used by NET layer drivers, but it will be expanded into 00007 * a link methos for ALL kernel-resident device drivers. 00008 * 00009 * Version: @(#)ddi.h 1.0.2 04/22/93 00010 * 00011 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 00012 00013 00014 */ 00015 #ifndef _LINUX_DDI_H 00016 #define _LINUX_DDI_H 00017 00018 00019 /// DDI control block flags. 00020 #define DDI_FREADY 0x10000000 ///< device is initialized 00021 #define DDI_FPRESENT 0x20000000 ///< device hardware is present 00022 #define DDI_FBLKDEV 0x00000001 ///< device has a BLK spec. file 00023 #define DDI_FCHRDEV 0x00000002 ///< device has a CHR spec. file 00024 00025 /// Various constants. 00026 #define DDI_MAXNAME 16 ///< length of a DDI ID string 00027 00028 00029 /// This structure is used to set up a DDI driver. 00030 struct ddconf { 00031 int ioaddr; ///< main I/O (port) address 00032 int ioaux; ///< auxiliary I/O (HD, AST) 00033 int irq; ///< IRQ channel 00034 int dma; ///< DMA channel to use 00035 unsigned long memsize; ///< size of onboard memory 00036 unsigned long memaddr; ///< base address of memory 00037 }; 00038 00039 00040 /// The DDI device control block. 00041 struct ddi_device { 00042 char *title; ///< title of the driver 00043 char name[DDI_MAXNAME]; ///< unit name of the I/O driver 00044 short int unit; ///< unit number of this driver 00045 short int nunits; ///< number of units in driver 00046 int (*init)(struct ddi_device *); ///< initialization func 00047 int (*handler)(int, ...); ///< command handler 00048 short int major; ///< driver major dev number 00049 short int minor; ///< driver minor dev number 00050 unsigned long flags; ///< various flags 00051 struct ddconf config; ///< driver HW setup 00052 }; 00053 00054 00055 /// This structure is used to set up networking protocols. 00056 struct ddi_proto { 00057 char *name; ///< protocol name 00058 void (*init)(struct ddi_proto *); ///< initialization func 00059 }; 00060 00061 00062 /// This structure is used to link a STREAMS interface. 00063 struct iflink { 00064 char id[DDI_MAXNAME]; ///< DDI ID string 00065 char stream[DDI_MAXNAME]; ///< STREAMS interface name 00066 int family; ///< address (protocol) family 00067 unsigned int flags; ///< any flags needed (unused) 00068 }; 00069 00070 00071 /// DDI control requests. 00072 #define DDIOCSDBG 0x9000 ///< set DDI debug level 00073 #define DDIOCGNAME 0x9001 ///< get DDI ID name 00074 #define DDIOCGCONF 0x9002 ///< get DDI HW config 00075 #define DDIOCSCONF 0x9003 ///< set DDI HW config 00076 00077 00078 /// DDI global functions. 00079 extern void ddi_init(void); 00080 extern struct ddi_device *ddi_map(const char *id); 00081 00082 00083 #endif // _LINUX_DDI_H
1.4.6-5