aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgb3i/cxgb3i_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/cxgb3i/cxgb3i_init.c')
-rw-r--r--drivers/scsi/cxgb3i/cxgb3i_init.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c
index 1ce9f244e46c..042d9bce9914 100644
--- a/drivers/scsi/cxgb3i/cxgb3i_init.c
+++ b/drivers/scsi/cxgb3i/cxgb3i_init.c
@@ -12,8 +12,8 @@
12#include "cxgb3i.h" 12#include "cxgb3i.h"
13 13
14#define DRV_MODULE_NAME "cxgb3i" 14#define DRV_MODULE_NAME "cxgb3i"
15#define DRV_MODULE_VERSION "1.0.1" 15#define DRV_MODULE_VERSION "1.0.2"
16#define DRV_MODULE_RELDATE "Jan. 2009" 16#define DRV_MODULE_RELDATE "Mar. 2009"
17 17
18static char version[] = 18static char version[] =
19 "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME 19 "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME
@@ -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/**
@@ -48,8 +50,9 @@ static void open_s3_dev(struct t3cdev *t3dev)
48 vers_printed = 1; 50 vers_printed = 1;
49 } 51 }
50 52
53 cxgb3i_ddp_init(t3dev);
51 cxgb3i_sdev_add(t3dev, &t3c_client); 54 cxgb3i_sdev_add(t3dev, &t3c_client);
52 cxgb3i_adapter_add(t3dev); 55 cxgb3i_adapter_open(t3dev);
53} 56}
54 57
55/** 58/**
@@ -58,8 +61,28 @@ static void open_s3_dev(struct t3cdev *t3dev)
58 */ 61 */
59static void close_s3_dev(struct t3cdev *t3dev) 62static void close_s3_dev(struct t3cdev *t3dev)
60{ 63{
61 cxgb3i_adapter_remove(t3dev); 64 cxgb3i_adapter_close(t3dev);
62 cxgb3i_sdev_remove(t3dev); 65 cxgb3i_sdev_remove(t3dev);
66 cxgb3i_ddp_cleanup(t3dev);
67}
68
69static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error)
70{
71 struct cxgb3i_adapter *snic = cxgb3i_adapter_find_by_tdev(tdev);
72
73 cxgb3i_log_info("snic 0x%p, tdev 0x%p, status 0x%x, err 0x%x.\n",
74 snic, tdev, status, error);
75 if (!snic)
76 return;
77
78 switch (status) {
79 case OFFLOAD_STATUS_DOWN:
80 snic->flags |= CXGB3I_ADAPTER_FLAG_RESET;
81 break;
82 case OFFLOAD_STATUS_UP:
83 snic->flags &= ~CXGB3I_ADAPTER_FLAG_RESET;
84 break;
85 }
63} 86}
64 87
65/** 88/**