Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142097
b: refs/heads/master
c: 5919a59
h: refs/heads/master
i:
  142095: 02e5be1
v: v3
  • Loading branch information
Vasu Dev authored and James Bottomley committed Apr 3, 2009
1 parent 33c5ae8 commit 9788237
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8976f424d43c80ea32b6e847226e1a8ccdb6e748
refs/heads/master: 5919a59503577c2dc6eaa8bfba0f7bde3f9924ba
3 changes: 1 addition & 2 deletions trunk/drivers/scsi/fcoe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ obj-$(CONFIG_FCOE) += fcoe.o

fcoe-y := \
libfcoe.o \
fcoe_sw.o \
fc_transport_fcoe.o
fcoe_sw.o
37 changes: 4 additions & 33 deletions trunk/drivers/scsi/fcoe/fcoe_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

#include <scsi/libfc.h>
#include <scsi/libfcoe.h>
#include <scsi/fc_transport_fcoe.h>

#define FCOE_SW_VERSION "0.1"
#define FCOE_SW_NAME "fcoesw"
Expand Down Expand Up @@ -302,7 +301,7 @@ static inline int fcoe_sw_em_config(struct fc_lport *lp)
*
* Returns: 0 if link is OK for use by FCoE.
*/
static int fcoe_sw_destroy(struct net_device *netdev)
int fcoe_sw_destroy(struct net_device *netdev)
{
struct fc_lport *lp = NULL;
struct fcoe_softc *fc;
Expand Down Expand Up @@ -415,7 +414,7 @@ static struct libfc_function_template fcoe_sw_libfc_fcn_templ = {
*
* Returns : 0 on success
*/
static int fcoe_sw_create(struct net_device *netdev)
int fcoe_sw_create(struct net_device *netdev)
{
int rc;
struct fc_lport *lp = NULL;
Expand Down Expand Up @@ -494,28 +493,7 @@ static int fcoe_sw_create(struct net_device *netdev)
}

/**
* fcoe_sw_match() - The FCoE SW transport match function
*
* Returns : false always
*/
static bool fcoe_sw_match(struct net_device *netdev)
{
/* FIXME - for sw transport, always return false */
return false;
}

/* the sw hba fcoe transport */
struct fcoe_transport fcoe_sw_transport = {
.name = "fcoesw",
.create = fcoe_sw_create,
.destroy = fcoe_sw_destroy,
.match = fcoe_sw_match,
.vendor = 0x0,
.device = 0xffff,
};

/**
* fcoe_sw_init() - Registers fcoe_sw_transport
* fcoe_sw_init() - attach to scsi transport
*
* Returns : 0 on success
*/
Expand All @@ -530,23 +508,16 @@ int __init fcoe_sw_init(void)
return -ENODEV;
}

mutex_init(&fcoe_sw_transport.devlock);
INIT_LIST_HEAD(&fcoe_sw_transport.devlist);

/* register sw transport */
fcoe_transport_register(&fcoe_sw_transport);
return 0;
}

/**
* fcoe_sw_exit() - Unregisters fcoe_sw_transport
* fcoe_sw_exit() - detach from scsi transport
*
* Returns : 0 on success
*/
int __exit fcoe_sw_exit(void)
{
/* dettach the transport */
fc_release_transport(scsi_transport_fcoe_sw);
fcoe_transport_unregister(&fcoe_sw_transport);
return 0;
}
25 changes: 6 additions & 19 deletions trunk/drivers/scsi/fcoe/libfcoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include <scsi/libfc.h>
#include <scsi/fc_frame.h>
#include <scsi/libfcoe.h>
#include <scsi/fc_transport_fcoe.h>

static int debug_fcoe;

Expand Down Expand Up @@ -1081,10 +1080,9 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
rc = -ENODEV;
goto out_putdev;
}
/* pass to transport */
rc = fcoe_transport_release(netdev);
rc = fcoe_sw_destroy(netdev);
if (rc) {
printk(KERN_ERR "fcoe: fcoe_transport_release(%s) failed\n",
printk(KERN_ERR "fcoe: fcoe_sw_destroy(%s) failed\n",
netdev->name);
rc = -EIO;
goto out_putdev;
Expand Down Expand Up @@ -1121,10 +1119,9 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
}
fcoe_ethdrv_get(netdev);

/* pass to transport */
rc = fcoe_transport_attach(netdev);
rc = fcoe_sw_create(netdev);
if (rc) {
printk(KERN_ERR "fcoe: fcoe_transport_attach(%s) failed\n",
printk(KERN_ERR "fcoe: fcoe_sw_create(%s) failed\n",
netdev->name);
fcoe_ethdrv_put(netdev);
rc = -EIO;
Expand Down Expand Up @@ -1429,10 +1426,6 @@ EXPORT_SYMBOL_GPL(fcoe_libfc_config);
/**
* fcoe_init() - fcoe module loading initialization
*
* Initialization routine
* 1. Will create fc transport software structure
* 2. initialize the link list of port information structure
*
* Returns 0 on success, negative on failure
*/
static int __init fcoe_init(void)
Expand Down Expand Up @@ -1464,9 +1457,6 @@ static int __init fcoe_init(void)

mod_timer(&fcoe_timer, jiffies + (10 * HZ));

/* initiatlize the fcoe transport */
fcoe_transport_init();

fcoe_sw_init();

return 0;
Expand Down Expand Up @@ -1495,9 +1485,9 @@ static void __exit fcoe_exit(void)
/* Stop the timer */
del_timer_sync(&fcoe_timer);

/* releases the associated fcoe transport for each lport */
/* releases the associated fcoe hosts */
list_for_each_entry_safe(fc, tmp, &fcoe_hostlist, list)
fcoe_transport_release(fc->real_dev);
fcoe_sw_destroy(fc->real_dev);

unregister_hotcpu_notifier(&fcoe_cpu_notifier);

Expand All @@ -1507,8 +1497,5 @@ static void __exit fcoe_exit(void)

/* remove sw trasnport */
fcoe_sw_exit();

/* detach the transport */
fcoe_transport_exit();
}
module_exit(fcoe_exit);
2 changes: 2 additions & 0 deletions trunk/include/scsi/libfcoe.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,6 @@ int fcoe_libfc_config(struct fc_lport *, struct libfc_function_template *);
/* fcoe sw hba */
int __init fcoe_sw_init(void);
int __exit fcoe_sw_exit(void);
int fcoe_sw_create(struct net_device *);
int fcoe_sw_destroy(struct net_device *);
#endif /* _LIBFCOE_H */

0 comments on commit 9788237

Please sign in to comment.