aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeerav Parikh <neerav.parikh@intel.com>2012-01-22 20:29:50 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-19 09:08:57 -0500
commitbb8ef587a715c6a084f80b9c311136aa765ebfad (patch)
treed698fe51340daabf798e94550e7b20b90decf1fc
parent263d9401a332ccec8945841dbc57707dcba1ec7d (diff)
[SCSI] scsi_transport_fc: Add FDMI host attributes
This adds FC-GS Fabric Device Management Interface (FDMI) related attributes to fc_host_attr structure. This is in preparation for allowing FDMI attributes to be registered via libfc. Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Acked-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/scsi_transport_fc.c30
-rw-r--r--include/scsi/scsi_transport_fc.h28
2 files changed, 57 insertions, 1 deletions
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index f59d4a05ecd7..80fbe2ac0b47 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -313,7 +313,7 @@ static void fc_scsi_scan_rport(struct work_struct *work);
313#define FC_STARGET_NUM_ATTRS 3 313#define FC_STARGET_NUM_ATTRS 3
314#define FC_RPORT_NUM_ATTRS 10 314#define FC_RPORT_NUM_ATTRS 10
315#define FC_VPORT_NUM_ATTRS 9 315#define FC_VPORT_NUM_ATTRS 9
316#define FC_HOST_NUM_ATTRS 22 316#define FC_HOST_NUM_ATTRS 29
317 317
318struct fc_internal { 318struct fc_internal {
319 struct scsi_transport_template t; 319 struct scsi_transport_template t;
@@ -399,6 +399,20 @@ static int fc_host_setup(struct transport_container *tc, struct device *dev,
399 fc_host->max_npiv_vports = 0; 399 fc_host->max_npiv_vports = 0;
400 memset(fc_host->serial_number, 0, 400 memset(fc_host->serial_number, 0,
401 sizeof(fc_host->serial_number)); 401 sizeof(fc_host->serial_number));
402 memset(fc_host->manufacturer, 0,
403 sizeof(fc_host->manufacturer));
404 memset(fc_host->model, 0,
405 sizeof(fc_host->model));
406 memset(fc_host->model_description, 0,
407 sizeof(fc_host->model_description));
408 memset(fc_host->hardware_version, 0,
409 sizeof(fc_host->hardware_version));
410 memset(fc_host->driver_version, 0,
411 sizeof(fc_host->driver_version));
412 memset(fc_host->firmware_version, 0,
413 sizeof(fc_host->firmware_version));
414 memset(fc_host->optionrom_version, 0,
415 sizeof(fc_host->optionrom_version));
402 416
403 fc_host->port_id = -1; 417 fc_host->port_id = -1;
404 fc_host->port_type = FC_PORTTYPE_UNKNOWN; 418 fc_host->port_type = FC_PORTTYPE_UNKNOWN;
@@ -1513,6 +1527,13 @@ fc_private_host_rd_attr_cast(permanent_port_name, "0x%llx\n", 20,
1513fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20); 1527fc_private_host_rd_attr(maxframe_size, "%u bytes\n", 20);
1514fc_private_host_rd_attr(max_npiv_vports, "%u\n", 20); 1528fc_private_host_rd_attr(max_npiv_vports, "%u\n", 20);
1515fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1)); 1529fc_private_host_rd_attr(serial_number, "%s\n", (FC_SERIAL_NUMBER_SIZE +1));
1530fc_private_host_rd_attr(manufacturer, "%s\n", FC_SERIAL_NUMBER_SIZE + 1);
1531fc_private_host_rd_attr(model, "%s\n", FC_SYMBOLIC_NAME_SIZE + 1);
1532fc_private_host_rd_attr(model_description, "%s\n", FC_SYMBOLIC_NAME_SIZE + 1);
1533fc_private_host_rd_attr(hardware_version, "%s\n", FC_VERSION_STRING_SIZE + 1);
1534fc_private_host_rd_attr(driver_version, "%s\n", FC_VERSION_STRING_SIZE + 1);
1535fc_private_host_rd_attr(firmware_version, "%s\n", FC_VERSION_STRING_SIZE + 1);
1536fc_private_host_rd_attr(optionrom_version, "%s\n", FC_VERSION_STRING_SIZE + 1);
1516 1537
1517 1538
1518/* Dynamic Host Attributes */ 1539/* Dynamic Host Attributes */
@@ -2208,6 +2229,13 @@ fc_attach_transport(struct fc_function_template *ft)
2208 SETUP_HOST_ATTRIBUTE_RD_NS(npiv_vports_inuse); 2229 SETUP_HOST_ATTRIBUTE_RD_NS(npiv_vports_inuse);
2209 } 2230 }
2210 SETUP_HOST_ATTRIBUTE_RD(serial_number); 2231 SETUP_HOST_ATTRIBUTE_RD(serial_number);
2232 SETUP_HOST_ATTRIBUTE_RD(manufacturer);
2233 SETUP_HOST_ATTRIBUTE_RD(model);
2234 SETUP_HOST_ATTRIBUTE_RD(model_description);
2235 SETUP_HOST_ATTRIBUTE_RD(hardware_version);
2236 SETUP_HOST_ATTRIBUTE_RD(driver_version);
2237 SETUP_HOST_ATTRIBUTE_RD(firmware_version);
2238 SETUP_HOST_ATTRIBUTE_RD(optionrom_version);
2211 2239
2212 SETUP_HOST_ATTRIBUTE_RD(port_id); 2240 SETUP_HOST_ATTRIBUTE_RD(port_id);
2213 SETUP_HOST_ATTRIBUTE_RD(port_type); 2241 SETUP_HOST_ATTRIBUTE_RD(port_type);
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 2a65167a8f10..0135cbc08089 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -486,6 +486,13 @@ struct fc_host_attrs {
486 u32 maxframe_size; 486 u32 maxframe_size;
487 u16 max_npiv_vports; 487 u16 max_npiv_vports;
488 char serial_number[FC_SERIAL_NUMBER_SIZE]; 488 char serial_number[FC_SERIAL_NUMBER_SIZE];
489 char manufacturer[FC_SERIAL_NUMBER_SIZE];
490 char model[FC_SYMBOLIC_NAME_SIZE];
491 char model_description[FC_SYMBOLIC_NAME_SIZE];
492 char hardware_version[FC_VERSION_STRING_SIZE];
493 char driver_version[FC_VERSION_STRING_SIZE];
494 char firmware_version[FC_VERSION_STRING_SIZE];
495 char optionrom_version[FC_VERSION_STRING_SIZE];
489 496
490 /* Dynamic Attributes */ 497 /* Dynamic Attributes */
491 u32 port_id; 498 u32 port_id;
@@ -541,6 +548,20 @@ struct fc_host_attrs {
541 (((struct fc_host_attrs *)(x)->shost_data)->max_npiv_vports) 548 (((struct fc_host_attrs *)(x)->shost_data)->max_npiv_vports)
542#define fc_host_serial_number(x) \ 549#define fc_host_serial_number(x) \
543 (((struct fc_host_attrs *)(x)->shost_data)->serial_number) 550 (((struct fc_host_attrs *)(x)->shost_data)->serial_number)
551#define fc_host_manufacturer(x) \
552 (((struct fc_host_attrs *)(x)->shost_data)->manufacturer)
553#define fc_host_model(x) \
554 (((struct fc_host_attrs *)(x)->shost_data)->model)
555#define fc_host_model_description(x) \
556 (((struct fc_host_attrs *)(x)->shost_data)->model_description)
557#define fc_host_hardware_version(x) \
558 (((struct fc_host_attrs *)(x)->shost_data)->hardware_version)
559#define fc_host_driver_version(x) \
560 (((struct fc_host_attrs *)(x)->shost_data)->driver_version)
561#define fc_host_firmware_version(x) \
562 (((struct fc_host_attrs *)(x)->shost_data)->firmware_version)
563#define fc_host_optionrom_version(x) \
564 (((struct fc_host_attrs *)(x)->shost_data)->optionrom_version)
544#define fc_host_port_id(x) \ 565#define fc_host_port_id(x) \
545 (((struct fc_host_attrs *)(x)->shost_data)->port_id) 566 (((struct fc_host_attrs *)(x)->shost_data)->port_id)
546#define fc_host_port_type(x) \ 567#define fc_host_port_type(x) \
@@ -700,6 +721,13 @@ struct fc_function_template {
700 unsigned long show_host_supported_speeds:1; 721 unsigned long show_host_supported_speeds:1;
701 unsigned long show_host_maxframe_size:1; 722 unsigned long show_host_maxframe_size:1;
702 unsigned long show_host_serial_number:1; 723 unsigned long show_host_serial_number:1;
724 unsigned long show_host_manufacturer:1;
725 unsigned long show_host_model:1;
726 unsigned long show_host_model_description:1;
727 unsigned long show_host_hardware_version:1;
728 unsigned long show_host_driver_version:1;
729 unsigned long show_host_firmware_version:1;
730 unsigned long show_host_optionrom_version:1;
703 /* host dynamic attributes */ 731 /* host dynamic attributes */
704 unsigned long show_host_port_id:1; 732 unsigned long show_host_port_id:1;
705 unsigned long show_host_port_type:1; 733 unsigned long show_host_port_type:1;