- more 2.6.17 port work (still does not build)
[linux-flexiantxendom0-3.2.10.git] / include / scsi / sas / sas_frames.h
1 /*
2  * SAS Frames
3  *
4  * Copyright (C) 2005 Adaptec, Inc.  All rights reserved.
5  * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
6  *
7  * This file is licensed under GPLv2.
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 2 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22  * USA
23  *
24  * $Id: //depot/sas-class/sas_frames.h#5 $
25  */
26
27 #ifndef _SAS_FRAMES_
28 #define _SAS_FRAMES_
29
30 #define SMP_REQUEST             0x40
31 #define SMP_RESPONSE            0x41
32
33 #define SSP_DATA                0x01
34 #define SSP_XFER_RDY            0x05
35 #define SSP_COMMAND             0x06
36 #define SSP_RESPONSE            0x07
37 #define SSP_TASK                0x16
38
39 struct  dev_to_host_fis {
40         u8     fis_type;          /* 0x34 */
41         u8     flags;
42         u8     status;
43         u8     error;
44
45         u8     lbal;
46         union { u8 lbam; u8 byte_count_low; };
47         union { u8 lbah; u8 byte_count_high; };
48         u8     device;
49
50         u8     lbal_exp;
51         u8     lbam_exp;
52         u8     lbah_exp;
53         u8     _r_a;
54
55         union { u8  sector_count; u8 interrupt_reason; };
56         u8     sector_count_exp;
57         u8     _r_b;
58         u8     _r_c;
59
60         u32    _r_d;
61 } __attribute__ ((packed));
62
63 struct host_to_dev_fis {
64         u8     fis_type;          /* 0x27 */
65         u8     flags;
66         u8     command;
67         u8     features;
68
69         u8     lbal;
70         union { u8 lbam; u8 byte_count_low; };
71         union { u8 lbah; u8 byte_count_high; };
72         u8     device;
73
74         u8     lbal_exp;
75         u8     lbam_exp;
76         u8     lbah_exp;
77         u8     features_exp;
78
79         union { u8  sector_count; u8 interrupt_reason; };
80         u8     sector_count_exp;
81         u8     _r_a;
82         u8     control;
83
84         u32    _r_b;
85 } __attribute__ ((packed));
86
87 /* Prefer to have code clarity over header file clarity.
88  */
89 #ifdef __LITTLE_ENDIAN_BITFIELD
90 #include <scsi/sas/sas_frames_le.h>
91 #elif defined(__BIG_ENDIAN_BITFIELD)
92 #include <scsi/sas/sas_frames_be.h>
93 #else
94 #error "Bitfield order not defined!"
95 #endif
96
97 #endif /* _SAS_FRAMES_ */