2 * QLogic iSCSI HBA Driver
3 * Copyright (c) 2003-2011 QLogic Corporation
5 * See LICENSE.qla4xxx for copyright and licensing details.
12 /* Scsi_Host attributes. */
14 qla4xxx_fw_version_show(struct device
*dev
,
15 struct device_attribute
*attr
, char *buf
)
17 struct scsi_qla_host
*ha
= to_qla_host(class_to_shost(dev
));
20 return snprintf(buf
, PAGE_SIZE
, "%d.%02d.%02d (%x)\n",
21 ha
->firmware_version
[0],
22 ha
->firmware_version
[1],
23 ha
->patch_number
, ha
->build_number
);
25 return snprintf(buf
, PAGE_SIZE
, "%d.%02d.%02d.%02d\n",
26 ha
->firmware_version
[0],
27 ha
->firmware_version
[1],
28 ha
->patch_number
, ha
->build_number
);
32 qla4xxx_serial_num_show(struct device
*dev
, struct device_attribute
*attr
,
35 struct scsi_qla_host
*ha
= to_qla_host(class_to_shost(dev
));
36 return snprintf(buf
, PAGE_SIZE
, "%s\n", ha
->serial_number
);
40 qla4xxx_iscsi_version_show(struct device
*dev
, struct device_attribute
*attr
,
43 struct scsi_qla_host
*ha
= to_qla_host(class_to_shost(dev
));
44 return snprintf(buf
, PAGE_SIZE
, "%d.%02d\n", ha
->iscsi_major
,
49 qla4xxx_optrom_version_show(struct device
*dev
, struct device_attribute
*attr
,
52 struct scsi_qla_host
*ha
= to_qla_host(class_to_shost(dev
));
53 return snprintf(buf
, PAGE_SIZE
, "%d.%02d.%02d.%02d\n",
54 ha
->bootload_major
, ha
->bootload_minor
,
55 ha
->bootload_patch
, ha
->bootload_build
);
58 static DEVICE_ATTR(fw_version
, S_IRUGO
, qla4xxx_fw_version_show
, NULL
);
59 static DEVICE_ATTR(serial_num
, S_IRUGO
, qla4xxx_serial_num_show
, NULL
);
60 static DEVICE_ATTR(iscsi_version
, S_IRUGO
, qla4xxx_iscsi_version_show
, NULL
);
61 static DEVICE_ATTR(optrom_version
, S_IRUGO
, qla4xxx_optrom_version_show
, NULL
);
63 struct device_attribute
*qla4xxx_host_attrs
[] = {
66 &dev_attr_iscsi_version
,
67 &dev_attr_optrom_version
,