diff options
author | Yi Zou <yi.zou@intel.com> | 2011-06-20 19:59:10 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 17:28:41 -0400 |
commit | 71f894915aa6680dbce2ff727fb9237c4f7ac373 (patch) | |
tree | 172d9ae8a36aa7cbc732a9f493aea35f2d0ba2c8 | |
parent | 33dc362b7f155a584688bcab2facdd4d21232001 (diff) |
[SCSI] fcoe: support ndo_fcoe_ddp_target() for DDP in FCoE targe
Add ddp_target() support to the Open-FCoE sw fcoe hba driver (fcoe.ko).
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index 155d7b9bdeae..f76a321ecb15 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -99,7 +99,8 @@ static void fcoe_destroy_work(struct work_struct *); | |||
99 | static int fcoe_ddp_setup(struct fc_lport *, u16, struct scatterlist *, | 99 | static int fcoe_ddp_setup(struct fc_lport *, u16, struct scatterlist *, |
100 | unsigned int); | 100 | unsigned int); |
101 | static int fcoe_ddp_done(struct fc_lport *, u16); | 101 | static int fcoe_ddp_done(struct fc_lport *, u16); |
102 | 102 | static int fcoe_ddp_target(struct fc_lport *, u16, struct scatterlist *, | |
103 | unsigned int); | ||
103 | static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *); | 104 | static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *); |
104 | 105 | ||
105 | static bool fcoe_match(struct net_device *netdev); | 106 | static bool fcoe_match(struct net_device *netdev); |
@@ -143,6 +144,7 @@ static struct libfc_function_template fcoe_libfc_fcn_templ = { | |||
143 | .frame_send = fcoe_xmit, | 144 | .frame_send = fcoe_xmit, |
144 | .ddp_setup = fcoe_ddp_setup, | 145 | .ddp_setup = fcoe_ddp_setup, |
145 | .ddp_done = fcoe_ddp_done, | 146 | .ddp_done = fcoe_ddp_done, |
147 | .ddp_target = fcoe_ddp_target, | ||
146 | .elsct_send = fcoe_elsct_send, | 148 | .elsct_send = fcoe_elsct_send, |
147 | .get_lesb = fcoe_get_lesb, | 149 | .get_lesb = fcoe_get_lesb, |
148 | .lport_set_port_id = fcoe_set_port_id, | 150 | .lport_set_port_id = fcoe_set_port_id, |
@@ -887,6 +889,28 @@ static int fcoe_ddp_setup(struct fc_lport *lport, u16 xid, | |||
887 | } | 889 | } |
888 | 890 | ||
889 | /** | 891 | /** |
892 | * fcoe_ddp_target() - Call a LLD's ddp_target through the net device | ||
893 | * @lport: The local port to setup DDP for | ||
894 | * @xid: The exchange ID for this DDP transfer | ||
895 | * @sgl: The scatterlist describing this transfer | ||
896 | * @sgc: The number of sg items | ||
897 | * | ||
898 | * Returns: 0 if the DDP context was not configured | ||
899 | */ | ||
900 | static int fcoe_ddp_target(struct fc_lport *lport, u16 xid, | ||
901 | struct scatterlist *sgl, unsigned int sgc) | ||
902 | { | ||
903 | struct net_device *netdev = fcoe_netdev(lport); | ||
904 | |||
905 | if (netdev->netdev_ops->ndo_fcoe_ddp_target) | ||
906 | return netdev->netdev_ops->ndo_fcoe_ddp_target(netdev, xid, | ||
907 | sgl, sgc); | ||
908 | |||
909 | return 0; | ||
910 | } | ||
911 | |||
912 | |||
913 | /** | ||
890 | * fcoe_ddp_done() - Call a LLD's ddp_done through the net device | 914 | * fcoe_ddp_done() - Call a LLD's ddp_done through the net device |
891 | * @lport: The local port to complete DDP on | 915 | * @lport: The local port to complete DDP on |
892 | * @xid: The exchange ID for this DDP transfer | 916 | * @xid: The exchange ID for this DDP transfer |