diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-05-05 05:01:22 +0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 15:04:46 +0400 |
commit | 2ec53eb4d5b301e5c9c386da5685894d572772a5 (patch) | |
tree | 5ae482456e06c036f61724318019299b3a3ca359 /drivers/scsi/isci/sas.h | |
parent | af5ae89350840b9d724fc4fb81d928673bffdd4d (diff) | |
download | linux-2ec53eb4d5b301e5c9c386da5685894d572772a5.tar.xz |
isci: Fixup of smp request
The struct smp_request data structure has be fixed up for Linux consumption.
This probably should go to scsi/sas.h eventually.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/sas.h')
-rw-r--r-- | drivers/scsi/isci/sas.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/drivers/scsi/isci/sas.h b/drivers/scsi/isci/sas.h index 1a1e9bc125c3..f5d7e6a51070 100644 --- a/drivers/scsi/isci/sas.h +++ b/drivers/scsi/isci/sas.h @@ -55,6 +55,9 @@ #ifndef _SCI_SAS_H_ #define _SCI_SAS_H_ + +#include <linux/kernel.h> + /* * SATA FIS Types These constants depict the various SATA FIS types devined in * the serial ATA specification. @@ -106,4 +109,108 @@ struct ssp_task_iu { u8 _r_c[12]; } __packed; + +/* + * struct smp_req_phy_id - This structure defines the contents of + * an SMP Request that is comprised of the struct smp_request_header and a + * phy identifier. + * Examples: SMP_REQUEST_DISCOVER, SMP_REQUEST_REPORT_PHY_SATA. + * + * For specific information on each of these individual fields please reference + * the SAS specification. + */ +struct smp_req_phy_id { + u8 _r_a[4]; /* bytes 4-7 */ + + u8 ign_zone_grp:1; /* byte 8 */ + u8 _r_b:7; + + u8 phy_id; /* byte 9 */ + u8 _r_c; /* byte 10 */ + u8 _r_d; /* byte 11 */ +} __packed; + +/* + * struct smp_req_config_route_info - This structure defines the + * contents of an SMP Configure Route Information request. + * + * For specific information on each of these individual fields please reference + * the SAS specification. + */ +struct smp_req_conf_rtinfo { + u16 exp_change_cnt; /* bytes 4-5 */ + u8 exp_rt_idx_hi; /* byte 6 */ + u8 exp_rt_idx; /* byte 7 */ + + u8 _r_a; /* byte 8 */ + u8 phy_id; /* byte 9 */ + u16 _r_b; /* bytes 10-11 */ + + u8 _r_c:7; /* byte 12 */ + u8 dis_rt_entry:1; + u8 _r_d[3]; /* bytes 13-15 */ + + u8 rt_sas_addr[8]; /* bytes 16-23 */ + u8 _r_e[16]; /* bytes 24-39 */ +} __packed; + +/* + * struct smp_req_phycntl - This structure defines the contents of an + * SMP Phy Controller request. + * + * For specific information on each of these individual fields please reference + * the SAS specification. + */ +struct smp_req_phycntl { + u16 exp_change_cnt; /* byte 4-5 */ + + u8 _r_a[3]; /* bytes 6-8 */ + + u8 phy_id; /* byte 9 */ + u8 phy_op; /* byte 10 */ + + u8 upd_pathway:1; /* byte 11 */ + u8 _r_b:7; + + u8 _r_c[12]; /* byte 12-23 */ + + u8 att_dev_name[8]; /* byte 24-31 */ + + u8 _r_d:4; /* byte 32 */ + u8 min_linkrate:4; + + u8 _r_e:4; /* byte 33 */ + u8 max_linkrate:4; + + u8 _r_f[2]; /* byte 34-35 */ + + u8 pathway:4; /* byte 36 */ + u8 _r_g:4; + + u8 _r_h[3]; /* bytes 37-39 */ +} __packed; + +#define SMP_REQ_VENDOR_SPECIFIC_MAX_LEN 1016 + +/* + * struct smp_req - This structure simply unionizes the existing request + * structures into a common request type. + * + * XXX: This data structure may need to go to scsi/sas.h + */ +struct smp_req { + u8 type; /* byte 0 */ + u8 func; /* byte 1 */ + u8 alloc_resp_len; /* byte 2 */ + u8 req_len; /* byte 3 */ + + union { /* bytes 4-N */ + u32 smp_req_gen; + struct smp_req_phy_id phy_id; + struct smp_req_phycntl phy_cntl; + struct smp_req_conf_rtinfo conf_rt_info; + u8 vendor[SMP_REQ_VENDOR_SPECIFIC_MAX_LEN]; + }; +} __packed; + #endif |