aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_config.c
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2009-08-20 03:53:49 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 10:36:13 -0400
commited79f1280d1bc54f168abcffc8c3e0bf8ffb1873 (patch)
tree61974bec8071cd483cd562bd465ed8a2adb09896 /drivers/scsi/mpt2sas/mpt2sas_config.c
parent34a03bef2202d0c9983a8da0a8abaee37d285847 (diff)
[SCSI] mpt2sas: Raid 10 Volume is showing as Raid 1E in dmesg
This patch modifies the slave_configure callback so the messages that get sent to system log for RAID1E volumes contain the string "RAID10" instead of "RAID1E". These messages contain information regarding what kind of scsi device is being added. Certain OEMS can enable displaying the RAID10 string instead of RAID1E via manufacturing page 10. The driver will read this config page at driver load time, then determine from the GenericFlags0 bits whether display the RAID10 or RAID1E string, also even drive count is taken into consideration. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Reviewed-by: Eric Moore <Eric.moore@lsi.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_config.c')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_config.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c
index 6ddee161beb3..b9f4d0f97e50 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_config.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_config.c
@@ -426,6 +426,67 @@ mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc,
426} 426}
427 427
428/** 428/**
429 * mpt2sas_config_get_manufacturing_pg10 - obtain manufacturing page 10
430 * @ioc: per adapter object
431 * @mpi_reply: reply mf payload returned from firmware
432 * @config_page: contents of the config page
433 * Context: sleep.
434 *
435 * Returns 0 for success, non-zero for failure.
436 */
437int
438mpt2sas_config_get_manufacturing_pg10(struct MPT2SAS_ADAPTER *ioc,
439 Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage10_t *config_page)
440{
441 Mpi2ConfigRequest_t mpi_request;
442 int r;
443 struct config_request mem;
444
445 memset(config_page, 0, sizeof(Mpi2ManufacturingPage10_t));
446 memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t));
447 mpi_request.Function = MPI2_FUNCTION_CONFIG;
448 mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
449 mpi_request.Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING;
450 mpi_request.Header.PageNumber = 10;
451 mpi_request.Header.PageVersion = MPI2_MANUFACTURING0_PAGEVERSION;
452 mpt2sas_base_build_zero_len_sge(ioc, &mpi_request.PageBufferSGE);
453 r = _config_request(ioc, &mpi_request, mpi_reply,
454 MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT);
455 if (r)
456 goto out;
457
458 mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT;
459 mpi_request.Header.PageVersion = mpi_reply->Header.PageVersion;
460 mpi_request.Header.PageNumber = mpi_reply->Header.PageNumber;
461 mpi_request.Header.PageType = mpi_reply->Header.PageType;
462 mpi_request.Header.PageLength = mpi_reply->Header.PageLength;
463 mem.config_page_sz = le16_to_cpu(mpi_reply->Header.PageLength) * 4;
464 if (mem.config_page_sz > ioc->config_page_sz) {
465 r = _config_alloc_config_dma_memory(ioc, &mem);
466 if (r)
467 goto out;
468 } else {
469 mem.config_page_dma = ioc->config_page_dma;
470 mem.config_page = ioc->config_page;
471 }
472 ioc->base_add_sg_single(&mpi_request.PageBufferSGE,
473 MPT2_CONFIG_COMMON_SGLFLAGS | mem.config_page_sz,
474 mem.config_page_dma);
475 r = _config_request(ioc, &mpi_request, mpi_reply,
476 MPT2_CONFIG_PAGE_DEFAULT_TIMEOUT);
477 if (!r)
478 memcpy(config_page, mem.config_page,
479 min_t(u16, mem.config_page_sz,
480 sizeof(Mpi2ManufacturingPage10_t)));
481
482 if (mem.config_page_sz > ioc->config_page_sz)
483 _config_free_config_dma_memory(ioc, &mem);
484
485 out:
486 return r;
487}
488
489/**
429 * mpt2sas_config_get_bios_pg2 - obtain bios page 2 490 * mpt2sas_config_get_bios_pg2 - obtain bios page 2
430 * @ioc: per adapter object 491 * @ioc: per adapter object
431 * @mpi_reply: reply mf payload returned from firmware 492 * @mpi_reply: reply mf payload returned from firmware