ARM: 7409/1: Do not call flush_cache_user_range with mmap_sem held
[linux/fpc-iii.git] / drivers / scsi / isci / scu_task_context.h
blob7df87d923285a8600fb8cfddfcec875030c382f1
1 /*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
5 * GPL LICENSE SUMMARY
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
24 * BSD LICENSE
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 #ifndef _SCU_TASK_CONTEXT_H_
57 #define _SCU_TASK_CONTEXT_H_
59 /**
60 * This file contains the structures and constants for the SCU hardware task
61 * context.
67 /**
68 * enum scu_ssp_task_type - This enumberation defines the various SSP task
69 * types the SCU hardware will accept. The definition for the various task
70 * types the SCU hardware will accept can be found in the DS specification.
74 typedef enum {
75 SCU_TASK_TYPE_IOREAD, /* /< IO READ direction or no direction */
76 SCU_TASK_TYPE_IOWRITE, /* /< IO Write direction */
77 SCU_TASK_TYPE_SMP_REQUEST, /* /< SMP Request type */
78 SCU_TASK_TYPE_RESPONSE, /* /< Driver generated response frame (targt mode) */
79 SCU_TASK_TYPE_RAW_FRAME, /* /< Raw frame request type */
80 SCU_TASK_TYPE_PRIMITIVE /* /< Request for a primitive to be transmitted */
81 } scu_ssp_task_type;
83 /**
84 * enum scu_sata_task_type - This enumeration defines the various SATA task
85 * types the SCU hardware will accept. The definition for the various task
86 * types the SCU hardware will accept can be found in the DS specification.
90 typedef enum {
91 SCU_TASK_TYPE_DMA_IN, /* /< Read request */
92 SCU_TASK_TYPE_FPDMAQ_READ, /* /< NCQ read request */
93 SCU_TASK_TYPE_PACKET_DMA_IN, /* /< Packet read request */
94 SCU_TASK_TYPE_SATA_RAW_FRAME, /* /< Raw frame request */
95 RESERVED_4,
96 RESERVED_5,
97 RESERVED_6,
98 RESERVED_7,
99 SCU_TASK_TYPE_DMA_OUT, /* /< Write request */
100 SCU_TASK_TYPE_FPDMAQ_WRITE, /* /< NCQ write Request */
101 SCU_TASK_TYPE_PACKET_DMA_OUT /* /< Packet write request */
102 } scu_sata_task_type;
108 * SCU_CONTEXT_TYPE
110 #define SCU_TASK_CONTEXT_TYPE 0
111 #define SCU_RNC_CONTEXT_TYPE 1
116 * SCU_TASK_CONTEXT_VALIDITY
118 #define SCU_TASK_CONTEXT_INVALID 0
119 #define SCU_TASK_CONTEXT_VALID 1
124 * SCU_COMMAND_CODE
126 #define SCU_COMMAND_CODE_INITIATOR_NEW_TASK 0
127 #define SCU_COMMAND_CODE_ACTIVE_TASK 1
128 #define SCU_COMMAND_CODE_PRIMITIVE_SEQ_TASK 2
129 #define SCU_COMMAND_CODE_TARGET_RAW_FRAMES 3
134 * SCU_TASK_PRIORITY
139 * This priority is used when there is no priority request for this request.
141 #define SCU_TASK_PRIORITY_NORMAL 0
146 * This priority indicates that the task should be scheduled to the head of the
147 * queue. The task will NOT be executed if the TX is suspended for the remote
148 * node.
150 #define SCU_TASK_PRIORITY_HEAD_OF_Q 1
155 * This priority indicates that the task will be executed before all
156 * SCU_TASK_PRIORITY_NORMAL and SCU_TASK_PRIORITY_HEAD_OF_Q tasks. The task
157 * WILL be executed if the TX is suspended for the remote node.
159 #define SCU_TASK_PRIORITY_HIGH 2
164 * This task priority is reserved and should not be used.
166 #define SCU_TASK_PRIORITY_RESERVED 3
168 #define SCU_TASK_INITIATOR_MODE 1
169 #define SCU_TASK_TARGET_MODE 0
171 #define SCU_TASK_REGULAR 0
172 #define SCU_TASK_ABORTED 1
174 /* direction bit defintion */
178 * SATA_DIRECTION
180 #define SCU_SATA_WRITE_DATA_DIRECTION 0
181 #define SCU_SATA_READ_DATA_DIRECTION 1
186 * SCU_COMMAND_CONTEXT_MACROS These macros provide the mask and shift
187 * operations to construct the various SCU commands
189 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_SHIFT 21
190 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_MASK 0x00E00000
191 #define scu_get_command_request_type(x) \
192 ((x) & SCU_CONTEXT_COMMAND_REQUEST_TYPE_MASK)
194 #define SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_SHIFT 18
195 #define SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_MASK 0x001C0000
196 #define scu_get_command_request_subtype(x) \
197 ((x) & SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_MASK)
199 #define SCU_CONTEXT_COMMAND_REQUEST_FULLTYPE_MASK \
201 SCU_CONTEXT_COMMAND_REQUEST_TYPE_MASK \
202 | SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_MASK \
204 #define scu_get_command_request_full_type(x) \
205 ((x) & SCU_CONTEXT_COMMAND_REQUEST_FULLTYPE_MASK)
207 #define SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_SHIFT 16
208 #define SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_MASK 0x00010000
209 #define scu_get_command_protocl_engine_group(x) \
210 ((x) & SCU_CONTEXT_COMMAND_PROTOCOL_ENGINE_GROUP_MASK)
212 #define SCU_CONTEXT_COMMAND_LOGICAL_PORT_SHIFT 12
213 #define SCU_CONTEXT_COMMAND_LOGICAL_PORT_MASK 0x00007000
214 #define scu_get_command_reqeust_logical_port(x) \
215 ((x) & SCU_CONTEXT_COMMAND_LOGICAL_PORT_MASK)
218 #define MAKE_SCU_CONTEXT_COMMAND_TYPE(type) \
219 ((u32)(type) << SCU_CONTEXT_COMMAND_REQUEST_TYPE_SHIFT)
222 * MAKE_SCU_CONTEXT_COMMAND_TYPE() -
224 * SCU_COMMAND_TYPES These constants provide the grouping of the different SCU
225 * command types.
227 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC MAKE_SCU_CONTEXT_COMMAND_TYPE(0)
228 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC MAKE_SCU_CONTEXT_COMMAND_TYPE(1)
229 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC MAKE_SCU_CONTEXT_COMMAND_TYPE(2)
230 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC MAKE_SCU_CONTEXT_COMMAND_TYPE(3)
231 #define SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC MAKE_SCU_CONTEXT_COMMAND_TYPE(6)
233 #define MAKE_SCU_CONTEXT_COMMAND_REQUEST(type, command) \
234 ((type) | ((command) << SCU_CONTEXT_COMMAND_REQUEST_SUBTYPE_SHIFT))
239 * SCU_REQUEST_TYPES These constants are the various request types that can be
240 * posted to the SCU hardware.
242 #define SCU_CONTEXT_COMMAND_REQUST_POST_TC \
243 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC, 0))
245 #define SCU_CONTEXT_COMMAND_REQUEST_POST_TC_ABORT \
246 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_TC, 1))
248 #define SCU_CONTEXT_COMMAND_REQUST_DUMP_TC \
249 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_TC, 0))
251 #define SCU_CONTEXT_COMMAND_POST_RNC_32 \
252 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC, 0))
254 #define SCU_CONTEXT_COMMAND_POST_RNC_96 \
255 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC, 1))
257 #define SCU_CONTEXT_COMMAND_POST_RNC_INVALIDATE \
258 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_POST_RNC, 2))
260 #define SCU_CONTEXT_COMMAND_DUMP_RNC_32 \
261 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC, 0))
263 #define SCU_CONTEXT_COMMAND_DUMP_RNC_96 \
264 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_DUMP_RNC, 1))
266 #define SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX \
267 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC, 0))
269 #define SCU_CONTEXT_COMMAND_POST_RNC_SUSPEND_TX_RX \
270 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC, 1))
272 #define SCU_CONTEXT_COMMAND_POST_RNC_RESUME \
273 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC, 2))
275 #define SCU_CONTEXT_IT_NEXUS_LOSS_TIMER_ENABLE \
276 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC, 3))
278 #define SCU_CONTEXT_IT_NEXUS_LOSS_TIMER_DISABLE \
279 (MAKE_SCU_CONTEXT_COMMAND_REQUEST(SCU_CONTEXT_COMMAND_REQUEST_TYPE_OTHER_RNC, 4))
284 * SCU_TASK_CONTEXT_PROTOCOL SCU Task context protocol types this is uesd to
285 * program the SCU Task context protocol field in word 0x00.
287 #define SCU_TASK_CONTEXT_PROTOCOL_SMP 0x00
288 #define SCU_TASK_CONTEXT_PROTOCOL_SSP 0x01
289 #define SCU_TASK_CONTEXT_PROTOCOL_STP 0x02
290 #define SCU_TASK_CONTEXT_PROTOCOL_NONE 0x07
293 * struct ssp_task_context - This is the SCU hardware definition for an SSP
294 * request.
298 struct ssp_task_context {
299 /* OFFSET 0x18 */
300 u32 reserved00:24;
301 u32 frame_type:8;
303 /* OFFSET 0x1C */
304 u32 reserved01;
306 /* OFFSET 0x20 */
307 u32 fill_bytes:2;
308 u32 reserved02:6;
309 u32 changing_data_pointer:1;
310 u32 retransmit:1;
311 u32 retry_data_frame:1;
312 u32 tlr_control:2;
313 u32 reserved03:19;
315 /* OFFSET 0x24 */
316 u32 uiRsvd4;
318 /* OFFSET 0x28 */
319 u32 target_port_transfer_tag:16;
320 u32 tag:16;
322 /* OFFSET 0x2C */
323 u32 data_offset;
327 * struct stp_task_context - This is the SCU hardware definition for an STP
328 * request.
332 struct stp_task_context {
333 /* OFFSET 0x18 */
334 u32 fis_type:8;
335 u32 pm_port:4;
336 u32 reserved0:3;
337 u32 control:1;
338 u32 command:8;
339 u32 features:8;
341 /* OFFSET 0x1C */
342 u32 reserved1;
344 /* OFFSET 0x20 */
345 u32 reserved2;
347 /* OFFSET 0x24 */
348 u32 reserved3;
350 /* OFFSET 0x28 */
351 u32 ncq_tag:5;
352 u32 reserved4:27;
354 /* OFFSET 0x2C */
355 u32 data_offset; /* TODO: What is this used for? */
359 * struct smp_task_context - This is the SCU hardware definition for an SMP
360 * request.
364 struct smp_task_context {
365 /* OFFSET 0x18 */
366 u32 response_length:8;
367 u32 function_result:8;
368 u32 function:8;
369 u32 frame_type:8;
371 /* OFFSET 0x1C */
372 u32 smp_response_ufi:12;
373 u32 reserved1:20;
375 /* OFFSET 0x20 */
376 u32 reserved2;
378 /* OFFSET 0x24 */
379 u32 reserved3;
381 /* OFFSET 0x28 */
382 u32 reserved4;
384 /* OFFSET 0x2C */
385 u32 reserved5;
389 * struct primitive_task_context - This is the SCU hardware definition used
390 * when the driver wants to send a primitive on the link.
394 struct primitive_task_context {
395 /* OFFSET 0x18 */
397 * This field is the control word and it must be 0.
399 u32 control; /* /< must be set to 0 */
401 /* OFFSET 0x1C */
403 * This field specifies the primitive that is to be transmitted.
405 u32 sequence;
407 /* OFFSET 0x20 */
408 u32 reserved0;
410 /* OFFSET 0x24 */
411 u32 reserved1;
413 /* OFFSET 0x28 */
414 u32 reserved2;
416 /* OFFSET 0x2C */
417 u32 reserved3;
421 * The union of the protocols that can be selected in the SCU task context
422 * field.
424 * protocol_context
426 union protocol_context {
427 struct ssp_task_context ssp;
428 struct stp_task_context stp;
429 struct smp_task_context smp;
430 struct primitive_task_context primitive;
431 u32 words[6];
435 * struct scu_sgl_element - This structure represents a single SCU defined SGL
436 * element. SCU SGLs contain a 64 bit address with the maximum data transfer
437 * being 24 bits in size. The SGL can not cross a 4GB boundary.
439 * struct scu_sgl_element
441 struct scu_sgl_element {
443 * This field is the upper 32 bits of the 64 bit physical address.
445 u32 address_upper;
448 * This field is the lower 32 bits of the 64 bit physical address.
450 u32 address_lower;
453 * This field is the number of bytes to transfer.
455 u32 length:24;
458 * This field is the address modifier to be used when a virtual function is
459 * requesting a data transfer.
461 u32 address_modifier:8;
465 #define SCU_SGL_ELEMENT_PAIR_A 0
466 #define SCU_SGL_ELEMENT_PAIR_B 1
469 * struct scu_sgl_element_pair - This structure is the SCU hardware definition
470 * of a pair of SGL elements. The SCU hardware always works on SGL pairs.
471 * They are refered to in the DS specification as SGL A and SGL B. Each SGL
472 * pair is followed by the address of the next pair.
476 struct scu_sgl_element_pair {
477 /* OFFSET 0x60-0x68 */
479 * This field is the SGL element A of the SGL pair.
481 struct scu_sgl_element A;
483 /* OFFSET 0x6C-0x74 */
485 * This field is the SGL element B of the SGL pair.
487 struct scu_sgl_element B;
489 /* OFFSET 0x78-0x7C */
491 * This field is the upper 32 bits of the 64 bit address to the next SGL
492 * element pair.
494 u32 next_pair_upper;
497 * This field is the lower 32 bits of the 64 bit address to the next SGL
498 * element pair.
500 u32 next_pair_lower;
505 * struct transport_snapshot - This structure is the SCU hardware scratch area
506 * for the task context. This is set to 0 by the driver but can be read by
507 * issuing a dump TC request to the SCU.
511 struct transport_snapshot {
512 /* OFFSET 0x48 */
513 u32 xfer_rdy_write_data_length;
515 /* OFFSET 0x4C */
516 u32 data_offset;
518 /* OFFSET 0x50 */
519 u32 data_transfer_size:24;
520 u32 reserved_50_0:8;
522 /* OFFSET 0x54 */
523 u32 next_initiator_write_data_offset;
525 /* OFFSET 0x58 */
526 u32 next_initiator_write_data_xfer_size:24;
527 u32 reserved_58_0:8;
531 * struct scu_task_context - This structure defines the contents of the SCU
532 * silicon task context. It lays out all of the fields according to the
533 * expected order and location for the Storage Controller unit.
537 struct scu_task_context {
538 /* OFFSET 0x00 ------ */
540 * This field must be encoded to one of the valid SCU task priority values
541 * - SCU_TASK_PRIORITY_NORMAL
542 * - SCU_TASK_PRIORITY_HEAD_OF_Q
543 * - SCU_TASK_PRIORITY_HIGH
545 u32 priority:2;
548 * This field must be set to true if this is an initiator generated request.
549 * Until target mode is supported all task requests are initiator requests.
551 u32 initiator_request:1;
554 * This field must be set to one of the valid connection rates valid values
555 * are 0x8, 0x9, and 0xA.
557 u32 connection_rate:4;
560 * This field muse be programed when generating an SMP response since the SMP
561 * connection remains open until the SMP response is generated.
563 u32 protocol_engine_index:3;
566 * This field must contain the logical port for the task request.
568 u32 logical_port_index:3;
571 * This field must be set to one of the SCU_TASK_CONTEXT_PROTOCOL values
572 * - SCU_TASK_CONTEXT_PROTOCOL_SMP
573 * - SCU_TASK_CONTEXT_PROTOCOL_SSP
574 * - SCU_TASK_CONTEXT_PROTOCOL_STP
575 * - SCU_TASK_CONTEXT_PROTOCOL_NONE
577 u32 protocol_type:3;
580 * This filed must be set to the TCi allocated for this task
582 u32 task_index:12;
585 * This field is reserved and must be set to 0x00
587 u32 reserved_00_0:1;
590 * For a normal task request this must be set to 0. If this is an abort of
591 * this task request it must be set to 1.
593 u32 abort:1;
596 * This field must be set to true for the SCU hardware to process the task.
598 u32 valid:1;
601 * This field must be set to SCU_TASK_CONTEXT_TYPE
603 u32 context_type:1;
605 /* OFFSET 0x04 */
607 * This field contains the RNi that is the target of this request.
609 u32 remote_node_index:12;
612 * This field is programmed if this is a mirrored request, which we are not
613 * using, in which case it is the RNi for the mirrored target.
615 u32 mirrored_node_index:12;
618 * This field is programmed with the direction of the SATA reqeust
619 * - SCU_SATA_WRITE_DATA_DIRECTION
620 * - SCU_SATA_READ_DATA_DIRECTION
622 u32 sata_direction:1;
625 * This field is programmsed with one of the following SCU_COMMAND_CODE
626 * - SCU_COMMAND_CODE_INITIATOR_NEW_TASK
627 * - SCU_COMMAND_CODE_ACTIVE_TASK
628 * - SCU_COMMAND_CODE_PRIMITIVE_SEQ_TASK
629 * - SCU_COMMAND_CODE_TARGET_RAW_FRAMES
631 u32 command_code:2;
634 * This field is set to true if the remote node should be suspended.
635 * This bit is only valid for SSP & SMP target devices.
637 u32 suspend_node:1;
640 * This field is programmed with one of the following command type codes
642 * For SAS requests use the scu_ssp_task_type
643 * - SCU_TASK_TYPE_IOREAD
644 * - SCU_TASK_TYPE_IOWRITE
645 * - SCU_TASK_TYPE_SMP_REQUEST
646 * - SCU_TASK_TYPE_RESPONSE
647 * - SCU_TASK_TYPE_RAW_FRAME
648 * - SCU_TASK_TYPE_PRIMITIVE
650 * For SATA requests use the scu_sata_task_type
651 * - SCU_TASK_TYPE_DMA_IN
652 * - SCU_TASK_TYPE_FPDMAQ_READ
653 * - SCU_TASK_TYPE_PACKET_DMA_IN
654 * - SCU_TASK_TYPE_SATA_RAW_FRAME
655 * - SCU_TASK_TYPE_DMA_OUT
656 * - SCU_TASK_TYPE_FPDMAQ_WRITE
657 * - SCU_TASK_TYPE_PACKET_DMA_OUT
659 u32 task_type:4;
661 /* OFFSET 0x08 */
663 * This field is reserved and the must be set to 0x00
665 u32 link_layer_control:8; /* presently all reserved */
668 * This field is set to true when TLR is to be enabled
670 u32 ssp_tlr_enable:1;
673 * This is field specifies if the SCU DMAs a response frame to host
674 * memory for good response frames when operating in target mode.
676 u32 dma_ssp_target_good_response:1;
679 * This field indicates if the SCU should DMA the response frame to
680 * host memory.
682 u32 do_not_dma_ssp_good_response:1;
685 * This field is set to true when strict ordering is to be enabled
687 u32 strict_ordering:1;
690 * This field indicates the type of endianess to be utilized for the
691 * frame. command, task, and response frames utilized control_frame
692 * set to 1.
694 u32 control_frame:1;
697 * This field is reserved and the driver should set to 0x00
699 u32 tl_control_reserved:3;
702 * This field is set to true when the SCU hardware task timeout control is to
703 * be enabled
705 u32 timeout_enable:1;
708 * This field is reserved and the driver should set it to 0x00
710 u32 pts_control_reserved:7;
713 * This field should be set to true when block guard is to be enabled
715 u32 block_guard_enable:1;
718 * This field is reserved and the driver should set to 0x00
720 u32 sdma_control_reserved:7;
722 /* OFFSET 0x0C */
724 * This field is the address modifier for this io request it should be
725 * programmed with the virtual function that is making the request.
727 u32 address_modifier:16;
730 * @todo What we support mirrored SMP response frame?
732 u32 mirrored_protocol_engine:3; /* mirrored protocol Engine Index */
735 * If this is a mirrored request the logical port index for the mirrored RNi
736 * must be programmed.
738 u32 mirrored_logical_port:4; /* mirrored local port index */
741 * This field is reserved and the driver must set it to 0x00
743 u32 reserved_0C_0:8;
746 * This field must be set to true if the mirrored request processing is to be
747 * enabled.
749 u32 mirror_request_enable:1; /* Mirrored request Enable */
751 /* OFFSET 0x10 */
753 * This field is the command iu length in dwords
755 u32 ssp_command_iu_length:8;
758 * This is the target TLR enable bit it must be set to 0 when creatning the
759 * task context.
761 u32 xfer_ready_tlr_enable:1;
764 * This field is reserved and the driver must set it to 0x00
766 u32 reserved_10_0:7;
769 * This is the maximum burst size that the SCU hardware will send in one
770 * connection its value is (N x 512) and N must be a multiple of 2. If the
771 * value is 0x00 then maximum burst size is disabled.
773 u32 ssp_max_burst_size:16;
775 /* OFFSET 0x14 */
777 * This filed is set to the number of bytes to be transfered in the request.
779 u32 transfer_length_bytes:24; /* In terms of bytes */
782 * This field is reserved and the driver should set it to 0x00
784 u32 reserved_14_0:8;
786 /* OFFSET 0x18-0x2C */
788 * This union provides for the protocol specif part of the SCU Task Context.
790 union protocol_context type;
792 /* OFFSET 0x30-0x34 */
794 * This field is the upper 32 bits of the 64 bit physical address of the
795 * command iu buffer
797 u32 command_iu_upper;
800 * This field is the lower 32 bits of the 64 bit physical address of the
801 * command iu buffer
803 u32 command_iu_lower;
805 /* OFFSET 0x38-0x3C */
807 * This field is the upper 32 bits of the 64 bit physical address of the
808 * response iu buffer
810 u32 response_iu_upper;
813 * This field is the lower 32 bits of the 64 bit physical address of the
814 * response iu buffer
816 u32 response_iu_lower;
818 /* OFFSET 0x40 */
820 * This field is set to the task phase of the SCU hardware. The driver must
821 * set this to 0x01
823 u32 task_phase:8;
826 * This field is set to the transport layer task status. The driver must set
827 * this to 0x00
829 u32 task_status:8;
832 * This field is used during initiator write TLR
834 u32 previous_extended_tag:4;
837 * This field is set the maximum number of retries for a STP non-data FIS
839 u32 stp_retry_count:2;
842 * This field is reserved and the driver must set it to 0x00
844 u32 reserved_40_1:2;
847 * This field is used by the SCU TL to determine when to take a snapshot when
848 * tranmitting read data frames.
849 * - 0x00 The entire IO
850 * - 0x01 32k
851 * - 0x02 64k
852 * - 0x04 128k
853 * - 0x08 256k
855 u32 ssp_tlr_threshold:4;
858 * This field is reserved and the driver must set it to 0x00
860 u32 reserved_40_2:4;
862 /* OFFSET 0x44 */
863 u32 write_data_length; /* read only set to 0 */
865 /* OFFSET 0x48-0x58 */
866 struct transport_snapshot snapshot; /* read only set to 0 */
868 /* OFFSET 0x5C */
869 u32 block_protection_enable:1;
870 u32 block_size:2;
871 u32 block_protection_function:2;
872 u32 reserved_5C_0:9;
873 u32 active_sgl_element:2; /* read only set to 0 */
874 u32 sgl_exhausted:1; /* read only set to 0 */
875 u32 payload_data_transfer_error:4; /* read only set to 0 */
876 u32 frame_buffer_offset:11; /* read only set to 0 */
878 /* OFFSET 0x60-0x7C */
880 * This field is the first SGL element pair found in the TC data structure.
882 struct scu_sgl_element_pair sgl_pair_ab;
883 /* OFFSET 0x80-0x9C */
885 * This field is the second SGL element pair found in the TC data structure.
887 struct scu_sgl_element_pair sgl_pair_cd;
889 /* OFFSET 0xA0-BC */
890 struct scu_sgl_element_pair sgl_snapshot_ac;
892 /* OFFSET 0xC0 */
893 u32 active_sgl_element_pair; /* read only set to 0 */
895 /* OFFSET 0xC4-0xCC */
896 u32 reserved_C4_CC[3];
898 /* OFFSET 0xD0 */
899 u32 intermediate_crc_value:16;
900 u32 initial_crc_seed:16;
902 /* OFFSET 0xD4 */
903 u32 application_tag_for_verify:16;
904 u32 application_tag_for_generate:16;
906 /* OFFSET 0xD8 */
907 u32 reference_tag_seed_for_verify_function;
909 /* OFFSET 0xDC */
910 u32 reserved_DC;
912 /* OFFSET 0xE0 */
913 u32 reserved_E0_0:16;
914 u32 application_tag_mask_for_generate:16;
916 /* OFFSET 0xE4 */
917 u32 block_protection_control:16;
918 u32 application_tag_mask_for_verify:16;
920 /* OFFSET 0xE8 */
921 u32 block_protection_error:8;
922 u32 reserved_E8_0:24;
924 /* OFFSET 0xEC */
925 u32 reference_tag_seed_for_verify;
927 /* OFFSET 0xF0 */
928 u32 intermediate_crc_valid_snapshot:16;
929 u32 reserved_F0_0:16;
931 /* OFFSET 0xF4 */
932 u32 reference_tag_seed_for_verify_function_snapshot;
934 /* OFFSET 0xF8 */
935 u32 snapshot_of_reserved_dword_DC_of_tc;
937 /* OFFSET 0xFC */
938 u32 reference_tag_seed_for_generate_function_snapshot;
942 #endif /* _SCU_TASK_CONTEXT_H_ */