100-compile_fix.patch 22 KB

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