diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-05-22 14:50:54 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 12:18:10 -0400 |
commit | 3772a99175f5378b5001e8da364341a8b8226a4a (patch) | |
tree | dd710f890c5bc097c874ad1783cd26ea56e88f57 /drivers/scsi/lpfc/lpfc.h | |
parent | a366695592ebc9151dd5a248681270f0925d8324 (diff) |
[SCSI] lpfc 8.3.2 : Reorganization for SLI4
Preps the organization of the driver so that the bottom half, which
interacts with the hardware, can share common code sequences for
attachment, detachment, initialization, teardown, etc with new hardware.
For very common code sections, which become specific to the interface
type, the driver uses an indirect function call. The function is set at
initialization. For less common sections, such as initialization, the
driver looks at the interface type and calls the routines relative to
the interface.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 72 |
1 files changed, 69 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 1105f9a111ba..6c24c9aabe7b 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -23,6 +23,13 @@ | |||
23 | 23 | ||
24 | struct lpfc_sli2_slim; | 24 | struct lpfc_sli2_slim; |
25 | 25 | ||
26 | #define LPFC_PCI_DEV_LP 0x1 | ||
27 | #define LPFC_PCI_DEV_OC 0x2 | ||
28 | |||
29 | #define LPFC_SLI_REV2 2 | ||
30 | #define LPFC_SLI_REV3 3 | ||
31 | #define LPFC_SLI_REV4 4 | ||
32 | |||
26 | #define LPFC_MAX_TARGET 4096 /* max number of targets supported */ | 33 | #define LPFC_MAX_TARGET 4096 /* max number of targets supported */ |
27 | #define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els | 34 | #define LPFC_MAX_DISC_THREADS 64 /* max outstanding discovery els |
28 | requests */ | 35 | requests */ |
@@ -264,8 +271,8 @@ enum hba_state { | |||
264 | }; | 271 | }; |
265 | 272 | ||
266 | struct lpfc_vport { | 273 | struct lpfc_vport { |
267 | struct list_head listentry; | ||
268 | struct lpfc_hba *phba; | 274 | struct lpfc_hba *phba; |
275 | struct list_head listentry; | ||
269 | uint8_t port_type; | 276 | uint8_t port_type; |
270 | #define LPFC_PHYSICAL_PORT 1 | 277 | #define LPFC_PHYSICAL_PORT 1 |
271 | #define LPFC_NPIV_PORT 2 | 278 | #define LPFC_NPIV_PORT 2 |
@@ -420,8 +427,66 @@ enum intr_type_t { | |||
420 | }; | 427 | }; |
421 | 428 | ||
422 | struct lpfc_hba { | 429 | struct lpfc_hba { |
430 | /* SCSI interface function jump table entries */ | ||
431 | int (*lpfc_new_scsi_buf) | ||
432 | (struct lpfc_vport *, int); | ||
433 | struct lpfc_scsi_buf * (*lpfc_get_scsi_buf) | ||
434 | (struct lpfc_hba *); | ||
435 | int (*lpfc_scsi_prep_dma_buf) | ||
436 | (struct lpfc_hba *, struct lpfc_scsi_buf *); | ||
437 | void (*lpfc_scsi_unprep_dma_buf) | ||
438 | (struct lpfc_hba *, struct lpfc_scsi_buf *); | ||
439 | void (*lpfc_release_scsi_buf) | ||
440 | (struct lpfc_hba *, struct lpfc_scsi_buf *); | ||
441 | void (*lpfc_rampdown_queue_depth) | ||
442 | (struct lpfc_hba *); | ||
443 | void (*lpfc_scsi_prep_cmnd) | ||
444 | (struct lpfc_vport *, struct lpfc_scsi_buf *, | ||
445 | struct lpfc_nodelist *); | ||
446 | int (*lpfc_scsi_prep_task_mgmt_cmd) | ||
447 | (struct lpfc_vport *, struct lpfc_scsi_buf *, | ||
448 | unsigned int, uint8_t); | ||
449 | |||
450 | /* IOCB interface function jump table entries */ | ||
451 | int (*__lpfc_sli_issue_iocb) | ||
452 | (struct lpfc_hba *, uint32_t, | ||
453 | struct lpfc_iocbq *, uint32_t); | ||
454 | void (*__lpfc_sli_release_iocbq)(struct lpfc_hba *, | ||
455 | struct lpfc_iocbq *); | ||
456 | int (*lpfc_hba_down_post)(struct lpfc_hba *phba); | ||
457 | |||
458 | |||
459 | IOCB_t * (*lpfc_get_iocb_from_iocbq) | ||
460 | (struct lpfc_iocbq *); | ||
461 | void (*lpfc_scsi_cmd_iocb_cmpl) | ||
462 | (struct lpfc_hba *, struct lpfc_iocbq *, struct lpfc_iocbq *); | ||
463 | |||
464 | /* MBOX interface function jump table entries */ | ||
465 | int (*lpfc_sli_issue_mbox) | ||
466 | (struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t); | ||
467 | /* Slow-path IOCB process function jump table entries */ | ||
468 | void (*lpfc_sli_handle_slow_ring_event) | ||
469 | (struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | ||
470 | uint32_t mask); | ||
471 | /* INIT device interface function jump table entries */ | ||
472 | int (*lpfc_sli_hbq_to_firmware) | ||
473 | (struct lpfc_hba *, uint32_t, struct hbq_dmabuf *); | ||
474 | int (*lpfc_sli_brdrestart) | ||
475 | (struct lpfc_hba *); | ||
476 | int (*lpfc_sli_brdready) | ||
477 | (struct lpfc_hba *, uint32_t); | ||
478 | void (*lpfc_handle_eratt) | ||
479 | (struct lpfc_hba *); | ||
480 | void (*lpfc_stop_port) | ||
481 | (struct lpfc_hba *); | ||
482 | |||
483 | |||
484 | /* SLI4 specific HBA data structure */ | ||
485 | struct lpfc_sli4_hba sli4_hba; | ||
486 | |||
423 | struct lpfc_sli sli; | 487 | struct lpfc_sli sli; |
424 | uint32_t sli_rev; /* SLI2 or SLI3 */ | 488 | uint8_t pci_dev_grp; /* lpfc PCI dev group: 0x0, 0x1, 0x2,... */ |
489 | uint32_t sli_rev; /* SLI2, SLI3, or SLI4 */ | ||
425 | uint32_t sli3_options; /* Mask of enabled SLI3 options */ | 490 | uint32_t sli3_options; /* Mask of enabled SLI3 options */ |
426 | #define LPFC_SLI3_HBQ_ENABLED 0x01 | 491 | #define LPFC_SLI3_HBQ_ENABLED 0x01 |
427 | #define LPFC_SLI3_NPIV_ENABLED 0x02 | 492 | #define LPFC_SLI3_NPIV_ENABLED 0x02 |
@@ -526,11 +591,12 @@ struct lpfc_hba { | |||
526 | unsigned long data_flags; | 591 | unsigned long data_flags; |
527 | 592 | ||
528 | uint32_t hbq_in_use; /* HBQs in use flag */ | 593 | uint32_t hbq_in_use; /* HBQs in use flag */ |
529 | struct list_head hbqbuf_in_list; /* in-fly hbq buffer list */ | 594 | struct list_head rb_pend_list; /* Received buffers to be processed */ |
530 | uint32_t hbq_count; /* Count of configured HBQs */ | 595 | uint32_t hbq_count; /* Count of configured HBQs */ |
531 | struct hbq_s hbqs[LPFC_MAX_HBQS]; /* local copy of hbq indicies */ | 596 | struct hbq_s hbqs[LPFC_MAX_HBQS]; /* local copy of hbq indicies */ |
532 | 597 | ||
533 | unsigned long pci_bar0_map; /* Physical address for PCI BAR0 */ | 598 | unsigned long pci_bar0_map; /* Physical address for PCI BAR0 */ |
599 | unsigned long pci_bar1_map; /* Physical address for PCI BAR1 */ | ||
534 | unsigned long pci_bar2_map; /* Physical address for PCI BAR2 */ | 600 | unsigned long pci_bar2_map; /* Physical address for PCI BAR2 */ |
535 | void __iomem *slim_memmap_p; /* Kernel memory mapped address for | 601 | void __iomem *slim_memmap_p; /* Kernel memory mapped address for |
536 | PCI BAR0 */ | 602 | PCI BAR0 */ |