home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / include / scsi / sas / sas.h < prev   
Encoding:
C/C++ Source or Header  |  2006-08-11  |  4.0 KB  |  163 lines

  1. /*
  2.  * SAS structures and definitions header file
  3.  *
  4.  * Copyright (C) 2005 Adaptec, Inc.  All rights reserved.
  5.  * Copyright (C) 2005 Luben Tuikov <luben_tuikov@adaptec.com>
  6.  *
  7.  * This file is licensed under GPLv2.
  8.  *
  9.  * This program is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU General Public License as
  11.  * published by the Free Software Foundation; either version 2 of the
  12.  * License, or (at your option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful, but
  15.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  17.  * General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  22.  *
  23.  * $Id: //depot/sas-class/sas.h#28 $
  24.  */
  25.  
  26. #ifndef _SAS_H_
  27. #define _SAS_H_
  28.  
  29. #include <linux/types.h>
  30. #include <asm/byteorder.h>
  31.  
  32. #define SAS_ADDR_SIZE        8
  33. #define HASHED_SAS_ADDR_SIZE 3
  34. #define SAS_ADDR(_sa)   ((unsigned long long) be64_to_cpu(*(__be64 *)(_sa)))
  35.  
  36. enum sas_oob_mode {
  37.     OOB_NOT_CONNECTED,
  38.     SATA_OOB_MODE,
  39.     SAS_OOB_MODE
  40. };
  41.  
  42. /* See sas_discover.c if you plan on changing these.
  43.  */
  44. enum sas_dev_type {
  45.     NO_DEVICE   = 0,      /* protocol */
  46.     SAS_END_DEV = 1,      /* protocol */
  47.     EDGE_DEV    = 2,      /* protocol */
  48.     FANOUT_DEV  = 3,      /* protocol */
  49.     SAS_HA      = 4,
  50.     SATA_DEV    = 5,
  51.     SATA_PM     = 7,
  52.     SATA_PM_PORT= 8,
  53. };
  54.  
  55. enum sas_phy_linkrate {
  56.     PHY_LINKRATE_NONE = 0,
  57.     PHY_LINKRATE_UNKNOWN = 0,
  58.     PHY_DISABLED,
  59.     PHY_RESET_PROBLEM,
  60.     PHY_SPINUP_HOLD,
  61.     PHY_PORT_SELECTOR,
  62.     PHY_LINKRATE_1_5 = 0x08,
  63.     PHY_LINKRATE_G1  = PHY_LINKRATE_1_5,
  64.     PHY_LINKRATE_3   = 0x09,
  65.     PHY_LINKRATE_G2  = PHY_LINKRATE_3,
  66.     PHY_LINKRATE_6   = 0x0A,
  67. };
  68.  
  69. /* Partly from IDENTIFY address frame. */
  70. enum sas_proto {
  71.     SATA_PROTO    = 1,
  72.     SAS_PROTO_SMP = 2,      /* protocol */
  73.     SAS_PROTO_STP = 4,      /* protocol */
  74.     SAS_PROTO_SSP = 8,      /* protocol */
  75.     SAS_PROTO_ALL = 0xE,
  76. };
  77.  
  78. enum phy_func {
  79.     PHY_FUNC_NOP,
  80.     PHY_FUNC_LINK_RESET,          /* Enables the phy */
  81.     PHY_FUNC_HARD_RESET,
  82.     PHY_FUNC_DISABLE,
  83.     PHY_FUNC_CLEAR_ERROR_LOG = 5,
  84.     PHY_FUNC_CLEAR_AFFIL,
  85.     PHY_FUNC_TX_SATA_PS_SIGNAL,
  86.     PHY_FUNC_RELEASE_SPINUP_HOLD = 0x10, /* LOCAL PORT ONLY! */
  87. };
  88.  
  89. #include <scsi/sas/sas_frames.h>
  90.  
  91. /* SAS LLDD would need to report only _very_few_ of those, like BROADCAST.
  92.  * Most of those are here for completeness.
  93.  */
  94. enum sas_prim {
  95.     SAS_PRIM_AIP_NORMAL = 1,
  96.     SAS_PRIM_AIP_R0     = 2,
  97.     SAS_PRIM_AIP_R1     = 3,
  98.     SAS_PRIM_AIP_R2     = 4,
  99.     SAS_PRIM_AIP_WC     = 5,
  100.     SAS_PRIM_AIP_WD     = 6,
  101.     SAS_PRIM_AIP_WP     = 7,
  102.     SAS_PRIM_AIP_RWP    = 8,
  103.  
  104.     SAS_PRIM_BC_CH      = 9,
  105.     SAS_PRIM_BC_RCH0    = 10,
  106.     SAS_PRIM_BC_RCH1    = 11,
  107.     SAS_PRIM_BC_R0      = 12,
  108.     SAS_PRIM_BC_R1      = 13,
  109.     SAS_PRIM_BC_R2      = 14,
  110.     SAS_PRIM_BC_R3      = 15,
  111.     SAS_PRIM_BC_R4      = 16,
  112.  
  113.     SAS_PRIM_NOTIFY_ENSP= 17,
  114.     SAS_PRIM_NOTIFY_R0  = 18,
  115.     SAS_PRIM_NOTIFY_R1  = 19,
  116.     SAS_PRIM_NOTIFY_R2  = 20,
  117.  
  118.     SAS_PRIM_CLOSE_CLAF = 21,
  119.     SAS_PRIM_CLOSE_NORM = 22,
  120.     SAS_PRIM_CLOSE_R0   = 23,
  121.     SAS_PRIM_CLOSE_R1   = 24,
  122.  
  123.     SAS_PRIM_OPEN_RTRY  = 25,
  124.     SAS_PRIM_OPEN_RJCT  = 26,
  125.     SAS_PRIM_OPEN_ACPT  = 27,
  126.  
  127.     SAS_PRIM_DONE       = 28,
  128.     SAS_PRIM_BREAK      = 29,
  129.  
  130.     SATA_PRIM_DMAT      = 33,
  131.     SATA_PRIM_PMNAK     = 34,
  132.     SATA_PRIM_PMACK     = 35,
  133.     SATA_PRIM_PMREQ_S   = 36,
  134.     SATA_PRIM_PMREQ_P   = 37,
  135.     SATA_SATA_R_ERR     = 38,
  136. };
  137.  
  138. enum sas_open_rej_reason {
  139.     /* Abandon open */
  140.     SAS_OREJ_UNKNOWN   = 0,
  141.     SAS_OREJ_BAD_DEST  = 1,
  142.     SAS_OREJ_CONN_RATE = 2,
  143.     SAS_OREJ_EPROTO    = 3,
  144.     SAS_OREJ_RESV_AB0  = 4,
  145.     SAS_OREJ_RESV_AB1  = 5,
  146.     SAS_OREJ_RESV_AB2  = 6,
  147.     SAS_OREJ_RESV_AB3  = 7,
  148.     SAS_OREJ_WRONG_DEST= 8,
  149.     SAS_OREJ_STP_NORES = 9,
  150.  
  151.     /* Retry open */
  152.     SAS_OREJ_NO_DEST   = 10,
  153.     SAS_OREJ_PATH_BLOCKED = 11,
  154.     SAS_OREJ_RSVD_CONT0 = 12,
  155.     SAS_OREJ_RSVD_CONT1 = 13,
  156.     SAS_OREJ_RSVD_INIT0 = 14,
  157.     SAS_OREJ_RSVD_INIT1 = 15,
  158.     SAS_OREJ_RSVD_STOP0 = 16,
  159.     SAS_OREJ_RSVD_STOP1 = 17,
  160.     SAS_OREJ_RSVD_RETRY = 18,
  161. };
  162. #endif /* _SAS_H_ */
  163.