aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-07-20 18:20:46 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:58 -0400
commit1dd454d9e5205f9a61d51fb97159afeffa0a506c (patch)
treed12a5d8f75b84f03721d7990225dd0aa113372e7 /drivers
parentcd229e42eb8cdfdcbe15dfeec39c3641f62de43a (diff)
[SCSI] fcoe: config via separate create_vn2vn module parameter
Add module parameter create_vn2vn that behaves like the create parameter except that the new instance is created in FIP vn2vn mode. This can be replaced once we change create to allow modifying per-instance attributes before starting the instance. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/fcoe/fcoe.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 4d3e70ab65b5..ab6ea60f2aee 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -117,9 +117,14 @@ static void fcoe_recv_frame(struct sk_buff *skb);
117 117
118static void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *); 118static void fcoe_get_lesb(struct fc_lport *, struct fc_els_lesb *);
119 119
120module_param_call(create, fcoe_create, NULL, NULL, S_IWUSR); 120module_param_call(create, fcoe_create, NULL, (void *)FIP_MODE_AUTO, S_IWUSR);
121__MODULE_PARM_TYPE(create, "string"); 121__MODULE_PARM_TYPE(create, "string");
122MODULE_PARM_DESC(create, " Creates fcoe instance on a ethernet interface"); 122MODULE_PARM_DESC(create, " Creates fcoe instance on a ethernet interface");
123module_param_call(create_vn2vn, fcoe_create, NULL,
124 (void *)FIP_MODE_VN2VN, S_IWUSR);
125__MODULE_PARM_TYPE(create_vn2vn, "string");
126MODULE_PARM_DESC(create_vn2vn, " Creates a VN_node to VN_node FCoE instance "
127 "on an Ethernet interface");
123module_param_call(destroy, fcoe_destroy, NULL, NULL, S_IWUSR); 128module_param_call(destroy, fcoe_destroy, NULL, NULL, S_IWUSR);
124__MODULE_PARM_TYPE(destroy, "string"); 129__MODULE_PARM_TYPE(destroy, "string");
125MODULE_PARM_DESC(destroy, " Destroys fcoe instance on a ethernet interface"); 130MODULE_PARM_DESC(destroy, " Destroys fcoe instance on a ethernet interface");
@@ -341,10 +346,12 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
341/** 346/**
342 * fcoe_interface_create() - Create a FCoE interface on a net device 347 * fcoe_interface_create() - Create a FCoE interface on a net device
343 * @netdev: The net device to create the FCoE interface on 348 * @netdev: The net device to create the FCoE interface on
349 * @fip_mode: The mode to use for FIP
344 * 350 *
345 * Returns: pointer to a struct fcoe_interface or NULL on error 351 * Returns: pointer to a struct fcoe_interface or NULL on error
346 */ 352 */
347static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev) 353static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev,
354 enum fip_state fip_mode)
348{ 355{
349 struct fcoe_interface *fcoe; 356 struct fcoe_interface *fcoe;
350 int err; 357 int err;
@@ -361,7 +368,7 @@ static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev)
361 /* 368 /*
362 * Initialize FIP. 369 * Initialize FIP.
363 */ 370 */
364 fcoe_ctlr_init(&fcoe->ctlr, FIP_MODE_AUTO); 371 fcoe_ctlr_init(&fcoe->ctlr, fip_mode);
365 fcoe->ctlr.send = fcoe_fip_send; 372 fcoe->ctlr.send = fcoe_fip_send;
366 fcoe->ctlr.update_mac = fcoe_update_src_mac; 373 fcoe->ctlr.update_mac = fcoe_update_src_mac;
367 fcoe->ctlr.get_src_addr = fcoe_get_src_mac; 374 fcoe->ctlr.get_src_addr = fcoe_get_src_mac;
@@ -2088,6 +2095,7 @@ static void fcoe_destroy_work(struct work_struct *work)
2088 */ 2095 */
2089static int fcoe_create(const char *buffer, struct kernel_param *kp) 2096static int fcoe_create(const char *buffer, struct kernel_param *kp)
2090{ 2097{
2098 enum fip_state fip_mode = (enum fip_state)(long)kp->arg;
2091 int rc; 2099 int rc;
2092 struct fcoe_interface *fcoe; 2100 struct fcoe_interface *fcoe;
2093 struct fc_lport *lport; 2101 struct fc_lport *lport;
@@ -2129,7 +2137,7 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
2129 goto out_putdev; 2137 goto out_putdev;
2130 } 2138 }
2131 2139
2132 fcoe = fcoe_interface_create(netdev); 2140 fcoe = fcoe_interface_create(netdev, fip_mode);
2133 if (!fcoe) { 2141 if (!fcoe) {
2134 rc = -ENOMEM; 2142 rc = -ENOMEM;
2135 goto out_putdev; 2143 goto out_putdev;