aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.h
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2009-11-03 14:47:50 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:08 -0500
commit1875f27e291d05711f15a8a3d486abfeaf385931 (patch)
tree7eb368cbc6fcec3a3859c2da092e79daf3bd68d2 /drivers/scsi/fcoe/fcoe.h
parent70b51aabf3b03fbf8d61c14847ccce4c69fb0cdd (diff)
[SCSI] fcoe: Formatting cleanups and commenting
Added kernel-doc comment blocks to all structures and functions. Renamed fc_lport instances rom lp to lport to be inline with our naming convention. Renamed all misnamed net_device instances to netdev to be inline with our naming convention. Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.h')
-rw-r--r--drivers/scsi/fcoe/fcoe.h75
1 files changed, 52 insertions, 23 deletions
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
index 99dfa7c2aeaa..c69b2c56c2d1 100644
--- a/drivers/scsi/fcoe/fcoe.h
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -50,7 +50,7 @@ unsigned int fcoe_debug_logging;
50module_param_named(debug_logging, fcoe_debug_logging, int, S_IRUGO|S_IWUSR); 50module_param_named(debug_logging, fcoe_debug_logging, int, S_IRUGO|S_IWUSR);
51MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels"); 51MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
52 52
53#define FCOE_LOGGING 0x01 /* General logging, not categorized */ 53#define FCOE_LOGGING 0x01 /* General logging, not categorized */
54#define FCOE_NETDEV_LOGGING 0x02 /* Netdevice logging */ 54#define FCOE_NETDEV_LOGGING 0x02 /* Netdevice logging */
55 55
56#define FCOE_CHECK_LOGGING(LEVEL, CMD) \ 56#define FCOE_CHECK_LOGGING(LEVEL, CMD) \
@@ -70,8 +70,13 @@ do { \
70 printk(KERN_INFO "fcoe: %s: " fmt, \ 70 printk(KERN_INFO "fcoe: %s: " fmt, \
71 netdev->name, ##args);) 71 netdev->name, ##args);)
72 72
73/* 73/**
74 * this percpu struct for fcoe 74 * struct fcoe_percpu_s - The per-CPU context for FCoE receive threads
75 * @thread: The thread context
76 * @fcoe_rx_list: The queue of pending packets to process
77 * @page: The memory page for calculating frame trailer CRCs
78 * @crc_eof_offset: The offset into the CRC page pointing to available
79 * memory for a new trailer
75 */ 80 */
76struct fcoe_percpu_s { 81struct fcoe_percpu_s {
77 struct task_struct *thread; 82 struct task_struct *thread;
@@ -80,38 +85,62 @@ struct fcoe_percpu_s {
80 int crc_eof_offset; 85 int crc_eof_offset;
81}; 86};
82 87
83/* 88/**
84 * an FCoE interface, 1:1 with netdev 89 * struct fcoe_interface - A FCoE interface
90 * @list: Handle for a list of FCoE interfaces
91 * @netdev: The associated net device
92 * @fcoe_packet_type: FCoE packet type
93 * @fip_packet_type: FIP packet type
94 * @ctlr: The FCoE controller (for FIP)
95 * @oem: The offload exchange manager for all local port
96 * instances associated with this port
97 * @kref: The kernel reference
98 *
99 * This structure is 1:1 with a net devive.
85 */ 100 */
86struct fcoe_interface { 101struct fcoe_interface {
87 struct list_head list; 102 struct list_head list;
88 struct net_device *netdev; 103 struct net_device *netdev;
89 struct packet_type fcoe_packet_type; 104 struct packet_type fcoe_packet_type;
90 struct packet_type fip_packet_type; 105 struct packet_type fip_packet_type;
91 struct fcoe_ctlr ctlr; 106 struct fcoe_ctlr ctlr;
92 struct fc_exch_mgr *oem; /* offload exchange manager */ 107 struct fc_exch_mgr *oem;
93 struct kref kref; 108 struct kref kref;
94}; 109};
95 110
96/* 111/**
97 * the FCoE private structure that's allocated along with the 112 * struct fcoe_port - The FCoE private structure
98 * Scsi_Host and libfc fc_lport structures 113 * @fcoe: The associated fcoe interface
114 * @lport: The associated local port
115 * @fcoe_pending_queue: The pending Rx queue of skbs
116 * @fcoe_pending_queue_active: Indicates if the pending queue is active
117 * @timer: The queue timer
118 * @destroy_work: Handle for work context
119 * (to prevent RTNL deadlocks)
120 * @data_srt_addr: Source address for data
121 *
122 * An instance of this structure is to be allocated along with the
123 * Scsi_Host and libfc fc_lport structures.
99 */ 124 */
100struct fcoe_port { 125struct fcoe_port {
101 struct fcoe_interface *fcoe; 126 struct fcoe_interface *fcoe;
102 struct fc_lport *lport; 127 struct fc_lport *lport;
103 struct sk_buff_head fcoe_pending_queue; 128 struct sk_buff_head fcoe_pending_queue;
104 u8 fcoe_pending_queue_active; 129 u8 fcoe_pending_queue_active;
105 struct timer_list timer; /* queue timer */ 130 struct timer_list timer;
106 struct work_struct destroy_work; /* to prevent rtnl deadlocks */ 131 struct work_struct destroy_work;
107 u8 data_src_addr[ETH_ALEN]; 132 u8 data_src_addr[ETH_ALEN];
108}; 133};
109 134
110#define fcoe_from_ctlr(fip) container_of(fip, struct fcoe_interface, ctlr) 135#define fcoe_from_ctlr(fip) container_of(fip, struct fcoe_interface, ctlr)
111 136
112static inline struct net_device *fcoe_netdev(const struct fc_lport *lp) 137/**
138 * fcoe_netdev() - Return the net device associated with a local port
139 * @lport: The local port to get the net device from
140 */
141static inline struct net_device *fcoe_netdev(const struct fc_lport *lport)
113{ 142{
114 return ((struct fcoe_port *)lport_priv(lp))->fcoe->netdev; 143 return ((struct fcoe_port *)lport_priv(lport))->fcoe->netdev;
115} 144}
116 145
117#endif /* _FCOE_H_ */ 146#endif /* _FCOE_H_ */