100-compile_fix.patch 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768
  1. --- a/cppi_cpaal5.c
  2. +++ b/cppi_cpaal5.c
  3. @@ -352,7 +352,7 @@ static int halRxReturn(HAL_RECEIVEINFO *
  4. {
  5. /* malloc failed, add this RCB to Needs Buffer List */
  6. TempRcb->FragCount = 1; /*MJH+030417*/
  7. - (HAL_RCB *)TempRcb->Eop = TempRcb; /* GSG +030430 */
  8. + TempRcb->Eop = TempRcb; /* GSG +030430 */
  9. if(HalDev->NeedsCount < MAX_NEEDS) /* +MJH 030410 */
  10. { /* +MJH 030410 */
  11. --- a/dsl_hal_api.c
  12. +++ b/dsl_hal_api.c
  13. @@ -254,15 +254,15 @@
  14. * of phyEnableDisableWord & phyControlWord to avoid changing API struct
  15. * which may cause change required to application data structure.
  16. ******************************************************************************/
  17. -#include <dev_host_interface.h>
  18. -#include <dsl_hal_register.h>
  19. -#include <dsl_hal_support.h>
  20. +#include "dev_host_interface.h"
  21. +#include "dsl_hal_register.h"
  22. +#include "dsl_hal_support.h"
  23. #ifndef NO_ADV_STATS
  24. -#include <dsl_hal_logtable.h>
  25. +#include "dsl_hal_logtable.h"
  26. #endif
  27. -#include <dsl_hal_version.h>
  28. +#include "dsl_hal_version.h"
  29. // UR8_MERGE_START CQ11054 Jack Zhang
  30. static unsigned int highprecision_selected = 0; //By default we use low precision for backward compt.
  31. --- a/dsl_hal_support.c
  32. +++ b/dsl_hal_support.c
  33. @@ -140,9 +140,9 @@
  34. * oamFeature are overriden
  35. // UR8_MERGE_END CQ10774 Ram
  36. *******************************************************************************/
  37. -#include <dev_host_interface.h>
  38. -#include <dsl_hal_register.h>
  39. -#include <dsl_hal_support.h>
  40. +#include "dev_host_interface.h"
  41. +#include "dsl_hal_register.h"
  42. +#include "dsl_hal_support.h"
  43. #define NUM_READ_RETRIES 3
  44. static unsigned int dslhal_support_adsl2ByteSwap32(unsigned int in32Bits);
  45. --- a/dsl_hal_support.h
  46. +++ b/dsl_hal_support.h
  47. @@ -49,7 +49,7 @@
  48. * 04Nov05 0.11.00 CPH Fixed T1413 mode got Zero DS/US rate when DSL_BIT_TMODE is set.
  49. *******************************************************************************/
  50. -#include <dsl_hal_api.h>
  51. +#include "dsl_hal_api.h"
  52. #define virtual2Physical(a) (((int)a)&~0xe0000000)
  53. /* External Function Prototype Declarations */
  54. --- a/Makefile
  55. +++ b/Makefile
  56. @@ -1,18 +1,9 @@
  57. -# File: drivers/atm/ti_evm3/Makefile
  58. #
  59. -# Makefile for the Texas Instruments EVM3 ADSL/ATM driver.
  60. +# Makefile for the TIATM device driver.
  61. #
  62. -#
  63. -# Copyright (c) 2000 Texas Instruments Incorporated.
  64. -# Jeff Harrell (jharrell@telogy.com)
  65. -# Viren Balar (vbalar@ti.com)
  66. -# Victor Wells (vwells@telogy.com)
  67. -#
  68. -include $(TOPDIR)/Rules.make
  69. -
  70. -
  71. -
  72. -
  73. -
  74. -
  75. +CONFIG_SANGAM_ATM=m
  76. +#EXTRA_CFLAGS += -DEL -I. -DPOST_SILICON -DCOMMON_NSP -DCONFIG_LED_MODULE -DDEREGISTER_LED -DNO_ACT
  77. +EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -DNO_ACT -D__NO__VOICE_PATCH__ -DEL
  78. +obj-$(CONFIG_SANGAM_ATM) := tiatm.o
  79. +tiatm-objs += cpsar.o aal5sar.o tn7sar.o tn7atm.o tn7dsl.o dsl_hal_api.o dsl_hal_support.o
  80. --- a/tn7atm.c
  81. +++ b/tn7atm.c
  82. @@ -61,7 +61,6 @@
  83. * UR8_MERGE_END CQ11057*
  84. *********************************************************************************************/
  85. -#include <linux/config.h>
  86. #include <linux/kernel.h>
  87. #include <linux/module.h>
  88. #include <linux/init.h>
  89. @@ -69,11 +68,14 @@
  90. #include <linux/delay.h>
  91. #include <linux/spinlock.h>
  92. #include <linux/smp_lock.h>
  93. -#include <asm/io.h>
  94. -#include <asm/mips-boards/prom.h>
  95. #include <linux/proc_fs.h>
  96. #include <linux/string.h>
  97. #include <linux/ctype.h>
  98. +
  99. +#include <asm/io.h>
  100. +#include <asm/ar7/ar7.h>
  101. +#include <asm/ar7/prom.h>
  102. +
  103. #include "dsl_hal_api.h"
  104. #include "tn7atm.h"
  105. #include "tn7api.h"
  106. @@ -82,6 +84,7 @@
  107. #include "dsl_hal_register.h"
  108. #ifdef MODULE
  109. +MODULE_LICENSE("GPL");
  110. MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver");
  111. MODULE_AUTHOR ("Zhicheng Tang");
  112. #endif
  113. @@ -100,9 +103,9 @@ MODULE_AUTHOR ("Zhicheng Tang");
  114. /*end of externs */
  115. -#ifndef TI_STATIC_ALLOCATIONS
  116. -#define TI_STATIC_ALLOCATIONS
  117. -#endif
  118. +//#ifndef TI_STATIC_ALLOCATIONS
  119. +//#define TI_STATIC_ALLOCATIONS
  120. +//#endif
  121. #define tn7atm_kfree_skb(x) dev_kfree_skb(x)
  122. @@ -114,7 +117,7 @@ static int EnableQoS = FALSE;
  123. /* prototypes */
  124. static int tn7atm_set_can_support_adsl2 (int can);
  125. -static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci);
  126. +static int tn7atm_open (struct atm_vcc *vcc);
  127. static void tn7atm_close (struct atm_vcc *vcc);
  128. @@ -257,13 +260,12 @@ static const struct atmdev_ops tn7atm_op
  129. getsockopt: NULL,
  130. setsockopt: NULL,
  131. send: tn7atm_send,
  132. - sg_send: NULL,
  133. phy_put: NULL,
  134. phy_get: NULL,
  135. change_qos: tn7atm_change_qos,
  136. };
  137. -const char drv_proc_root_folder[] = "avalanche/";
  138. +const char drv_proc_root_folder[] = "avalanche";
  139. static struct proc_dir_entry *root_proc_dir_entry = NULL;
  140. #define DRV_PROC_MODE 0644
  141. static int proc_root_already_exists = TRUE;
  142. @@ -559,56 +561,6 @@ static int turbodsl_check_priority_type(
  143. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  144. *
  145. - * Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci)
  146. - *
  147. - * Description: retrieve VPI/VCI for connection
  148. - *
  149. - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  150. -static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci)
  151. -{
  152. - struct atm_vcc *walk;
  153. -
  154. - /*
  155. - * find a free VPI
  156. - */
  157. - if (*vpi == ATM_VPI_ANY)
  158. - {
  159. -
  160. - for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next)
  161. - {
  162. -
  163. - if ((walk->vci == *vci) && (walk->vpi == *vpi))
  164. - {
  165. - (*vpi)++;
  166. - walk = vcc->dev->vccs;
  167. - }
  168. - }
  169. - }
  170. -
  171. - /*
  172. - * find a free VCI
  173. - */
  174. - if (*vci == ATM_VCI_ANY)
  175. - {
  176. -
  177. - for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk;
  178. - walk = walk->next)
  179. - {
  180. -
  181. - if ((walk->vpi = *vpi) && (walk->vci == *vci))
  182. - {
  183. - *vci = walk->vci + 1;
  184. - walk = vcc->dev->vccs;
  185. - }
  186. - }
  187. - }
  188. -
  189. - return 0;
  190. -}
  191. -
  192. -
  193. -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  194. - *
  195. * Function: int tn7atm_sar_irq(void)
  196. *
  197. * Description: tnetd73xx SAR interrupt.
  198. @@ -693,7 +645,7 @@ static int __init tn7atm_irq_request (st
  199. * Register SAR interrupt
  200. */
  201. priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */
  202. - if (request_irq (priv->sar_irq, tn7atm_sar_irq, SA_INTERRUPT, "SAR ", dev))
  203. + if (request_irq (priv->sar_irq, tn7atm_sar_irq, IRQF_DISABLED, "SAR ", dev))
  204. printk ("Could not register tn7atm_sar_irq\n");
  205. /*
  206. @@ -704,14 +656,14 @@ static int __init tn7atm_irq_request (st
  207. {
  208. def_sar_inter_pace = os_atoi (ptr);
  209. }
  210. - avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM,
  211. - def_sar_inter_pace);
  212. +/* avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM,
  213. + def_sar_inter_pace);*/
  214. /*
  215. * Reigster Receive interrupt A
  216. */
  217. priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */
  218. - if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, SA_INTERRUPT, "DSL ", dev))
  219. + if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, IRQF_DISABLED, "DSL ", dev))
  220. printk ("Could not register tn7atm_dsl_irq\n");
  221. /***** VRB Tasklet Mode ****/
  222. @@ -875,11 +827,15 @@ static int __init tn7atm_get_ESI (struct
  223. #define ATM_VBR_RT 5
  224. #endif
  225. -int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci)
  226. +int tn7atm_open (struct atm_vcc *vcc)
  227. {
  228. tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm;
  229. int rc;
  230. //int flags;
  231. + tn7atm_activate_vc_parm.pcr = 0x20000;
  232. + tn7atm_activate_vc_parm.scr = 0x20000;
  233. + tn7atm_activate_vc_parm.mbs = 0x20000;
  234. + tn7atm_activate_vc_parm.cdvt = 10000;
  235. dgprintf(1, "tn7atm_open()\n");
  236. @@ -891,24 +847,18 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  237. return -1;
  238. }
  239. - MOD_INC_USE_COUNT;
  240. +// MOD_INC_USE_COUNT;
  241. - /* find a free VPI/VCI */
  242. - tn7atm_walk_vccs(vcc, &vpi, &vci);
  243. -
  244. - vcc->vpi = vpi;
  245. - vcc->vci = vci;
  246. -
  247. - if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC))
  248. + if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC))
  249. {
  250. - MOD_DEC_USE_COUNT;
  251. +// MOD_DEC_USE_COUNT;
  252. return -EBUSY;
  253. }
  254. - tn7atm_activate_vc_parm.vpi = vpi;
  255. - tn7atm_activate_vc_parm.vci = vci;
  256. + tn7atm_activate_vc_parm.vpi = vcc->vpi;
  257. + tn7atm_activate_vc_parm.vci = vcc->vci;
  258. - if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI))
  259. + if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI))
  260. {
  261. /* always use (max_dma_chan+1) for clear eoc */
  262. tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN;
  263. @@ -916,7 +866,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  264. /* check to see whether clear eoc is opened or not */
  265. if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse)
  266. {
  267. - MOD_DEC_USE_COUNT;
  268. +// MOD_DEC_USE_COUNT;
  269. printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan);
  270. return -EBUSY;
  271. }
  272. @@ -925,7 +875,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  273. if (rc)
  274. {
  275. printk("tn7atm_open: failed to setup clear_eoc\n");
  276. - MOD_DEC_USE_COUNT;
  277. +// MOD_DEC_USE_COUNT;
  278. return -EBUSY;
  279. }
  280. tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan);
  281. @@ -934,17 +884,17 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  282. }
  283. else /* PVC channel setup */
  284. {
  285. - if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI))
  286. + if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI))
  287. {
  288. tn7atm_activate_vc_parm.chan = 14; /* always use chan 14 for MII PVC-base romote mgmt */
  289. }
  290. else
  291. {
  292. - rc = tn7atm_lut_find(vpi, vci);
  293. + rc = tn7atm_lut_find(vcc->vpi, vcc->vci);
  294. /* check to see whether PVC is opened or not */
  295. if(ATM_NO_DMA_CHAN != rc)
  296. {
  297. - MOD_DEC_USE_COUNT;
  298. +// MOD_DEC_USE_COUNT;
  299. printk("PVC already opened. dmachan = %d\n", rc);
  300. return -EBUSY;
  301. }
  302. @@ -976,6 +926,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  303. tn7atm_activate_vc_parm.priority = 2;
  304. break;
  305. +#if 0
  306. case ATM_VBR: /* Variable Bit Rate-Non RealTime*/
  307. tn7atm_activate_vc_parm.qos = 1;
  308. tn7atm_activate_vc_parm.priority = 1;
  309. @@ -997,6 +948,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  310. tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr;
  311. tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv;
  312. break;
  313. +#endif
  314. default:
  315. tn7atm_activate_vc_parm.qos = 2;
  316. @@ -1024,7 +976,7 @@ int tn7atm_open (struct atm_vcc *vcc, sh
  317. if (rc < 0)
  318. {
  319. printk("failed to activate hw channel\n");
  320. - MOD_DEC_USE_COUNT;
  321. +// MOD_DEC_USE_COUNT;
  322. tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan);
  323. //spin_unlock_irqrestore(&chan_init_lock, flags);
  324. return -EBUSY;
  325. @@ -1114,7 +1066,7 @@ void tn7atm_close (struct atm_vcc *vcc)
  326. tn7atm_lut_clear (vcc, dmachan);
  327. //spin_unlock_irqrestore (&closeLock, closeFlag);
  328. - MOD_DEC_USE_COUNT;
  329. +// MOD_DEC_USE_COUNT;
  330. dgprintf (1, "Leave tn7atm_close\n");
  331. }
  332. @@ -1528,8 +1480,7 @@ int tn7atm_receive (void *os_dev, int ch
  333. * firewall is on */
  334. dgprintf (3, "pushing the skb...\n");
  335. -
  336. - skb->stamp = vcc->timestamp = xtime;
  337. + __net_timestamp(skb);
  338. xdump ((unsigned char *) skb->data, skb->len, 5);
  339. @@ -1725,8 +1676,7 @@ static void tn7atm_exit (void)
  340. kfree (dev->dev_data);
  341. - // atm_dev_deregister (dev);
  342. - shutdown_atm_dev (dev);
  343. + atm_dev_deregister (dev);
  344. /*
  345. * remove proc entries
  346. @@ -1885,9 +1835,6 @@ static int __init tn7atm_detect (void)
  347. /*
  348. * Set up proc entry for atm stats
  349. */
  350. - if (tn7atm_xlate_proc_name
  351. - (drv_proc_root_folder, &root_proc_dir_entry, &residual))
  352. - {
  353. printk ("Creating new root folder %s in the proc for the driver stats \n",
  354. drv_proc_root_folder);
  355. root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL);
  356. @@ -1897,7 +1844,6 @@ static int __init tn7atm_detect (void)
  357. return -ENOMEM;
  358. }
  359. proc_root_already_exists = FALSE;
  360. - }
  361. /*
  362. * AV: Clean-up. Moved all the definitions to the data structure.
  363. @@ -2479,7 +2425,5 @@ static int tn7atm_proc_qos_write(struct
  364. return count;
  365. }
  366. -#ifdef MODULE
  367. module_init (tn7atm_detect);
  368. module_exit (tn7atm_exit);
  369. -#endif /* MODULE */
  370. --- a/tn7atm.h
  371. +++ b/tn7atm.h
  372. @@ -19,7 +19,8 @@
  373. //#include "mips_support.h"
  374. #include <linux/list.h>
  375. -#include <linux/config.h>
  376. +#define MIPS_EXCEPTION_OFFSET 8
  377. +#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET)
  378. #ifdef CONFIG_MODVERSIONS
  379. #include <linux/modversions.h>
  380. --- a/tn7dsl.c
  381. +++ b/tn7dsl.c
  382. @@ -94,7 +94,6 @@
  383. * 1/02/07 JZ CQ11054: Data Precision and Range Changes for TR-069 Conformance
  384. * UR8_MERGE_END CQ11054*
  385. *********************************************************************************************/
  386. -#include <linux/config.h>
  387. #include <linux/kernel.h>
  388. #include <linux/module.h>
  389. #include <linux/init.h>
  390. @@ -102,8 +101,6 @@
  391. #include <linux/delay.h>
  392. #include <linux/spinlock.h>
  393. #include <linux/smp_lock.h>
  394. -#include <asm/io.h>
  395. -#include <asm/mips-boards/prom.h>
  396. #include <linux/proc_fs.h>
  397. #include <linux/string.h>
  398. #include <linux/ctype.h>
  399. @@ -111,6 +108,12 @@
  400. #include <linux/timer.h>
  401. #include <linux/vmalloc.h>
  402. #include <linux/file.h>
  403. +#include <linux/firmware.h>
  404. +
  405. +#include <asm/io.h>
  406. +#include <asm/ar7/ar7.h>
  407. +#include <asm/ar7/prom.h>
  408. +
  409. /* Modules specific header files */
  410. #include "tn7atm.h"
  411. #include "tn7api.h"
  412. @@ -173,7 +176,7 @@ led_reg_t ledreg[2];
  413. static struct led_funcs ledreg[2];
  414. #endif
  415. -#define DEV_DSLMOD 1
  416. +#define DEV_DSLMOD CTL_UNNUMBERED
  417. #define MAX_STR_SIZE 256
  418. #define DSL_MOD_SIZE 256
  419. @@ -299,7 +302,7 @@ static PITIDSLHW_T pIhw;
  420. static volatile int bshutdown;
  421. static char info[MAX_STR_SIZE];
  422. /* Used for DSL Polling enable */
  423. -static DECLARE_MUTEX_LOCKED (adsl_sem_overlay);
  424. +static struct semaphore adsl_sem_overlay;
  425. //kthread_t overlay_thread;
  426. /* end of module wide declars */
  427. @@ -323,6 +326,14 @@ static int tn7dsl_proc_snr_print (char *
  428. #define gDot1(a) ((a>0)?(a%10):((-a)%10))
  429. // UR8_MERGE_END CQ11054*
  430. +int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num,
  431. + unsigned int pace_value)
  432. +{
  433. + printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value);
  434. + return 0;
  435. +}
  436. +
  437. +
  438. int os_atoi(const char *pStr)
  439. {
  440. int MulNeg = (*pStr == '-' ? -1 : 1);
  441. @@ -359,39 +370,6 @@ void dprintf (int uDbgLevel, char *szFmt
  442. #endif
  443. }
  444. -int strcmp(const char *s1, const char *s2)
  445. -{
  446. -
  447. - int size = strlen(s1);
  448. -
  449. - return(strncmp(s1, s2, size));
  450. -}
  451. -
  452. -int strncmp(const char *s1, const char *s2, size_t size)
  453. -{
  454. - int i = 0;
  455. - int max_size = (int)size;
  456. -
  457. - while((s1[i] != 0) && i < max_size)
  458. - {
  459. - if(s2[i] == 0)
  460. - {
  461. - return -1;
  462. - }
  463. - if(s1[i] != s2[i])
  464. - {
  465. - return 1;
  466. - }
  467. - i++;
  468. - }
  469. - if(s2[i] != 0)
  470. - {
  471. - return 1;
  472. - }
  473. -
  474. - return 0;
  475. -}
  476. -
  477. // * UR8_MERGE_START CQ10640 Jack Zhang
  478. int tn7dsl_dump_dsp_memory(char *input_str) //cph99
  479. {
  480. @@ -441,101 +419,74 @@ unsigned int shim_osGetCpuFrequency(void
  481. return CpuFrequency;
  482. }
  483. -int shim_osLoadFWImage(unsigned char *ptr)
  484. +static void avsar_release(struct device *dev)
  485. {
  486. - unsigned int bytesRead;
  487. - mm_segment_t oldfs;
  488. - static struct file *filp;
  489. - unsigned int imageLength=0x5ffff;
  490. -
  491. -
  492. - dgprintf(4, "tn7dsl_read_dsp()\n");
  493. -
  494. - dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH);
  495. -
  496. - filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY);
  497. - if(filp ==NULL)
  498. - {
  499. - printk("Failed: Could not open DSP binary file\n");
  500. - return -1;
  501. - }
  502. -
  503. - if (filp->f_dentry != NULL)
  504. - {
  505. - if (filp->f_dentry->d_inode != NULL)
  506. - {
  507. - printk ("DSP binary filesize = %d bytes\n",
  508. - (int) filp->f_dentry->d_inode->i_size);
  509. - imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200;
  510. - }
  511. - }
  512. -
  513. - if (filp->f_op->read==NULL)
  514. - return -1; /* File(system) doesn't allow reads */
  515. -
  516. - /*
  517. - * Disable parameter checking
  518. - */
  519. - oldfs = get_fs();
  520. - set_fs(KERNEL_DS);
  521. -
  522. - /*
  523. - * Now read bytes from postion "StartPos"
  524. - */
  525. - filp->f_pos = 0;
  526. -
  527. - bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos);
  528. -
  529. - dgprintf(4,"file length = %d\n", bytesRead);
  530. -
  531. - set_fs(oldfs);
  532. -
  533. - /*
  534. - * Close the file
  535. - */
  536. - fput(filp);
  537. -
  538. - return bytesRead;
  539. + printk(KERN_DEBUG "avsar firmware released\n");
  540. }
  541. +static struct device avsar = {
  542. + .bus_id = "vlynq",
  543. + .release = avsar_release,
  544. +};
  545. -unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset,
  546. - unsigned int secLength)
  547. +int shim_osLoadFWImage(unsigned char *ptr)
  548. {
  549. - unsigned int bytesRead;
  550. - mm_segment_t oldfs;
  551. - struct file *filp;
  552. -
  553. - dgprintf(4,"shim_read_overlay_page\n");
  554. - //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength);
  555. + const struct firmware *fw_entry;
  556. + size_t size;
  557. - filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY);
  558. - if(filp ==NULL)
  559. - {
  560. - printk("Failed: Could not open DSP binary file\n");
  561. - return -1;
  562. - }
  563. -
  564. - if (filp->f_op->read==NULL)
  565. - return -1; /* File(system) doesn't allow reads */
  566. -
  567. - /*
  568. - * Now read bytes from postion "StartPos"
  569. - */
  570. -
  571. - if(filp->f_op->llseek)
  572. - filp->f_op->llseek(filp,secOffset, 0);
  573. - oldfs = get_fs();
  574. - set_fs(KERNEL_DS);
  575. - filp->f_pos = secOffset;
  576. - bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos);
  577. -
  578. - set_fs(oldfs);
  579. - /*
  580. - * Close the file
  581. - */
  582. - fput(filp);
  583. - return bytesRead;
  584. + printk("requesting firmware image \"ar0700xx.bin\"\n");
  585. + if(device_register(&avsar) < 0) {
  586. + printk(KERN_ERR
  587. + "avsar: device_register fails\n");
  588. + return -1;
  589. + }
  590. +
  591. + if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) {
  592. + printk(KERN_ERR
  593. + "avsar: Firmware not available\n");
  594. + device_unregister(&avsar);
  595. + return -1;
  596. + }
  597. + size = fw_entry->size;
  598. + device_unregister(&avsar);
  599. + if(size > 0x5ffff) {
  600. + printk(KERN_ERR
  601. + "avsar: Firmware too big (%d bytes)\n", size);
  602. + release_firmware(fw_entry);
  603. + return -1;
  604. + }
  605. + memcpy(ptr, fw_entry->data, size);
  606. + release_firmware(fw_entry);
  607. + return size;
  608. +}
  609. +
  610. +unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength)
  611. +{
  612. + const struct firmware *fw_entry;
  613. +
  614. + printk("requesting firmware image \"ar0700xx.bin\"\n");
  615. + if(device_register(&avsar) < 0) {
  616. + printk(KERN_ERR
  617. + "avsar: device_register fails\n");
  618. + return -1;
  619. + }
  620. +
  621. + if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) {
  622. + printk(KERN_ERR
  623. + "avsar: Firmware not available\n");
  624. + device_unregister(&avsar);
  625. + return -1;
  626. + }
  627. + device_unregister(&avsar);
  628. + if(fw_entry->size > secLength) {
  629. + printk(KERN_ERR
  630. + "avsar: Firmware too big (%d bytes)\n", fw_entry->size);
  631. + release_firmware(fw_entry);
  632. + return -1;
  633. + }
  634. + memcpy(ptr + secOffset, fw_entry->data, secLength);
  635. + release_firmware(fw_entry);
  636. + return secLength;
  637. }
  638. int shim_osLoadDebugFWImage(unsigned char *ptr)
  639. @@ -3064,6 +3015,7 @@ int tn7dsl_init(void *priv)
  640. int high_precision_selected = 0;
  641. // UR8_MERGE_END CQ11054*
  642. + sema_init(&adsl_sem_overlay, 0);
  643. /*
  644. * start dsl
  645. */
  646. @@ -3442,7 +3394,7 @@ static int dslmod_sysctl(ctl_table *ctl,
  647. */
  648. if(write)
  649. {
  650. - ret = proc_dostring(ctl, write, filp, buffer, lenp);
  651. + ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
  652. switch (ctl->ctl_name)
  653. {
  654. @@ -3528,14 +3480,14 @@ static int dslmod_sysctl(ctl_table *ctl,
  655. else
  656. {
  657. len += sprintf(info+len, mod_req);
  658. - ret = proc_dostring(ctl, write, filp, buffer, lenp);
  659. + ret = proc_dostring(ctl, write, filp, buffer, lenp, 0);
  660. }
  661. return ret;
  662. }
  663. ctl_table dslmod_table[] = {
  664. - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, &dslmod_sysctl}
  665. + {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string}
  666. ,
  667. {0}
  668. };
  669. @@ -3558,8 +3510,7 @@ void tn7dsl_dslmod_sysctl_register(void)
  670. if (initialized == 1)
  671. return;
  672. - dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1);
  673. - dslmod_root_table->child->de->owner = THIS_MODULE;
  674. + dslmod_sysctl_header = register_sysctl_table(dslmod_root_table);
  675. /*
  676. * set the defaults
  677. @@ -4821,4 +4772,4 @@ int tn7dsl_proc_PMDus(char* buf, char **
  678. }
  679. #endif //NO_ADV_STATS
  680. #endif //TR69_PMD_IN
  681. -// * UR8_MERGE_END CQ11057 *
  682. \ No newline at end of file
  683. +// * UR8_MERGE_END CQ11057 *
  684. --- a/tn7sar.c
  685. +++ b/tn7sar.c
  686. @@ -42,7 +42,6 @@
  687. * UR8_MERGE_END CQ10700
  688. *******************************************************************************/
  689. -#include <linux/config.h>
  690. #include <linux/kernel.h>
  691. #include <linux/module.h>
  692. #include <linux/init.h>
  693. @@ -50,12 +49,13 @@
  694. #include <linux/delay.h>
  695. #include <linux/spinlock.h>
  696. #include <linux/smp_lock.h>
  697. -#include <asm/io.h>
  698. -#include <asm/mips-boards/prom.h>
  699. #include <linux/proc_fs.h>
  700. #include <linux/string.h>
  701. #include <linux/ctype.h>
  702. +#include <asm/io.h>
  703. +#include <asm/ar7/ar7.h>
  704. +#include <asm/ar7/prom.h>
  705. #define _CPHAL_AAL5
  706. #define _CPHAL_SAR