patch-tn7dsl_c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. --- sangam-atm-1.0.orig/tn7dsl.c 2007-01-04 09:04:14.000000000 +0100
  2. +++ sangam-atm-1.0/tn7dsl.c 2009-12-17 23:40:56.457448616 +0100
  3. @@ -94,7 +94,6 @@
  4. * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance
  5. * UR8_MERGE_END CQ11054*
  6. *********************************************************************************************/
  7. -#include <linux/config.h>
  8. #include <linux/kernel.h>
  9. #include <linux/module.h>
  10. #include <linux/init.h>
  11. @@ -102,8 +101,6 @@
  12. #include <linux/delay.h>
  13. #include <linux/spinlock.h>
  14. #include <linux/smp_lock.h>
  15. -#include <asm/io.h>
  16. -#include <asm/mips-boards/prom.h>
  17. #include <linux/proc_fs.h>
  18. #include <linux/string.h>
  19. #include <linux/ctype.h>
  20. @@ -111,6 +108,18 @@
  21. #include <linux/timer.h>
  22. #include <linux/vmalloc.h>
  23. #include <linux/file.h>
  24. +#include <linux/firmware.h>
  25. +#include <linux/version.h>
  26. +
  27. +#include <asm/io.h>
  28. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
  29. +#include <asm/ar7/ar7.h>
  30. +#include <asm/ar7/prom.h>
  31. +#else
  32. +#include <asm/mach-ar7/ar7.h>
  33. +#include <asm/mach-ar7/prom.h>
  34. +#endif
  35. +
  36. /* Modules specific header files */
  37. #include "tn7atm.h"
  38. #include "tn7api.h"
  39. @@ -133,6 +142,27 @@
  40. #define NEW_TRAINING_VAL_T1413 128
  41. #define NEW_TRAINING_VAL_MMODE 255
  42. +extern char *mp_modulation;
  43. +extern int mp_fine_gain_control;
  44. +extern int mp_fine_gain_value;
  45. +extern int mp_enable_margin_retrain;
  46. +extern int mp_margin_threshold;
  47. +extern int mp_enable_rate_adapt;
  48. +extern int mp_powercutback;
  49. +extern int mp_trellis;
  50. +extern int mp_bitswap;
  51. +extern int mp_maximum_bits_per_carrier;
  52. +extern int mp_maximum_interleave_depth;
  53. +extern int mp_pair_selection;
  54. +extern int mp_dgas_polarity;
  55. +extern int mp_los_alarm;
  56. +extern char *mp_eoc_vendor_id;
  57. +extern int mp_eoc_vendor_revision;
  58. +extern char *mp_eoc_vendor_serialnum;
  59. +extern char *mp_invntry_vernum;
  60. +extern int mp_dsl_bit_tmode;
  61. +extern int mp_high_precision;
  62. +
  63. int testflag1 = 0;
  64. extern int __guDbgLevel;
  65. extern sar_stat_t sarStat;
  66. @@ -173,7 +203,7 @@ led_reg_t ledreg[2];
  67. static struct led_funcs ledreg[2];
  68. #endif
  69. -#define DEV_DSLMOD 1
  70. +#define DEV_DSLMOD CTL_UNNUMBERED
  71. #define MAX_STR_SIZE 256
  72. #define DSL_MOD_SIZE 256
  73. @@ -299,7 +329,7 @@ static PITIDSLHW_T pIhw;
  74. static volatile int bshutdown;
  75. static char info[MAX_STR_SIZE];
  76. /* Used for DSL Polling enable */
  77. -static DECLARE_MUTEX_LOCKED (adsl_sem_overlay);
  78. +static struct semaphore adsl_sem_overlay;
  79. //kthread_t overlay_thread;
  80. /* end of module wide declars */
  81. @@ -309,8 +339,7 @@ static void tn7dsl_chng_modulation(void*
  82. static unsigned int tn7dsl_set_modulation(void* data, int flag);
  83. static void tn7dsl_ctrl_fineGain(int value);
  84. static void tn7dsl_set_fineGainValue(int value);
  85. -static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp,
  86. - void *buffer, size_t * lenp);
  87. +static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, size_t * lenp, loff_t *ppos);
  88. static void tn7dsl_register_dslss_led(void);
  89. void tn7dsl_dslmod_sysctl_register(void);
  90. void tn7dsl_dslmod_sysctl_unregister(void);
  91. @@ -323,6 +352,14 @@ static int tn7dsl_proc_snr_print (char *
  92. #define gDot1(a) ((a>0)?(a%10):((-a)%10))
  93. // UR8_MERGE_END CQ11054*
  94. +int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num,
  95. + unsigned int pace_value)
  96. +{
  97. + printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value);
  98. + return 0;
  99. +}
  100. +
  101. +
  102. int os_atoi(const char *pStr)
  103. {
  104. int MulNeg = (*pStr == '-' ? -1 : 1);
  105. @@ -359,39 +396,6 @@ void dprintf (int uDbgLevel, char *szFmt
  106. #endif
  107. }
  108. -int strcmp(const char *s1, const char *s2)
  109. -{
  110. -
  111. - int size = strlen(s1);
  112. -
  113. - return(strncmp(s1, s2, size));
  114. -}
  115. -
  116. -int strncmp(const char *s1, const char *s2, size_t size)
  117. -{
  118. - int i = 0;
  119. - int max_size = (int)size;
  120. -
  121. - while((s1[i] != 0) && i < max_size)
  122. - {
  123. - if(s2[i] == 0)
  124. - {
  125. - return -1;
  126. - }
  127. - if(s1[i] != s2[i])
  128. - {
  129. - return 1;
  130. - }
  131. - i++;
  132. - }
  133. - if(s2[i] != 0)
  134. - {
  135. - return 1;
  136. - }
  137. -
  138. - return 0;
  139. -}
  140. -
  141. // * UR8_MERGE_START CQ10640 Jack Zhang
  142. int tn7dsl_dump_dsp_memory(char *input_str) //cph99
  143. {
  144. @@ -441,101 +445,79 @@ unsigned int shim_osGetCpuFrequency(void
  145. return CpuFrequency;
  146. }
  147. -int shim_osLoadFWImage(unsigned char *ptr)
  148. +static void avsar_release(struct device *dev)
  149. {
  150. - unsigned int bytesRead;
  151. - mm_segment_t oldfs;
  152. - static struct file *filp;
  153. - unsigned int imageLength=0x5ffff;
  154. -
  155. -
  156. - dgprintf(4, "tn7dsl_read_dsp()\n");
  157. -
  158. - dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH);
  159. -
  160. - filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY);
  161. - if(filp ==NULL)
  162. - {
  163. - printk("Failed: Could not open DSP binary file\n");
  164. - return -1;
  165. - }
  166. -
  167. - if (filp->f_dentry != NULL)
  168. - {
  169. - if (filp->f_dentry->d_inode != NULL)
  170. - {
  171. - printk ("DSP binary filesize = %d bytes\n",
  172. - (int) filp->f_dentry->d_inode->i_size);
  173. - imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200;
  174. - }
  175. - }
  176. -
  177. - if (filp->f_op->read==NULL)
  178. - return -1; /* File(system) doesn't allow reads */
  179. -
  180. - /*
  181. - * Disable parameter checking
  182. - */
  183. - oldfs = get_fs();
  184. - set_fs(KERNEL_DS);
  185. -
  186. - /*
  187. - * Now read bytes from postion "StartPos"
  188. - */
  189. - filp->f_pos = 0;
  190. -
  191. - bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos);
  192. -
  193. - dgprintf(4,"file length = %d\n", bytesRead);
  194. -
  195. - set_fs(oldfs);
  196. -
  197. - /*
  198. - * Close the file
  199. - */
  200. - fput(filp);
  201. -
  202. - return bytesRead;
  203. + printk(KERN_DEBUG "avsar firmware released\n");
  204. }
  205. +static struct device avsar = {
  206. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
  207. + .bus_id = "vlynq",
  208. +#endif
  209. + .release = avsar_release,
  210. +};
  211. -unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset,
  212. - unsigned int secLength)
  213. +int shim_osLoadFWImage(unsigned char *ptr)
  214. {
  215. - unsigned int bytesRead;
  216. - mm_segment_t oldfs;
  217. - struct file *filp;
  218. -
  219. - dgprintf(4,"shim_read_overlay_page\n");
  220. - //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength);
  221. + const struct firmware *fw_entry;
  222. + size_t size;
  223. - filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY);
  224. - if(filp ==NULL)
  225. - {
  226. - printk("Failed: Could not open DSP binary file\n");
  227. - return -1;
  228. - }
  229. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30)
  230. + dev_set_name(&avsar, "avsar");
  231. +#endif
  232. + printk("requesting firmware image \"ar0700xx.bin\"\n");
  233. + if(device_register(&avsar) < 0) {
  234. + printk(KERN_ERR
  235. + "avsar: device_register fails\n");
  236. + return -1;
  237. + }
  238. - if (filp->f_op->read==NULL)
  239. - return -1; /* File(system) doesn't allow reads */
  240. + if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) {
  241. + printk(KERN_ERR
  242. + "avsar: Firmware not available\n");
  243. + device_unregister(&avsar);
  244. + return -1;
  245. + }
  246. + size = fw_entry->size;
  247. + device_unregister(&avsar);
  248. + if(size > 0x5ffff) {
  249. + printk(KERN_ERR
  250. + "avsar: Firmware too big (%d bytes)\n", size);
  251. + release_firmware(fw_entry);
  252. + return -1;
  253. + }
  254. + memcpy(ptr, fw_entry->data, size);
  255. + release_firmware(fw_entry);
  256. + return size;
  257. +}
  258. - /*
  259. - * Now read bytes from postion "StartPos"
  260. - */
  261. +unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength)
  262. +{
  263. + const struct firmware *fw_entry;
  264. - if(filp->f_op->llseek)
  265. - filp->f_op->llseek(filp,secOffset, 0);
  266. - oldfs = get_fs();
  267. - set_fs(KERNEL_DS);
  268. - filp->f_pos = secOffset;
  269. - bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos);
  270. + printk("requesting firmware image \"ar0700xx.bin\"\n");
  271. + if(device_register(&avsar) < 0) {
  272. + printk(KERN_ERR
  273. + "avsar: device_register fails\n");
  274. + return -1;
  275. + }
  276. - set_fs(oldfs);
  277. - /*
  278. - * Close the file
  279. - */
  280. - fput(filp);
  281. - return bytesRead;
  282. + if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) {
  283. + printk(KERN_ERR
  284. + "avsar: Firmware not available\n");
  285. + device_unregister(&avsar);
  286. + return -1;
  287. + }
  288. + device_unregister(&avsar);
  289. + if(fw_entry->size > secLength) {
  290. + printk(KERN_ERR
  291. + "avsar: Firmware too big (%d bytes)\n", fw_entry->size);
  292. + release_firmware(fw_entry);
  293. + return -1;
  294. + }
  295. + memcpy(ptr + secOffset, fw_entry->data, secLength);
  296. + release_firmware(fw_entry);
  297. + return secLength;
  298. }
  299. int shim_osLoadDebugFWImage(unsigned char *ptr)
  300. @@ -2834,7 +2816,6 @@ static int tn7dsl_set_dsl(void)
  301. int value;
  302. int i, offset[2]={4,11},oamFeature=0;
  303. char tmp[4];
  304. - char dspVer[10];
  305. // OAM Feature Configuration
  306. dslhal_api_dspInterfaceRead (pIhw, (unsigned int) pIhw->pmainAddr, 2,
  307. @@ -2845,98 +2826,82 @@ static int tn7dsl_set_dsl(void)
  308. (unsigned int *) &offset,
  309. (unsigned char *) &oamFeature, 4);
  310. - /* Do only if we are in the new Base PSP 7.4.*/
  311. - #if ((PSP_VERSION_MAJOR == 7) && (PSP_VERSION_MINOR == 4))
  312. - /* Check to see if we are operating in the new bit mode. */
  313. - ptr = prom_getenv("DSL_BIT_TMODE");
  314. - if (ptr)
  315. - {
  316. - /* If we are see if this is the first time the user has upgraded. */
  317. - ptr = prom_getenv("DSL_UPG_DONE");
  318. - if(!ptr)
  319. - {
  320. - /* If it is the first time the user is upgrading, then make sure that
  321. - we clear the modulation environment variable, as this could potentially
  322. - not have the same meaning in the new mode.
  323. - */
  324. - prom_unsetenv("modulation");
  325. - prom_setenv("DSL_UPG_DONE", "1");
  326. - }
  327. - }
  328. - #endif
  329. -
  330. // modulation
  331. ptr = prom_getenv("modulation");
  332. - if (ptr)
  333. + if (ptr || mp_modulation != NULL)
  334. {
  335. - tn7dsl_set_modulation(ptr, FALSE);
  336. + tn7dsl_set_modulation(mp_modulation == NULL ? ptr : mp_modulation, FALSE);
  337. }
  338. // Fine Gains
  339. ptr = prom_getenv("fine_gain_control");
  340. - if (ptr)
  341. + if (ptr || mp_fine_gain_control != -1)
  342. {
  343. - value = os_atoi(ptr);
  344. + value = mp_fine_gain_control == -1 ? os_atoi(ptr) : mp_fine_gain_control;
  345. tn7dsl_ctrl_fineGain(value);
  346. }
  347. ptr = NULL;
  348. ptr = prom_getenv("fine_gain_value");
  349. - if(ptr)
  350. - tn7dsl_set_fineGainValue(os_atoh(ptr));
  351. + if(ptr || mp_fine_gain_value != -1)
  352. + tn7dsl_set_fineGainValue(mp_fine_gain_value == -1 ? os_atoh(ptr) : mp_fine_gain_value);
  353. // margin retrain
  354. ptr = NULL;
  355. ptr = prom_getenv("enable_margin_retrain");
  356. - if(ptr)
  357. + value = mp_enable_margin_retrain == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_enable_margin_retrain;
  358. +
  359. + if (value == 1)
  360. {
  361. - value = os_atoi(ptr);
  362. - if(value == 1)
  363. + dslhal_api_setMarginMonitorFlags(pIhw, 0, 1);
  364. + bMarginRetrainEnable = 1;
  365. + //printk("enable showtime margin monitor.\n");
  366. +
  367. + ptr = NULL;
  368. + ptr = prom_getenv("margin_threshold");
  369. + value = mp_margin_threshold == -1 ? (ptr ? os_atoi(ptr) : 0) : mp_margin_threshold;
  370. +
  371. + if(value >= 0)
  372. {
  373. - dslhal_api_setMarginMonitorFlags(pIhw, 0, 1);
  374. - bMarginRetrainEnable = 1;
  375. - //printk("enable showtime margin monitor.\n");
  376. - ptr = NULL;
  377. - ptr = prom_getenv("margin_threshold");
  378. - if(ptr)
  379. - {
  380. - value = os_atoi(ptr);
  381. - //printk("Set margin threshold to %d x 0.5 db\n",value);
  382. - if(value >= 0)
  383. - {
  384. - dslhal_api_setMarginThreshold(pIhw, value);
  385. - bMarginThConfig=1;
  386. - }
  387. - }
  388. + dslhal_api_setMarginThreshold(pIhw, value);
  389. + bMarginThConfig=1;
  390. }
  391. }
  392. // rate adapt
  393. ptr = NULL;
  394. ptr = prom_getenv("enable_rate_adapt");
  395. - if(ptr)
  396. + if(ptr || mp_enable_rate_adapt != -1)
  397. {
  398. - dslhal_api_setRateAdaptFlag(pIhw, os_atoi(ptr));
  399. + dslhal_api_setRateAdaptFlag(pIhw, mp_enable_rate_adapt == -1 ? os_atoi(ptr) : mp_enable_rate_adapt);
  400. + }
  401. +
  402. + // set powercutback
  403. + ptr = NULL;
  404. + ptr = prom_getenv("powercutback");
  405. + if(ptr || mp_powercutback != -1)
  406. + {
  407. + dslhal_advcfg_onOffPcb(pIhw, mp_powercutback == -1 ? os_atoi(ptr) : mp_powercutback);
  408. }
  409. // trellis
  410. ptr = NULL;
  411. ptr = prom_getenv("trellis");
  412. - if(ptr)
  413. + if(ptr || mp_trellis != -1)
  414. {
  415. - dslhal_api_setTrellisFlag(pIhw, os_atoi(ptr));
  416. - trellis = os_atoi(ptr);
  417. + trellis = mp_trellis == -1 ? os_atoi(ptr) : mp_trellis;
  418. + dslhal_api_setTrellisFlag(pIhw, trellis);
  419. //printk("trellis=%d\n");
  420. }
  421. // bitswap
  422. ptr = NULL;
  423. ptr = prom_getenv("bitswap");
  424. - if(ptr)
  425. + if(ptr || mp_bitswap != -1)
  426. {
  427. int offset[2] = {33, 0};
  428. unsigned int bitswap;
  429. - bitswap = os_atoi(ptr);
  430. + bitswap = mp_bitswap == -1 ? os_atoi(ptr) : mp_bitswap;
  431. tn7dsl_generic_read(2, offset);
  432. dslReg &= dslhal_support_byteSwap32(0xFFFFFF00);
  433. @@ -2954,46 +2919,47 @@ static int tn7dsl_set_dsl(void)
  434. // maximum bits per carrier
  435. ptr = NULL;
  436. ptr = prom_getenv("maximum_bits_per_carrier");
  437. - if(ptr)
  438. + if(ptr || mp_maximum_bits_per_carrier != -1)
  439. {
  440. - dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, os_atoi(ptr));
  441. + dslhal_api_setMaxBitsPerCarrierUpstream(pIhw, mp_maximum_bits_per_carrier == -1 ? os_atoi(ptr) : mp_maximum_bits_per_carrier);
  442. }
  443. // maximum interleave depth
  444. ptr = NULL;
  445. ptr = prom_getenv("maximum_interleave_depth");
  446. - if(ptr)
  447. + if(ptr || mp_maximum_interleave_depth != -1)
  448. {
  449. - dslhal_api_setMaxInterleaverDepth(pIhw, os_atoi(ptr));
  450. + dslhal_api_setMaxInterleaverDepth(pIhw, mp_maximum_interleave_depth == -1 ? os_atoi(ptr) : mp_maximum_interleave_depth);
  451. }
  452. // inner and outer pairs
  453. ptr = NULL;
  454. ptr = prom_getenv("pair_selection");
  455. - if(ptr)
  456. + if(ptr || mp_pair_selection != -1)
  457. {
  458. - dslhal_api_selectInnerOuterPair(pIhw, os_atoi(ptr));
  459. + dslhal_api_selectInnerOuterPair(pIhw, mp_pair_selection == -1 ? os_atoi(ptr) : mp_pair_selection);
  460. }
  461. ptr = NULL;
  462. ptr = prom_getenv("dgas_polarity");
  463. - if(ptr)
  464. + if(ptr || mp_dgas_polarity != -1)
  465. {
  466. dslhal_api_configureDgaspLpr(pIhw, 1, 1);
  467. - dslhal_api_configureDgaspLpr(pIhw, 0, os_atoi(ptr));
  468. + dslhal_api_configureDgaspLpr(pIhw, 0, mp_dgas_polarity == -1 ? os_atoi(ptr) : mp_dgas_polarity);
  469. }
  470. ptr = NULL;
  471. ptr = prom_getenv("los_alarm");
  472. - if(ptr)
  473. + if(ptr || mp_los_alarm != -1)
  474. {
  475. - dslhal_api_disableLosAlarm(pIhw, os_atoi(ptr));
  476. + dslhal_api_disableLosAlarm(pIhw, mp_los_alarm == -1 ? os_atoi(ptr) : mp_los_alarm);
  477. }
  478. ptr = NULL;
  479. ptr = prom_getenv("eoc_vendor_id");
  480. - if(ptr)
  481. + if(ptr || mp_eoc_vendor_id != NULL)
  482. {
  483. + ptr = mp_eoc_vendor_id == NULL ? ptr : mp_eoc_vendor_id;
  484. for(i=0;i<8;i++)
  485. {
  486. tmp[0]=ptr[i*2];
  487. @@ -3018,26 +2984,26 @@ static int tn7dsl_set_dsl(void)
  488. }
  489. ptr = NULL;
  490. ptr = prom_getenv("eoc_vendor_revision");
  491. - if(ptr)
  492. + if(ptr || mp_eoc_vendor_revision != -1)
  493. {
  494. - value = os_atoi(ptr);
  495. + value = mp_eoc_vendor_revision == -1 ? os_atoi(ptr) : mp_eoc_vendor_revision;
  496. //printk("eoc rev=%d\n", os_atoi(ptr));
  497. dslhal_api_setEocRevisionNumber(pIhw, (char *)&value);
  498. }
  499. ptr = NULL;
  500. ptr = prom_getenv("eoc_vendor_serialnum");
  501. - if(ptr)
  502. + if(ptr || mp_eoc_vendor_serialnum != NULL)
  503. {
  504. - dslhal_api_setEocSerialNumber(pIhw, ptr);
  505. + dslhal_api_setEocSerialNumber(pIhw, mp_eoc_vendor_serialnum == NULL ? ptr : mp_eoc_vendor_serialnum);
  506. }
  507. // CQ10037 Added invntry_vernum environment variable to be able to set version number in ADSL2, ADSL2+ modes.
  508. ptr = NULL;
  509. ptr = prom_getenv("invntry_vernum");
  510. - if(ptr)
  511. + if(ptr || mp_invntry_vernum != NULL)
  512. {
  513. - dslhal_api_setEocRevisionNumber(pIhw, ptr);
  514. + dslhal_api_setEocRevisionNumber(pIhw, mp_invntry_vernum == NULL ? ptr : mp_invntry_vernum);
  515. }
  516. return 0;
  517. @@ -3064,6 +3030,7 @@ int tn7dsl_init(void *priv)
  518. int high_precision_selected = 0;
  519. // UR8_MERGE_END CQ11054*
  520. + sema_init(&adsl_sem_overlay, 0);
  521. /*
  522. * start dsl
  523. */
  524. @@ -3081,7 +3048,7 @@ int tn7dsl_init(void *priv)
  525. * backward compatibility.
  526. */
  527. cp = prom_getenv("DSL_BIT_TMODE");
  528. - if (cp)
  529. + if (cp || mp_dsl_bit_tmode != -1)
  530. {
  531. printk("%s : env var DSL_BIT_TMODE is set\n", __FUNCTION__);
  532. /*
  533. @@ -3110,9 +3077,9 @@ int tn7dsl_init(void *priv)
  534. // UR8_MERGE_START CQ11054 Jack Zhang
  535. cp = prom_getenv("high_precision");
  536. - if (cp)
  537. + if (cp || mp_high_precision != -1)
  538. {
  539. - high_precision_selected = os_atoi(cp);
  540. + high_precision_selected = mp_high_precision == -1 ? os_atoi(cp) : mp_high_precision;
  541. }
  542. if ( high_precision_selected)
  543. {
  544. @@ -3419,8 +3386,7 @@ unsigned int tn7dsl_get_memory(unsigned
  545. -static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp,
  546. - void *buffer, size_t *lenp)
  547. +static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, size_t *lenp, loff_t *ppos)
  548. {
  549. char *ptr;
  550. int ret, len = 0;
  551. @@ -3432,7 +3398,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  552. char mod_req[16] = { '\t' };
  553. char fst_byt;
  554. - if (!*lenp || (filp->f_pos && !write))
  555. + if (!*lenp || (!*ppos && !write))
  556. {
  557. *lenp = 0;
  558. return 0;
  559. @@ -3442,7 +3408,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  560. */
  561. if(write)
  562. {
  563. - ret = proc_dostring(ctl, write, filp, buffer, lenp);
  564. + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  565. switch (ctl->ctl_name)
  566. {
  567. @@ -3528,14 +3494,14 @@ static int dslmod_sysctl(ctl_table *ctl,
  568. else
  569. {
  570. len += sprintf(info+len, mod_req);
  571. - ret = proc_dostring(ctl, write, filp, buffer, lenp);
  572. + ret = proc_dostring(ctl, write, buffer, lenp, ppos);
  573. }
  574. return ret;
  575. }
  576. ctl_table dslmod_table[] = {
  577. - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, &dslmod_sysctl}
  578. + {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
  579. ,
  580. {0}
  581. };
  582. @@ -3558,8 +3524,7 @@ void tn7dsl_dslmod_sysctl_register(void)
  583. if (initialized == 1)
  584. return;
  585. - dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1);
  586. - dslmod_root_table->child->de->owner = THIS_MODULE;
  587. + dslmod_sysctl_header = register_sysctl_table(dslmod_root_table);
  588. /*
  589. * set the defaults
  590. @@ -4821,4 +4786,4 @@ int tn7dsl_proc_PMDus(char* buf, char **
  591. }
  592. #endif //NO_ADV_STATS
  593. #endif //TR69_PMD_IN
  594. -// * UR8_MERGE_END CQ11057 *
  595. \ No newline at end of file
  596. +// * UR8_MERGE_END CQ11057 *