[SCSI] bfa: Added HBA diagnostics support.
- Added diagnostics sub-module to BFA. - Implemented interface to perform memtest/loopback test and some other diagnostics tests. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:

committed by
James Bottomley

parent
5a54b1d576
commit
3d7fc66dcd
@@ -214,10 +214,10 @@ bfad_debugfs_read(struct file *file, char __user *buf,
|
||||
|
||||
#define BFA_REG_CT_ADDRSZ (0x40000)
|
||||
#define BFA_REG_CB_ADDRSZ (0x20000)
|
||||
#define BFA_REG_ADDRSZ(__bfa) \
|
||||
((bfa_ioc_devid(&(__bfa)->ioc) == BFA_PCI_DEVICE_ID_CT) ? \
|
||||
BFA_REG_CT_ADDRSZ : BFA_REG_CB_ADDRSZ)
|
||||
#define BFA_REG_ADDRMSK(__bfa) ((u32)(BFA_REG_ADDRSZ(__bfa) - 1))
|
||||
#define BFA_REG_ADDRSZ(__ioc) \
|
||||
((u32)(bfa_asic_id_ctc(bfa_ioc_devid(__ioc)) ? \
|
||||
BFA_REG_CT_ADDRSZ : BFA_REG_CB_ADDRSZ))
|
||||
#define BFA_REG_ADDRMSK(__ioc) (BFA_REG_ADDRSZ(__ioc) - 1)
|
||||
|
||||
static bfa_status_t
|
||||
bfad_reg_offset_check(struct bfa_s *bfa, u32 offset, u32 len)
|
||||
@@ -236,7 +236,7 @@ bfad_reg_offset_check(struct bfa_s *bfa, u32 offset, u32 len)
|
||||
return BFA_STATUS_EINVAL;
|
||||
} else {
|
||||
/* CB register space 64KB */
|
||||
if ((offset + (len<<2)) > BFA_REG_ADDRMSK(bfa))
|
||||
if ((offset + (len<<2)) > BFA_REG_ADDRMSK(&bfa->ioc))
|
||||
return BFA_STATUS_EINVAL;
|
||||
}
|
||||
return BFA_STATUS_OK;
|
||||
@@ -317,7 +317,7 @@ bfad_debugfs_write_regrd(struct file *file, const char __user *buf,
|
||||
|
||||
bfad->reglen = len << 2;
|
||||
rb = bfa_ioc_bar0(ioc);
|
||||
addr &= BFA_REG_ADDRMSK(bfa);
|
||||
addr &= BFA_REG_ADDRMSK(ioc);
|
||||
|
||||
/* offset and len sanity check */
|
||||
rc = bfad_reg_offset_check(bfa, addr, len);
|
||||
@@ -380,7 +380,7 @@ bfad_debugfs_write_regwr(struct file *file, const char __user *buf,
|
||||
}
|
||||
kfree(kern_buf);
|
||||
|
||||
addr &= BFA_REG_ADDRMSK(bfa); /* offset only 17 bit and word align */
|
||||
addr &= BFA_REG_ADDRMSK(ioc); /* offset only 17 bit and word align */
|
||||
|
||||
/* offset and len sanity check */
|
||||
rc = bfad_reg_offset_check(bfa, addr, 1);
|
||||
|
Reference in New Issue
Block a user