7c89fe538be314151c1cecbb4a2bf386fb8ed021
[librecmc/librecmc.git] / package / ar7-atm / patches / 160-module-params.patch
1 Index: package/ar7-atm/patches/150-module_params.patch
2 ===================================================================
3 --- package/ar7-atm/patches/150-module_params.patch     (revision 0)
4 +++ package/ar7-atm/patches/150-module_params.patch     (revision 0)
5 @@ -0,0 +1,580 @@
6 +diff -urN sangam_atm-07.02.01.00/tn7atm.c sangam_atm-07.02.01.00.mod/tn7atm.c
7 +--- sangam_atm-07.02.01.00/tn7atm.c    2007-09-19 04:12:20.000000000 +0200
8 ++++ sangam_atm-07.02.01.00.mod/tn7atm.c        2007-09-20 14:45:19.280250000 +0200
9 +@@ -84,6 +84,146 @@
10 + MODULE_LICENSE("GPL");
11 + MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver");
12 + MODULE_AUTHOR ("Zhicheng Tang");
13 ++
14 ++int mp_sar_ipacemax = -1;
15 ++module_param_named(ipacemax, mp_sar_ipacemax, int, 0);
16 ++MODULE_PARM_DESC(ipacemax, "Interrupt pacing");
17 ++
18 ++char *mp_macc = NULL;
19 ++module_param_named(macc, mp_macc, charp, 0);
20 ++MODULE_PARM_DESC(macc, "MAC address");
21 ++
22 ++int mp_dsp_noboost = -1;
23 ++module_param_named(dsp_noboost, mp_dsp_noboost, int, 0);
24 ++MODULE_PARM_DESC(dsp_noboost, "Suppress DSP frequency boost");
25 ++
26 ++int mp_dsp_freq = -1;
27 ++module_param_named(dsp_freq, mp_dsp_freq, int, 0);
28 ++MODULE_PARM_DESC(dsp_freq, "Frequency to boost the DSP to");
29 ++
30 ++char *mp_featctl0 = NULL;
31 ++module_param_named(featctl0, mp_featctl0, charp, 0);
32 ++MODULE_PARM_DESC(featctl0, "DSL feature control 0");
33 ++
34 ++char *mp_featctl1 = NULL;
35 ++module_param_named(featctl1, mp_featctl1, charp, 0);
36 ++MODULE_PARM_DESC(featctl1, "DSL feature control 1");
37 ++
38 ++char *mp_phyctl0 = NULL;
39 ++module_param_named(phyctl0, mp_phyctl0, charp, 0);
40 ++MODULE_PARM_DESC(phyctl0, "DSL PHY control 0");
41 ++
42 ++char *mp_phyctl1 = NULL;
43 ++module_param_named(phyctl1, mp_phyctl1, charp, 0);
44 ++MODULE_PARM_DESC(phyctl1, "DSL PHY control 1");
45 ++
46 ++int mp_turbodsl = -1;
47 ++module_param_named(turbodsl, mp_turbodsl, int, 0);
48 ++MODULE_PARM_DESC(turbodsl, "Enable TurboDSL");
49 ++
50 ++int mp_sar_rxbuf = -1;
51 ++module_param_named(sar_rxbuf, mp_sar_rxbuf, int, 0);
52 ++MODULE_PARM_DESC(sar_rxbuf, "SAR RxBuf size");
53 ++
54 ++int mp_sar_rxmax = -1;
55 ++module_param_named(sar_rxmax, mp_sar_rxmax, int, 0);
56 ++MODULE_PARM_DESC(sar_rxmax, "SAR RxMax size");
57 ++
58 ++int mp_sar_txbuf = -1;
59 ++module_param_named(sar_txbuf, mp_sar_txbuf, int, 0);
60 ++MODULE_PARM_DESC(sar_txbuf, "SAR TxBuf size");
61 ++
62 ++int mp_sar_txmax = -1;
63 ++module_param_named(sar_txmax, mp_sar_txmax, int, 0);
64 ++MODULE_PARM_DESC(sar_txmax, "SAR TxMax size");
65 ++
66 ++char *mp_modulation = NULL;
67 ++module_param_named(modulation, mp_modulation, charp, 0);
68 ++MODULE_PARM_DESC(modulation, "Modulation");
69 ++
70 ++int mp_fine_gain_control = -1;
71 ++module_param_named(fine_gain_control, mp_fine_gain_control, int, 0);
72 ++MODULE_PARM_DESC(fine_gain_control, "Fine gain control");
73 ++
74 ++int mp_fine_gain_value = -1;
75 ++module_param_named(fine_gain_value, mp_fine_gain_value, int, 0);
76 ++MODULE_PARM_DESC(fine_gain_value, "Fine gain value");
77 ++
78 ++int mp_enable_margin_retrain = -1;
79 ++module_param_named(enable_margin_retrain, mp_enable_margin_retrain, int, 0);
80 ++MODULE_PARM_DESC(enable_margin_retrain, "Enable margin retrain");
81 ++
82 ++int mp_margin_threshold = -1;
83 ++module_param_named(margin_threshold, mp_margin_threshold, int, 0);
84 ++MODULE_PARM_DESC(margin_threshold, "Margin retrain treshold");
85 ++
86 ++int mp_enable_rate_adapt = -1;
87 ++module_param_named(enable_rate_adapt, mp_enable_rate_adapt, int, 0);
88 ++MODULE_PARM_DESC(enable_rate_adapt, "Enable rate adaption");
89 ++
90 ++int mp_powercutback = -1;
91 ++module_param_named(powercutback, mp_powercutback, int, 0);
92 ++MODULE_PARM_DESC(powercutback, "Enable / disable powercutback");
93 ++
94 ++int mp_trellis = -1;
95 ++module_param_named(trellis, mp_trellis, int, 0);
96 ++MODULE_PARM_DESC(trellis, "Enable / disable trellis coding");
97 ++
98 ++int mp_bitswap = -1;
99 ++module_param_named(bitswap, mp_bitswap, int, 0);
100 ++MODULE_PARM_DESC(bitswap, "Enable / disable bitswap");
101 ++
102 ++int mp_maximum_bits_per_carrier = -1;
103 ++module_param_named(maximum_bits_per_carrier, mp_maximum_bits_per_carrier, int, 0);
104 ++MODULE_PARM_DESC(maximum_bits_per_carrier, "Maximum bits per carrier");
105 ++
106 ++int mp_maximum_interleave_depth = -1;
107 ++module_param_named(maximum_interleave_depth, mp_maximum_interleave_depth, int, 0);
108 ++MODULE_PARM_DESC(maximum_interleave_depth, "Maximum interleave depth");
109 ++
110 ++int mp_pair_selection = -1;
111 ++module_param_named(pair_selection, mp_pair_selection, int, 0);
112 ++MODULE_PARM_DESC(pair_selection, "Pair selection");
113 ++
114 ++int mp_dgas_polarity = -1;
115 ++module_param_named(dgas_polarity, mp_dgas_polarity, int, 0);
116 ++MODULE_PARM_DESC(dgas_polarity, "DGAS polarity");
117 ++
118 ++int mp_los_alarm = -1;
119 ++module_param_named(los_alarm, mp_los_alarm, int, 0);
120 ++MODULE_PARM_DESC(los_alarm, "LOS alarm");
121 ++
122 ++char *mp_eoc_vendor_id = NULL;
123 ++module_param_named(eoc_vendor_id, mp_eoc_vendor_id, charp, 0);
124 ++MODULE_PARM_DESC(eoc_vendor_id, "EOC vendor id");
125 ++
126 ++int mp_eoc_vendor_revision = -1;
127 ++module_param_named(eoc_vendor_revision, mp_eoc_vendor_revision, int, 0);
128 ++MODULE_PARM_DESC(eoc_vendor_revision, "EOC vendor revision");
129 ++
130 ++char *mp_eoc_vendor_serialnum = NULL;
131 ++module_param_named(eoc_vendor_serialnum, mp_eoc_vendor_serialnum, charp, 0);
132 ++MODULE_PARM_DESC(eoc_vendor_serialnum, "EOC vendor serial number");
133 ++
134 ++char *mp_invntry_vernum = NULL;
135 ++module_param_named(invntry_vernum, mp_invntry_vernum, charp, 0);
136 ++MODULE_PARM_DESC(invntry_vernum, "Inventory revision number");
137 ++
138 ++int mp_dsl_bit_tmode = -1;
139 ++module_param_named(dsl_bit_tmode, mp_dsl_bit_tmode, int, 0);
140 ++MODULE_PARM_DESC(dsl_bit_tmode, "DSL bit training mode");
141 ++
142 ++int mp_high_precision = -1;
143 ++module_param_named(high_precision, mp_high_precision, int, 0);
144 ++MODULE_PARM_DESC(high_precision, "High precision");
145 ++
146 ++int mp_autopvc_enable = -1;
147 ++module_param_named(autopvc_enable, mp_autopvc_enable, int, 0);
148 ++MODULE_PARM_DESC(autopvc_enable, "Enable / disable automatic PVC");
149 ++
150 ++int mp_oam_lb_timeout = -1;
151 ++module_param_named(oam_lb_timeout, mp_oam_lb_timeout, int, 0);
152 ++MODULE_PARM_DESC(oam_lb_timeout, "OAM LB timeout");
153 + #endif
154
155 + #ifndef TRUE
156 +@@ -657,9 +797,9 @@
157 +    * interrupt pacing
158 +    */
159 +   ptr = prom_getenv ("sar_ipacemax");
160 +-  if (ptr)
161 ++  if (ptr || mp_sar_ipacemax != -1)
162 +   {
163 +-    def_sar_inter_pace = os_atoi (ptr);
164 ++    def_sar_inter_pace = mp_sar_ipacemax == -1 ? os_atoi (ptr) : mp_sar_ipacemax;
165 +   }
166 + /*  avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM,
167 +                             def_sar_inter_pace);*/
168 +@@ -799,7 +939,7 @@
169 +   char esi_addr[ESI_LEN] = { 0x00, 0x00, 0x11, 0x22, 0x33, 0x44 };
170 +   char *esiaddr_str = NULL;
171
172 +-  esiaddr_str = prom_getenv ("macc");
173 ++  esiaddr_str = mp_macc ? mp_macc : prom_getenv ("macc");
174
175 +   if (!esiaddr_str)
176 +   {
177 +@@ -1932,15 +2072,15 @@
178 + //UR8_MERGE_END   CQ10450*
179
180 +   cp = prom_getenv ("dsp_noboost");
181 +-  if (cp)
182 ++  if (cp || mp_dsp_noboost != -1)
183 +   {
184 +-    dsp_noboost = os_atoi (cp);
185 ++    dsp_noboost = mp_dsp_noboost == -1 ? os_atoi (cp) : mp_dsp_noboost;
186 +   }
187
188 +   cp = (char *) prom_getenv ("dsp_freq");
189 +-  if (cp)
190 ++  if (cp || mp_dsp_freq != -1)
191 +   {
192 +-    dspfreq = os_atoi (cp);
193 ++    dspfreq = mp_dsp_freq == -1 ? os_atoi (cp) : mp_dsp_freq;
194 +     if (dspfreq == 250)
195 +     {
196 +       boostDsp = 1;
197 +@@ -2189,8 +2329,9 @@
198 +   // Inter-Op DSL phy Control
199 +   // Note the setting of _dsl_Feature_0 and _dsl_Feature_1 must before
200 +   // dslhal_api_dslStartup (in tn7dsl_init()).
201 +-  if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL)
202 ++  if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_0")) != NULL || mp_featctl0 != NULL)
203 +   {
204 ++    if (mp_featctl0 != NULL) ptr = mp_featctl0;
205 +     if ((ptr[0] == '0') && (ptr[1] == 'x'))     // skip 0x before pass to
206 +       // os_atoh
207 +       ptr += 2;
208 +@@ -2198,8 +2339,9 @@
209 +     _dsl_Feature_0_defined = 1;
210 +   }
211
212 +-  if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL)
213 ++  if ((ptr = prom_getenv ("DSL_FEATURE_CNTL_1")) != NULL || mp_featctl1 != NULL)
214 +   {
215 ++    if (mp_featctl1 != NULL) ptr = mp_featctl1;
216 +     if ((ptr[0] == '0') && (ptr[1] == 'x'))     // skip 0x before pass to
217 +       // os_atoh
218 +       ptr += 2;
219 +@@ -2211,8 +2353,9 @@
220 +   // DSL phy Feature Control
221 +   // Note the setting of _dsl_PhyControl_0 and _dsl_PhyControl_1 must before
222 +   // dslhal_api_dslStartup (in tn7dsl_init()).
223 +-  if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL)
224 ++  if ((ptr = prom_getenv ("DSL_PHY_CNTL_0")) != NULL || mp_phyctl0 != NULL)
225 +   {
226 ++    if (mp_phyctl0 != NULL) ptr = mp_phyctl0;
227 +     if ((ptr[0] == '0') && (ptr[1] == 'x'))     // skip 0x before pass to
228 +       // os_atoh
229 +       ptr += 2;
230 +@@ -2220,8 +2363,9 @@
231 +     _dsl_PhyControl_0_defined = 1;
232 +   }
233
234 +-  if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL)
235 ++  if ((ptr = prom_getenv ("DSL_PHY_CNTL_1")) != NULL || mp_phyctl1 != NULL)
236 +   {
237 ++    if (mp_phyctl1 != NULL) ptr = mp_phyctl1;
238 +     if ((ptr[0] == '0') && (ptr[1] == 'x'))     // skip 0x before pass to
239 +       // os_atoh
240 +       ptr += 2;
241 +@@ -2249,9 +2393,9 @@
242 +   priv->bTurboDsl = 1;
243 +   // read config for turbo dsl
244 +   ptr = prom_getenv ("TurboDSL");
245 +-  if (ptr)
246 ++  if (ptr || mp_turbodsl != -1)
247 +   {
248 +-    priv->bTurboDsl = os_atoi (ptr);
249 ++    priv->bTurboDsl = mp_turbodsl == -1 ? os_atoi (ptr) : mp_turbodsl;
250 +   }
251
252 +   // @Added to make Rx buffer number & Service max configurable through
253 +@@ -2259,30 +2403,30 @@
254 +   priv->sarRxBuf = RX_BUFFER_NUM;
255 +   ptr = NULL;
256 +   ptr = prom_getenv ("SarRxBuf");
257 +-  if (ptr)
258 ++  if (ptr || mp_sar_rxbuf != -1)
259 +   {
260 +-    priv->sarRxBuf = os_atoi (ptr);
261 ++    priv->sarRxBuf = mp_sar_rxbuf == -1 ? os_atoi (ptr) : mp_sar_rxbuf;
262 +   }
263 +   priv->sarRxMax = RX_SERVICE_MAX;
264 +   ptr = NULL;
265 +   ptr = prom_getenv ("SarRxMax");
266 +-  if (ptr)
267 ++  if (ptr || mp_sar_rxmax != -1)
268 +   {
269 +-    priv->sarRxMax = os_atoi (ptr);
270 ++    priv->sarRxMax = mp_sar_rxmax == -1 ? os_atoi (ptr) : mp_sar_rxmax;
271 +   }
272 +   priv->sarTxBuf = TX_BUFFER_NUM;
273 +   ptr = NULL;
274 +   ptr = prom_getenv ("SarTxBuf");
275 +-  if (ptr)
276 ++  if (ptr || mp_sar_txbuf != -1)
277 +   {
278 +-    priv->sarTxBuf = os_atoi (ptr);
279 ++    priv->sarTxBuf = mp_sar_txbuf == -1 ? os_atoi (ptr) : mp_sar_txbuf;
280 +   }
281 +   priv->sarTxMax = TX_SERVICE_MAX;
282 +   ptr = NULL;
283 +   ptr = prom_getenv ("SarTxMax");
284 +-  if (ptr)
285 ++  if (ptr || mp_sar_txmax != -1)
286 +   {
287 +-    priv->sarTxMax = os_atoi (ptr);
288 ++    priv->sarTxMax = mp_sar_txmax == -1 ? os_atoi (ptr) : mp_sar_txmax;
289 +   }
290
291 +   return 0;
292 +diff -urN sangam_atm-07.02.01.00/tn7dsl.c sangam_atm-07.02.01.00.mod/tn7dsl.c
293 +--- sangam_atm-07.02.01.00/tn7dsl.c    2007-09-19 04:12:20.000000000 +0200
294 ++++ sangam_atm-07.02.01.00.mod/tn7dsl.c        2007-09-20 14:55:46.608375000 +0200
295 +@@ -134,6 +134,27 @@
296 + #define NEW_TRAINING_VAL_T1413  128
297 + #define NEW_TRAINING_VAL_MMODE  255
298
299 ++extern char *mp_modulation;
300 ++extern int mp_fine_gain_control;
301 ++extern int mp_fine_gain_value;
302 ++extern int mp_enable_margin_retrain;
303 ++extern int mp_margin_threshold;
304 ++extern int mp_enable_rate_adapt;
305 ++extern int mp_powercutback;
306 ++extern int mp_trellis;
307 ++extern int mp_bitswap;
308 ++extern int mp_maximum_bits_per_carrier;
309 ++extern int mp_maximum_interleave_depth;
310 ++extern int mp_pair_selection;
311 ++extern int mp_dgas_polarity;
312 ++extern int mp_los_alarm;
313 ++extern char *mp_eoc_vendor_id;
314 ++extern int mp_eoc_vendor_revision;
315 ++extern char *mp_eoc_vendor_serialnum;
316 ++extern char *mp_invntry_vernum;
317 ++extern int mp_dsl_bit_tmode;
318 ++extern int mp_high_precision;
319 ++
320 + int testflag1 = 0;
321 + extern int  __guDbgLevel;
322 + extern sar_stat_t sarStat;
323 +@@ -2816,84 +2837,80 @@
324
325 +   // modulation
326 +   ptr = prom_getenv("modulation");
327 +-  if (ptr)
328 ++  if (ptr || mp_modulation != NULL)
329 +   {
330 +-    tn7dsl_set_modulation(ptr, FALSE);
331 ++    tn7dsl_set_modulation(mp_modulation == NULL ? ptr : mp_modulation, FALSE);
332 +   }
333
334 +   // Fine Gains
335 +   ptr = prom_getenv("fine_gain_control");
336 +-  if (ptr)
337 ++  if (ptr || mp_fine_gain_control != -1)
338 +   {
339 +-    value = os_atoi(ptr);
340 ++    value = mp_fine_gain_control == -1 ? os_atoi(ptr) : mp_fine_gain_control;
341 +     tn7dsl_ctrl_fineGain(value);
342 +   }
343 +   ptr = NULL;
344 +   ptr = prom_getenv("fine_gain_value");
345 +-  if(ptr)
346 +-    tn7dsl_set_fineGainValue(os_atoh(ptr));
347 ++  if(ptr || mp_fine_gain_value != -1)
348 ++    tn7dsl_set_fineGainValue(mp_fine_gain_value == -1 ? os_atoh(ptr) : mp_fine_gain_value);
349
350 +   // margin retrain
351 +   ptr = NULL;
352 +   ptr = prom_getenv("enable_margin_retrain");
353 +-  if(ptr)
354 ++  value = mp_enable_margin_retrain == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_enable_margin_retrain;
355 ++
356 ++  if (value == 1)
357 +   {
358 +-    value = os_atoi(ptr);
359 +-    if(value == 1)
360 ++    dslhal_api_setMarginMonitorFlags(pIhw, 0, 1);
361 ++    bMarginRetrainEnable = 1;
362 ++    //printk("enable showtime margin monitor.\n");
363 ++
364 ++    ptr = NULL;
365 ++    ptr = prom_getenv("margin_threshold");
366 ++    value = mp_margin_threshold == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_margin_threshold;
367 ++
368 ++    if(value >= 0)
369 +     {
370 +-      dslhal_api_setMarginMonitorFlags(pIhw, 0, 1);
371 +-      bMarginRetrainEnable = 1;
372 +-      //printk("enable showtime margin monitor.\n");
373 +-      ptr = NULL;
374 +-      ptr = prom_getenv("margin_threshold");
375 +-      if(ptr)
376 +-      {
377 +-        value = os_atoi(ptr);
378 +-        //printk("Set margin threshold to %d x 0.5 db\n",value);
379 +-        if(value >= 0)
380 +-        {
381 +-          dslhal_api_setMarginThreshold(pIhw, value);
382 +-          bMarginThConfig=1;
383 +-        }
384 +-      }
385 ++      dslhal_api_setMarginThreshold(pIhw, value);
386 ++      bMarginThConfig=1;
387 +     }
388 +   }
389
390 +   // rate adapt
391 +   ptr = NULL;
392 +   ptr = prom_getenv("enable_rate_adapt");
393 +-  if(ptr)
394 ++  if(ptr || mp_enable_rate_adapt != -1)
395 +   {
396 +-    dslhal_api_setRateAdaptFlag(pIhw, os_atoi(ptr));
397 ++    dslhal_api_setRateAdaptFlag(pIhw, mp_enable_rate_adapt == -1 ? os_atoi(ptr) : mp_enable_rate_adapt);
398 +   }
399
400 +   // set powercutback
401 +   ptr = NULL;
402 +   ptr = prom_getenv("powercutback");
403 +-  if(ptr)
404 ++  if(ptr || mp_powercutback != -1)
405 +   {
406 +-    dslhal_advcfg_onOffPcb(pIhw, os_atoi(ptr));
407 ++    dslhal_advcfg_onOffPcb(pIhw, mp_powercutback == -1 ? os_atoi(ptr) : mp_powercutback);
408 +   }
409
410 +   // trellis
411 +   ptr = NULL;
412 +   ptr = prom_getenv("trellis");
413 +-  if(ptr)
414 ++  if(ptr || mp_trellis != -1)
415 +   {
416 +-    dslhal_api_setTrellisFlag(pIhw, os_atoi(ptr));
417 +-    trellis = os_atoi(ptr);
418 ++    trellis = mp_trellis == -1 ? os_atoi(ptr) : mp_trellis;
419 ++    dslhal_api_setTrellisFlag(pIhw, trellis);
420 +     //printk("trellis=%d\n");
421 +   }
422
423 +   // bitswap
424 +   ptr = NULL;
425 +   ptr = prom_getenv("bitswap");
426 +-  if(ptr)
427 ++  if(ptr || mp_bitswap != -1)
428 +   {
429 +     int offset[2] = {33, 0};
430 +     unsigned int bitswap;
431
432 +-    bitswap = os_atoi(ptr);
433 ++    bitswap = mp_bitswap == -1 ? os_atoi(ptr) : mp_bitswap;
434
435 +     tn7dsl_generic_read(2, offset);
436 +     dslReg &= dslhal_support_byteSwap32(0xFFFFFF00);
437 +@@ -2911,46 +2928,47 @@
438 +   // maximum bits per carrier
439 +   ptr = NULL;
440 +   ptr = prom_getenv("maximum_bits_per_carrier");
441 +-  if(ptr)
442 ++  if(ptr || mp_maximum_bits_per_carrier != -1)
443 +   {
444 +-    dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, os_atoi(ptr));
445 ++    dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, mp_maximum_bits_per_carrier == -1 ? os_atoi(ptr) : mp_maximum_bits_per_carrier);
446 +   }
447
448 +   // maximum interleave depth
449 +   ptr = NULL;
450 +   ptr = prom_getenv("maximum_interleave_depth");
451 +-  if(ptr)
452 ++  if(ptr || mp_maximum_interleave_depth != -1)
453 +   {
454 +-    dslhal_api_setMaxInterleaverDepth(pIhw, os_atoi(ptr));
455 ++    dslhal_api_setMaxInterleaverDepth(pIhw, mp_maximum_interleave_depth == -1 ? os_atoi(ptr) : mp_maximum_interleave_depth);
456 +   }
457
458 +   // inner and outer pairs
459 +   ptr = NULL;
460 +   ptr = prom_getenv("pair_selection");
461 +-  if(ptr)
462 ++  if(ptr || mp_pair_selection != -1)
463 +   {
464 +-    dslhal_api_selectInnerOuterPair(pIhw, os_atoi(ptr));
465 ++    dslhal_api_selectInnerOuterPair(pIhw, mp_pair_selection == -1 ? os_atoi(ptr) : mp_pair_selection);
466 +   }
467
468 +   ptr = NULL;
469 +   ptr = prom_getenv("dgas_polarity");
470 +-  if(ptr)
471 ++  if(ptr || mp_dgas_polarity != -1)
472 +   {
473 +     dslhal_api_configureDgaspLpr(pIhw, 1, 1);
474 +-    dslhal_api_configureDgaspLpr(pIhw, 0, os_atoi(ptr));
475 ++    dslhal_api_configureDgaspLpr(pIhw, 0, mp_dgas_polarity == -1 ? os_atoi(ptr) : mp_dgas_polarity);
476 +   }
477
478 +   ptr = NULL;
479 +   ptr = prom_getenv("los_alarm");
480 +-  if(ptr)
481 ++  if(ptr || mp_los_alarm != -1)
482 +   {
483 +-    dslhal_api_disableLosAlarm(pIhw, os_atoi(ptr));
484 ++    dslhal_api_disableLosAlarm(pIhw, mp_los_alarm == -1 ? os_atoi(ptr) : mp_los_alarm);
485 +   }
486
487 +   ptr = NULL;
488 +   ptr = prom_getenv("eoc_vendor_id");
489 +-  if(ptr)
490 ++  if(ptr || mp_eoc_vendor_id != NULL)
491 +   {
492 ++    ptr = mp_eoc_vendor_id == NULL ? ptr : mp_eoc_vendor_id;
493 +     for(i=0;i<8;i++)
494 +     {
495 +       tmp[0]=ptr[i*2];
496 +@@ -2975,26 +2993,26 @@
497 +   }
498 +   ptr = NULL;
499 +   ptr = prom_getenv("eoc_vendor_revision");
500 +-  if(ptr)
501 ++  if(ptr || mp_eoc_vendor_revision != -1)
502 +   {
503 +-    value = os_atoi(ptr);
504 ++    value = mp_eoc_vendor_revision == -1 ? os_atoi(ptr) : mp_eoc_vendor_revision;
505 +     //printk("eoc rev=%d\n", os_atoi(ptr));
506 +     dslhal_api_setEocRevisionNumber(pIhw, (char *)&value);
507
508 +   }
509 +   ptr = NULL;
510 +   ptr = prom_getenv("eoc_vendor_serialnum");
511 +-  if(ptr)
512 ++  if(ptr || mp_eoc_vendor_serialnum != NULL)
513 +   {
514 +-    dslhal_api_setEocSerialNumber(pIhw, ptr);
515 ++    dslhal_api_setEocSerialNumber(pIhw, mp_eoc_vendor_serialnum == NULL ? ptr : mp_eoc_vendor_serialnum);
516 +   }  
517 +   
518 +   // CQ10037 Added invntry_vernum environment variable to be able to set version number in ADSL2, ADSL2+ modes.  
519 +   ptr = NULL;
520 +   ptr = prom_getenv("invntry_vernum");
521 +-  if(ptr)
522 ++  if(ptr || mp_invntry_vernum != NULL)
523 +   {
524 +-    dslhal_api_setEocRevisionNumber(pIhw, ptr);
525 ++    dslhal_api_setEocRevisionNumber(pIhw, mp_invntry_vernum == NULL ? ptr : mp_invntry_vernum);
526 +   }
527
528 +   return 0;
529 +@@ -3038,7 +3056,7 @@
530 +    * backward compatibility.
531 +    */
532 +   cp = prom_getenv("DSL_BIT_TMODE");
533 +-  if (cp)
534 ++  if (cp || mp_dsl_bit_tmode != -1)
535 +   {
536 +     printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__);
537 +     /*
538 +@@ -3067,9 +3085,9 @@
539
540 + //  UR8_MERGE_START CQ11054   Jack Zhang
541 +   cp = prom_getenv("high_precision");
542 +-  if (cp)
543 ++  if (cp || mp_high_precision != -1)
544 +   {
545 +-    high_precision_selected = os_atoi(cp);
546 ++    high_precision_selected = mp_high_precision == -1 ? os_atoi(cp) : mp_high_precision;
547 +   }
548 +   if ( high_precision_selected)
549 +   {
550 +diff -urN sangam_atm-07.02.01.00/tn7sar.c sangam_atm-07.02.01.00.mod/tn7sar.c
551 +--- sangam_atm-07.02.01.00/tn7sar.c    2007-09-19 04:12:20.000000000 +0200
552 ++++ sangam_atm-07.02.01.00.mod/tn7sar.c        2007-09-20 14:23:50.436500000 +0200
553 +@@ -73,6 +73,8 @@
554 + /* PDSP Firmware files */
555 + #include "tnetd7300_sar_firm.h"
556
557 ++extern int mp_oam_lb_timeout;
558 ++extern int mp_autopvc_enable;
559
560 + enum
561 + {
562 +@@ -816,9 +818,9 @@
563 +   pHalDev  = (HAL_DEVICE *)priv->pSarHalDev;
564
565 +   pauto_pvc = prom_getenv("autopvc_enable");
566 +-  if(pauto_pvc)  //CQ10273
567 ++  if(pauto_pvc || mp_autopvc_enable != -1)  //CQ10273
568 +   {
569 +-    auto_pvc =tn7sar_strtoul(pauto_pvc, NULL, 10);
570 ++    auto_pvc = mp_autopvc_enable == -1 ? tn7sar_strtoul(pauto_pvc, NULL, 10) : mp_autopvc_enable;
571 +   }
572
573 +   memset(&chInfo, 0xff, sizeof(chInfo));
574 +@@ -984,9 +986,9 @@
575
576 +   /* read in oam lb timeout value */
577 +   pLbTimeout = prom_getenv("oam_lb_timeout");
578 +-  if(pLbTimeout)
579 ++  if(pLbTimeout || mp_oam_lb_timeout != -1)
580 +   {
581 +-    lbTimeout =tn7sar_strtoul(pLbTimeout, NULL, 10);
582 ++    lbTimeout = mp_oam_lb_timeout == -1 ? tn7sar_strtoul(pLbTimeout, NULL, 10) : mp_oam_lb_timeout;
583 +     oamLbTimeout = lbTimeout;
584 +     pHalFunc->Control(pHalDev,"OamLbTimeout", "Set", &lbTimeout);
585 +   }