Commit 2f9b8857 authored by Krishna Gudipati's avatar Krishna Gudipati Committed by James Bottomley

[SCSI] bfa: Enable IOC auto-recovery and IOC type fix.

bfa_ioc.c:
  - Enable IOC auto-recovery by default.
  - When CNA is in FC mode, return IOC type as FC (not FCoE)

bfa_iocfc.c:
  - Set fcmode before pci initialization/setup.
Signed-off-by: default avatarKrishna Gudipati <kgudipat@brocade.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 5c1fb1d5
...@@ -56,7 +56,7 @@ BFA_TRC_FILE(HAL, IOC); ...@@ -56,7 +56,7 @@ BFA_TRC_FILE(HAL, IOC);
#define BFA_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS) #define BFA_FLASH_CHUNK_NO(off) (off / BFI_FLASH_CHUNK_SZ_WORDS)
#define BFA_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS) #define BFA_FLASH_OFFSET_IN_CHUNK(off) (off % BFI_FLASH_CHUNK_SZ_WORDS)
#define BFA_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS) #define BFA_FLASH_CHUNK_ADDR(chunkno) (chunkno * BFI_FLASH_CHUNK_SZ_WORDS)
bfa_boolean_t bfa_auto_recover = BFA_FALSE; bfa_boolean_t bfa_auto_recover = BFA_TRUE;
/* /*
* forward declarations * forward declarations
...@@ -1642,7 +1642,7 @@ bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param) ...@@ -1642,7 +1642,7 @@ bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_param)
void void
bfa_ioc_auto_recover(bfa_boolean_t auto_recover) bfa_ioc_auto_recover(bfa_boolean_t auto_recover)
{ {
bfa_auto_recover = BFA_FALSE; bfa_auto_recover = auto_recover;
} }
...@@ -2082,7 +2082,7 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr) ...@@ -2082,7 +2082,7 @@ bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr)
ioc_attr->state = bfa_sm_to_state(ioc_sm_table, ioc->fsm); ioc_attr->state = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
ioc_attr->port_id = ioc->port_id; ioc_attr->port_id = ioc->port_id;
if (!ioc->ctdev) if (!ioc->ctdev || ioc->fcmode)
ioc_attr->ioc_type = BFA_IOC_TYPE_FC; ioc_attr->ioc_type = BFA_IOC_TYPE_FC;
else if (ioc->ioc_mc == BFI_MC_IOCFC) else if (ioc->ioc_mc == BFI_MC_IOCFC)
ioc_attr->ioc_type = BFA_IOC_TYPE_FCoE; ioc_attr->ioc_type = BFA_IOC_TYPE_FCoE;
......
...@@ -619,8 +619,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, ...@@ -619,8 +619,6 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod, bfa_ioc_attach(&bfa->ioc, bfa, &bfa_iocfc_cbfn, &bfa->timer_mod,
bfa->trcmod, bfa->aen, bfa->logm); bfa->trcmod, bfa->aen, bfa->logm);
bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC);
bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs);
/** /**
* Choose FC (ssid: 0x1C) v/s FCoE (ssid: 0x14) mode. * Choose FC (ssid: 0x1C) v/s FCoE (ssid: 0x14) mode.
...@@ -628,6 +626,9 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, ...@@ -628,6 +626,9 @@ bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
if (0) if (0)
bfa_ioc_set_fcmode(&bfa->ioc); bfa_ioc_set_fcmode(&bfa->ioc);
bfa_ioc_pci_init(&bfa->ioc, pcidev, BFI_MC_IOCFC);
bfa_ioc_mbox_register(&bfa->ioc, bfa_mbox_isrs);
bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev); bfa_iocfc_init_mem(bfa, bfad, cfg, pcidev);
bfa_iocfc_mem_claim(bfa, cfg, meminfo); bfa_iocfc_mem_claim(bfa, cfg, meminfo);
bfa_timer_init(&bfa->timer_mod); bfa_timer_init(&bfa->timer_mod);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment