From 515f1c885af2ba8a9500c8a7aa4ed16bbbfa3ef4 Mon Sep 17 00:00:00 2001 From: Karen Xie Date: Wed, 1 Apr 2009 13:11:23 -0500 Subject: [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 Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/cxgb3i/cxgb3i_init.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/cxgb3i/cxgb3i_init.c') 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); static void open_s3_dev(struct t3cdev *); static void close_s3_dev(struct t3cdev *); +static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error); static cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS]; static struct cxgb3_client t3c_client = { @@ -33,6 +34,7 @@ static struct cxgb3_client t3c_client = { .handlers = cxgb3i_cpl_handlers, .add = open_s3_dev, .remove = close_s3_dev, + .err_handler = s3_err_handler, }; /** @@ -49,7 +51,7 @@ static void open_s3_dev(struct t3cdev *t3dev) } cxgb3i_sdev_add(t3dev, &t3c_client); - cxgb3i_adapter_add(t3dev); + cxgb3i_adapter_open(t3dev); } /** @@ -58,10 +60,29 @@ static void open_s3_dev(struct t3cdev *t3dev) */ static void close_s3_dev(struct t3cdev *t3dev) { - cxgb3i_adapter_remove(t3dev); + cxgb3i_adapter_close(t3dev); cxgb3i_sdev_remove(t3dev); } +static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error) +{ + struct cxgb3i_adapter *snic = cxgb3i_adapter_find_by_tdev(tdev); + + cxgb3i_log_info("snic 0x%p, tdev 0x%p, status 0x%x, err 0x%x.\n", + snic, tdev, status, error); + if (!snic) + return; + + switch (status) { + case OFFLOAD_STATUS_DOWN: + snic->flags |= CXGB3I_ADAPTER_FLAG_RESET; + break; + case OFFLOAD_STATUS_UP: + snic->flags &= ~CXGB3I_ADAPTER_FLAG_RESET; + break; + } +} + /** * cxgb3i_init_module - module init entry point * -- cgit v1.2.3-18-g5258 From 0d0c27f2e83619083280c4c4f1bc33f2b58132ac Mon Sep 17 00:00:00 2001 From: Karen Xie Date: Wed, 1 Apr 2009 13:11:27 -0500 Subject: [SCSI] cxgb3i: merge cxgb3i_ddp into cxgb3i module - Merge cxgb3i_ddp.ko to cxgb3i.ko as there is no other users. - Bump the driver version up to 1.0.2. Signed-off-by: Karen Xie Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- drivers/scsi/cxgb3i/cxgb3i_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/scsi/cxgb3i/cxgb3i_init.c') diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c index 833dbfa3f88..042d9bce991 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_init.c +++ b/drivers/scsi/cxgb3i/cxgb3i_init.c @@ -12,8 +12,8 @@ #include "cxgb3i.h" #define DRV_MODULE_NAME "cxgb3i" -#define DRV_MODULE_VERSION "1.0.1" -#define DRV_MODULE_RELDATE "Jan. 2009" +#define DRV_MODULE_VERSION "1.0.2" +#define DRV_MODULE_RELDATE "Mar. 2009" static char version[] = "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME @@ -50,6 +50,7 @@ static void open_s3_dev(struct t3cdev *t3dev) vers_printed = 1; } + cxgb3i_ddp_init(t3dev); cxgb3i_sdev_add(t3dev, &t3c_client); cxgb3i_adapter_open(t3dev); } @@ -62,6 +63,7 @@ static void close_s3_dev(struct t3cdev *t3dev) { cxgb3i_adapter_close(t3dev); cxgb3i_sdev_remove(t3dev); + cxgb3i_ddp_cleanup(t3dev); } static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error) -- cgit v1.2.3-18-g5258