~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/scsi/fcoe/fcoe.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <linux/kthread.h>
25
25
 
26
26
#define FCOE_MAX_QUEUE_DEPTH    256
27
 
#define FCOE_LOW_QUEUE_DEPTH    32
 
27
#define FCOE_MIN_QUEUE_DEPTH    32
28
28
 
29
29
#define FCOE_WORD_TO_BYTE       4
30
30
 
40
40
#define FCOE_MIN_XID            0x0000  /* the min xid supported by fcoe_sw */
41
41
#define FCOE_MAX_XID            0x0FFF  /* the max xid supported by fcoe_sw */
42
42
 
43
 
/*
44
 
 * Max MTU for FCoE: 14 (FCoE header) + 24 (FC header) + 2112 (max FC payload)
45
 
 * + 4 (FC CRC) + 4 (FCoE trailer) =  2158 bytes
46
 
 */
47
 
#define FCOE_MTU        2158
48
 
 
49
43
unsigned int fcoe_debug_logging;
50
44
module_param_named(debug_logging, fcoe_debug_logging, int, S_IRUGO|S_IWUSR);
51
45
MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
71
65
                                  netdev->name, ##args);)
72
66
 
73
67
/**
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
80
 
 */
81
 
struct fcoe_percpu_s {
82
 
        struct task_struct *thread;
83
 
        struct sk_buff_head fcoe_rx_list;
84
 
        struct page *crc_eof_page;
85
 
        int crc_eof_offset;
86
 
};
87
 
 
88
 
/**
89
68
 * struct fcoe_interface - A FCoE interface
90
69
 * @list:             Handle for a list of FCoE interfaces
91
70
 * @netdev:           The associated net device
108
87
        struct kref        kref;
109
88
};
110
89
 
111
 
/**
112
 
 * struct fcoe_port - The FCoE private structure
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.
124
 
 */
125
 
struct fcoe_port {
126
 
        struct fcoe_interface *fcoe;
127
 
        struct fc_lport       *lport;
128
 
        struct sk_buff_head   fcoe_pending_queue;
129
 
        u8                    fcoe_pending_queue_active;
130
 
        struct timer_list     timer;
131
 
        struct work_struct    destroy_work;
132
 
        u8                    data_src_addr[ETH_ALEN];
133
 
};
134
 
 
135
90
#define fcoe_from_ctlr(fip) container_of(fip, struct fcoe_interface, ctlr)
136
91
 
137
92
/**
140
95
 */
141
96
static inline struct net_device *fcoe_netdev(const struct fc_lport *lport)
142
97
{
143
 
        return ((struct fcoe_port *)lport_priv(lport))->fcoe->netdev;
 
98
        return ((struct fcoe_interface *)
 
99
                        ((struct fcoe_port *)lport_priv(lport))->priv)->netdev;
 
100
}
 
101
 
 
102
static inline void wwn_to_str(u64 wwn, char *buf, int len)
 
103
{
 
104
        u8 wwpn[8];
 
105
 
 
106
        u64_to_wwn(wwn, wwpn);
 
107
        snprintf(buf, len, "%02x%02x%02x%02x%02x%02x%02x%02x",
 
108
                wwpn[0], wwpn[1], wwpn[2], wwpn[3],
 
109
                wwpn[4], wwpn[5], wwpn[6], wwpn[7]);
144
110
}
145
111
 
146
112
#endif /* _FCOE_H_ */