This source file includes following definitions.
- cplhdr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 #ifndef _CXGB3_OFFLOAD_H
33 #define _CXGB3_OFFLOAD_H
34
35 #include <linux/list.h>
36 #include <linux/skbuff.h>
37
38 #include "l2t.h"
39
40 #include "t3cdev.h"
41 #include "t3_cpl.h"
42
43 struct adapter;
44
45 void cxgb3_offload_init(void);
46
47 void cxgb3_adapter_ofld(struct adapter *adapter);
48 void cxgb3_adapter_unofld(struct adapter *adapter);
49 int cxgb3_offload_activate(struct adapter *adapter);
50 void cxgb3_offload_deactivate(struct adapter *adapter);
51
52 void cxgb3_set_dummy_ops(struct t3cdev *dev);
53
54 struct t3cdev *dev2t3cdev(struct net_device *dev);
55
56
57
58
59
60
61
62
63 void cxgb3_register_client(struct cxgb3_client *client);
64 void cxgb3_unregister_client(struct cxgb3_client *client);
65 void cxgb3_add_clients(struct t3cdev *tdev);
66 void cxgb3_remove_clients(struct t3cdev *tdev);
67 void cxgb3_event_notify(struct t3cdev *tdev, u32 event, u32 port);
68
69 typedef int (*cxgb3_cpl_handler_func)(struct t3cdev *dev,
70 struct sk_buff *skb, void *ctx);
71
72 enum {
73 OFFLOAD_STATUS_UP,
74 OFFLOAD_STATUS_DOWN,
75 OFFLOAD_PORT_DOWN,
76 OFFLOAD_PORT_UP,
77 OFFLOAD_DB_FULL,
78 OFFLOAD_DB_EMPTY,
79 OFFLOAD_DB_DROP
80 };
81
82 struct cxgb3_client {
83 char *name;
84 void (*add) (struct t3cdev *);
85 void (*remove) (struct t3cdev *);
86 cxgb3_cpl_handler_func *handlers;
87 int (*redirect)(void *ctx, struct dst_entry *old,
88 struct dst_entry *new, struct l2t_entry *l2t);
89 struct list_head client_list;
90 void (*event_handler)(struct t3cdev *tdev, u32 event, u32 port);
91 };
92
93
94
95
96 int cxgb3_alloc_atid(struct t3cdev *dev, struct cxgb3_client *client,
97 void *ctx);
98 int cxgb3_alloc_stid(struct t3cdev *dev, struct cxgb3_client *client,
99 void *ctx);
100 void *cxgb3_free_atid(struct t3cdev *dev, int atid);
101 void cxgb3_free_stid(struct t3cdev *dev, int stid);
102 void cxgb3_insert_tid(struct t3cdev *dev, struct cxgb3_client *client,
103 void *ctx, unsigned int tid);
104 void cxgb3_queue_tid_release(struct t3cdev *dev, unsigned int tid);
105 void cxgb3_remove_tid(struct t3cdev *dev, void *ctx, unsigned int tid);
106
107 struct t3c_tid_entry {
108 struct cxgb3_client *client;
109 void *ctx;
110 };
111
112
113 enum {
114 CPL_PRIORITY_DATA = 0,
115 CPL_PRIORITY_SETUP = 1,
116 CPL_PRIORITY_TEARDOWN = 0,
117 CPL_PRIORITY_LISTEN = 1,
118 CPL_PRIORITY_ACK = 1,
119 CPL_PRIORITY_CONTROL = 1
120 };
121
122
123 enum {
124 CPL_RET_BUF_DONE = 1,
125 CPL_RET_BAD_MSG = 2,
126 CPL_RET_UNKNOWN_TID = 4
127 };
128
129 typedef int (*cpl_handler_func)(struct t3cdev *dev, struct sk_buff *skb);
130
131
132
133
134
135 static inline void *cplhdr(struct sk_buff *skb)
136 {
137 return skb->data;
138 }
139
140 void t3_register_cpl_handler(unsigned int opcode, cpl_handler_func h);
141
142 union listen_entry {
143 struct t3c_tid_entry t3c_tid;
144 union listen_entry *next;
145 };
146
147 union active_open_entry {
148 struct t3c_tid_entry t3c_tid;
149 union active_open_entry *next;
150 };
151
152
153
154
155
156
157 struct tid_info {
158 struct t3c_tid_entry *tid_tab;
159 unsigned int ntids;
160 atomic_t tids_in_use;
161
162 union listen_entry *stid_tab;
163 unsigned int nstids;
164 unsigned int stid_base;
165
166 union active_open_entry *atid_tab;
167 unsigned int natids;
168 unsigned int atid_base;
169
170
171
172
173
174
175
176
177
178 spinlock_t atid_lock ____cacheline_aligned_in_smp;
179 union active_open_entry *afree;
180 unsigned int atids_in_use;
181
182 spinlock_t stid_lock ____cacheline_aligned;
183 union listen_entry *sfree;
184 unsigned int stids_in_use;
185 };
186
187 struct t3c_data {
188 struct list_head list_node;
189 struct t3cdev *dev;
190 unsigned int tx_max_chunk;
191 unsigned int max_wrs;
192 unsigned int nmtus;
193 const unsigned short *mtus;
194 struct tid_info tid_maps;
195
196 struct t3c_tid_entry *tid_release_list;
197 spinlock_t tid_release_lock;
198 struct work_struct tid_release_task;
199
200 struct sk_buff *nofail_skb;
201 unsigned int release_list_incomplete;
202 };
203
204
205
206
207 #define T3C_DATA(dev) (*(struct t3c_data **)&(dev)->l4opt)
208
209 #endif