diff options
author | James Bottomley <JBottomley@Parallels.com> | 2014-01-22 09:57:27 -0800 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-01-22 09:57:27 -0800 |
commit | 4b1a9a5e40210cb4a0687806d3b631f7db4b9b0e (patch) | |
tree | 4f33f3af2e1ff163c6f4a1022d1d6b6be7b11547 /drivers/scsi/bfa/bfa_ioc_cb.c | |
parent | dcaf9aed995c2b2a49fb86bbbcfa2f92c797ab5d (diff) | |
parent | 3ce438df106826edde7ad724f3819716a3f0cf56 (diff) |
Merge branch 'misc' into for-linus
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc_cb.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc_cb.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc_cb.c b/drivers/scsi/bfa/bfa_ioc_cb.c index e3b928746674..453c2f5b5561 100644 --- a/drivers/scsi/bfa/bfa_ioc_cb.c +++ b/drivers/scsi/bfa/bfa_ioc_cb.c @@ -81,6 +81,29 @@ bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc) static bfa_boolean_t bfa_ioc_cb_firmware_lock(struct bfa_ioc_s *ioc) { + enum bfi_ioc_state alt_fwstate, cur_fwstate; + struct bfi_ioc_image_hdr_s fwhdr; + + cur_fwstate = bfa_ioc_cb_get_cur_ioc_fwstate(ioc); + bfa_trc(ioc, cur_fwstate); + alt_fwstate = bfa_ioc_cb_get_alt_ioc_fwstate(ioc); + bfa_trc(ioc, alt_fwstate); + + /* + * Uninit implies this is the only driver as of now. + */ + if (cur_fwstate == BFI_IOC_UNINIT) + return BFA_TRUE; + /* + * Check if another driver with a different firmware is active + */ + bfa_ioc_fwver_get(ioc, &fwhdr); + if (!bfa_ioc_fwver_cmp(ioc, &fwhdr) && + alt_fwstate != BFI_IOC_DISABLED) { + bfa_trc(ioc, alt_fwstate); + return BFA_FALSE; + } + return BFA_TRUE; } |