diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-04-07 01:33:38 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-05-20 18:21:07 -0400 |
commit | bad7001c200458c24864df6f2b1b66548bca7c75 (patch) | |
tree | 84bd053f821cbbfd06710c1d59e3fc26624ad3ab | |
parent | d53b48d512ef477c939aba09c7e258b8dc331b6a (diff) |
[SCSI] qla2xxx: Export additional FCoE attributes for application support.
Cull and export VN_Port MAC address and VLAN_ID information on
supported FCoE ISPs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 32 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 5 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 14 |
3 files changed, 50 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index b09993a06576..5d44e3e6488c 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1088,6 +1088,33 @@ qla2x00_flash_block_size_show(struct device *dev, | |||
1088 | return snprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); | 1088 | return snprintf(buf, PAGE_SIZE, "0x%x\n", ha->fdt_block_size); |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | static ssize_t | ||
1092 | qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr, | ||
1093 | char *buf) | ||
1094 | { | ||
1095 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1096 | |||
1097 | if (!IS_QLA81XX(vha->hw)) | ||
1098 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1099 | |||
1100 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); | ||
1101 | } | ||
1102 | |||
1103 | static ssize_t | ||
1104 | qla2x00_vn_port_mac_address_show(struct device *dev, | ||
1105 | struct device_attribute *attr, char *buf) | ||
1106 | { | ||
1107 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1108 | |||
1109 | if (!IS_QLA81XX(vha->hw)) | ||
1110 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1111 | |||
1112 | return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", | ||
1113 | vha->fcoe_vn_port_mac[5], vha->fcoe_vn_port_mac[4], | ||
1114 | vha->fcoe_vn_port_mac[3], vha->fcoe_vn_port_mac[2], | ||
1115 | vha->fcoe_vn_port_mac[1], vha->fcoe_vn_port_mac[0]); | ||
1116 | } | ||
1117 | |||
1091 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 1118 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |
1092 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); | 1119 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); |
1093 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); | 1120 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); |
@@ -1116,6 +1143,9 @@ static DEVICE_ATTR(mpi_version, S_IRUGO, qla2x00_mpi_version_show, NULL); | |||
1116 | static DEVICE_ATTR(phy_version, S_IRUGO, qla2x00_phy_version_show, NULL); | 1143 | static DEVICE_ATTR(phy_version, S_IRUGO, qla2x00_phy_version_show, NULL); |
1117 | static DEVICE_ATTR(flash_block_size, S_IRUGO, qla2x00_flash_block_size_show, | 1144 | static DEVICE_ATTR(flash_block_size, S_IRUGO, qla2x00_flash_block_size_show, |
1118 | NULL); | 1145 | NULL); |
1146 | static DEVICE_ATTR(vlan_id, S_IRUGO, qla2x00_vlan_id_show, NULL); | ||
1147 | static DEVICE_ATTR(vn_port_mac_address, S_IRUGO, | ||
1148 | qla2x00_vn_port_mac_address_show, NULL); | ||
1119 | 1149 | ||
1120 | struct device_attribute *qla2x00_host_attrs[] = { | 1150 | struct device_attribute *qla2x00_host_attrs[] = { |
1121 | &dev_attr_driver_version, | 1151 | &dev_attr_driver_version, |
@@ -1138,6 +1168,8 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
1138 | &dev_attr_mpi_version, | 1168 | &dev_attr_mpi_version, |
1139 | &dev_attr_phy_version, | 1169 | &dev_attr_phy_version, |
1140 | &dev_attr_flash_block_size, | 1170 | &dev_attr_flash_block_size, |
1171 | &dev_attr_vlan_id, | ||
1172 | &dev_attr_vn_port_mac_address, | ||
1141 | NULL, | 1173 | NULL, |
1142 | }; | 1174 | }; |
1143 | 1175 | ||
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 714ee67567e1..645cfd9e6cf6 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2618,6 +2618,11 @@ typedef struct scsi_qla_host { | |||
2618 | uint8_t node_name[WWN_SIZE]; | 2618 | uint8_t node_name[WWN_SIZE]; |
2619 | uint8_t port_name[WWN_SIZE]; | 2619 | uint8_t port_name[WWN_SIZE]; |
2620 | uint8_t fabric_node_name[WWN_SIZE]; | 2620 | uint8_t fabric_node_name[WWN_SIZE]; |
2621 | |||
2622 | uint16_t fcoe_vlan_id; | ||
2623 | uint16_t fcoe_fcf_idx; | ||
2624 | uint8_t fcoe_vn_port_mac[6]; | ||
2625 | |||
2621 | uint32_t vp_abort_cnt; | 2626 | uint32_t vp_abort_cnt; |
2622 | 2627 | ||
2623 | struct fc_vport *fc_vport; /* holds fc_vport * for each vport */ | 2628 | struct fc_vport *fc_vport; /* holds fc_vport * for each vport */ |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 14584380ad26..dc5a1fe19210 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -931,6 +931,8 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa, | |||
931 | mcp->mb[9] = vha->vp_idx; | 931 | mcp->mb[9] = vha->vp_idx; |
932 | mcp->out_mb = MBX_9|MBX_0; | 932 | mcp->out_mb = MBX_9|MBX_0; |
933 | mcp->in_mb = MBX_9|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; | 933 | mcp->in_mb = MBX_9|MBX_7|MBX_6|MBX_3|MBX_2|MBX_1|MBX_0; |
934 | if (IS_QLA81XX(vha->hw)) | ||
935 | mcp->in_mb |= MBX_13|MBX_12|MBX_11|MBX_10; | ||
934 | mcp->tov = MBX_TOV_SECONDS; | 936 | mcp->tov = MBX_TOV_SECONDS; |
935 | mcp->flags = 0; | 937 | mcp->flags = 0; |
936 | rval = qla2x00_mailbox_command(vha, mcp); | 938 | rval = qla2x00_mailbox_command(vha, mcp); |
@@ -952,9 +954,19 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa, | |||
952 | DEBUG2_3_11(printk("qla2x00_get_adapter_id(%ld): failed=%x.\n", | 954 | DEBUG2_3_11(printk("qla2x00_get_adapter_id(%ld): failed=%x.\n", |
953 | vha->host_no, rval)); | 955 | vha->host_no, rval)); |
954 | } else { | 956 | } else { |
955 | /*EMPTY*/ | ||
956 | DEBUG11(printk("qla2x00_get_adapter_id(%ld): done.\n", | 957 | DEBUG11(printk("qla2x00_get_adapter_id(%ld): done.\n", |
957 | vha->host_no)); | 958 | vha->host_no)); |
959 | |||
960 | if (IS_QLA81XX(vha->hw)) { | ||
961 | vha->fcoe_vlan_id = mcp->mb[9] & 0xfff; | ||
962 | vha->fcoe_fcf_idx = mcp->mb[10]; | ||
963 | vha->fcoe_vn_port_mac[5] = mcp->mb[11] >> 8; | ||
964 | vha->fcoe_vn_port_mac[4] = mcp->mb[11] & 0xff; | ||
965 | vha->fcoe_vn_port_mac[3] = mcp->mb[12] >> 8; | ||
966 | vha->fcoe_vn_port_mac[2] = mcp->mb[12] & 0xff; | ||
967 | vha->fcoe_vn_port_mac[1] = mcp->mb[13] >> 8; | ||
968 | vha->fcoe_vn_port_mac[0] = mcp->mb[13] & 0xff; | ||
969 | } | ||
958 | } | 970 | } |
959 | 971 | ||
960 | return rval; | 972 | return rval; |