aboutsummaryrefslogtreecommitdiff
path: root/include/scsi/fc_transport_fcoe.h
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2008-12-09 15:10:24 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 11:24:33 -0600
commit85b4aa4926a50210b683ac89326e338e7d131211 (patch)
tree127b6586573194f2d37b5a298e12c8b7d24a6fac /include/scsi/fc_transport_fcoe.h
parent42e9a92fe6a9095bd68a379aaec7ad2be0337f7a (diff)
[SCSI] fcoe: Fibre Channel over Ethernet
Encapsulation protocol for running Fibre Channel over Ethernet interfaces. Creates virtual Fibre Channel host adapters using libfc. This layer is the LLD to the scsi-ml. It allocates the Scsi_Host, utilizes libfc for Fibre Channel protocol processing and interacts with netdev to send/receive Ethernet packets. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/fc_transport_fcoe.h')
-rw-r--r--include/scsi/fc_transport_fcoe.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/scsi/fc_transport_fcoe.h b/include/scsi/fc_transport_fcoe.h
new file mode 100644
index 00000000000..8dca2af14ff
--- /dev/null
+++ b/include/scsi/fc_transport_fcoe.h
@@ -0,0 +1,54 @@
+#ifndef FC_TRANSPORT_FCOE_H
+#define FC_TRANSPORT_FCOE_H
+
+#include <linux/device.h>
+#include <linux/netdevice.h>
+#include <scsi/scsi_host.h>
+#include <scsi/libfc.h>
+
+/**
+ * struct fcoe_transport - FCoE transport struct for generic transport
+ * for Ethernet devices as well as pure HBAs
+ *
+ * @name: name for thsi transport
+ * @bus: physical bus type (pci_bus_type)
+ * @driver: physical bus driver for network device
+ * @create: entry create function
+ * @destroy: exit destroy function
+ * @list: list of transports
+ */
+struct fcoe_transport {
+ char *name;
+ unsigned short vendor;
+ unsigned short device;
+ struct bus_type *bus;
+ struct device_driver *driver;
+ int (*create)(struct net_device *device);
+ int (*destroy)(struct net_device *device);
+ bool (*match)(struct net_device *device);
+ struct list_head list;
+ struct list_head devlist;
+ struct mutex devlock;
+};
+
+/**
+ * MODULE_ALIAS_FCOE_PCI
+ *
+ * some care must be taken with this, vendor and device MUST be a hex value
+ * preceded with 0x and with letters in lower case (0x12ab, not 0x12AB or 12AB)
+ */
+#define MODULE_ALIAS_FCOE_PCI(vendor, device) \
+ MODULE_ALIAS("fcoe-pci-" __stringify(vendor) "-" __stringify(device))
+
+/* exported funcs */
+int fcoe_transport_attach(struct net_device *netdev);
+int fcoe_transport_release(struct net_device *netdev);
+int fcoe_transport_register(struct fcoe_transport *t);
+int fcoe_transport_unregister(struct fcoe_transport *t);
+int fcoe_load_transport_driver(struct net_device *netdev);
+int __init fcoe_transport_init(void);
+int __exit fcoe_transport_exit(void);
+
+/* fcow_sw is the default transport */
+extern struct fcoe_transport fcoe_sw_transport;
+#endif /* FC_TRANSPORT_FCOE_H */