Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drv_xgbe_impl.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 Tilera Corporation. All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation, version 2.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11  * NON INFRINGEMENT. See the GNU General Public License for
12  * more details.
13  */
14 
20 #ifndef __DRV_XGBE_IMPL_H__
21 #define __DRV_XGBE_IMPL_H__
22 
23 #include <hv/netio_errors.h>
24 #include <hv/netio_intf.h>
25 #include <hv/drv_xgbe_intf.h>
26 
27 
29 #define LOG2_NUM_GROUPS (12)
30 
31 #define NUM_GROUPS (1 << LOG2_NUM_GROUPS)
32 
34 #define EPP_REQS_PER_TILE (32)
35 
37 #define EDMA_WDS_NO_CSUM 8
38 
39 #define EDMA_WDS_CSUM 10
40 
41 #define EDMA_WDS_TOTAL 128
42 
43 
44 /*
45  * FIXME: These definitions are internal and should have underscores!
46  * NOTE: The actual numeric values here are intentional and allow us to
47  * optimize the concept "if small ... else if large ... else ...", by
48  * checking for the low bit being set, and then for non-zero.
49  * These are used as array indices, so they must have the values (0, 1, 2)
50  * in some order.
51  */
52 #define SIZE_SMALL (1)
53 #define SIZE_LARGE (2)
54 #define SIZE_JUMBO (0)
57 #define NETIO_NUM_SIZES 3
58 
59 
60 /*
61  * Default numbers of packets for IPP drivers. These values are chosen
62  * such that CIPP1 will not overflow its L2 cache.
63  */
64 
66 #define NETIO_DEFAULT_SMALL_PACKETS 2750
67 
68 #define NETIO_DEFAULT_LARGE_PACKETS 2500
69 
70 #define NETIO_DEFAULT_JUMBO_PACKETS 250
71 
72 
74 #define NETIO_ARENA_SHIFT 24 /* 16 MB */
75 
76 #define NETIO_ARENA_SIZE (1 << NETIO_ARENA_SHIFT)
77 
78 
111 typedef struct {
116 
120 }
122 
123 
178 typedef struct
179 {
183 
187 }
189 
190 
194 typedef struct __netio_queue_impl_t
195 {
199  unsigned int __intr_id;
203  /* ISSUE: Actually this is always "0" or "~0". */
206  unsigned int __queue_id;
214  void* __va_0;
216  void* __va_1;
221 }
223 
224 
229 {
250  int __fd;
251 }
253 
254 
255 #define NETIO_GROUP_CHUNK_SIZE 64
256 #define NETIO_BUCKET_CHUNK_SIZE 64
263 typedef struct
264 {
271 }
273 
274 
283 #define __NETIO_SEND_FLG_ACK 0x1
284 
288 #define __NETIO_SEND_FLG_CSUM 0x2
289 
291 #define __NETIO_SEND_FLG_COMPLETION 0x4
292 
295 #define __NETIO_SEND_FLG_XSEG_SHIFT 3
296 
298 #define __NETIO_SEND_FLG_XSEG_WIDTH 2
299 
300 #endif /* __DRV_XGBE_IMPL_H__ */