diff options
author | Prakash, Sathya <sathya.prakash@lsi.com> | 2007-07-17 05:09:14 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-18 12:17:04 -0400 |
commit | edb9068d0d7a3ba92f66b8c86cba625f3a439f64 (patch) | |
tree | 1a36c6a203c91e2584b8970ad6b5eb9c17d55460 /drivers/message/fusion/mptbase.c | |
parent | fc6e740d0b8619b7e5b6a1899d2db73e309de6a5 (diff) |
[SCSI] mpt fusion: add sysfs attributes to display IOC parameters
New sysfs scsi_host attributes are added to provide information about Firmware
version, BIOS version, MPI version and other product related information
signed-off-by: Sathya Praksh <sathya.prakash@lsi.com>
Acked-by: "Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 5a10c87239c2..9d29ee62b6eb 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -161,6 +161,7 @@ static int mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum); | |||
161 | static void mpt_read_ioc_pg_1(MPT_ADAPTER *ioc); | 161 | static void mpt_read_ioc_pg_1(MPT_ADAPTER *ioc); |
162 | static void mpt_read_ioc_pg_4(MPT_ADAPTER *ioc); | 162 | static void mpt_read_ioc_pg_4(MPT_ADAPTER *ioc); |
163 | static void mpt_timer_expired(unsigned long data); | 163 | static void mpt_timer_expired(unsigned long data); |
164 | static void mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc); | ||
164 | static int SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch); | 165 | static int SendEventNotification(MPT_ADAPTER *ioc, u8 EvSwitch); |
165 | static int SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp); | 166 | static int SendEventAck(MPT_ADAPTER *ioc, EventNotificationReply_t *evnp); |
166 | static int mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int sleepFlag); | 167 | static int mpt_host_page_access_control(MPT_ADAPTER *ioc, u8 access_control_value, int sleepFlag); |
@@ -1880,6 +1881,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
1880 | } | 1881 | } |
1881 | 1882 | ||
1882 | GetIoUnitPage2(ioc); | 1883 | GetIoUnitPage2(ioc); |
1884 | mpt_get_manufacturing_pg_0(ioc); | ||
1883 | } | 1885 | } |
1884 | 1886 | ||
1885 | /* | 1887 | /* |
@@ -5190,6 +5192,49 @@ mpt_read_ioc_pg_1(MPT_ADAPTER *ioc) | |||
5190 | return; | 5192 | return; |
5191 | } | 5193 | } |
5192 | 5194 | ||
5195 | static void | ||
5196 | mpt_get_manufacturing_pg_0(MPT_ADAPTER *ioc) | ||
5197 | { | ||
5198 | CONFIGPARMS cfg; | ||
5199 | ConfigPageHeader_t hdr; | ||
5200 | dma_addr_t buf_dma; | ||
5201 | ManufacturingPage0_t *pbuf = NULL; | ||
5202 | |||
5203 | memset(&cfg, 0 , sizeof(CONFIGPARMS)); | ||
5204 | memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); | ||
5205 | |||
5206 | hdr.PageType = MPI_CONFIG_PAGETYPE_MANUFACTURING; | ||
5207 | cfg.cfghdr.hdr = &hdr; | ||
5208 | cfg.physAddr = -1; | ||
5209 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | ||
5210 | cfg.timeout = 10; | ||
5211 | |||
5212 | if (mpt_config(ioc, &cfg) != 0) | ||
5213 | goto out; | ||
5214 | |||
5215 | if (!cfg.cfghdr.hdr->PageLength) | ||
5216 | goto out; | ||
5217 | |||
5218 | cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; | ||
5219 | pbuf = pci_alloc_consistent(ioc->pcidev, hdr.PageLength * 4, &buf_dma); | ||
5220 | if (!pbuf) | ||
5221 | goto out; | ||
5222 | |||
5223 | cfg.physAddr = buf_dma; | ||
5224 | |||
5225 | if (mpt_config(ioc, &cfg) != 0) | ||
5226 | goto out; | ||
5227 | |||
5228 | memcpy(ioc->board_name, pbuf->BoardName, sizeof(ioc->board_name)); | ||
5229 | memcpy(ioc->board_assembly, pbuf->BoardAssembly, sizeof(ioc->board_assembly)); | ||
5230 | memcpy(ioc->board_tracer, pbuf->BoardTracerNumber, sizeof(ioc->board_tracer)); | ||
5231 | |||
5232 | out: | ||
5233 | |||
5234 | if (pbuf) | ||
5235 | pci_free_consistent(ioc->pcidev, hdr.PageLength * 4, pbuf, buf_dma); | ||
5236 | } | ||
5237 | |||
5193 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5238 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
5194 | /** | 5239 | /** |
5195 | * SendEventNotification - Send EventNotification (on or off) request to adapter | 5240 | * SendEventNotification - Send EventNotification (on or off) request to adapter |