aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgb3i/cxgb3i_init.c
diff options
context:
space:
mode:
authorKaren Xie <kxie@chelsio.com>2009-04-01 14:11:23 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-04-03 10:23:11 -0400
commit515f1c885af2ba8a9500c8a7aa4ed16bbbfa3ef4 (patch)
tree5d6833dc4f2ecc26a72fd72f560286cc847a74a9 /drivers/scsi/cxgb3i/cxgb3i_init.c
parentd8e965076514dcb16410c0d18c6c8de4dcba19fc (diff)
[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_init.c')
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_init.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c
index 1ce9f244e46..833dbfa3f88 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_init.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_init.c
@@ -26,6 +26,7 @@ MODULE_VERSION(DRV_MODULE_VERSION);
26 26
27static void open_s3_dev(struct t3cdev *); 27static void open_s3_dev(struct t3cdev *);
28static void close_s3_dev(struct t3cdev *); 28static void close_s3_dev(struct t3cdev *);
29static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error);
29 30
30static cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS]; 31static cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];
31static struct cxgb3_client t3c_client = { 32static struct cxgb3_client t3c_client = {
@@ -33,6 +34,7 @@ static struct cxgb3_client t3c_client = {
33 .handlers = cxgb3i_cpl_handlers, 34 .handlers = cxgb3i_cpl_handlers,
34 .add = open_s3_dev, 35 .add = open_s3_dev,
35 .remove = close_s3_dev, 36 .remove = close_s3_dev,
37 .err_handler = s3_err_handler,
36}; 38};
37 39
38/** 40/**
@@ -49,7 +51,7 @@ static void open_s3_dev(struct t3cdev *t3dev)
49 } 51 }
50 52
51 cxgb3i_sdev_add(t3dev, &t3c_client); 53 cxgb3i_sdev_add(t3dev, &t3c_client);
52 cxgb3i_adapter_add(t3dev); 54 cxgb3i_adapter_open(t3dev);
53} 55}
54 56
55/** 57/**
@@ -58,10 +60,29 @@ static void open_s3_dev(struct t3cdev *t3dev)
58 */ 60 */
59static void close_s3_dev(struct t3cdev *t3dev) 61static void close_s3_dev(struct t3cdev *t3dev)
60{ 62{
61 cxgb3i_adapter_remove(t3dev); 63 cxgb3i_adapter_close(t3dev);
62 cxgb3i_sdev_remove(t3dev); 64 cxgb3i_sdev_remove(t3dev);
63} 65}
64 66
67static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error)
68{
69 struct cxgb3i_adapter *snic = cxgb3i_adapter_find_by_tdev(tdev);
70
71 cxgb3i_log_info("snic 0x%p, tdev 0x%p, status 0x%x, err 0x%x.\n",
72 snic, tdev, status, error);
73 if (!snic)
74 return;
75
76 switch (status) {
77 case OFFLOAD_STATUS_DOWN:
78 snic->flags |= CXGB3I_ADAPTER_FLAG_RESET;
79 break;
80 case OFFLOAD_STATUS_UP:
81 snic->flags &= ~CXGB3I_ADAPTER_FLAG_RESET;
82 break;
83 }
84}
85
65/** 86/**
66 * cxgb3i_init_module - module init entry point 87 * cxgb3i_init_module - module init entry point
67 * 88 *