[SCSI] bfa: Support Power on Hours display and diag temp sensor fixes
authorKrishna Gudipati <kgudipat@brocade.com>
Sat, 22 Sep 2012 00:27:01 +0000 (17:27 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Sun, 7 Oct 2012 10:24:19 +0000 (11:24 +0100)
- 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>
drivers/scsi/bfa/bfa_defs.h
drivers/scsi/bfa/bfa_defs_svc.h
drivers/scsi/bfa/bfa_ioc.c

index f0b251e928bffdba6817c00716f5be58aa7f4889..daf7314d2eeaa8d1e3fb75dc939f225539f01e74 100644 (file)
@@ -918,11 +918,40 @@ struct sfp_diag_ext_s {
        u8      ext_status_ctl[2];
 };
 
+/*
+ * Diagnostic: Data Fields -- Address A2h
+ * General Use Fields: User Writable Table - Features's Control Registers
+ * Total 32 bytes
+ */
+struct sfp_usr_eeprom_s {
+       u8      rsvd1[2];       /* 128-129 */
+       u8      ewrap;          /* 130 */
+       u8      rsvd2[2];       /*  */
+       u8      owrap;          /* 133 */
+       u8      rsvd3[2];       /*  */
+       u8      prbs;           /* 136: PRBS 7 generator */
+       u8      rsvd4[2];       /*  */
+       u8      tx_eqz_16;      /* 139: TX Equalizer (16xFC) */
+       u8      tx_eqz_8;       /* 140: TX Equalizer (8xFC) */
+       u8      rsvd5[2];       /*  */
+       u8      rx_emp_16;      /* 143: RX Emphasis (16xFC) */
+       u8      rx_emp_8;       /* 144: RX Emphasis (8xFC) */
+       u8      rsvd6[2];       /*  */
+       u8      tx_eye_adj;     /* 147: TX eye Threshold Adjust */
+       u8      rsvd7[3];       /*  */
+       u8      tx_eye_qctl;    /* 151: TX eye Quality Control */
+       u8      tx_eye_qres;    /* 152: TX eye Quality Result */
+       u8      rsvd8[2];       /*  */
+       u8      poh[3];         /* 155-157: Power On Hours */
+       u8      rsvd9[2];       /*  */
+};
+
 struct sfp_mem_s {
        struct sfp_srlid_base_s srlid_base;
        struct sfp_srlid_ext_s  srlid_ext;
        struct sfp_diag_base_s  diag_base;
        struct sfp_diag_ext_s   diag_ext;
+       struct sfp_usr_eeprom_s usr_eeprom;
 };
 
 /*
index 0e37e233ebc5d2977724400ad1541ed7898e5aff..ec03c8cd8dacd0ecb3961ba1233816880bc46c4a 100644 (file)
@@ -258,6 +258,7 @@ struct bfa_fw_port_lksm_stats_s {
        u32    hwsm_lrr_rx;        /*  No. of times LRR rx-ed by HWSM      */
        u32    hwsm_lr_rx;         /*  No. of times LR rx-ed by HWSM       */
        u32    bbsc_lr;            /* LKSM LR tx for credit recovery       */
+       u32     rsvd;
 };
 
 struct bfa_fw_port_snsm_stats_s {
@@ -270,6 +271,9 @@ struct bfa_fw_port_snsm_stats_s {
        u32    sync_lost;          /*  Sync loss count                     */
        u32    sig_lost;           /*  Signal loss count                   */
        u32    asn8g_attempts;     /* SNSM HWSM at 8Gbps attempts          */
+       u32    adapt_success;      /* SNSM adaptation success   */
+       u32    adapt_fails;        /* SNSM adaptation failures */
+       u32    adapt_ign_fails;    /* SNSM adaptation failures ignored */
 };
 
 struct bfa_fw_port_physm_stats_s {
index c697890eeca8c680d8834fcf407f826b1ac0a375..dea6a5e8677625ae5e1fdefd203f2d3f658bdd81 100644 (file)
@@ -4687,22 +4687,25 @@ diag_tempsensor_comp(struct bfa_diag_s *diag, bfi_diag_ts_rsp_t *rsp)
        diag->tsensor.temp->temp = be16_to_cpu(rsp->temp);
        diag->tsensor.temp->ts_junc = rsp->ts_junc;
        diag->tsensor.temp->ts_brd = rsp->ts_brd;
-       diag->tsensor.temp->status = BFA_STATUS_OK;
 
        if (rsp->ts_brd) {
+               /* tsensor.temp->status is brd_temp status */
+               diag->tsensor.temp->status = rsp->status;
                if (rsp->status == BFA_STATUS_OK) {
                        diag->tsensor.temp->brd_temp =
                                be16_to_cpu(rsp->brd_temp);
-               } else {
-                       bfa_trc(diag, rsp->status);
+               } else
                        diag->tsensor.temp->brd_temp = 0;
-                       diag->tsensor.temp->status = BFA_STATUS_DEVBUSY;
-               }
        }
+
+       bfa_trc(diag, rsp->status);
        bfa_trc(diag, rsp->ts_junc);
        bfa_trc(diag, rsp->temp);
        bfa_trc(diag, rsp->ts_brd);
        bfa_trc(diag, rsp->brd_temp);
+
+       /* tsensor status is always good bcos we always have junction temp */
+       diag->tsensor.status = BFA_STATUS_OK;
        diag->tsensor.cbfn(diag->tsensor.cbarg, diag->tsensor.status);
        diag->tsensor.lock = 0;
 }
@@ -4931,6 +4934,7 @@ bfa_diag_tsensor_query(struct bfa_diag_s *diag,
        diag->tsensor.temp = result;
        diag->tsensor.cbfn = cbfn;
        diag->tsensor.cbarg = cbarg;
+       diag->tsensor.status = BFA_STATUS_OK;
 
        /* Send msg to fw */
        diag_tempsensor_send(diag);
This page took 0.02874 seconds and 5 git commands to generate.