diff options
author | Karen Xie <kxie@chelsio.com> | 2009-04-01 14:11:27 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-04-03 10:23:13 -0400 |
commit | 0d0c27f2e83619083280c4c4f1bc33f2b58132ac (patch) | |
tree | 62fc26f09335c64549c8b7eea5c14e469d8eae28 | |
parent | 2a90030fcb827afa16914e57ac587e683280ae4a (diff) |
[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 <kxie@chelsio.com>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r-- | drivers/scsi/cxgb3i/Kbuild | 4 | ||||
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_ddp.c | 63 | ||||
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_ddp.h | 3 | ||||
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_init.c | 6 | ||||
-rw-r--r-- | drivers/scsi/cxgb3i/cxgb3i_offload.h | 2 |
5 files changed, 21 insertions, 57 deletions
diff --git a/drivers/scsi/cxgb3i/Kbuild b/drivers/scsi/cxgb3i/Kbuild index ee7d6d2f9c3b..25a2032bfa26 100644 --- a/drivers/scsi/cxgb3i/Kbuild +++ b/drivers/scsi/cxgb3i/Kbuild | |||
@@ -1,4 +1,4 @@ | |||
1 | EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 | 1 | EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 |
2 | 2 | ||
3 | cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o | 3 | cxgb3i-y := cxgb3i_init.o cxgb3i_iscsi.o cxgb3i_pdu.o cxgb3i_offload.o cxgb3i_ddp.o |
4 | obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i_ddp.o cxgb3i.o | 4 | obj-$(CONFIG_SCSI_CXGB3_ISCSI) += cxgb3i.o |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_ddp.c b/drivers/scsi/cxgb3i/cxgb3i_ddp.c index bb1eebf654cf..275d2da443be 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_ddp.c +++ b/drivers/scsi/cxgb3i/cxgb3i_ddp.c | |||
@@ -23,19 +23,6 @@ | |||
23 | 23 | ||
24 | #include "cxgb3i_ddp.h" | 24 | #include "cxgb3i_ddp.h" |
25 | 25 | ||
26 | #define DRV_MODULE_NAME "cxgb3i_ddp" | ||
27 | #define DRV_MODULE_VERSION "1.0.0" | ||
28 | #define DRV_MODULE_RELDATE "Dec. 1, 2008" | ||
29 | |||
30 | static char version[] = | ||
31 | "Chelsio S3xx iSCSI DDP " DRV_MODULE_NAME | ||
32 | " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | ||
33 | |||
34 | MODULE_AUTHOR("Karen Xie <kxie@chelsio.com>"); | ||
35 | MODULE_DESCRIPTION("cxgb3i ddp pagepod manager"); | ||
36 | MODULE_LICENSE("GPL"); | ||
37 | MODULE_VERSION(DRV_MODULE_VERSION); | ||
38 | |||
39 | #define ddp_log_error(fmt...) printk(KERN_ERR "cxgb3i_ddp: ERR! " fmt) | 26 | #define ddp_log_error(fmt...) printk(KERN_ERR "cxgb3i_ddp: ERR! " fmt) |
40 | #define ddp_log_warn(fmt...) printk(KERN_WARNING "cxgb3i_ddp: WARN! " fmt) | 27 | #define ddp_log_warn(fmt...) printk(KERN_WARNING "cxgb3i_ddp: WARN! " fmt) |
41 | #define ddp_log_info(fmt...) printk(KERN_INFO "cxgb3i_ddp: " fmt) | 28 | #define ddp_log_info(fmt...) printk(KERN_INFO "cxgb3i_ddp: " fmt) |
@@ -212,7 +199,6 @@ int cxgb3i_ddp_find_page_index(unsigned long pgsz) | |||
212 | ddp_log_debug("ddp page size 0x%lx not supported.\n", pgsz); | 199 | ddp_log_debug("ddp page size 0x%lx not supported.\n", pgsz); |
213 | return DDP_PGIDX_MAX; | 200 | return DDP_PGIDX_MAX; |
214 | } | 201 | } |
215 | EXPORT_SYMBOL_GPL(cxgb3i_ddp_find_page_index); | ||
216 | 202 | ||
217 | static inline void ddp_gl_unmap(struct pci_dev *pdev, | 203 | static inline void ddp_gl_unmap(struct pci_dev *pdev, |
218 | struct cxgb3i_gather_list *gl) | 204 | struct cxgb3i_gather_list *gl) |
@@ -335,7 +321,6 @@ error_out: | |||
335 | kfree(gl); | 321 | kfree(gl); |
336 | return NULL; | 322 | return NULL; |
337 | } | 323 | } |
338 | EXPORT_SYMBOL_GPL(cxgb3i_ddp_make_gl); | ||
339 | 324 | ||
340 | /** | 325 | /** |
341 | * cxgb3i_ddp_release_gl - release a page buffer list | 326 | * cxgb3i_ddp_release_gl - release a page buffer list |
@@ -349,7 +334,6 @@ void cxgb3i_ddp_release_gl(struct cxgb3i_gather_list *gl, | |||
349 | ddp_gl_unmap(pdev, gl); | 334 | ddp_gl_unmap(pdev, gl); |
350 | kfree(gl); | 335 | kfree(gl); |
351 | } | 336 | } |
352 | EXPORT_SYMBOL_GPL(cxgb3i_ddp_release_gl); | ||
353 | 337 | ||
354 | /** | 338 | /** |
355 | * cxgb3i_ddp_tag_reserve - set up ddp for a data transfer | 339 | * cxgb3i_ddp_tag_reserve - set up ddp for a data transfer |
@@ -431,7 +415,6 @@ unmark_entries: | |||
431 | ddp_unmark_entries(ddp, idx, npods); | 415 | ddp_unmark_entries(ddp, idx, npods); |
432 | return err; | 416 | return err; |
433 | } | 417 | } |
434 | EXPORT_SYMBOL_GPL(cxgb3i_ddp_tag_reserve); | ||
435 | 418 | ||
436 | /** | 419 | /** |
437 | * cxgb3i_ddp_tag_release - release a ddp tag | 420 | * cxgb3i_ddp_tag_release - release a ddp tag |
@@ -469,7 +452,6 @@ void cxgb3i_ddp_tag_release(struct t3cdev *tdev, u32 tag) | |||
469 | ddp_log_error("ddp tag 0x%x, idx 0x%x > max 0x%x.\n", | 452 | ddp_log_error("ddp tag 0x%x, idx 0x%x > max 0x%x.\n", |
470 | tag, idx, ddp->nppods); | 453 | tag, idx, ddp->nppods); |
471 | } | 454 | } |
472 | EXPORT_SYMBOL_GPL(cxgb3i_ddp_tag_release); | ||
473 | 455 | ||
474 | static int setup_conn_pgidx(struct t3cdev *tdev, unsigned int tid, int pg_idx, | 456 | static int setup_conn_pgidx(struct t3cdev *tdev, unsigned int tid, int pg_idx, |
475 | int reply) | 457 | int reply) |
@@ -510,7 +492,6 @@ int cxgb3i_setup_conn_host_pagesize(struct t3cdev *tdev, unsigned int tid, | |||
510 | { | 492 | { |
511 | return setup_conn_pgidx(tdev, tid, page_idx, reply); | 493 | return setup_conn_pgidx(tdev, tid, page_idx, reply); |
512 | } | 494 | } |
513 | EXPORT_SYMBOL_GPL(cxgb3i_setup_conn_host_pagesize); | ||
514 | 495 | ||
515 | /** | 496 | /** |
516 | * cxgb3i_setup_conn_pagesize - setup the conn.'s ddp page size | 497 | * cxgb3i_setup_conn_pagesize - setup the conn.'s ddp page size |
@@ -527,7 +508,6 @@ int cxgb3i_setup_conn_pagesize(struct t3cdev *tdev, unsigned int tid, | |||
527 | 508 | ||
528 | return setup_conn_pgidx(tdev, tid, pgidx, reply); | 509 | return setup_conn_pgidx(tdev, tid, pgidx, reply); |
529 | } | 510 | } |
530 | EXPORT_SYMBOL_GPL(cxgb3i_setup_conn_pagesize); | ||
531 | 511 | ||
532 | /** | 512 | /** |
533 | * cxgb3i_setup_conn_digest - setup conn. digest setting | 513 | * cxgb3i_setup_conn_digest - setup conn. digest setting |
@@ -563,7 +543,6 @@ int cxgb3i_setup_conn_digest(struct t3cdev *tdev, unsigned int tid, | |||
563 | cxgb3_ofld_send(tdev, skb); | 543 | cxgb3_ofld_send(tdev, skb); |
564 | return 0; | 544 | return 0; |
565 | } | 545 | } |
566 | EXPORT_SYMBOL_GPL(cxgb3i_setup_conn_digest); | ||
567 | 546 | ||
568 | 547 | ||
569 | /** | 548 | /** |
@@ -606,7 +585,6 @@ int cxgb3i_adapter_ddp_info(struct t3cdev *tdev, | |||
606 | *txsz, ddp->max_txsz, *rxsz, ddp->max_rxsz); | 585 | *txsz, ddp->max_txsz, *rxsz, ddp->max_rxsz); |
607 | return 0; | 586 | return 0; |
608 | } | 587 | } |
609 | EXPORT_SYMBOL_GPL(cxgb3i_adapter_ddp_info); | ||
610 | 588 | ||
611 | /** | 589 | /** |
612 | * ddp_release - release the cxgb3 adapter's ddp resource | 590 | * ddp_release - release the cxgb3 adapter's ddp resource |
@@ -651,7 +629,6 @@ static void ddp_init(struct t3cdev *tdev) | |||
651 | struct ulp_iscsi_info uinfo; | 629 | struct ulp_iscsi_info uinfo; |
652 | unsigned int ppmax, bits; | 630 | unsigned int ppmax, bits; |
653 | int i, err; | 631 | int i, err; |
654 | static int vers_printed; | ||
655 | 632 | ||
656 | if (tdev->ulp_iscsi) { | 633 | if (tdev->ulp_iscsi) { |
657 | ddp_log_warn("t3dev 0x%p, ddp 0x%p already set up.\n", | 634 | ddp_log_warn("t3dev 0x%p, ddp 0x%p already set up.\n", |
@@ -659,11 +636,6 @@ static void ddp_init(struct t3cdev *tdev) | |||
659 | return; | 636 | return; |
660 | } | 637 | } |
661 | 638 | ||
662 | if (!vers_printed) { | ||
663 | printk(KERN_INFO "%s", version); | ||
664 | vers_printed = 1; | ||
665 | } | ||
666 | |||
667 | err = tdev->ctl(tdev, ULP_ISCSI_GET_PARAMS, &uinfo); | 639 | err = tdev->ctl(tdev, ULP_ISCSI_GET_PARAMS, &uinfo); |
668 | if (err < 0) { | 640 | if (err < 0) { |
669 | ddp_log_error("%s, failed to get iscsi param err=%d.\n", | 641 | ddp_log_error("%s, failed to get iscsi param err=%d.\n", |
@@ -730,36 +702,23 @@ free_ddp_map: | |||
730 | cxgb3i_free_big_mem(ddp); | 702 | cxgb3i_free_big_mem(ddp); |
731 | } | 703 | } |
732 | 704 | ||
733 | static struct cxgb3_client t3c_ddp_client = { | ||
734 | .name = "iscsiddp_cxgb3", | ||
735 | .add = ddp_init, | ||
736 | .remove = ddp_release, | ||
737 | }; | ||
738 | |||
739 | /** | 705 | /** |
740 | * cxgb3i_ddp_init_module - module init entry point | 706 | * cxgb3i_ddp_init - initialize ddp functions |
741 | * initialize any driver wide global data structures and register with the | ||
742 | * cxgb3 module | ||
743 | */ | 707 | */ |
744 | static int __init cxgb3i_ddp_init_module(void) | 708 | void cxgb3i_ddp_init(struct t3cdev *tdev) |
745 | { | 709 | { |
746 | page_idx = cxgb3i_ddp_find_page_index(PAGE_SIZE); | 710 | if (page_idx == DDP_PGIDX_MAX) { |
747 | ddp_log_info("system PAGE_SIZE %lu, ddp idx %u.\n", | 711 | page_idx = cxgb3i_ddp_find_page_index(PAGE_SIZE); |
748 | PAGE_SIZE, page_idx); | 712 | ddp_log_info("system PAGE_SIZE %lu, ddp idx %u.\n", |
749 | 713 | PAGE_SIZE, page_idx); | |
750 | cxgb3_register_client(&t3c_ddp_client); | 714 | } |
751 | return 0; | 715 | ddp_init(tdev); |
752 | } | 716 | } |
753 | 717 | ||
754 | /** | 718 | /** |
755 | * cxgb3i_ddp_exit_module - module cleanup/exit entry point | 719 | * cxgb3i_ddp_cleaup - clean up ddp function |
756 | * go through the ddp list, unregister with the cxgb3 module and release | ||
757 | * any resource held. | ||
758 | */ | 720 | */ |
759 | static void __exit cxgb3i_ddp_exit_module(void) | 721 | void cxgb3i_ddp_cleanup(struct t3cdev *tdev) |
760 | { | 722 | { |
761 | cxgb3_unregister_client(&t3c_ddp_client); | 723 | ddp_release(tdev); |
762 | } | 724 | } |
763 | |||
764 | module_init(cxgb3i_ddp_init_module); | ||
765 | module_exit(cxgb3i_ddp_exit_module); | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i_ddp.h b/drivers/scsi/cxgb3i/cxgb3i_ddp.h index 87f032bf6360..0d296de7cf32 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_ddp.h +++ b/drivers/scsi/cxgb3i/cxgb3i_ddp.h | |||
@@ -303,4 +303,7 @@ int cxgb3i_setup_conn_digest(struct t3cdev *, unsigned int tid, | |||
303 | int cxgb3i_ddp_find_page_index(unsigned long pgsz); | 303 | int cxgb3i_ddp_find_page_index(unsigned long pgsz); |
304 | int cxgb3i_adapter_ddp_info(struct t3cdev *, struct cxgb3i_tag_format *, | 304 | int cxgb3i_adapter_ddp_info(struct t3cdev *, struct cxgb3i_tag_format *, |
305 | unsigned int *txsz, unsigned int *rxsz); | 305 | unsigned int *txsz, unsigned int *rxsz); |
306 | |||
307 | void cxgb3i_ddp_init(struct t3cdev *); | ||
308 | void cxgb3i_ddp_cleanup(struct t3cdev *); | ||
306 | #endif | 309 | #endif |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c index 833dbfa3f88a..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 | ||
18 | static char version[] = | 18 | static char version[] = |
19 | "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME | 19 | "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME |
@@ -50,6 +50,7 @@ static void open_s3_dev(struct t3cdev *t3dev) | |||
50 | vers_printed = 1; | 50 | vers_printed = 1; |
51 | } | 51 | } |
52 | 52 | ||
53 | cxgb3i_ddp_init(t3dev); | ||
53 | cxgb3i_sdev_add(t3dev, &t3c_client); | 54 | cxgb3i_sdev_add(t3dev, &t3c_client); |
54 | cxgb3i_adapter_open(t3dev); | 55 | cxgb3i_adapter_open(t3dev); |
55 | } | 56 | } |
@@ -62,6 +63,7 @@ static void close_s3_dev(struct t3cdev *t3dev) | |||
62 | { | 63 | { |
63 | cxgb3i_adapter_close(t3dev); | 64 | cxgb3i_adapter_close(t3dev); |
64 | cxgb3i_sdev_remove(t3dev); | 65 | cxgb3i_sdev_remove(t3dev); |
66 | cxgb3i_ddp_cleanup(t3dev); | ||
65 | } | 67 | } |
66 | 68 | ||
67 | static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error) | 69 | static void s3_err_handler(struct t3cdev *tdev, u32 status, u32 error) |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_offload.h b/drivers/scsi/cxgb3i/cxgb3i_offload.h index dab759d67bec..ebfca960c0a9 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_offload.h +++ b/drivers/scsi/cxgb3i/cxgb3i_offload.h | |||
@@ -16,7 +16,7 @@ | |||
16 | #define _CXGB3I_OFFLOAD_H | 16 | #define _CXGB3I_OFFLOAD_H |
17 | 17 | ||
18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
19 | #include <net/tcp.h> | 19 | #include <linux/in.h> |
20 | 20 | ||
21 | #include "common.h" | 21 | #include "common.h" |
22 | #include "adapter.h" | 22 | #include "adapter.h" |