diff options
Diffstat (limited to 'drivers/message/fusion/mptfc.c')
-rw-r--r-- | drivers/message/fusion/mptfc.c | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index c3a3499bce2a..b343f2a68b1c 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -154,7 +154,7 @@ MODULE_DEVICE_TABLE(pci, mptfc_pci_table); | |||
154 | 154 | ||
155 | static struct scsi_transport_template *mptfc_transport_template = NULL; | 155 | static struct scsi_transport_template *mptfc_transport_template = NULL; |
156 | 156 | ||
157 | struct fc_function_template mptfc_transport_functions = { | 157 | static struct fc_function_template mptfc_transport_functions = { |
158 | .dd_fcrport_size = 8, | 158 | .dd_fcrport_size = 8, |
159 | .show_host_node_name = 1, | 159 | .show_host_node_name = 1, |
160 | .show_host_port_name = 1, | 160 | .show_host_port_name = 1, |
@@ -349,24 +349,6 @@ mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid) | |||
349 | } | 349 | } |
350 | 350 | ||
351 | static void | 351 | static void |
352 | mptfc_remap_sdev(struct scsi_device *sdev, void *arg) | ||
353 | { | ||
354 | VirtDevice *vdev; | ||
355 | VirtTarget *vtarget; | ||
356 | struct scsi_target *starget; | ||
357 | |||
358 | starget = scsi_target(sdev); | ||
359 | if (starget->hostdata == arg) { | ||
360 | vtarget = arg; | ||
361 | vdev = sdev->hostdata; | ||
362 | if (vdev) { | ||
363 | vdev->bus_id = vtarget->bus_id; | ||
364 | vdev->target_id = vtarget->target_id; | ||
365 | } | ||
366 | } | ||
367 | } | ||
368 | |||
369 | static void | ||
370 | mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | 352 | mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) |
371 | { | 353 | { |
372 | struct fc_rport_identifiers rport_ids; | 354 | struct fc_rport_identifiers rport_ids; |
@@ -423,8 +405,6 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
423 | if (vtarget) { | 405 | if (vtarget) { |
424 | vtarget->target_id = pg0->CurrentTargetID; | 406 | vtarget->target_id = pg0->CurrentTargetID; |
425 | vtarget->bus_id = pg0->CurrentBus; | 407 | vtarget->bus_id = pg0->CurrentBus; |
426 | starget_for_each_device(ri->starget, | ||
427 | vtarget,mptfc_remap_sdev); | ||
428 | } | 408 | } |
429 | ri->remap_needed = 0; | 409 | ri->remap_needed = 0; |
430 | } | 410 | } |
@@ -432,7 +412,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
432 | "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " | 412 | "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " |
433 | "rport tid %d, tmo %d\n", | 413 | "rport tid %d, tmo %d\n", |
434 | ioc->name, | 414 | ioc->name, |
435 | oc->sh->host_no, | 415 | ioc->sh->host_no, |
436 | pg0->PortIdentifier, | 416 | pg0->PortIdentifier, |
437 | pg0->WWNN, | 417 | pg0->WWNN, |
438 | pg0->WWPN, | 418 | pg0->WWPN, |
@@ -514,7 +494,7 @@ mptfc_target_alloc(struct scsi_target *starget) | |||
514 | * Return non-zero if allocation fails. | 494 | * Return non-zero if allocation fails. |
515 | * Init memory once per LUN. | 495 | * Init memory once per LUN. |
516 | */ | 496 | */ |
517 | int | 497 | static int |
518 | mptfc_slave_alloc(struct scsi_device *sdev) | 498 | mptfc_slave_alloc(struct scsi_device *sdev) |
519 | { | 499 | { |
520 | MPT_SCSI_HOST *hd; | 500 | MPT_SCSI_HOST *hd; |
@@ -553,23 +533,26 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
553 | } | 533 | } |
554 | 534 | ||
555 | vdev->vtarget = vtarget; | 535 | vdev->vtarget = vtarget; |
556 | vdev->ioc_id = hd->ioc->id; | ||
557 | vdev->lun = sdev->lun; | 536 | vdev->lun = sdev->lun; |
558 | vdev->target_id = vtarget->target_id; | ||
559 | vdev->bus_id = vtarget->bus_id; | ||
560 | 537 | ||
561 | spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); | 538 | spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); |
562 | 539 | ||
563 | vtarget->num_luns++; | 540 | vtarget->num_luns++; |
564 | 541 | ||
542 | #ifdef DMPT_DEBUG_FC | ||
543 | { | ||
544 | struct mptfc_rport_info *ri; | ||
545 | ri = *((struct mptfc_rport_info **)rport->dd_data); | ||
565 | dfcprintk ((MYIOC_s_INFO_FMT | 546 | dfcprintk ((MYIOC_s_INFO_FMT |
566 | "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " | 547 | "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " |
567 | "CurrentTargetID %d, %x %llx %llx\n", | 548 | "CurrentTargetID %d, %x %llx %llx\n", |
568 | ioc->name, | 549 | hd->ioc->name, |
569 | sdev->host->host_no, | 550 | sdev->host->host_no, |
570 | vtarget->num_luns, | 551 | vtarget->num_luns, |
571 | sdev->id, ri->pg0.CurrentTargetID, | 552 | sdev->id, ri->pg0.CurrentTargetID, |
572 | ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); | 553 | ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); |
554 | } | ||
555 | #endif | ||
573 | 556 | ||
574 | return 0; | 557 | return 0; |
575 | } | 558 | } |
@@ -941,7 +924,7 @@ mptfc_init(void) | |||
941 | mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER); | 924 | mptfcInternalCtx = mpt_register(mptscsih_scandv_complete, MPTFC_DRIVER); |
942 | 925 | ||
943 | if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) { | 926 | if (mpt_event_register(mptfcDoneCtx, mptscsih_event_process) == 0) { |
944 | devtprintk((KERN_INFO MYNAM | 927 | devtverboseprintk((KERN_INFO MYNAM |
945 | ": Registered for IOC event notifications\n")); | 928 | ": Registered for IOC event notifications\n")); |
946 | } | 929 | } |
947 | 930 | ||