0001
0002
0003
0004
0005
0006
0007
0008 #ifndef _FCOE_H_
0009 #define _FCOE_H_
0010
0011 #include <linux/skbuff.h>
0012 #include <linux/kthread.h>
0013
0014 #define FCOE_MAX_QUEUE_DEPTH 256
0015 #define FCOE_MIN_QUEUE_DEPTH 32
0016
0017 #define FCOE_WORD_TO_BYTE 4
0018
0019 #define FCOE_VERSION "0.1"
0020 #define FCOE_NAME "fcoe"
0021 #define FCOE_VENDOR "Open-FCoE.org"
0022
0023 #define FCOE_MAX_LUN 0xFFFF
0024 #define FCOE_MAX_FCP_TARGET 256
0025
0026 #define FCOE_MAX_OUTSTANDING_COMMANDS 1024
0027
0028 #define FCOE_MIN_XID 0x0000
0029 #define FCOE_MAX_XID 0x0FFF
0030
0031 extern unsigned int fcoe_debug_logging;
0032
0033 #define FCOE_LOGGING 0x01
0034 #define FCOE_NETDEV_LOGGING 0x02
0035
0036 #define FCOE_CHECK_LOGGING(LEVEL, CMD) \
0037 do { \
0038 if (unlikely(fcoe_debug_logging & LEVEL)) \
0039 do { \
0040 CMD; \
0041 } while (0); \
0042 } while (0)
0043
0044 #define FCOE_DBG(fmt, args...) \
0045 FCOE_CHECK_LOGGING(FCOE_LOGGING, \
0046 pr_info("fcoe: " fmt, ##args);)
0047
0048 #define FCOE_NETDEV_DBG(netdev, fmt, args...) \
0049 FCOE_CHECK_LOGGING(FCOE_NETDEV_LOGGING, \
0050 pr_info("fcoe: %s: " fmt, \
0051 netdev->name, ##args);)
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065 struct fcoe_interface {
0066 struct list_head list;
0067 struct net_device *netdev;
0068 struct net_device *realdev;
0069 struct packet_type fcoe_packet_type;
0070 struct packet_type fip_packet_type;
0071 struct packet_type fip_vlan_packet_type;
0072 struct fc_exch_mgr *oem;
0073 u8 removed;
0074 u8 priority;
0075 };
0076
0077 #define fcoe_to_ctlr(x) \
0078 (struct fcoe_ctlr *)(((struct fcoe_ctlr *)(x)) - 1)
0079
0080 #define fcoe_from_ctlr(x) \
0081 ((struct fcoe_interface *)((x) + 1))
0082
0083
0084
0085
0086
0087 static inline struct net_device *fcoe_netdev(const struct fc_lport *lport)
0088 {
0089 return ((struct fcoe_interface *)
0090 ((struct fcoe_port *)lport_priv(lport))->priv)->netdev;
0091 }
0092
0093 #endif