Commit ceb2a252 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

qla2xxx: Tx/Rx Sensitivity additions

Add support for new transmit/receive sensitivity settings when
updating an ISPs serial-link options.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 7552a93a
...@@ -1026,9 +1026,27 @@ typedef struct { ...@@ -1026,9 +1026,27 @@ typedef struct {
uint8_t special_options[2]; uint8_t special_options[2];
/* Reserved for expanded RISC parameter block */ /* Reserved for expanded RISC parameter block */
uint8_t reserved_2[24]; uint8_t reserved_2[22];
/* /*
* LSB BIT 0 = Tx Sensitivity 1G bit 0
* LSB BIT 1 = Tx Sensitivity 1G bit 1
* LSB BIT 2 = Tx Sensitivity 1G bit 2
* LSB BIT 3 = Tx Sensitivity 1G bit 3
* LSB BIT 4 = Rx Sensitivity 1G bit 0
* LSB BIT 5 = Rx Sensitivity 1G bit 1
* LSB BIT 6 = Rx Sensitivity 1G bit 2
* LSB BIT 7 = Rx Sensitivity 1G bit 3
*
* MSB BIT 0 = Tx Sensitivity 2G bit 0
* MSB BIT 1 = Tx Sensitivity 2G bit 1
* MSB BIT 2 = Tx Sensitivity 2G bit 2
* MSB BIT 3 = Tx Sensitivity 2G bit 3
* MSB BIT 4 = Rx Sensitivity 2G bit 0
* MSB BIT 5 = Rx Sensitivity 2G bit 1
* MSB BIT 6 = Rx Sensitivity 2G bit 2
* MSB BIT 7 = Rx Sensitivity 2G bit 3
*
* LSB BIT 0 = Output Swing 1G bit 0 * LSB BIT 0 = Output Swing 1G bit 0
* LSB BIT 1 = Output Swing 1G bit 1 * LSB BIT 1 = Output Swing 1G bit 1
* LSB BIT 2 = Output Swing 1G bit 2 * LSB BIT 2 = Output Swing 1G bit 2
...@@ -1047,7 +1065,7 @@ typedef struct { ...@@ -1047,7 +1065,7 @@ typedef struct {
* MSB BIT 6 = * MSB BIT 6 =
* MSB BIT 7 = * MSB BIT 7 =
*/ */
uint8_t seriallink_options[2]; uint8_t seriallink_options[4];
/* /*
* NVRAM host parameter block * NVRAM host parameter block
...@@ -2070,6 +2088,7 @@ typedef struct scsi_qla_host { ...@@ -2070,6 +2088,7 @@ typedef struct scsi_qla_host {
uint32_t enable_lip_reset :1; uint32_t enable_lip_reset :1;
uint32_t enable_lip_full_login :1; uint32_t enable_lip_full_login :1;
uint32_t enable_target_reset :1; uint32_t enable_target_reset :1;
uint32_t enable_led_scheme :1;
} flags; } flags;
atomic_t loop_state; atomic_t loop_state;
...@@ -2347,7 +2366,7 @@ typedef struct scsi_qla_host { ...@@ -2347,7 +2366,7 @@ typedef struct scsi_qla_host {
uint32_t fw_transfer_size; uint32_t fw_transfer_size;
uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */ uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */
uint8_t fw_seriallink_options[2]; uint8_t fw_seriallink_options[4];
/* Firmware dump information. */ /* Firmware dump information. */
void *fw_dump; void *fw_dump;
......
...@@ -828,7 +828,7 @@ qla2x00_init_response_q_entries(scsi_qla_host_t *ha) ...@@ -828,7 +828,7 @@ qla2x00_init_response_q_entries(scsi_qla_host_t *ha)
static void static void
qla2x00_update_fw_options(scsi_qla_host_t *ha) qla2x00_update_fw_options(scsi_qla_host_t *ha)
{ {
uint16_t swing, emphasis; uint16_t swing, emphasis, tx_sens, rx_sens;
memset(ha->fw_options, 0, sizeof(ha->fw_options)); memset(ha->fw_options, 0, sizeof(ha->fw_options));
qla2x00_get_fw_options(ha, ha->fw_options); qla2x00_get_fw_options(ha, ha->fw_options);
...@@ -843,24 +843,54 @@ qla2x00_update_fw_options(scsi_qla_host_t *ha) ...@@ -843,24 +843,54 @@ qla2x00_update_fw_options(scsi_qla_host_t *ha)
sizeof(ha->fw_seriallink_options))); sizeof(ha->fw_seriallink_options)));
ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING; ha->fw_options[1] &= ~FO1_SET_EMPHASIS_SWING;
if (ha->fw_seriallink_options[1] & BIT_2) if (ha->fw_seriallink_options[3] & BIT_2) {
ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING; ha->fw_options[1] |= FO1_SET_EMPHASIS_SWING;
/* 1G settings */ /* 1G settings */
swing = ha->fw_seriallink_options[0] & (BIT_2 | BIT_1 | BIT_0); swing = ha->fw_seriallink_options[2] & (BIT_2 | BIT_1 | BIT_0);
emphasis = ha->fw_seriallink_options[0] & (BIT_4 | BIT_3); emphasis = (ha->fw_seriallink_options[2] &
emphasis >>= 3; (BIT_4 | BIT_3)) >> 3;
ha->fw_options[10] = (emphasis << 14) | (swing << 8) | 0x3; tx_sens = ha->fw_seriallink_options[0] &
/* 2G settings */ (BIT_3 | BIT_2 | BIT_1 | BIT_0);
swing = ha->fw_seriallink_options[0] & (BIT_7 | BIT_6 | BIT_5); rx_sens = (ha->fw_seriallink_options[0] &
swing >>= 5; (BIT_7 | BIT_6 | BIT_5 | BIT_4)) >> 4;
emphasis = ha->fw_seriallink_options[1] & (BIT_1 | BIT_0); ha->fw_options[10] = (emphasis << 14) | (swing << 8);
ha->fw_options[11] = (emphasis << 14) | (swing << 8) | 0x3; if (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA6312(ha)) {
if (rx_sens == 0x0)
rx_sens = 0x3;
ha->fw_options[10] |= (tx_sens << 4) | rx_sens;
} else if (IS_QLA2322(ha) || IS_QLA6322(ha))
ha->fw_options[10] |= BIT_5 |
((rx_sens & (BIT_1 | BIT_0)) << 2) |
(tx_sens & (BIT_1 | BIT_0));
/* 2G settings */
swing = (ha->fw_seriallink_options[2] &
(BIT_7 | BIT_6 | BIT_5)) >> 5;
emphasis = ha->fw_seriallink_options[3] & (BIT_1 | BIT_0);
tx_sens = ha->fw_seriallink_options[1] &
(BIT_3 | BIT_2 | BIT_1 | BIT_0);
rx_sens = (ha->fw_seriallink_options[1] &
(BIT_7 | BIT_6 | BIT_5 | BIT_4)) >> 4;
ha->fw_options[11] = (emphasis << 14) | (swing << 8);
if (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA6312(ha)) {
if (rx_sens == 0x0)
rx_sens = 0x3;
ha->fw_options[11] |= (tx_sens << 4) | rx_sens;
} else if (IS_QLA2322(ha) || IS_QLA6322(ha))
ha->fw_options[11] |= BIT_5 |
((rx_sens & (BIT_1 | BIT_0)) << 2) |
(tx_sens & (BIT_1 | BIT_0));
}
/* FCP2 options. */ /* FCP2 options. */
/* Return command IOCBs without waiting for an ABTS to complete. */ /* Return command IOCBs without waiting for an ABTS to complete. */
ha->fw_options[3] |= BIT_13; ha->fw_options[3] |= BIT_13;
/* LED scheme. */
if (ha->flags.enable_led_scheme)
ha->fw_options[2] |= BIT_12;
/* Update firmware options. */ /* Update firmware options. */
qla2x00_set_fw_options(ha, ha->fw_options); qla2x00_set_fw_options(ha, ha->fw_options);
} }
...@@ -1369,12 +1399,13 @@ qla2x00_nvram_config(scsi_qla_host_t *ha) ...@@ -1369,12 +1399,13 @@ qla2x00_nvram_config(scsi_qla_host_t *ha)
ha->flags.enable_lip_reset = ((nv->host_p[1] & BIT_1) ? 1 : 0); ha->flags.enable_lip_reset = ((nv->host_p[1] & BIT_1) ? 1 : 0);
ha->flags.enable_lip_full_login = ((nv->host_p[1] & BIT_2) ? 1 : 0); ha->flags.enable_lip_full_login = ((nv->host_p[1] & BIT_2) ? 1 : 0);
ha->flags.enable_target_reset = ((nv->host_p[1] & BIT_3) ? 1 : 0); ha->flags.enable_target_reset = ((nv->host_p[1] & BIT_3) ? 1 : 0);
ha->flags.enable_led_scheme = ((nv->efi_parameters & BIT_3) ? 1 : 0);
ha->operating_mode = ha->operating_mode =
(icb->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) >> 4; (icb->add_firmware_options[0] & (BIT_6 | BIT_5 | BIT_4)) >> 4;
ha->fw_seriallink_options[0] = nv->seriallink_options[0]; memcpy(ha->fw_seriallink_options, nv->seriallink_options,
ha->fw_seriallink_options[1] = nv->seriallink_options[1]; sizeof(ha->fw_seriallink_options));
/* save HBA serial number */ /* save HBA serial number */
ha->serial0 = icb->port_name[5]; ha->serial0 = icb->port_name[5];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment