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 __SCU_REMOTE_NODE_CONTEXT_HEADER__
0057 #define __SCU_REMOTE_NODE_CONTEXT_HEADER__
0058 
0059 /**
0060  * This file contains the structures and constatns used by the SCU hardware to
0061  *    describe a remote node context.
0062  *
0063  *
0064  */
0065 
0066 /**
0067  * struct ssp_remote_node_context - This structure contains the SCU hardware
0068  *    definition for an SSP remote node.
0069  *
0070  *
0071  */
0072 struct ssp_remote_node_context {
0073     /* WORD 0 */
0074 
0075     /**
0076      * This field is the remote node index assigned for this remote node. All
0077      * remote nodes must have a unique remote node index. The value of the remote
0078      * node index can not exceed the maximum number of remote nodes reported in
0079      * the SCU device context capacity register.
0080      */
0081     u32 remote_node_index:12;
0082     u32 reserved0_1:4;
0083 
0084     /**
0085      * This field tells the SCU hardware how many simultaneous connections that
0086      * this remote node will support.
0087      */
0088     u32 remote_node_port_width:4;
0089 
0090     /**
0091      * This field tells the SCU hardware which logical port to associate with this
0092      * remote node.
0093      */
0094     u32 logical_port_index:3;
0095     u32 reserved0_2:5;
0096 
0097     /**
0098      * This field will enable the I_T nexus loss timer for this remote node.
0099      */
0100     u32 nexus_loss_timer_enable:1;
0101 
0102     /**
0103      * This field is the for driver debug only and is not used.
0104      */
0105     u32 check_bit:1;
0106 
0107     /**
0108      * This field must be set to true when the hardware DMAs the remote node
0109      * context to the hardware SRAM.  When the remote node is being invalidated
0110      * this field must be set to false.
0111      */
0112     u32 is_valid:1;
0113 
0114     /**
0115      * This field must be set to true.
0116      */
0117     u32 is_remote_node_context:1;
0118 
0119     /* WORD 1 - 2 */
0120 
0121     /**
0122      * This is the low word of the remote device SAS Address
0123      */
0124     u32 remote_sas_address_lo;
0125 
0126     /**
0127      * This field is the high word of the remote device SAS Address
0128      */
0129     u32 remote_sas_address_hi;
0130 
0131     /* WORD 3 */
0132     /**
0133      * This field reprensets the function number assigned to this remote device.
0134      * This value must match the virtual function number that is being used to
0135      * communicate to the device.
0136      */
0137     u32 function_number:8;
0138     u32 reserved3_1:8;
0139 
0140     /**
0141      * This field provides the driver a way to cheat on the arbitration wait time
0142      * for this remote node.
0143      */
0144     u32 arbitration_wait_time:16;
0145 
0146     /* WORD 4 */
0147     /**
0148      * This field tells the SCU hardware how long this device may occupy the
0149      * connection before it must be closed.
0150      */
0151     u32 connection_occupancy_timeout:16;
0152 
0153     /**
0154      * This field tells the SCU hardware how long to maintain a connection when
0155      * there are no frames being transmitted on the link.
0156      */
0157     u32 connection_inactivity_timeout:16;
0158 
0159     /* WORD  5 */
0160     /**
0161      * This field allows the driver to cheat on the arbitration wait time for this
0162      * remote node.
0163      */
0164     u32 initial_arbitration_wait_time:16;
0165 
0166     /**
0167      * This field is tells the hardware what to program for the connection rate in
0168      * the open address frame.  See the SAS spec for valid values.
0169      */
0170     u32 oaf_connection_rate:4;
0171 
0172     /**
0173      * This field tells the SCU hardware what to program for the features in the
0174      * open address frame.  See the SAS spec for valid values.
0175      */
0176     u32 oaf_features:4;
0177 
0178     /**
0179      * This field tells the SCU hardware what to use for the source zone group in
0180      * the open address frame.  See the SAS spec for more details on zoning.
0181      */
0182     u32 oaf_source_zone_group:8;
0183 
0184     /* WORD 6 */
0185     /**
0186      * This field tells the SCU hardware what to use as the more capibilities in
0187      * the open address frame. See the SAS Spec for details.
0188      */
0189     u32 oaf_more_compatibility_features;
0190 
0191     /* WORD 7 */
0192     u32 reserved7;
0193 
0194 };
0195 
0196 /**
0197  * struct stp_remote_node_context - This structure contains the SCU hardware
0198  *    definition for a STP remote node.
0199  *
0200  * STP Targets are not yet supported so this definition is a placeholder until
0201  * we do support them.
0202  */
0203 struct stp_remote_node_context {
0204     /**
0205      * Placeholder data for the STP remote node.
0206      */
0207     u32 data[8];
0208 
0209 };
0210 
0211 /**
0212  * This union combines the SAS and SATA remote node definitions.
0213  *
0214  * union scu_remote_node_context
0215  */
0216 union scu_remote_node_context {
0217     /**
0218      * SSP Remote Node
0219      */
0220     struct ssp_remote_node_context ssp;
0221 
0222     /**
0223      * STP Remote Node
0224      */
0225     struct stp_remote_node_context stp;
0226 
0227 };
0228 
0229 #endif /* __SCU_REMOTE_NODE_CONTEXT_HEADER__ */