diff options
author | Karen Xie <kxie@chelsio.com> | 2009-04-01 18:11:23 (GMT) |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 14:23:11 (GMT) |
commit | 515f1c885af2ba8a9500c8a7aa4ed16bbbfa3ef4 (patch) | |
tree | 5d6833dc4f2ecc26a72fd72f560286cc847a74a9 /drivers/scsi/cxgb3i/cxgb3i_iscsi.c | |
parent | d8e965076514dcb16410c0d18c6c8de4dcba19fc (diff) | |
download | linux-fsl-qoriq-515f1c885af2ba8a9500c8a7aa4ed16bbbfa3ef4.tar.xz |
[SCSI] cxgb3i: subscribe to error notification from cxgb3 driver
Add error notification handling function which is called during chip reset.
Signed-off-by: Karen Xie <kxie@chelsio.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/cxgb3i/cxgb3i_iscsi.c')
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_iscsi.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c index e185ded..ff6bfd6 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c @@ -53,11 +53,30 @@ static LIST_HEAD(cxgb3i_snic_list); static DEFINE_RWLOCK(cxgb3i_snic_rwlock); /** - * cxgb3i_adapter_add - init a s3 adapter structure and any h/w settings + * cxgb3i_adpater_find_by_tdev - find the cxgb3i_adapter structure via t3cdev + * @tdev: t3cdev pointer + */ +struct cxgb3i_adapter *cxgb3i_adapter_find_by_tdev(struct t3cdev *tdev) +{ + struct cxgb3i_adapter *snic; + + read_lock(&cxgb3i_snic_rwlock); + list_for_each_entry(snic, &cxgb3i_snic_list, list_head) { + if (snic->tdev == tdev) { + read_unlock(&cxgb3i_snic_rwlock); + return snic; + } + } + read_unlock(&cxgb3i_snic_rwlock); + return NULL; +} + +/** + * cxgb3i_adapter_open - init a s3 adapter structure and any h/w settings * @t3dev: t3cdev adapter * return the resulting cxgb3i_adapter struct */ -struct cxgb3i_adapter *cxgb3i_adapter_add(struct t3cdev *t3dev) +struct cxgb3i_adapter *cxgb3i_adapter_open(struct t3cdev *t3dev) { struct cxgb3i_adapter *snic; struct adapter *adapter = tdev2adap(t3dev); @@ -101,10 +120,10 @@ free_snic: } /** - * cxgb3i_adapter_remove - release the resources held and cleanup h/w settings + * cxgb3i_adapter_close - release the resources held and cleanup h/w settings * @t3dev: t3cdev adapter */ -void cxgb3i_adapter_remove(struct t3cdev *t3dev) +void cxgb3i_adapter_close(struct t3cdev *t3dev) { int i; struct cxgb3i_adapter *snic; |