linux/drivers/scsi/isci/scu_task_context.h

/*
 * This file is provided under a dual BSD/GPLv2 license.  When using or
 * redistributing this file, you may do so under either license.
 *
 * GPL LICENSE SUMMARY
 *
 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 * The full GNU General Public License is included in this distribution
 * in the file called LICENSE.GPL.
 *
 * BSD LICENSE
 *
 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *   * Neither the name of Intel Corporation nor the names of its
 *     contributors may be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _SCU_TASK_CONTEXT_H_
#define _SCU_TASK_CONTEXT_H_

/**
 * This file contains the structures and constants for the SCU hardware task
 *    context.
 *
 *
 */


/**
 * enum scu_ssp_task_type - This enumberation defines the various SSP task
 *    types the SCU hardware will accept. The definition for the various task
 *    types the SCU hardware will accept can be found in the DS specification.
 *
 *
 */
scu_ssp_task_type;

/**
 * enum scu_sata_task_type - This enumeration defines the various SATA task
 *    types the SCU hardware will accept. The definition for the various task
 *    types the SCU hardware will accept can be found in the DS specification.
 *
 *
 */
scu_sata_task_type;


/**
 *
 *
 * SCU_CONTEXT_TYPE
 */
#define SCU_TASK_CONTEXT_TYPE
#define SCU_RNC_CONTEXT_TYPE

/**
 *
 *
 * SCU_TASK_CONTEXT_VALIDITY
 */
#define SCU_TASK_CONTEXT_INVALID
#define SCU_TASK_CONTEXT_VALID

/**
 *
 *
 * SCU_COMMAND_CODE
 */
#define SCU_COMMAND_CODE_INITIATOR_NEW_TASK
#define SCU_COMMAND_CODE_ACTIVE_TASK
#define SCU_COMMAND_CODE_PRIMITIVE_SEQ_TASK
#define SCU_COMMAND_CODE_TARGET_RAW_FRAMES

/**
 *
 *
 * SCU_TASK_PRIORITY
 */
/**
 *
 *
 * This priority is used when there is no priority request for this request.
 */
#define SCU_TASK_PRIORITY_NORMAL

/**
 *
 *
 * This priority indicates that the task should be scheduled to the head of the
 * queue.  The task will NOT be executed if the TX is suspended for the remote
 * node.
 */
#define SCU_TASK_PRIORITY_HEAD_OF_Q

/**
 *
 *
 * This priority indicates that the task will be executed before all
 * SCU_TASK_PRIORITY_NORMAL and SCU_TASK_PRIORITY_HEAD_OF_Q tasks. The task
 * WILL be executed if the TX is suspended for the remote node.
 */
#define SCU_TASK_PRIORITY_HIGH

/**
 *
 *
 * This task priority is reserved and should not be used.
 */
#define SCU_TASK_PRIORITY_RESERVED

#define SCU_TASK_INITIATOR_MODE
#define SCU_TASK_TARGET_MODE

#define SCU_TASK_REGULAR
#define SCU_TASK_ABORTED

/* direction bit defintion */
/**
 *
 *
 * SATA_DIRECTION
 */
#define SCU_SATA_WRITE_DATA_DIRECTION
#define SCU_SATA_READ_DATA_DIRECTION

/**
 *
 *
 * SCU_COMMAND_CONTEXT_MACROS These macros provide the mask and shift
 * operations to construct the various SCU commands
 */
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_SHIFT
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_MASK
#define scu_get_command_request_type(x)

#define SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_SHIFT
#define SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_MASK
#define scu_get_command_request_subtype(x)

#define SCU_CONTEXT_COMMAND_REQUEST_FULLTYPE_MASK
#define scu_get_command_request_full_type(x)

#define SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT
#define SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_MASK
#define scu_get_command_protocl_engine_group(x)

#define SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT
#define SCU_CONTEXT_COMMAND_LOGICAL_PORT_MASK
#define scu_get_command_reqeust_logical_port(x)


#define MAKE_SCU_CONTEXT_COMMAND_TYPE(type)

/**
 * MAKE_SCU_CONTEXT_COMMAND_TYPE() -
 *
 * SCU_COMMAND_TYPES These constants provide the grouping of the different SCU
 * command types.
 */
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC
#define SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC

#define MAKE_SCU_CONTEXT_COMMAND_REQUEST(type, command)

/**
 *
 *
 * SCU_REQUEST_TYPES These constants are the various request types that can be
 * posted to the SCU hardware.
 */
#define SCU_CONTEXT_COMMAND_REQUST_POST_TC

#define SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT

#define SCU_CONTEXT_COMMAND_REQUST_DUMP_TC

#define SCU_CONTEXT_COMMAND_POST_RNC_32

#define SCU_CONTEXT_COMMAND_POST_RNC_96

#define SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE

#define SCU_CONTEXT_COMMAND_DUMP_RNC_32

#define SCU_CONTEXT_COMMAND_DUMP_RNC_96

#define SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX

#define SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX

#define SCU_CONTEXT_COMMAND_POST_RNC_RESUME

#define SCU_CONTEXT_IT_NEXUS_LOSS_TIMER_ENABLE

#define SCU_CONTEXT_IT_NEXUS_LOSS_TIMER_DISABLE

/**
 *
 *
 * SCU_TASK_CONTEXT_PROTOCOL SCU Task context protocol types this is uesd to
 * program the SCU Task context protocol field in word 0x00.
 */
#define SCU_TASK_CONTEXT_PROTOCOL_SMP
#define SCU_TASK_CONTEXT_PROTOCOL_SSP
#define SCU_TASK_CONTEXT_PROTOCOL_STP
#define SCU_TASK_CONTEXT_PROTOCOL_NONE

/**
 * struct ssp_task_context - This is the SCU hardware definition for an SSP
 *    request.
 *
 *
 */
struct ssp_task_context {};

/**
 * struct stp_task_context - This is the SCU hardware definition for an STP
 *    request.
 *
 *
 */
struct stp_task_context {};

/**
 * struct smp_task_context - This is the SCU hardware definition for an SMP
 *    request.
 *
 *
 */
struct smp_task_context {};

/**
 * struct primitive_task_context - This is the SCU hardware definition used
 *    when the driver wants to send a primitive on the link.
 *
 *
 */
struct primitive_task_context {};

/**
 * The union of the protocols that can be selected in the SCU task context
 *    field.
 *
 * protocol_context
 */
protocol_context;

/**
 * struct scu_sgl_element - This structure represents a single SCU defined SGL
 *    element. SCU SGLs contain a 64 bit address with the maximum data transfer
 *    being 24 bits in size.  The SGL can not cross a 4GB boundary.
 *
 * struct scu_sgl_element
 */
struct scu_sgl_element {};

#define SCU_SGL_ELEMENT_PAIR_A
#define SCU_SGL_ELEMENT_PAIR_B

/**
 * struct scu_sgl_element_pair - This structure is the SCU hardware definition
 *    of a pair of SGL elements. The SCU hardware always works on SGL pairs.
 *    They are refered to in the DS specification as SGL A and SGL B.  Each SGL
 *    pair is followed by the address of the next pair.
 *
 *
 */
struct scu_sgl_element_pair {};

/**
 * struct transport_snapshot - This structure is the SCU hardware scratch area
 *    for the task context. This is set to 0 by the driver but can be read by
 *    issuing a dump TC request to the SCU.
 *
 *
 */
struct transport_snapshot {};

/**
 * struct scu_task_context - This structure defines the contents of the SCU
 *    silicon task context. It lays out all of the fields according to the
 *    expected order and location for the Storage Controller unit.
 *
 *
 */
struct scu_task_context {} __packed;

#endif /* _SCU_TASK_CONTEXT_H_ */