Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is provided under a dual BSD/GPLv2 license.  When using or
0003  * redistributing this file, you may do so under either license.
0004  *
0005  * GPL LICENSE SUMMARY
0006  *
0007  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of version 2 of the GNU General Public License as
0011  * published by the Free Software Foundation.
0012  *
0013  * This program is distributed in the hope that it will be useful, but
0014  * WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU General Public License
0019  * along with this program; if not, write to the Free Software
0020  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
0021  * The full GNU General Public License is included in this distribution
0022  * in the file called LICENSE.GPL.
0023  *
0024  * BSD LICENSE
0025  *
0026  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
0027  * All rights reserved.
0028  *
0029  * Redistribution and use in source and binary forms, with or without
0030  * modification, are permitted provided that the following conditions
0031  * are met:
0032  *
0033  *   * Redistributions of source code must retain the above copyright
0034  *     notice, this list of conditions and the following disclaimer.
0035  *   * Redistributions in binary form must reproduce the above copyright
0036  *     notice, this list of conditions and the following disclaimer in
0037  *     the documentation and/or other materials provided with the
0038  *     distribution.
0039  *   * Neither the name of Intel Corporation nor the names of its
0040  *     contributors may be used to endorse or promote products derived
0041  *     from this software without specific prior written permission.
0042  *
0043  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0044  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0045  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0046  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0047  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0048  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0049  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0050  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0051  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0052  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0053  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0054  */
0055 
0056 #ifndef _SCI_SAS_H_
0057 #define _SCI_SAS_H_
0058 
0059 #include <linux/kernel.h>
0060 
0061 /*
0062  * SATA FIS Types These constants depict the various SATA FIS types devined in
0063  * the serial ATA specification.
0064  * XXX: This needs to go into <scsi/sas.h>
0065  */
0066 #define FIS_REGH2D          0x27
0067 #define FIS_REGD2H          0x34
0068 #define FIS_SETDEVBITS      0xA1
0069 #define FIS_DMA_ACTIVATE    0x39
0070 #define FIS_DMA_SETUP       0x41
0071 #define FIS_BIST_ACTIVATE   0x58
0072 #define FIS_PIO_SETUP       0x5F
0073 #define FIS_DATA            0x46
0074 
0075 /**************************************************************************/
0076 #define SSP_RESP_IU_MAX_SIZE    280
0077 
0078 /*
0079  * contents of the SSP COMMAND INFORMATION UNIT.
0080  * For specific information on each of these individual fields please
0081  * reference the SAS specification SSP transport layer section.
0082  * XXX: This needs to go into <scsi/sas.h>
0083  */
0084 struct ssp_cmd_iu {
0085     u8 LUN[8];
0086     u8 add_cdb_len:6;
0087     u8 _r_a:2;
0088     u8 _r_b;
0089     u8 en_fburst:1;
0090     u8 task_prio:4;
0091     u8 task_attr:3;
0092     u8 _r_c;
0093 
0094     u8 cdb[16];
0095 }  __packed;
0096 
0097 /*
0098  * contents of the SSP TASK INFORMATION UNIT.
0099  * For specific information on each of these individual fields please
0100  * reference the SAS specification SSP transport layer section.
0101  * XXX: This needs to go into <scsi/sas.h>
0102  */
0103 struct ssp_task_iu {
0104     u8 LUN[8];
0105     u8 _r_a;
0106     u8 task_func;
0107     u8 _r_b[4];
0108     u16 task_tag;
0109     u8 _r_c[12];
0110 }  __packed;
0111 
0112 
0113 /*
0114  * struct smp_req_phy_id - This structure defines the contents of
0115  *    an SMP Request that is comprised of the struct smp_request_header and a
0116  *    phy identifier.
0117  *    Examples: SMP_REQUEST_DISCOVER, SMP_REQUEST_REPORT_PHY_SATA.
0118  *
0119  * For specific information on each of these individual fields please reference
0120  * the SAS specification.
0121  */
0122 struct smp_req_phy_id {
0123     u8 _r_a[4];     /* bytes 4-7 */
0124 
0125     u8 ign_zone_grp:1;  /* byte 8 */
0126     u8 _r_b:7;
0127 
0128     u8 phy_id;      /* byte 9 */
0129     u8 _r_c;        /* byte 10 */
0130     u8 _r_d;        /* byte 11 */
0131 }  __packed;
0132 
0133 /*
0134  * struct smp_req_config_route_info - This structure defines the
0135  *    contents of an SMP Configure Route Information request.
0136  *
0137  * For specific information on each of these individual fields please reference
0138  * the SAS specification.
0139  */
0140 struct smp_req_conf_rtinfo {
0141     u16 exp_change_cnt;     /* bytes 4-5 */
0142     u8 exp_rt_idx_hi;       /* byte 6 */
0143     u8 exp_rt_idx;          /* byte 7 */
0144 
0145     u8 _r_a;            /* byte 8 */
0146     u8 phy_id;          /* byte 9 */
0147     u16 _r_b;           /* bytes 10-11 */
0148 
0149     u8 _r_c:7;          /* byte 12 */
0150     u8 dis_rt_entry:1;
0151     u8 _r_d[3];         /* bytes 13-15 */
0152 
0153     u8 rt_sas_addr[8];      /* bytes 16-23 */
0154     u8 _r_e[16];            /* bytes 24-39 */
0155 }  __packed;
0156 
0157 /*
0158  * struct smp_req_phycntl - This structure defines the contents of an
0159  *    SMP Phy Controller request.
0160  *
0161  * For specific information on each of these individual fields please reference
0162  * the SAS specification.
0163  */
0164 struct smp_req_phycntl {
0165     u16 exp_change_cnt;     /* byte 4-5 */
0166 
0167     u8 _r_a[3];         /* bytes 6-8 */
0168 
0169     u8 phy_id;          /* byte 9 */
0170     u8 phy_op;          /* byte 10 */
0171 
0172     u8 upd_pathway:1;       /* byte 11 */
0173     u8 _r_b:7;
0174 
0175     u8 _r_c[12];            /* byte 12-23 */
0176 
0177     u8 att_dev_name[8];             /* byte 24-31 */
0178 
0179     u8 _r_d:4;          /* byte 32 */
0180     u8 min_linkrate:4;
0181 
0182     u8 _r_e:4;          /* byte 33 */
0183     u8 max_linkrate:4;
0184 
0185     u8 _r_f[2];         /* byte 34-35 */
0186 
0187     u8 pathway:4;           /* byte 36 */
0188     u8 _r_g:4;
0189 
0190     u8 _r_h[3];         /* bytes 37-39 */
0191 }  __packed;
0192 
0193 /*
0194  * struct smp_req - This structure simply unionizes the existing request
0195  *    structures into a common request type.
0196  *
0197  * XXX: This data structure may need to go to scsi/sas.h
0198  */
0199 struct smp_req {
0200     u8 type;        /* byte 0 */
0201     u8 func;        /* byte 1 */
0202     u8 alloc_resp_len;  /* byte 2 */
0203     u8 req_len;     /* byte 3 */
0204     u8 req_data[];
0205 }  __packed;
0206 
0207 /*
0208  * struct sci_sas_address - This structure depicts how a SAS address is
0209  *    represented by SCI.
0210  * XXX convert this to u8 [SAS_ADDR_SIZE] like the rest of libsas
0211  *
0212  */
0213 struct sci_sas_address {
0214     u32 high;
0215     u32 low;
0216 };
0217 #endif