aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2011-06-20 19:59:10 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 17:28:41 -0400
commit71f894915aa6680dbce2ff727fb9237c4f7ac373 (patch)
tree172d9ae8a36aa7cbc732a9f493aea35f2d0ba2c8 /drivers/scsi/fcoe/fcoe.c
parent33dc362b7f155a584688bcab2facdd4d21232001 (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>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r--drivers/scsi/fcoe/fcoe.c26
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 *);
99static int fcoe_ddp_setup(struct fc_lport *, u16, struct scatterlist *, 99static int fcoe_ddp_setup(struct fc_lport *, u16, struct scatterlist *,
100 unsigned int); 100 unsigned int);
101static int fcoe_ddp_done(struct fc_lport *, u16); 101static int fcoe_ddp_done(struct fc_lport *, u16);
102 102static int fcoe_ddp_target(struct fc_lport *, u16, struct scatterlist *,
103 unsigned int);
103static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *); 104static int fcoe_cpu_callback(struct notifier_block *, unsigned long, void *);
104 105
105static bool fcoe_match(struct net_device *netdev); 106static 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 */
900static 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