aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptbase.c
diff options
context:
space:
mode:
authorMichael Reed <mdr@sgi.com>2006-01-13 15:31:54 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2006-01-14 11:55:02 -0500
commit05e8ec17f4d11ba13795e878fc389cb04d1fdadd (patch)
tree0b7a7360e37be4851ce823450cabbce97bc28eea /drivers/message/fusion/mptbase.c
parentd158d26167a3f6a910ec3e0eda23cc0cd437c689 (diff)
[SCSI] mptfusion - fc transport attributes
Signed-off-by: Michael Reed <mdr@sgi.com> Signed-off-by: Eric Moore <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.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 80ec89c505d2..8c26f093fb65 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -148,7 +148,6 @@ static int WaitForDoorbellAck(MPT_ADAPTER *ioc, int howlong, int sleepFlag);
148static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 148static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag);
149static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); 149static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag);
150static int GetLanConfigPages(MPT_ADAPTER *ioc); 150static int GetLanConfigPages(MPT_ADAPTER *ioc);
151static int GetFcPortPage0(MPT_ADAPTER *ioc, int portnum);
152static int GetIoUnitPage2(MPT_ADAPTER *ioc); 151static int GetIoUnitPage2(MPT_ADAPTER *ioc);
153int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); 152int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
154static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); 153static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum);
@@ -1244,6 +1243,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1244 ioc->pcidev = pdev; 1243 ioc->pcidev = pdev;
1245 ioc->diagPending = 0; 1244 ioc->diagPending = 0;
1246 spin_lock_init(&ioc->diagLock); 1245 spin_lock_init(&ioc->diagLock);
1246 spin_lock_init(&ioc->fc_rescan_work_lock);
1247 spin_lock_init(&ioc->fc_rport_lock);
1247 spin_lock_init(&ioc->initializing_hba_lock); 1248 spin_lock_init(&ioc->initializing_hba_lock);
1248 1249
1249 /* Initialize the event logging. 1250 /* Initialize the event logging.
@@ -1267,6 +1268,10 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
1267 */ 1268 */
1268 INIT_LIST_HEAD(&ioc->configQ); 1269 INIT_LIST_HEAD(&ioc->configQ);
1269 1270
1271 /* Initialize the fc rport list head.
1272 */
1273 INIT_LIST_HEAD(&ioc->fc_rports);
1274
1270 /* Find lookup slot. */ 1275 /* Find lookup slot. */
1271 INIT_LIST_HEAD(&ioc->list); 1276 INIT_LIST_HEAD(&ioc->list);
1272 ioc->id = mpt_ids++; 1277 ioc->id = mpt_ids++;
@@ -1879,7 +1884,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
1879 * (FCPortPage0_t stuff) 1884 * (FCPortPage0_t stuff)
1880 */ 1885 */
1881 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { 1886 for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
1882 (void) GetFcPortPage0(ioc, ii); 1887 (void) mptbase_GetFcPortPage0(ioc, ii);
1883 } 1888 }
1884 1889
1885 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) && 1890 if ((ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) &&
@@ -4198,7 +4203,7 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
4198 4203
4199/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 4204/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
4200/* 4205/*
4201 * GetFcPortPage0 - Fetch FCPort config Page0. 4206 * mptbase_GetFcPortPage0 - Fetch FCPort config Page0.
4202 * @ioc: Pointer to MPT_ADAPTER structure 4207 * @ioc: Pointer to MPT_ADAPTER structure
4203 * @portnum: IOC Port number 4208 * @portnum: IOC Port number
4204 * 4209 *
@@ -4208,8 +4213,8 @@ GetLanConfigPages(MPT_ADAPTER *ioc)
4208 * -EAGAIN if no msg frames currently available 4213 * -EAGAIN if no msg frames currently available
4209 * -EFAULT for non-successful reply or no reply (timeout) 4214 * -EFAULT for non-successful reply or no reply (timeout)
4210 */ 4215 */
4211static int 4216int
4212GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) 4217mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
4213{ 4218{
4214 ConfigPageHeader_t hdr; 4219 ConfigPageHeader_t hdr;
4215 CONFIGPARMS cfg; 4220 CONFIGPARMS cfg;
@@ -4219,6 +4224,8 @@ GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
4219 int data_sz; 4224 int data_sz;
4220 int copy_sz; 4225 int copy_sz;
4221 int rc; 4226 int rc;
4227 int count = 400;
4228
4222 4229
4223 /* Get FCPort Page 0 header */ 4230 /* Get FCPort Page 0 header */
4224 hdr.PageVersion = 0; 4231 hdr.PageVersion = 0;
@@ -4242,6 +4249,8 @@ GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
4242 rc = -ENOMEM; 4249 rc = -ENOMEM;
4243 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); 4250 ppage0_alloc = (FCPortPage0_t *) pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma);
4244 if (ppage0_alloc) { 4251 if (ppage0_alloc) {
4252
4253 try_again:
4245 memset((u8 *)ppage0_alloc, 0, data_sz); 4254 memset((u8 *)ppage0_alloc, 0, data_sz);
4246 cfg.physAddr = page0_dma; 4255 cfg.physAddr = page0_dma;
4247 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; 4256 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
@@ -4273,6 +4282,19 @@ GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
4273 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount); 4282 pp0dest->DiscoveredPortsCount = le32_to_cpu(pp0dest->DiscoveredPortsCount);
4274 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators); 4283 pp0dest->MaxInitiators = le32_to_cpu(pp0dest->MaxInitiators);
4275 4284
4285 /*
4286 * if still doing discovery,
4287 * hang loose a while until finished
4288 */
4289 if (pp0dest->PortState == MPI_FCPORTPAGE0_PORTSTATE_UNKNOWN) {
4290 if (count-- > 0) {
4291 msleep_interruptible(100);
4292 goto try_again;
4293 }
4294 printk(MYIOC_s_INFO_FMT "Firmware discovery not"
4295 " complete.\n",
4296 ioc->name);
4297 }
4276 } 4298 }
4277 4299
4278 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); 4300 pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
@@ -6357,6 +6379,7 @@ EXPORT_SYMBOL(mpt_alloc_fw_memory);
6357EXPORT_SYMBOL(mpt_free_fw_memory); 6379EXPORT_SYMBOL(mpt_free_fw_memory);
6358EXPORT_SYMBOL(mptbase_sas_persist_operation); 6380EXPORT_SYMBOL(mptbase_sas_persist_operation);
6359EXPORT_SYMBOL(mpt_alt_ioc_wait); 6381EXPORT_SYMBOL(mpt_alt_ioc_wait);
6382EXPORT_SYMBOL(mptbase_GetFcPortPage0);
6360 6383
6361 6384
6362/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 6385/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/