1 /* 2 * Copyright (c) 1982, 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)device.h 7.1 (Berkeley) 05/08/90 8 */ 9 10 struct driver { 11 int (*d_init)(); 12 char *d_name; 13 int (*d_start)(); 14 int (*d_go)(); 15 int (*d_intr)(); 16 int (*d_done)(); 17 }; 18 19 struct hp_ctlr { 20 struct driver *hp_driver; 21 int hp_unit; 22 int hp_alive; 23 char *hp_addr; 24 int hp_flags; 25 int hp_ipl; 26 }; 27 28 struct hp_device { 29 struct driver *hp_driver; 30 struct driver *hp_cdriver; 31 int hp_unit; 32 int hp_ctlr; 33 int hp_slave; 34 char *hp_addr; 35 int hp_dk; 36 int hp_flags; 37 int hp_alive; 38 int hp_ipl; 39 }; 40 41 struct devqueue { 42 struct devqueue *dq_forw; 43 struct devqueue *dq_back; 44 int dq_ctlr; 45 int dq_unit; 46 int dq_slave; 47 struct driver *dq_driver; 48 }; 49 50 struct hp_hw { 51 char *hw_addr; /* physical address of registers */ 52 short hw_sc; /* select code (if applicable) */ 53 short hw_type; /* type (defined below) */ 54 short hw_id; /* HW returned id */ 55 short hw_id2; /* secondary HW id (displays) */ 56 char *hw_name; /* HP product name */ 57 }; 58 59 #define MAX_CTLR 16 /* Totally arbitrary */ 60 #define MAXSLAVES 8 /* Currently the HPIB limit */ 61 62 #define WILD_CARD_CTLR 0 63 64 /* A controller is a card which can have one or more slaves attached */ 65 #define CONTROLLER 0x10 66 #define HPIB 0x16 67 #define SCSI 0x17 68 #define VME 0x18 69 #define FLINK 0x19 70 71 /* Slaves are devices which attach to controllers, e.g. disks, tapes */ 72 #define RD 0x2a 73 #define PPI 0x2b 74 #define CT 0x2c 75 76 /* These are not controllers, but may have their own HPIB address */ 77 #define BITMAP 0x01 78 #define NET 0x02 79 #define COMM 0x03 80 #define FPA 0x04 81 #define MISC 0x05 82 #define KEYBOARD 0x06 83 84 #ifdef KERNEL 85 extern struct hp_ctlr hp_cinit[]; 86 extern struct hp_device hp_dinit[]; 87 extern struct hp_hw sc_table[]; 88 #endif 89