diff options
author | Christoph Hellwig <hch@lst.de> | 2005-08-18 10:26:15 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-04 20:48:06 -0400 |
commit | 69218ee5186aded6c78e12e083e073d000ff2e9b (patch) | |
tree | 6dfd357efa1a17fa3c845570c722185b568423f0 /drivers/message/fusion/mptbase.c | |
parent | 1ff927306e08b356d764e605eff7c50079550bd2 (diff) |
[SCSI] fusion: extended config header support
Acked by: Moore, Eric Dean <Eric.Moore@lsil.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 | 90 |
1 files changed, 62 insertions, 28 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index ffbe6f4720e1..284202766804 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -491,10 +491,21 @@ mpt_base_reply(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *reply) | |||
491 | 491 | ||
492 | pCfg->status = status; | 492 | pCfg->status = status; |
493 | if (status == MPI_IOCSTATUS_SUCCESS) { | 493 | if (status == MPI_IOCSTATUS_SUCCESS) { |
494 | pCfg->hdr->PageVersion = pReply->Header.PageVersion; | 494 | if ((pReply->Header.PageType & |
495 | pCfg->hdr->PageLength = pReply->Header.PageLength; | 495 | MPI_CONFIG_PAGETYPE_MASK) == |
496 | pCfg->hdr->PageNumber = pReply->Header.PageNumber; | 496 | MPI_CONFIG_PAGETYPE_EXTENDED) { |
497 | pCfg->hdr->PageType = pReply->Header.PageType; | 497 | pCfg->cfghdr.ehdr->ExtPageLength = |
498 | le16_to_cpu(pReply->ExtPageLength); | ||
499 | pCfg->cfghdr.ehdr->ExtPageType = | ||
500 | pReply->ExtPageType; | ||
501 | } | ||
502 | pCfg->cfghdr.hdr->PageVersion = pReply->Header.PageVersion; | ||
503 | |||
504 | /* If this is a regular header, save PageLength. */ | ||
505 | /* LMP Do this better so not using a reserved field! */ | ||
506 | pCfg->cfghdr.hdr->PageLength = pReply->Header.PageLength; | ||
507 | pCfg->cfghdr.hdr->PageNumber = pReply->Header.PageNumber; | ||
508 | pCfg->cfghdr.hdr->PageType = pReply->Header.PageType; | ||
498 | } | 509 | } |
499 | } | 510 | } |
500 | 511 | ||
@@ -3819,7 +3830,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc) | |||
3819 | hdr.PageLength = 0; | 3830 | hdr.PageLength = 0; |
3820 | hdr.PageNumber = 0; | 3831 | hdr.PageNumber = 0; |
3821 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; | 3832 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; |
3822 | cfg.hdr = &hdr; | 3833 | cfg.cfghdr.hdr = &hdr; |
3823 | cfg.physAddr = -1; | 3834 | cfg.physAddr = -1; |
3824 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3835 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3825 | cfg.dir = 0; | 3836 | cfg.dir = 0; |
@@ -3863,7 +3874,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc) | |||
3863 | hdr.PageLength = 0; | 3874 | hdr.PageLength = 0; |
3864 | hdr.PageNumber = 1; | 3875 | hdr.PageNumber = 1; |
3865 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; | 3876 | hdr.PageType = MPI_CONFIG_PAGETYPE_LAN; |
3866 | cfg.hdr = &hdr; | 3877 | cfg.cfghdr.hdr = &hdr; |
3867 | cfg.physAddr = -1; | 3878 | cfg.physAddr = -1; |
3868 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3879 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3869 | cfg.dir = 0; | 3880 | cfg.dir = 0; |
@@ -3930,7 +3941,7 @@ GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) | |||
3930 | hdr.PageLength = 0; | 3941 | hdr.PageLength = 0; |
3931 | hdr.PageNumber = 0; | 3942 | hdr.PageNumber = 0; |
3932 | hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; | 3943 | hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT; |
3933 | cfg.hdr = &hdr; | 3944 | cfg.cfghdr.hdr = &hdr; |
3934 | cfg.physAddr = -1; | 3945 | cfg.physAddr = -1; |
3935 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 3946 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
3936 | cfg.dir = 0; | 3947 | cfg.dir = 0; |
@@ -4012,7 +4023,7 @@ GetIoUnitPage2(MPT_ADAPTER *ioc) | |||
4012 | hdr.PageLength = 0; | 4023 | hdr.PageLength = 0; |
4013 | hdr.PageNumber = 2; | 4024 | hdr.PageNumber = 2; |
4014 | hdr.PageType = MPI_CONFIG_PAGETYPE_IO_UNIT; | 4025 | hdr.PageType = MPI_CONFIG_PAGETYPE_IO_UNIT; |
4015 | cfg.hdr = &hdr; | 4026 | cfg.cfghdr.hdr = &hdr; |
4016 | cfg.physAddr = -1; | 4027 | cfg.physAddr = -1; |
4017 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4028 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
4018 | cfg.dir = 0; | 4029 | cfg.dir = 0; |
@@ -4102,7 +4113,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4102 | header.PageLength = 0; | 4113 | header.PageLength = 0; |
4103 | header.PageNumber = 0; | 4114 | header.PageNumber = 0; |
4104 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; | 4115 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; |
4105 | cfg.hdr = &header; | 4116 | cfg.cfghdr.hdr = &header; |
4106 | cfg.physAddr = -1; | 4117 | cfg.physAddr = -1; |
4107 | cfg.pageAddr = portnum; | 4118 | cfg.pageAddr = portnum; |
4108 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4119 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4168,7 +4179,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum) | |||
4168 | header.PageLength = 0; | 4179 | header.PageLength = 0; |
4169 | header.PageNumber = 2; | 4180 | header.PageNumber = 2; |
4170 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; | 4181 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_PORT; |
4171 | cfg.hdr = &header; | 4182 | cfg.cfghdr.hdr = &header; |
4172 | cfg.physAddr = -1; | 4183 | cfg.physAddr = -1; |
4173 | cfg.pageAddr = portnum; | 4184 | cfg.pageAddr = portnum; |
4174 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4185 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4236,7 +4247,7 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4236 | header.PageLength = 0; | 4247 | header.PageLength = 0; |
4237 | header.PageNumber = 1; | 4248 | header.PageNumber = 1; |
4238 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; | 4249 | header.PageType = MPI_CONFIG_PAGETYPE_SCSI_DEVICE; |
4239 | cfg.hdr = &header; | 4250 | cfg.cfghdr.hdr = &header; |
4240 | cfg.physAddr = -1; | 4251 | cfg.physAddr = -1; |
4241 | cfg.pageAddr = portnum; | 4252 | cfg.pageAddr = portnum; |
4242 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4253 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4245,8 +4256,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4245 | if (mpt_config(ioc, &cfg) != 0) | 4256 | if (mpt_config(ioc, &cfg) != 0) |
4246 | return -EFAULT; | 4257 | return -EFAULT; |
4247 | 4258 | ||
4248 | ioc->spi_data.sdp1version = cfg.hdr->PageVersion; | 4259 | ioc->spi_data.sdp1version = cfg.cfghdr.hdr->PageVersion; |
4249 | ioc->spi_data.sdp1length = cfg.hdr->PageLength; | 4260 | ioc->spi_data.sdp1length = cfg.cfghdr.hdr->PageLength; |
4250 | 4261 | ||
4251 | header.PageVersion = 0; | 4262 | header.PageVersion = 0; |
4252 | header.PageLength = 0; | 4263 | header.PageLength = 0; |
@@ -4255,8 +4266,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int portnum) | |||
4255 | if (mpt_config(ioc, &cfg) != 0) | 4266 | if (mpt_config(ioc, &cfg) != 0) |
4256 | return -EFAULT; | 4267 | return -EFAULT; |
4257 | 4268 | ||
4258 | ioc->spi_data.sdp0version = cfg.hdr->PageVersion; | 4269 | ioc->spi_data.sdp0version = cfg.cfghdr.hdr->PageVersion; |
4259 | ioc->spi_data.sdp0length = cfg.hdr->PageLength; | 4270 | ioc->spi_data.sdp0length = cfg.cfghdr.hdr->PageLength; |
4260 | 4271 | ||
4261 | dcprintk((MYIOC_s_INFO_FMT "Headers: 0: version %d length %d\n", | 4272 | dcprintk((MYIOC_s_INFO_FMT "Headers: 0: version %d length %d\n", |
4262 | ioc->name, ioc->spi_data.sdp0version, ioc->spi_data.sdp0length)); | 4273 | ioc->name, ioc->spi_data.sdp0version, ioc->spi_data.sdp0length)); |
@@ -4298,7 +4309,7 @@ mpt_findImVolumes(MPT_ADAPTER *ioc) | |||
4298 | header.PageLength = 0; | 4309 | header.PageLength = 0; |
4299 | header.PageNumber = 2; | 4310 | header.PageNumber = 2; |
4300 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4311 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4301 | cfg.hdr = &header; | 4312 | cfg.cfghdr.hdr = &header; |
4302 | cfg.physAddr = -1; | 4313 | cfg.physAddr = -1; |
4303 | cfg.pageAddr = 0; | 4314 | cfg.pageAddr = 0; |
4304 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4315 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4394,7 +4405,7 @@ mpt_read_ioc_pg_3(MPT_ADAPTER *ioc) | |||
4394 | header.PageLength = 0; | 4405 | header.PageLength = 0; |
4395 | header.PageNumber = 3; | 4406 | header.PageNumber = 3; |
4396 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4407 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4397 | cfg.hdr = &header; | 4408 | cfg.cfghdr.hdr = &header; |
4398 | cfg.physAddr = -1; | 4409 | cfg.physAddr = -1; |
4399 | cfg.pageAddr = 0; | 4410 | cfg.pageAddr = 0; |
4400 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4411 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4446,7 +4457,7 @@ mpt_read_ioc_pg_4(MPT_ADAPTER *ioc) | |||
4446 | header.PageLength = 0; | 4457 | header.PageLength = 0; |
4447 | header.PageNumber = 4; | 4458 | header.PageNumber = 4; |
4448 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4459 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4449 | cfg.hdr = &header; | 4460 | cfg.cfghdr.hdr = &header; |
4450 | cfg.physAddr = -1; | 4461 | cfg.physAddr = -1; |
4451 | cfg.pageAddr = 0; | 4462 | cfg.pageAddr = 0; |
4452 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4463 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4498,7 +4509,7 @@ mpt_read_ioc_pg_1(MPT_ADAPTER *ioc) | |||
4498 | header.PageLength = 0; | 4509 | header.PageLength = 0; |
4499 | header.PageNumber = 1; | 4510 | header.PageNumber = 1; |
4500 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; | 4511 | header.PageType = MPI_CONFIG_PAGETYPE_IOC; |
4501 | cfg.hdr = &header; | 4512 | cfg.cfghdr.hdr = &header; |
4502 | cfg.physAddr = -1; | 4513 | cfg.physAddr = -1; |
4503 | cfg.pageAddr = 0; | 4514 | cfg.pageAddr = 0; |
4504 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; | 4515 | cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER; |
@@ -4647,10 +4658,11 @@ int | |||
4647 | mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | 4658 | mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) |
4648 | { | 4659 | { |
4649 | Config_t *pReq; | 4660 | Config_t *pReq; |
4661 | ConfigExtendedPageHeader_t *pExtHdr = NULL; | ||
4650 | MPT_FRAME_HDR *mf; | 4662 | MPT_FRAME_HDR *mf; |
4651 | unsigned long flags; | 4663 | unsigned long flags; |
4652 | int ii, rc; | 4664 | int ii, rc; |
4653 | u32 flagsLength; | 4665 | int flagsLength; |
4654 | int in_isr; | 4666 | int in_isr; |
4655 | 4667 | ||
4656 | /* Prevent calling wait_event() (below), if caller happens | 4668 | /* Prevent calling wait_event() (below), if caller happens |
@@ -4675,16 +4687,30 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | |||
4675 | pReq->Reserved = 0; | 4687 | pReq->Reserved = 0; |
4676 | pReq->ChainOffset = 0; | 4688 | pReq->ChainOffset = 0; |
4677 | pReq->Function = MPI_FUNCTION_CONFIG; | 4689 | pReq->Function = MPI_FUNCTION_CONFIG; |
4690 | |||
4691 | /* Assume page type is not extended and clear "reserved" fields. */ | ||
4678 | pReq->ExtPageLength = 0; | 4692 | pReq->ExtPageLength = 0; |
4679 | pReq->ExtPageType = 0; | 4693 | pReq->ExtPageType = 0; |
4680 | pReq->MsgFlags = 0; | 4694 | pReq->MsgFlags = 0; |
4695 | |||
4681 | for (ii=0; ii < 8; ii++) | 4696 | for (ii=0; ii < 8; ii++) |
4682 | pReq->Reserved2[ii] = 0; | 4697 | pReq->Reserved2[ii] = 0; |
4683 | 4698 | ||
4684 | pReq->Header.PageVersion = pCfg->hdr->PageVersion; | 4699 | pReq->Header.PageVersion = pCfg->cfghdr.hdr->PageVersion; |
4685 | pReq->Header.PageLength = pCfg->hdr->PageLength; | 4700 | pReq->Header.PageLength = pCfg->cfghdr.hdr->PageLength; |
4686 | pReq->Header.PageNumber = pCfg->hdr->PageNumber; | 4701 | pReq->Header.PageNumber = pCfg->cfghdr.hdr->PageNumber; |
4687 | pReq->Header.PageType = (pCfg->hdr->PageType & MPI_CONFIG_PAGETYPE_MASK); | 4702 | pReq->Header.PageType = (pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK); |
4703 | |||
4704 | if ((pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK) == MPI_CONFIG_PAGETYPE_EXTENDED) { | ||
4705 | pExtHdr = (ConfigExtendedPageHeader_t *)pCfg->cfghdr.ehdr; | ||
4706 | pReq->ExtPageLength = cpu_to_le16(pExtHdr->ExtPageLength); | ||
4707 | pReq->ExtPageType = pExtHdr->ExtPageType; | ||
4708 | pReq->Header.PageType = MPI_CONFIG_PAGETYPE_EXTENDED; | ||
4709 | |||
4710 | /* Page Length must be treated as a reserved field for the extended header. */ | ||
4711 | pReq->Header.PageLength = 0; | ||
4712 | } | ||
4713 | |||
4688 | pReq->PageAddress = cpu_to_le32(pCfg->pageAddr); | 4714 | pReq->PageAddress = cpu_to_le32(pCfg->pageAddr); |
4689 | 4715 | ||
4690 | /* Add a SGE to the config request. | 4716 | /* Add a SGE to the config request. |
@@ -4694,12 +4720,20 @@ mpt_config(MPT_ADAPTER *ioc, CONFIGPARMS *pCfg) | |||
4694 | else | 4720 | else |
4695 | flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; | 4721 | flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ; |
4696 | 4722 | ||
4697 | flagsLength |= pCfg->hdr->PageLength * 4; | 4723 | if ((pCfg->cfghdr.hdr->PageType & MPI_CONFIG_PAGETYPE_MASK) == MPI_CONFIG_PAGETYPE_EXTENDED) { |
4724 | flagsLength |= pExtHdr->ExtPageLength * 4; | ||
4698 | 4725 | ||
4699 | mpt_add_sge((char *)&pReq->PageBufferSGE, flagsLength, pCfg->physAddr); | 4726 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", |
4727 | ioc->name, pReq->ExtPageType, pReq->Header.PageNumber, pReq->Action)); | ||
4728 | } | ||
4729 | else { | ||
4730 | flagsLength |= pCfg->cfghdr.hdr->PageLength * 4; | ||
4700 | 4731 | ||
4701 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", | 4732 | dcprintk((MYIOC_s_INFO_FMT "Sending Config request type %d, page %d and action %d\n", |
4702 | ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action)); | 4733 | ioc->name, pReq->Header.PageType, pReq->Header.PageNumber, pReq->Action)); |
4734 | } | ||
4735 | |||
4736 | mpt_add_sge((char *)&pReq->PageBufferSGE, flagsLength, pCfg->physAddr); | ||
4703 | 4737 | ||
4704 | /* Append pCfg pointer to end of mf | 4738 | /* Append pCfg pointer to end of mf |
4705 | */ | 4739 | */ |