Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cpl5_cmd.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * *
3  * File: cpl5_cmd.h *
4  * $Revision: 1.6 $ *
5  * $Date: 2005/06/21 18:29:47 $ *
6  * Description: *
7  * part of the Chelsio 10Gb Ethernet Driver. *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License, version 2, as *
11  * published by the Free Software Foundation. *
12  * *
13  * You should have received a copy of the GNU General Public License along *
14  * with this program; if not, write to the Free Software Foundation, Inc., *
15  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
16  * *
17  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED *
18  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF *
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
20  * *
21  * http://www.chelsio.com *
22  * *
23  * Copyright (c) 2003 - 2005 Chelsio Communications, Inc. *
24  * All rights reserved. *
25  * *
26  * Maintainers: [email protected] *
27  * *
28  * Authors: Dimitrios Michailidis <[email protected]> *
29  * Tina Yang <[email protected]> *
30  * Felix Marti <[email protected]> *
31  * Scott Bardone <[email protected]> *
32  * Kurt Ottaway <[email protected]> *
33  * Frank DiMambro <[email protected]> *
34  * *
35  * History: *
36  * *
37  ****************************************************************************/
38 
39 #ifndef _CXGB_CPL5_CMD_H_
40 #define _CXGB_CPL5_CMD_H_
41 
42 #include <asm/byteorder.h>
43 
44 #if !defined(__LITTLE_ENDIAN_BITFIELD) && !defined(__BIG_ENDIAN_BITFIELD)
45 #error "Adjust your <asm/byteorder.h> defines"
46 #endif
47 
48 enum CPL_opcode {
64 
65  CPL_GET_TCB = 0x24,
67  CPL_SET_TCB = 0x26,
70  CPL_PCMD = 0x29,
71 
72  CPL_PCMD_READ = 0x31,
74 
75 
76  CPL_RX_DATA = 0xA0,
79  CPL_RX_PKT = 0xAD,
82  CPL_TX_DATA = 0xB1,
83  CPL_TX_PKT = 0xB2,
85 
104  CPL_ERROR = 0xD7,
105 
106  /* internal: driver -> TOM */
108 };
109 
110 #define NUM_CPL_CMDS 256
111 
112 enum CPL_error {
127 };
128 
129 enum {
133 };
134 
135 enum {
141 };
142 
143 enum {
146 };
147 
148 enum {
152 };
153 
154 enum { // TX_PKT_LSO ethernet types
159 };
160 
161 union opcode_tid {
164 };
165 
166 #define S_OPCODE 24
167 #define V_OPCODE(x) ((x) << S_OPCODE)
168 #define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF)
169 #define G_TID(x) ((x) & 0xFFFFFF)
170 
171 /* tid is assumed to be 24-bits */
172 #define MK_OPCODE_TID(opcode, tid) (V_OPCODE(opcode) | (tid))
173 
174 #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
175 
176 /* extract the TID from a CPL command */
177 #define GET_TID(cmd) (G_TID(ntohl(OPCODE_TID(cmd))))
178 
179 struct tcp_options {
182 #if defined(__LITTLE_ENDIAN_BITFIELD)
183  u8 rsvd:4;
184  u8 ecn:1;
185  u8 sack:1;
186  u8 tstamp:1;
187 #else
189  u8 sack:1;
190  u8 ecn:1;
191  u8 rsvd:4;
192 #endif
193 };
194 
196  union opcode_tid ot;
205 };
206 
208  union opcode_tid ot;
213  u8 resvd[7];
215 };
216 
218  union opcode_tid ot;
225  u8 rsvd[3];
228 };
229 
230 struct cpl_pass_accept_req {
231  union opcode_tid ot;
241  u8 rsvd[2];
244 };
245 
247  union opcode_tid ot;
252  union {
254  struct {
255  u8 rsvd[3];
257  };
258  };
259 };
260 
262  union opcode_tid ot;
271 };
272 
274  union opcode_tid ot;
280  u8 rsvd[3];
282 };
283 
285  union opcode_tid ot;
294 };
295 
296 struct cpl_get_tcb {
297  union opcode_tid ot;
299 };
300 
302  union opcode_tid ot;
306 };
307 
308 struct cpl_set_tcb {
309  union opcode_tid ot;
312 };
313 
315  union opcode_tid ot;
316  u8 rsvd[3];
320 };
321 
323  union opcode_tid ot;
324  u8 rsvd[3];
326 };
327 
328 struct cpl_pcmd {
329  union opcode_tid ot;
333 };
334 
336  union opcode_tid ot;
341 };
342 
344  union opcode_tid ot;
346 };
347 
349  union opcode_tid ot;
351 };
352 
354  union opcode_tid ot;
355  u8 rsvd[3];
359 };
360 
362  union opcode_tid ot;
364 };
365 
367  union opcode_tid ot;
368  u8 rsvd[3];
370 };
371 
373  union opcode_tid ot;
377  u8 rsvd2[6];
378 };
379 
381  union opcode_tid ot;
385  u8 rsvd2[6];
386 };
387 
389  union opcode_tid ot;
391 };
392 
393 struct cpl_tx_data {
394  union opcode_tid ot;
399 };
400 
402  union opcode_tid ot;
404 };
405 
406 struct cpl_rx_data {
407  union opcode_tid ot;
413 };
414 
416  union opcode_tid ot;
418 };
419 
421  union opcode_tid ot;
429 };
430 
431 /*
432  * We want this header's alignment to be no more stringent than 2-byte aligned.
433  * All fields are u8 or u16 except for the length. However that field is not
434  * used so we break it into 2 16-bit parts to easily meet our alignment needs.
435  */
436 struct cpl_tx_pkt {
438 #if defined(__LITTLE_ENDIAN_BITFIELD)
439  u8 iff:4;
440  u8 ip_csum_dis:1;
441  u8 l4_csum_dis:1;
442  u8 vlan_valid:1;
443  u8 rsvd:1;
444 #else
445  u8 rsvd:1;
449  u8 iff:4;
450 #endif
454 };
455 
458 #if defined(__LITTLE_ENDIAN_BITFIELD)
459  u8 iff:4;
460  u8 ip_csum_dis:1;
461  u8 l4_csum_dis:1;
462  u8 vlan_valid:1;
463  u8 :1;
464 #else
465  u8 :1;
469  u8 iff:4;
470 #endif
473 
474  u8 rsvd[5];
475 #if defined(__LITTLE_ENDIAN_BITFIELD)
476  u8 tcp_hdr_words:4;
477  u8 ip_hdr_words:4;
478 #else
481 #endif
483 };
484 
485 struct cpl_rx_pkt {
487 #if defined(__LITTLE_ENDIAN_BITFIELD)
488  u8 iff:4;
489  u8 csum_valid:1;
490  u8 bad_pkt:1;
491  u8 vlan_valid:1;
492  u8 rsvd:1;
493 #else
494  u8 rsvd:1;
498  u8 iff:4;
499 #endif
503 };
504 
506  union opcode_tid ot;
508  u8 rsvd1[2];
510 };
511 
513  union opcode_tid ot;
515  u8 rsvd[3];
516 };
517 
519  union opcode_tid ot;
520  u8 rsvd[3];
522 };
523 
525  union opcode_tid ot;
527  u8 rsvd1[2];
529 };
530 
532  union opcode_tid ot;
534 #if defined(__LITTLE_ENDIAN_BITFIELD)
535  u8 rsvd1:1;
536  u8 mtu_idx:3;
537  u8 iff:4;
538 #else
539  u8 iff:4;
542 #endif
548 };
549 
551  union opcode_tid ot;
553  u8 rsvd[3];
554 };
555 
557  union opcode_tid ot;
559 #if defined(__LITTLE_ENDIAN_BITFIELD)
560  u8 rsvd1:4;
561  u8 iff:4;
562 #else
563  u8 iff:4;
565 #endif
567 };
568 
570  union opcode_tid ot;
572 #if defined(__LITTLE_ENDIAN_BITFIELD)
573  u8 rsvd1:1;
574  u8 mtu_idx:3;
575  u8 rsvd0:4;
576 #else
580 #endif
586 };
587 
589  union opcode_tid ot;
591 };
592 
594  union opcode_tid ot;
596  u8 rsvd[3];
597 };
598 
600  union opcode_tid ot;
604 };
605 
607  union opcode_tid ot;
609  u8 rsvd[3];
610 };
611 
613  union opcode_tid ot;
615 };
616 
618  union opcode_tid ot;
620  u8 rsvd0[2];
622 #if defined(__LITTLE_ENDIAN_BITFIELD)
623  u8 rsvd1:7;
624  u8 select:1;
625 #else
628 #endif
629  u8 rsvd2[3];
631 };
632 
634  union opcode_tid ot;
636 };
637 
638 #endif /* _CXGB_CPL5_CMD_H_ */
639