diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-09-21 20:27:01 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-10-07 06:24:19 -0400 |
commit | 4a49b044487dd04e41019b0c8c2aeec3ab090029 (patch) | |
tree | 1cd2a89aa91c72a5689595b982a21ed9fcc24679 /drivers/scsi/bfa | |
parent | 1a1297c644b38d2edfef3004bcc6f9c0084b43a9 (diff) |
[SCSI] bfa: Support Power on Hours display and diag temp sensor fixes
- Add Power On Hours display support during sfpshow
- Fix to properly set the diag temperature sensor status variable.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_defs.h | 29 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 14 |
3 files changed, 42 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfa_defs.h b/drivers/scsi/bfa/bfa_defs.h index f0b251e928bf..daf7314d2eea 100644 --- a/drivers/scsi/bfa/bfa_defs.h +++ b/drivers/scsi/bfa/bfa_defs.h | |||
@@ -918,11 +918,40 @@ struct sfp_diag_ext_s { | |||
918 | u8 ext_status_ctl[2]; | 918 | u8 ext_status_ctl[2]; |
919 | }; | 919 | }; |
920 | 920 | ||
921 | /* | ||
922 | * Diagnostic: Data Fields -- Address A2h | ||
923 | * General Use Fields: User Writable Table - Features's Control Registers | ||
924 | * Total 32 bytes | ||
925 | */ | ||
926 | struct sfp_usr_eeprom_s { | ||
927 | u8 rsvd1[2]; /* 128-129 */ | ||
928 | u8 ewrap; /* 130 */ | ||
929 | u8 rsvd2[2]; /* */ | ||
930 | u8 owrap; /* 133 */ | ||
931 | u8 rsvd3[2]; /* */ | ||
932 | u8 prbs; /* 136: PRBS 7 generator */ | ||
933 | u8 rsvd4[2]; /* */ | ||
934 | u8 tx_eqz_16; /* 139: TX Equalizer (16xFC) */ | ||
935 | u8 tx_eqz_8; /* 140: TX Equalizer (8xFC) */ | ||
936 | u8 rsvd5[2]; /* */ | ||
937 | u8 rx_emp_16; /* 143: RX Emphasis (16xFC) */ | ||
938 | u8 rx_emp_8; /* 144: RX Emphasis (8xFC) */ | ||
939 | u8 rsvd6[2]; /* */ | ||
940 | u8 tx_eye_adj; /* 147: TX eye Threshold Adjust */ | ||
941 | u8 rsvd7[3]; /* */ | ||
942 | u8 tx_eye_qctl; /* 151: TX eye Quality Control */ | ||
943 | u8 tx_eye_qres; /* 152: TX eye Quality Result */ | ||
944 | u8 rsvd8[2]; /* */ | ||
945 | u8 poh[3]; /* 155-157: Power On Hours */ | ||
946 | u8 rsvd9[2]; /* */ | ||
947 | }; | ||
948 | |||
921 | struct sfp_mem_s { | 949 | struct sfp_mem_s { |
922 | struct sfp_srlid_base_s srlid_base; | 950 | struct sfp_srlid_base_s srlid_base; |
923 | struct sfp_srlid_ext_s srlid_ext; | 951 | struct sfp_srlid_ext_s srlid_ext; |
924 | struct sfp_diag_base_s diag_base; | 952 | struct sfp_diag_base_s diag_base; |
925 | struct sfp_diag_ext_s diag_ext; | 953 | struct sfp_diag_ext_s diag_ext; |
954 | struct sfp_usr_eeprom_s usr_eeprom; | ||
926 | }; | 955 | }; |
927 | 956 | ||
928 | /* | 957 | /* |
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index 0e37e233ebc5..ec03c8cd8dac 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h | |||
@@ -258,6 +258,7 @@ struct bfa_fw_port_lksm_stats_s { | |||
258 | u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ | 258 | u32 hwsm_lrr_rx; /* No. of times LRR rx-ed by HWSM */ |
259 | u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ | 259 | u32 hwsm_lr_rx; /* No. of times LR rx-ed by HWSM */ |
260 | u32 bbsc_lr; /* LKSM LR tx for credit recovery */ | 260 | u32 bbsc_lr; /* LKSM LR tx for credit recovery */ |
261 | u32 rsvd; | ||
261 | }; | 262 | }; |
262 | 263 | ||
263 | struct bfa_fw_port_snsm_stats_s { | 264 | struct bfa_fw_port_snsm_stats_s { |
@@ -270,6 +271,9 @@ struct bfa_fw_port_snsm_stats_s { | |||
270 | u32 sync_lost; /* Sync loss count */ | 271 | u32 sync_lost; /* Sync loss count */ |
271 | u32 sig_lost; /* Signal loss count */ | 272 | u32 sig_lost; /* Signal loss count */ |
272 | u32 asn8g_attempts; /* SNSM HWSM at 8Gbps attempts */ | 273 | u32 asn8g_attempts; /* SNSM HWSM at 8Gbps attempts */ |
274 | u32 adapt_success; /* SNSM adaptation success */ | ||
275 | u32 adapt_fails; /* SNSM adaptation failures */ | ||
276 | u32 adapt_ign_fails; /* SNSM adaptation failures ignored */ | ||
273 | }; | 277 | }; |
274 | 278 | ||
275 | struct bfa_fw_port_physm_stats_s { | 279 | struct bfa_fw_port_physm_stats_s { |
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index c697890eeca8..dea6a5e86776 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -4687,22 +4687,25 @@ diag_tempsensor_comp(struct bfa_diag_s *diag, bfi_diag_ts_rsp_t *rsp) | |||
4687 | diag->tsensor.temp->temp = be16_to_cpu(rsp->temp); | 4687 | diag->tsensor.temp->temp = be16_to_cpu(rsp->temp); |
4688 | diag->tsensor.temp->ts_junc = rsp->ts_junc; | 4688 | diag->tsensor.temp->ts_junc = rsp->ts_junc; |
4689 | diag->tsensor.temp->ts_brd = rsp->ts_brd; | 4689 | diag->tsensor.temp->ts_brd = rsp->ts_brd; |
4690 | diag->tsensor.temp->status = BFA_STATUS_OK; | ||
4691 | 4690 | ||
4692 | if (rsp->ts_brd) { | 4691 | if (rsp->ts_brd) { |
4692 | /* tsensor.temp->status is brd_temp status */ | ||
4693 | diag->tsensor.temp->status = rsp->status; | ||
4693 | if (rsp->status == BFA_STATUS_OK) { | 4694 | if (rsp->status == BFA_STATUS_OK) { |
4694 | diag->tsensor.temp->brd_temp = | 4695 | diag->tsensor.temp->brd_temp = |
4695 | be16_to_cpu(rsp->brd_temp); | 4696 | be16_to_cpu(rsp->brd_temp); |
4696 | } else { | 4697 | } else |
4697 | bfa_trc(diag, rsp->status); | ||
4698 | diag->tsensor.temp->brd_temp = 0; | 4698 | diag->tsensor.temp->brd_temp = 0; |
4699 | diag->tsensor.temp->status = BFA_STATUS_DEVBUSY; | ||
4700 | } | ||
4701 | } | 4699 | } |
4700 | |||
4701 | bfa_trc(diag, rsp->status); | ||
4702 | bfa_trc(diag, rsp->ts_junc); | 4702 | bfa_trc(diag, rsp->ts_junc); |
4703 | bfa_trc(diag, rsp->temp); | 4703 | bfa_trc(diag, rsp->temp); |
4704 | bfa_trc(diag, rsp->ts_brd); | 4704 | bfa_trc(diag, rsp->ts_brd); |
4705 | bfa_trc(diag, rsp->brd_temp); | 4705 | bfa_trc(diag, rsp->brd_temp); |
4706 | |||
4707 | /* tsensor status is always good bcos we always have junction temp */ | ||
4708 | diag->tsensor.status = BFA_STATUS_OK; | ||
4706 | diag->tsensor.cbfn(diag->tsensor.cbarg, diag->tsensor.status); | 4709 | diag->tsensor.cbfn(diag->tsensor.cbarg, diag->tsensor.status); |
4707 | diag->tsensor.lock = 0; | 4710 | diag->tsensor.lock = 0; |
4708 | } | 4711 | } |
@@ -4931,6 +4934,7 @@ bfa_diag_tsensor_query(struct bfa_diag_s *diag, | |||
4931 | diag->tsensor.temp = result; | 4934 | diag->tsensor.temp = result; |
4932 | diag->tsensor.cbfn = cbfn; | 4935 | diag->tsensor.cbfn = cbfn; |
4933 | diag->tsensor.cbarg = cbarg; | 4936 | diag->tsensor.cbarg = cbarg; |
4937 | diag->tsensor.status = BFA_STATUS_OK; | ||
4934 | 4938 | ||
4935 | /* Send msg to fw */ | 4939 | /* Send msg to fw */ |
4936 | diag_tempsensor_send(diag); | 4940 | diag_tempsensor_send(diag); |