import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / drivers / scsi / AM53C974.h
1 /* AM53/79C974 (PCscsi) driver release 0.5
2
3  * The architecture and much of the code of this device
4  * driver was originally developed by Drew Eckhardt for
5  * the NCR5380. The following copyrights apply:
6  *  For the architecture and all parts similar to the NCR5380:
7  *    Copyright 1993, Drew Eckhardt
8  *      Visionary Computing 
9  *      (Unix and Linux consulting and custom programming)
10  *      drew@colorado.edu
11  *      +1 (303) 666-5836
12  *
13  *  The AM53C974_nobios_detect code was originally developed by
14  *   Robin Cutshaw (robin@xfree86.org) and is used here in a 
15  *   modified form.
16  *
17  *  For the other parts:
18  *    Copyright 1994, D. Frieauff
19  *    EMail: fri@rsx42sun0.dofn.de
20  *    Phone: x49-7545-8-2256 , x49-7541-42305
21  */
22
23 /*
24  * $Log: AM53C974.h,v $
25  * Revision 1.1.1.1  2005/04/11 02:50:35  jack
26  * first release
27  *
28  * Revision 1.1.1.1  2005/01/10 13:16:34  jack
29  * First release
30  *
31  */
32
33 #ifndef AM53C974_H
34 #define AM53C974_H
35
36 #include <scsi/scsicam.h>
37
38 struct AM53C974_hostdata {
39         volatile unsigned in_reset:1;   /* flag, says bus reset pending */
40         volatile unsigned aborted:1;    /* flag, says aborted */
41         volatile unsigned selecting:1;  /* selection started, but not yet finished */
42         volatile unsigned disconnecting: 1;     /* disconnection started, but not yet finished */
43         volatile unsigned dma_busy:1;   /* dma busy when service request for info transfer received */
44         volatile unsigned char msgout[10];      /* message to output in MSGOUT_PHASE */
45         volatile unsigned char last_message[10];        /* last message OUT */
46         volatile Scsi_Cmnd *issue_queue;        /* waiting to be issued */
47         volatile Scsi_Cmnd *disconnected_queue;         /* waiting for reconnect */
48         volatile Scsi_Cmnd *sel_cmd;    /* command for selection */
49         volatile Scsi_Cmnd *connected;  /* currently connected command */
50         volatile unsigned char busy[8];         /* index = target, bit = lun */
51         unsigned char sync_per[8];      /* synchronous transfer period (in effect) */
52         unsigned char sync_off[8];      /* synchronous offset (in effect) */
53         unsigned char sync_neg[8];      /* sync. negotiation performed (in effect) */
54         unsigned char sync_en[8];       /* sync. negotiation performed (in effect) */
55         unsigned char max_rate[8];      /* max. transfer rate (setup) */
56         unsigned char max_offset[8];    /* max. sync. offset (setup), only valid if corresponding sync_en is nonzero */
57 };
58
59 #define AM53C974 {                                \
60     proc_name:      "am53c974",                   \
61     name:           "AM53C974",                   \
62     detect:         AM53C974_pci_detect,          \
63     release:        AM53C974_release,             \
64     info:           AM53C974_info,                \
65     command:        AM53C974_command,             \
66     queuecommand:   AM53C974_queue_command,       \
67     abort:          AM53C974_abort,               \
68     reset:          AM53C974_reset,               \
69     bios_param:     scsicam_bios_param,           \
70     can_queue:      12,                           \
71     this_id:        -1,                           \
72     sg_tablesize:   SG_ALL,                       \
73     cmd_per_lun:    1,                            \
74     use_clustering: DISABLE_CLUSTERING            \
75     }
76
77 static int AM53C974_pci_detect(Scsi_Host_Template * tpnt);
78 static int AM53C974_release(struct Scsi_Host *shp);
79 static const char *AM53C974_info(struct Scsi_Host *);
80 static int AM53C974_command(Scsi_Cmnd * SCpnt);
81 static int AM53C974_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *));
82 static int AM53C974_abort(Scsi_Cmnd * cmd);
83 static int AM53C974_reset(Scsi_Cmnd * cmd, unsigned int);
84
85 #endif                          /* AM53C974_H */