1285809Sscottl/*******************************************************************************
2285809Sscottl*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3285809Sscottl*
4285809Sscottl*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5285809Sscottl*that the following conditions are met:
6285809Sscottl*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7285809Sscottl*following disclaimer.
8285809Sscottl*2. Redistributions in binary form must reproduce the above copyright notice,
9285809Sscottl*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10285809Sscottl*with the distribution.
11285809Sscottl*
12285809Sscottl*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13285809Sscottl*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14285809Sscottl*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15285809Sscottl*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16285809Sscottl*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17285809Sscottl*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18285809Sscottl*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19285809Sscottl*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20285809Sscottl
21285809Sscottl********************************************************************************/
22285809Sscottl/*******************************************************************************/
23285809Sscottl/** \file
24285809Sscottl *
25285809Sscottl * $RCSfile: ttdglobl.h,v $
26285809Sscottl *
27285809Sscottl * Copyright 2006 PMC-Sierra, Inc.
28285809Sscottl *
29285809Sscottl * $Author: vempatin $
30285809Sscottl * $Revision: 113679 $
31285809Sscottl * $Date: 2012-04-16 14:35:19 -0700 (Mon, 16 Apr 2012) $
32285809Sscottl *
33285809Sscottl * #define for SAS target in SAS/SATA TD layer
34285809Sscottl *
35285809Sscottl */
36285809Sscottl
37285809Sscottl
38285809Sscottl#ifndef __TTD_GLOBALS_H__
39285809Sscottl
40285809Sscottl#define __TTD_GLOBALS_H__
41285809Sscottl
42285809Sscottl/*
43285809Sscottl * Transport Target specific default parameters.
44285809Sscottl */
45285809Sscottl#define DEFAULT_XCHGS                   256
46285809Sscottl#define DEFAULT_TGT_TIMER_TICK          1000000     /* 1 second */
47285809Sscottl#define DEFAULT_MAX_TARGETS             256
48285809Sscottl#define DEFAULT_BLOCK_SIZE              512
49285809Sscottl
50285809Sscottl
51285809Sscottl/* Exchange field accessors */
52285809Sscottl#define TD_XCHG_CONTEXT(ti_root)                    (&TD_GET_TITGT_CONTEXT(ti_root)->ttdsaXchgData)
53285809Sscottl#define TD_XCHG_CONTEXT_MAX_NUM_XCHGS(ti_root)      (TD_XCHG_CONTEXT(ti_root)->maxNumXchgs)
54285809Sscottl#define TD_XCHG_CONTEXT_NO_USED(ti_root)            (TD_XCHG_CONTEXT(ti_root)->noUsed)
55285809Sscottl#define TD_XCHG_CONTEXT_NO_FREED(ti_root)           (TD_XCHG_CONTEXT(ti_root)->noFreed)
56285809Sscottl#define TD_XCHG_CONTEXT_NO_CMD_RCVD(ti_root)        (TD_XCHG_CONTEXT(ti_root)->noCmdRcvd)
57285809Sscottl#define TD_XCHG_CONTEXT_NO_START_IO(ti_root)        (TD_XCHG_CONTEXT(ti_root)->noStartIo)
58285809Sscottl#define TD_XCHG_CONTEXT_NO_SEND_RSP(ti_root)        (TD_XCHG_CONTEXT(ti_root)->noSendRsp)
59285809Sscottl#define TD_XCHG_CONTEXT_NO_IO_COMPLETED(ti_root)    (TD_XCHG_CONTEXT(ti_root)->noCompleted)
60285809Sscottl
61285809Sscottl#define TD_XCHG_GET_CONTEXT(ti_request)             ((ttdsaXchg_t *)(ti_request)->tdData)
62285809Sscottl#define TD_XCHG_GET_STATE(xchg)                     (xchg->state)
63285809Sscottl#define TD_XCHG_SET_STATE(xchg, val)                (xchg->state) = (val)
64285809Sscottl
65285809Sscottl#define TD_XCHG_STATE_ACTIVE                        1
66285809Sscottl#define TD_XCHG_STATE_INACTIVE                      0
67285809Sscottl
68285809Sscottl#define READ_GOOD_RESPONSE                          0x1
69285809Sscottl#define WRITE_GOOD_RESPONSE                         0x2
70285809Sscottl
71285809Sscottl#endif  /* __TTD_GLOBALS_H__ */
72