1 /* 2 * ddi.h Define the structure for linking in I/O drivers into the 3 * operating system kernel. This method is currently only 4 * used by NET layer drivers, but it will be expanded into 5 * a link methos for ALL kernel-resident device drivers. 6 * 7 * Version: @(#)ddi.h 1.0.2 04/22/93 8 * 9 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 10 */ 11 #ifndef _LINUX_DDI_H 12 #define _LINUX_DDI_H 13 14 15 /* DDI control block flags. */ 16 #define DDI_FREADY 0x10000000 /* device is initialized */ 17 #define DDI_FPRESENT 0x20000000 /* device hardware is present */ 18 #define DDI_FBLKDEV 0x00000001 /* device has a BLK spec. file */ 19 #define DDI_FCHRDEV 0x00000002 /* device has a CHR spec. file */ 20 21 /* Various constants. */ 22 #define DDI_MAXNAME 16 /* length of a DDI ID string */ 23 24 25 /* This structure is used to set up a DDI driver. */ 26 struct ddconf { 27 int ioaddr; /* main I/O (port) address */ 28 int ioaux; /* auxiliary I/O (HD, AST) */ 29 int irq; /* IRQ channel */ 30 int dma; /* DMA channel to use */ 31 unsigned long memsize; /* size of onboard memory */ 32 unsigned long memaddr; /* base address of memory */ 33 }; 34 35 36 /* The DDI device control block. */ 37 struct ddi_device { 38 char *title; /* title of the driver */ 39 char name[DDI_MAXNAME]; /* unit name of the I/O driver */ 40 short int unit; /* unit number of this driver */ 41 short int nunits; /* number of units in driver */ 42 int (*init)(struct ddi_device *); /* initialization func */ 43 int (*handler)(int, ...); /* command handler */ 44 short int major; /* driver major dev number */ 45 short int minor; /* driver minor dev number */ 46 unsigned long flags; /* various flags */ 47 struct ddconf config; /* driver HW setup */ 48 }; 49 50 51 /* This structure is used to set up networking protocols. */ 52 struct ddi_proto { 53 char *name; /* protocol name */ 54 void (*init)(struct ddi_proto *); /* initialization func */ 55 }; 56 57 58 /* This structure is used to link a STREAMS interface. */ 59 struct iflink { 60 char id[DDI_MAXNAME]; /* DDI ID string */ 61 char stream[DDI_MAXNAME]; /* STREAMS interface name */ 62 int family; /* address (protocol) family */ 63 unsigned int flags; /* any flags needed (unused) */ 64 }; 65 66 67 /* DDI control requests. */ 68 #define DDIOCSDBG 0x9000 /* set DDI debug level */ 69 #define DDIOCGNAME 0x9001 /* get DDI ID name */ 70 #define DDIOCGCONF 0x9002 /* get DDI HW config */ 71 #define DDIOCSCONF 0x9003 /* set DDI HW config */ 72 73 74 /* DDI global functions. */ 75 extern void ddi_init(void); 76 extern struct ddi_device *ddi_map(const char *id); 77 78 79 #endif /* _LINUX_DDI_H */