diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-24 23:28:17 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 18:25:44 -0400 |
commit | 3d7fc66dcd8d510aaa46ab9b914b632bc149b05c (patch) | |
tree | 256cf906d79359a90c462b5c1d08dc1969b6b7ed /drivers/scsi/bfa/bfi.h | |
parent | 5a54b1d576d1880eb249e906e0c8e2ffe64506d3 (diff) |
[SCSI] bfa: Added HBA diagnostics support.
- Added diagnostics sub-module to BFA.
- Implemented interface to perform memtest/loopback test
and some other diagnostics tests.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfi.h')
-rw-r--r-- | drivers/scsi/bfa/bfi.h | 109 |
1 files changed, 108 insertions, 1 deletions
diff --git a/drivers/scsi/bfa/bfi.h b/drivers/scsi/bfa/bfi.h index b7eb3dc27d5b..efa41b64bb32 100644 --- a/drivers/scsi/bfa/bfi.h +++ b/drivers/scsi/bfa/bfi.h | |||
@@ -190,6 +190,7 @@ enum bfi_pcifn_class { | |||
190 | */ | 190 | */ |
191 | enum bfi_mclass { | 191 | enum bfi_mclass { |
192 | BFI_MC_IOC = 1, /* IO Controller (IOC) */ | 192 | BFI_MC_IOC = 1, /* IO Controller (IOC) */ |
193 | BFI_MC_DIAG = 2, /* Diagnostic Msgs */ | ||
193 | BFI_MC_FLASH = 3, /* Flash message class */ | 194 | BFI_MC_FLASH = 3, /* Flash message class */ |
194 | BFI_MC_CEE = 4, /* CEE */ | 195 | BFI_MC_CEE = 4, /* CEE */ |
195 | BFI_MC_FCPORT = 5, /* FC port */ | 196 | BFI_MC_FCPORT = 5, /* FC port */ |
@@ -339,7 +340,7 @@ struct bfi_ioc_image_hdr_s { | |||
339 | ((u32)(__p1_mode))) | 340 | ((u32)(__p1_mode))) |
340 | 341 | ||
341 | #define BFI_FWBOOT_TYPE_NORMAL 0 | 342 | #define BFI_FWBOOT_TYPE_NORMAL 0 |
342 | #define BFI_FWBOOT_TYPE_MEMTEST 1 | 343 | #define BFI_FWBOOT_TYPE_MEMTEST 2 |
343 | #define BFI_FWBOOT_ENV_OS 0 | 344 | #define BFI_FWBOOT_ENV_OS 0 |
344 | 345 | ||
345 | enum bfi_port_mode { | 346 | enum bfi_port_mode { |
@@ -923,6 +924,112 @@ struct bfi_flash_erase_rsp_s { | |||
923 | u32 status; | 924 | u32 status; |
924 | }; | 925 | }; |
925 | 926 | ||
927 | /* | ||
928 | *---------------------------------------------------------------------- | ||
929 | * DIAG | ||
930 | *---------------------------------------------------------------------- | ||
931 | */ | ||
932 | enum bfi_diag_h2i { | ||
933 | BFI_DIAG_H2I_PORTBEACON = 1, | ||
934 | BFI_DIAG_H2I_LOOPBACK = 2, | ||
935 | BFI_DIAG_H2I_FWPING = 3, | ||
936 | BFI_DIAG_H2I_TEMPSENSOR = 4, | ||
937 | BFI_DIAG_H2I_LEDTEST = 5, | ||
938 | BFI_DIAG_H2I_QTEST = 6, | ||
939 | }; | ||
940 | |||
941 | enum bfi_diag_i2h { | ||
942 | BFI_DIAG_I2H_PORTBEACON = BFA_I2HM(BFI_DIAG_H2I_PORTBEACON), | ||
943 | BFI_DIAG_I2H_LOOPBACK = BFA_I2HM(BFI_DIAG_H2I_LOOPBACK), | ||
944 | BFI_DIAG_I2H_FWPING = BFA_I2HM(BFI_DIAG_H2I_FWPING), | ||
945 | BFI_DIAG_I2H_TEMPSENSOR = BFA_I2HM(BFI_DIAG_H2I_TEMPSENSOR), | ||
946 | BFI_DIAG_I2H_LEDTEST = BFA_I2HM(BFI_DIAG_H2I_LEDTEST), | ||
947 | BFI_DIAG_I2H_QTEST = BFA_I2HM(BFI_DIAG_H2I_QTEST), | ||
948 | }; | ||
949 | |||
950 | #define BFI_DIAG_MAX_SGES 2 | ||
951 | #define BFI_DIAG_DMA_BUF_SZ (2 * 1024) | ||
952 | #define BFI_BOOT_MEMTEST_RES_ADDR 0x900 | ||
953 | #define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3 | ||
954 | |||
955 | struct bfi_diag_lb_req_s { | ||
956 | struct bfi_mhdr_s mh; | ||
957 | u32 loopcnt; | ||
958 | u32 pattern; | ||
959 | u8 lb_mode; /*!< bfa_port_opmode_t */ | ||
960 | u8 speed; /*!< bfa_port_speed_t */ | ||
961 | u8 rsvd[2]; | ||
962 | }; | ||
963 | |||
964 | struct bfi_diag_lb_rsp_s { | ||
965 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
966 | struct bfa_diag_loopback_result_s res; /* 16 bytes */ | ||
967 | }; | ||
968 | |||
969 | struct bfi_diag_fwping_req_s { | ||
970 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
971 | struct bfi_alen_s alen; /* 12 bytes */ | ||
972 | u32 data; /* user input data pattern */ | ||
973 | u32 count; /* user input dma count */ | ||
974 | u8 qtag; /* track CPE vc */ | ||
975 | u8 rsv[3]; | ||
976 | }; | ||
977 | |||
978 | struct bfi_diag_fwping_rsp_s { | ||
979 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
980 | u32 data; /* user input data pattern */ | ||
981 | u8 qtag; /* track CPE vc */ | ||
982 | u8 dma_status; /* dma status */ | ||
983 | u8 rsv[2]; | ||
984 | }; | ||
985 | |||
986 | /* | ||
987 | * Temperature Sensor | ||
988 | */ | ||
989 | struct bfi_diag_ts_req_s { | ||
990 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
991 | u16 temp; /* 10-bit A/D value */ | ||
992 | u16 brd_temp; /* 9-bit board temp */ | ||
993 | u8 status; | ||
994 | u8 ts_junc; /* show junction tempsensor */ | ||
995 | u8 ts_brd; /* show board tempsensor */ | ||
996 | u8 rsv; | ||
997 | }; | ||
998 | #define bfi_diag_ts_rsp_t struct bfi_diag_ts_req_s | ||
999 | |||
1000 | struct bfi_diag_ledtest_req_s { | ||
1001 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
1002 | u8 cmd; | ||
1003 | u8 color; | ||
1004 | u8 portid; | ||
1005 | u8 led; /* bitmap of LEDs to be tested */ | ||
1006 | u16 freq; /* no. of blinks every 10 secs */ | ||
1007 | u8 rsv[2]; | ||
1008 | }; | ||
1009 | |||
1010 | /* notify host led operation is done */ | ||
1011 | struct bfi_diag_ledtest_rsp_s { | ||
1012 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
1013 | }; | ||
1014 | |||
1015 | struct bfi_diag_portbeacon_req_s { | ||
1016 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
1017 | u32 period; /* beaconing period */ | ||
1018 | u8 beacon; /* 1: beacon on */ | ||
1019 | u8 rsvd[3]; | ||
1020 | }; | ||
1021 | |||
1022 | /* notify host the beacon is off */ | ||
1023 | struct bfi_diag_portbeacon_rsp_s { | ||
1024 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
1025 | }; | ||
1026 | |||
1027 | struct bfi_diag_qtest_req_s { | ||
1028 | struct bfi_mhdr_s mh; /* 4 bytes */ | ||
1029 | u32 data[BFI_LMSG_PL_WSZ]; /* fill up tcm prefetch area */ | ||
1030 | }; | ||
1031 | #define bfi_diag_qtest_rsp_t struct bfi_diag_qtest_req_s | ||
1032 | |||
926 | #pragma pack() | 1033 | #pragma pack() |
927 | 1034 | ||
928 | #endif /* __BFI_H__ */ | 1035 | #endif /* __BFI_H__ */ |