aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
-rw-r--r--drivers/message/fusion/mptbase.c112
1 files changed, 0 insertions, 112 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 164375eea896..330c29080e3c 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1188,7 +1188,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1188 ioc->pcidev = pdev; 1188 ioc->pcidev = pdev;
1189 ioc->diagPending = 0; 1189 ioc->diagPending = 0;
1190 spin_lock_init(&ioc->diagLock); 1190 spin_lock_init(&ioc->diagLock);
1191 spin_lock_init(&ioc->fc_rescan_work_lock);
1192 spin_lock_init(&ioc->initializing_hba_lock); 1191 spin_lock_init(&ioc->initializing_hba_lock);
1193 1192
1194 /* Initialize the event logging. 1193 /* Initialize the event logging.
@@ -1847,14 +1846,6 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1847 mpt_findImVolumes(ioc); 1846 mpt_findImVolumes(ioc);
1848 1847
1849 } else if (ioc->bus_type == FC) { 1848 } else if (ioc->bus_type == FC) {
1850 /*
1851 * Pre-fetch FC port WWN and stuff...
1852 * (FCPortPage0_t stuff)
1853 */
1854 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
1855 (void) mptbase_GetFcPortPage0(ioc, ii);
1856 }
1857
1858 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && 1849 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) &&
1859 (ioc->lan_cnfg_page0.Header.PageLength == 0)) { 1850 (ioc->lan_cnfg_page0.Header.PageLength == 0)) {
1860 /* 1851 /*
@@ -4186,108 +4177,6 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
4186 4177
4187/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 4178/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
4188/* 4179/*
4189 * mptbase_GetFcPortPage0 - Fetch FCPort config Page0.
4190 * @ioc: Pointer to MPT_ADAPTER structure
4191 * @portnum: IOC Port number
4192 *
4193 * Return: 0 for success
4194 * -ENOMEM if no memory available
4195 * -EPERM if not allowed due to ISR context
4196 * -EAGAIN if no msg frames currently available
4197 * -EFAULT for non-successful reply or no reply (timeout)
4198 */
4199int
4200mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
4201{
4202 ConfigPageHeader_t hdr;
4203 CONFIGPARMS cfg;
4204 FCPortPage0_t *ppage0_alloc;
4205 FCPortPage0_t *pp0dest;
4206 dma_addr_t page0_dma;
4207 int data_sz;
4208 int copy_sz;
4209 int rc;
4210 int count = 400;
4211
4212
4213 /* Get FCPort Page 0 header */
4214 hdr.PageVersion = 0;
4215 hdr.PageLength = 0;
4216 hdr.PageNumber = 0;
4217 hdr.PageType = MPI_CONFIG_PAGETYPE_FC_PORT;
4218 cfg.cfghdr.hdr = &hdr;
4219 cfg.physAddr = -1;
4220 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
4221 cfg.dir = 0;
4222 cfg.pageAddr = portnum;
4223 cfg.timeout = 0;
4224
4225 if ((rc = mpt_config(ioc, &cfg)) != 0)
4226 return rc;
4227
4228 if (hdr.PageLength == 0)
4229 return 0;
4230
4231 data_sz = hdr.PageLength * 4;
4232 rc = -ENOMEM;
4233 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
4234 if (ppage0_alloc) {
4235
4236 try_again:
4237 memset((u8 *)ppage0_alloc, 0, data_sz);
4238 cfg.physAddr = page0_dma;
4239 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
4240
4241 if ((rc = mpt_config(ioc, &cfg)) == 0) {
4242 /* save the data */
4243 pp0dest = &ioc->fc_port_page0[portnum];
4244 copy_sz = min_t(int, sizeof(FCPortPage0_t), data_sz);
4245 memcpy(pp0dest, ppage0_alloc, copy_sz);
4246
4247 /*
4248 * Normalize endianness of structure data,
4249 * by byte-swapping all > 1 byte fields!
4250 */
4251 pp0dest->Flags = le32_to_cpu(pp0dest->Flags);
4252 pp0dest->PortIdentifier = le32_to_cpu(pp0dest->PortIdentifier);
4253 pp0dest->WWNN.Low = le32_to_cpu(pp0dest->WWNN.Low);
4254 pp0dest->WWNN.High = le32_to_cpu(pp0dest->WWNN.High);
4255 pp0dest->WWPN.Low = le32_to_cpu(pp0dest->WWPN.Low);
4256 pp0dest->WWPN.High = le32_to_cpu(pp0dest->WWPN.High);
4257 pp0dest->SupportedServiceClass = le32_to_cpu(pp0dest->SupportedServiceClass);
4258 pp0dest->SupportedSpeeds = le32_to_cpu(pp0dest->SupportedSpeeds);
4259 pp0dest->CurrentSpeed = le32_to_cpu(pp0dest->CurrentSpeed);
4260 pp0dest->MaxFrameSize = le32_to_cpu(pp0dest->MaxFrameSize);
4261 pp0dest->FabricWWNN.Low = le32_to_cpu(pp0dest->FabricWWNN.Low);
4262 pp0dest->FabricWWNN.High = le32_to_cpu(pp0dest->FabricWWNN.High);
4263 pp0dest->FabricWWPN.Low = le32_to_cpu(pp0dest->FabricWWPN.Low);
4264 pp0dest->FabricWWPN.High = le32_to_cpu(pp0dest->FabricWWPN.High);
4265 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
4266 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
4267
4268 /*
4269 * if still doing discovery,
4270 * hang loose a while until finished
4271 */
4272 if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
4273 if (count-- > 0) {
4274 msleep_interruptible(100);
4275 goto try_again;
4276 }
4277 printk(MYIOC_s_INFO_FMT "Firmware discovery not"
4278 " complete.\n",
4279 ioc->name);
4280 }
4281 }
4282
4283 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
4284 }
4285
4286 return rc;
4287}
4288
4289/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
4290/*
4291 * mptbase_sas_persist_operation - Perform operation on SAS Persitent Table 4180 * mptbase_sas_persist_operation - Perform operation on SAS Persitent Table
4292 * @ioc: Pointer to MPT_ADAPTER structure 4181 * @ioc: Pointer to MPT_ADAPTER structure
4293 * @sas_address: 64bit SAS Address for operation. 4182 * @sas_address: 64bit SAS Address for operation.
@@ -6495,7 +6384,6 @@ EXPORT_SYMBOL(mpt_findImVolumes);
6495EXPORT_SYMBOL(mpt_alloc_fw_memory); 6384EXPORT_SYMBOL(mpt_alloc_fw_memory);
6496EXPORT_SYMBOL(mpt_free_fw_memory); 6385EXPORT_SYMBOL(mpt_free_fw_memory);
6497EXPORT_SYMBOL(mptbase_sas_persist_operation); 6386EXPORT_SYMBOL(mptbase_sas_persist_operation);
6498EXPORT_SYMBOL(mptbase_GetFcPortPage0);
6499 6387
6500 6388
6501/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6389/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/