X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fcxgb3i%2Fcxgb3i_init.c;h=d0ab23a583558a5b66cb856e760015140a7e410f;hb=d90a7e86401ffea2163a4337f3a47f3909c4e255;hp=1ce9f244e46c53d9725cb9d953b0b8169e1470fe;hpb=4f3bff70a64b105921dac8630bc4381567b21ebd;p=pandora-kernel.git diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c index 1ce9f244e46c..d0ab23a58355 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 @@ -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_event_handler(struct t3cdev *tdev, u32 event, u32 port); 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, + .event_handler = s3_event_handler, }; /** @@ -48,8 +50,9 @@ static void open_s3_dev(struct t3cdev *t3dev) vers_printed = 1; } + cxgb3i_ddp_init(t3dev); cxgb3i_sdev_add(t3dev, &t3c_client); - cxgb3i_adapter_add(t3dev); + cxgb3i_adapter_open(t3dev); } /** @@ -58,8 +61,28 @@ 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); + cxgb3i_ddp_cleanup(t3dev); +} + +static void s3_event_handler(struct t3cdev *tdev, u32 event, u32 port) +{ + struct cxgb3i_adapter *snic = cxgb3i_adapter_find_by_tdev(tdev); + + cxgb3i_log_info("snic 0x%p, tdev 0x%p, event 0x%x, port 0x%x.\n", + snic, tdev, event, port); + if (!snic) + return; + + switch (event) { + case OFFLOAD_STATUS_DOWN: + snic->flags |= CXGB3I_ADAPTER_FLAG_RESET; + break; + case OFFLOAD_STATUS_UP: + snic->flags &= ~CXGB3I_ADAPTER_FLAG_RESET; + break; + } } /**