diff options
author | Michael Reed <mdr@sgi.com> | 2006-01-13 15:31:54 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-14 11:55:02 -0500 |
commit | 05e8ec17f4d11ba13795e878fc389cb04d1fdadd (patch) | |
tree | 0b7a7360e37be4851ce823450cabbce97bc28eea /drivers/message/fusion/mptbase.c | |
parent | d158d26167a3f6a910ec3e0eda23cc0cd437c689 (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.c | 33 |
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); | |||
148 | static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); | 148 | static int WaitForDoorbellInt(MPT_ADAPTER *ioc, int howlong, int sleepFlag); |
149 | static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); | 149 | static int WaitForDoorbellReply(MPT_ADAPTER *ioc, int howlong, int sleepFlag); |
150 | static int GetLanConfigPages(MPT_ADAPTER *ioc); | 150 | static int GetLanConfigPages(MPT_ADAPTER *ioc); |
151 | static int GetFcPortPage0(MPT_ADAPTER *ioc, int portnum); | ||
152 | static int GetIoUnitPage2(MPT_ADAPTER *ioc); | 151 | static int GetIoUnitPage2(MPT_ADAPTER *ioc); |
153 | int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); | 152 | int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode); |
154 | static int mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum); | 153 | static 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 | */ |
4211 | static int | 4216 | int |
4212 | GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) | 4217 | mptbase_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); | |||
6357 | EXPORT_SYMBOL(mpt_free_fw_memory); | 6379 | EXPORT_SYMBOL(mpt_free_fw_memory); |
6358 | EXPORT_SYMBOL(mptbase_sas_persist_operation); | 6380 | EXPORT_SYMBOL(mptbase_sas_persist_operation); |
6359 | EXPORT_SYMBOL(mpt_alt_ioc_wait); | 6381 | EXPORT_SYMBOL(mpt_alt_ioc_wait); |
6382 | EXPORT_SYMBOL(mptbase_GetFcPortPage0); | ||
6360 | 6383 | ||
6361 | 6384 | ||
6362 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 6385 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |