xref: /illumos-gate/usr/src/uts/common/io/bnx/bnxcfg.h (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
1 /*
2  * Copyright 2014-2017 Cavium, Inc.
3  * The contents of this file are subject to the terms of the Common Development
4  * and Distribution License, v.1,  (the "License").
5  *
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the License at available
9  * at http://opensource.org/licenses/CDDL-1.0
10  *
11  * See the License for the specific language governing permissions and
12  * limitations under the License.
13  */
14 
15 /*
16  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
17  */
18 
19 #ifndef _BNXCFG_H
20 #define	_BNXCFG_H
21 
22 #include "bnx.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #define	USER_OPTION_KEYWORD_STATSTICKS	"statticks"
29 #define	USER_OPTION_KEYWORD_RX_DCOPY	"RxDCopy"
30 
31 
32 #define	USER_OPTION_CKSUM_NONE			0x0
33 #define	USER_OPTION_CKSUM_TX_ONLY		0x1
34 #define	USER_OPTION_CKSUM_RX_ONLY		0x2
35 #define	USER_OPTION_CKSUM_TX_RX			0x3
36 #define	USER_OPTION_CKSUM_DEFAULT		0x3
37 
38 #define	USER_OPTION_STATSTICKS_MIN		0
39 #define	USER_OPTION_STATSTICKS_MAX		1000000
40 #define	USER_OPTION_STATSTICKS_DEFAULT		1000000
41 
42 #define	USER_OPTION_TICKS_MIN			0
43 #define	USER_OPTION_TICKS_MAX			LM_HC_RX_TICKS_VAL_MAX
44 
45 #define	USER_OPTION_TICKS_INT_MIN		0
46 #define	USER_OPTION_TICKS_INT_MAX		LM_HC_RX_TICKS_INT_MAX
47 
48 #define	USER_OPTION_TXTICKS_DEFAULT		45
49 #define	USER_OPTION_TXTICKS_INT_DEFAULT		15
50 #define	USER_OPTION_RXTICKS_DEFAULT		20
51 #define	USER_OPTION_RXTICKS_INT_DEFAULT		15
52 
53 #define	USER_OPTION_FRAMES_MIN			0
54 #define	USER_OPTION_FRAMES_MAX			LM_HC_RX_QUICK_CONS_TRIP_VAL_MAX
55 
56 #define	USER_OPTION_TXFRAMES_DEFAULT		16
57 #define	USER_OPTION_TXFRAMES_INT_DEFAULT	8
58 #define	USER_OPTION_RXFRAMES_DEFAULT		4
59 #define	USER_OPTION_RXFRAMES_INT_DEFAULT	4
60 
61 #define	USER_OPTION_TX_DESC_CNT_MIN		1
62 #define	USER_OPTION_TX_DESC_CNT_MAX		32385
63 #define	USER_OPTION_TX_DESC_CNT_DEFAULT		\
64 	(1024 - (1024 % MAX_BD_PER_PAGE))
65 
66 #define	USER_OPTION_RX_DESC_CNT_MIN		1
67 #define	USER_OPTION_RX_DESC_CNT_MAX		32385
68 #define	USER_OPTION_RX_DESC_CNT_DEFAULT		(512 - (512 % MAX_BD_PER_PAGE))
69 
70 #define	USER_OPTION_MTU_MIN			60
71 #define	USER_OPTION_MTU_MAX			9000
72 #define	USER_OPTION_MTU_DEFAULT		1500
73 
74 #define	USER_OPTION_TX_DCOPY_THRESH_DEFAULT	512
75 #define	USER_OPTION_RX_DCOPY_DEFAULT		0xffffffff
76 
77 
78 extern const bnx_lnk_cfg_t bnx_copper_config;
79 extern const bnx_lnk_cfg_t bnx_serdes_config;
80 
81 void bnx_cfg_msix(um_device_t * const umdevice);
82 void bnx_cfg_init(um_device_t * const umdevice);
83 void bnx_cfg_reset(um_device_t * const umdevice);
84 void bnx_cfg_map_phy(um_device_t * const umdevice);
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* _BNXCFG_H */
91