Newer
Older
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/******************************************************************************
Copyright (c) 2007-2015
Lantiq Beteiligungs-GmbH & Co. KG
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
/*
Includes
*/
#include "dsl_cpe_control.h"
#include "drv_dsl_cpe_api.h"
#include "dsl_cpe_init_cfg.h"
#undef DSL_CCA_DBG_BLOCK
#define DSL_CCA_DBG_BLOCK DSL_CCA_DBG_APP
#ifndef _lint
DSL_InitData_t gInitCfgData =
{
DSL_CPE_FW1_SET(DSL_NULL, 0x0),
DSL_CPE_FW_FEATURE_SET(0, DSL_FW_XDSLMODE_CLEANED, DSL_FW_XDSLFEATURE_CLEANED, \
DSL_FW_XDSLFEATURE_CLEANED),
DSL_CPE_FW2_SET(DSL_NULL, 0x0),
DSL_CPE_XTU_SET(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7),
DSL_CPE_LINE_INV_NE_SET(DSL_NULL),
DSL_CPE_AUTOBOOT_CTRL_SET(DSL_AUTOBOOT_CTRL_STOP),
DSL_CPE_AUTOBOOT_CFG_SET(DSL_FALSE, DSL_FALSE, DSL_FALSE),
DSL_CPE_TEST_MODE_CTRL_SET(DSL_TESTMODE_DISABLE),
DSL_CPE_LINE_ACTIVATE_CTRL_SET(DSL_G997_INHIBIT_LDSF, DSL_G997_INHIBIT_ACSF, DSL_G997_NORMAL_STARTUP),
/** Device specific configuration parameters*/
#if defined(INCLUDE_DSL_CPE_API_VRX)
{
DSL_CPE_LL_CFG_SET(DSL_DEV_FILTER_NA, DSL_DEV_HS_TONE_GROUP_MODE_AUTO, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
DSL_DEV_HS_TONE_GROUP_CLEANED, \
0x1E116000, 0x37, -1),
DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII, \
DSL_TC_EFM, DSL_EMF_TC_CLEANED, DSL_EMF_TC_CLEANED, DSL_SYSTEMIF_MII),
DSL_CPE_MAC_CFG_SET(DSL_EFM_SPEED_100, DSL_EFM_DUPLEX_FULL, DSL_EFM_FLOWCTRL_ON, DSL_EFM_AUTONEG_OFF, \
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 1536, DSL_FALSE)
}
#endif
#if defined (INCLUDE_DSL_CPE_API_DANUBE)
{
DSL_CPE_LL_CFG_SET(DSL_DEV_HYBRID_NA),
DSL_CPE_SIC_SET(DSL_TC_ATM, DSL_EMF_TC_NORMAL, DSL_EMF_TC_NORMAL, DSL_SYSTEMIF_MII)
}
#endif
};
#endif /* _lint*/
#if defined(INCLUDE_DSL_CPE_API_VRX)
static DSL_Error_t DSL_VRX_ProcessDevConfigLine(
DSL_char_t *pLine,
DSL_uint32_t cfgLine,
DSL_DeviceLowLevelConfig_t *pRetLLCfg )
{
DSL_Error_t nRet = DSL_SUCCESS;
DSL_int_t nFilter = -1, nHsToneGroupMode = -1,
nIrqNum = 0,
bNtrEnable = -1;
DSL_uint32_t nHsToneGroup_A = -1, nHsToneGroup_V = -1,
nHsToneGroup_AV = -1, nBaseAddr = 0;
switch(cfgLine)
{
case 0:
sscanf(pLine,
"%d",
&nFilter);
pRetLLCfg->nFilter = (DSL_uint32_t)nFilter;
break;
case 1:
sscanf(pLine,
"%d %x %x %x",
&nHsToneGroupMode,
&nHsToneGroup_A,
&nHsToneGroup_V,
&nHsToneGroup_AV);
pRetLLCfg->nHsToneGroupMode = (DSL_uint32_t)nHsToneGroupMode;
pRetLLCfg->nHsToneGroup_A = (DSL_uint32_t)nHsToneGroup_A;
pRetLLCfg->nHsToneGroup_V = (DSL_uint32_t)nHsToneGroup_V;
pRetLLCfg->nHsToneGroup_AV = (DSL_uint32_t)nHsToneGroup_AV;
case 2:
sscanf(pLine,
"%x %d",
&nBaseAddr,
&nIrqNum);
pRetLLCfg->nBaseAddr = (DSL_uint32_t)nBaseAddr;
pRetLLCfg->nIrqNum = (DSL_int8_t)nIrqNum;
break;
case 3:
sscanf(pLine,
"%d",
&bNtrEnable);
pRetLLCfg->bNtrEnable = (DSL_boolean_t)bNtrEnable;
break;
default:
break;
}
return(nRet);
}
/**
This function returns the Initial Low Level Configuration from the give file
or the fixed default settings.
\param pName file name of the given LowLevelConfig
\param ppRetLLCfg Pointer to return the settings.
\return
Return values are defined within the DSL_Error_t definition
- DSL_SUCCESS in case of success
- DSL_ERROR if operation failed
- The return pointer is set to the given configuration or ULL
*/
DSL_Error_t DSL_CPE_GetInitialLowLevelConfig( DSL_char_t const *pName,
DSL_DeviceLowLevelConfig_t *pRetLLCfg )
{
DSL_CPE_File_t *fdCfg = DSL_NULL;
DSL_Error_t nRet = DSL_SUCCESS;
DSL_uint32_t nCfgFileLine;
DSL_char_t line[256];
/*
# VRX Low Level Configuration File
#
# Parameters must be separated by tabs or spaces.
# Empty lines and comments will be ignored.
#
# nFilter
#
# NA = -1
# OFF = 0
# ISDN = 1
# POTS = 2
# POTS_2 = 3
# POTS_3 = 4
#
# (dec)
-1
# nHsToneGroupMode nHsToneGroup_A nHsToneGroup_V nHsToneGroup_AV
#
# NA = -1 NA = -1 see see
# AUTO = 0 VDSL2_B43 = 0x0001 nHsToneGroup_A nHsToneGroup_A
# MANUAL = 1 VDSL2_A43 = 0x0002
# VDSL2_V43 = 0x0004
# VDSL1_V43P = 0x0008
# VDSL1_V43I = 0x0010
# ADSL1_C43 = 0x0020
# ADSL2_J43 = 0x0040
# ADSL2_B43C = 0x0080
# ADSL2_A43C = 0x0100
#
# (dec) (hex) (hex) (hex)
0 0x1 0x1 0x1
# nBaseAddr nIrqNum
#
# (hex) (dec)
0x1e116000 55
# nUtopiaPhyAdr nUtopiaBusWidth nPosPhyParity
# default(16b) = 0 NA = -1
# 8-bit = 1 ODD = 0
# 16-bit = 2
#
#
# (hex) (dec) (dec)
0xFF 0 0
# bNtrEnable
#
# (dec)
0
*/
if (pName != DSL_NULL)
{
fdCfg = DSL_CPE_FOpen(pName, "r");
if (fdCfg == DSL_NULL)
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL: Error opening low level configuration file %s " DSL_CPE_CRLF , pName));
return DSL_ERROR;
}
nCfgFileLine = 0;
while( (DSL_CPE_FGets(line, sizeof(line), fdCfg)) != DSL_NULL )
{
if( (line[0] == '\n') || (line[0] == '#') )
{
continue;
}
nRet = DSL_VRX_ProcessDevConfigLine(line, nCfgFileLine, pRetLLCfg);
nCfgFileLine++;
if( nRet != DSL_SUCCESS )
{
DSL_CCA_DEBUG(DSL_CCA_DBG_ERR, (DSL_CPE_PREFIX
"DSL: Error processing configuration file %s, line %d "DSL_CPE_CRLF, pName, nCfgFileLine));
break;
}
}
DSL_CPE_FClose (fdCfg);
}
else
{
DSL_CCA_DEBUG(DSL_CCA_DBG_WRN, (DSL_CPE_PREFIX
"DSL: Low Level Configuration file not specified, using default configuration"DSL_CPE_CRLF));
}
return nRet;
}
#endif /* #if defined(INCLUDE_DSL_CPE_API_VRX)*/