patch-tn7sar_c 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. --- sangam-atm-1.0.orig/tn7sar.c 2007-05-18 09:46:30.000000000 +0200
  2. +++ sangam-atm-1.0/tn7sar.c 2009-12-17 19:10:27.628421613 +0100
  3. @@ -42,7 +42,6 @@
  4. * UR8_MERGE_END CQ10700
  5. *******************************************************************************/
  6. -#include <linux/config.h>
  7. #include <linux/kernel.h>
  8. #include <linux/module.h>
  9. #include <linux/init.h>
  10. @@ -50,12 +49,19 @@
  11. #include <linux/delay.h>
  12. #include <linux/spinlock.h>
  13. #include <linux/smp_lock.h>
  14. -#include <asm/io.h>
  15. -#include <asm/mips-boards/prom.h>
  16. #include <linux/proc_fs.h>
  17. #include <linux/string.h>
  18. #include <linux/ctype.h>
  19. +#include <linux/version.h>
  20. +#include <asm/io.h>
  21. +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
  22. +#include <asm/ar7/ar7.h>
  23. +#include <asm/ar7/prom.h>
  24. +#else
  25. +#include <asm/mach-ar7/ar7.h>
  26. +#include <asm/mach-ar7/prom.h>
  27. +#endif
  28. #define _CPHAL_AAL5
  29. #define _CPHAL_SAR
  30. @@ -74,6 +80,8 @@ typedef void OS_SETUP;
  31. /* PDSP Firmware files */
  32. #include "tnetd7300_sar_firm.h"
  33. +extern int mp_oam_lb_timeout;
  34. +extern int mp_autopvc_enable;
  35. enum
  36. {
  37. @@ -103,10 +111,10 @@ enum
  38. #define RESERVED_OAM_CHANNEL 15
  39. -#define AAL5_PARM "id=aal5, base = 0x03000000, offset = 0, int_line=15, ch0=[RxBufSize=1522; RxNumBuffers = 32; RxServiceMax = 50; TxServiceMax=50; TxNumBuffers=32; CpcsUU=0x5aa5; TxVc_CellRate=0x3000; TxVc_AtmHeader=0x00000640]"
  40. -#define SAR_PARM "id=sar,base = 0x03000000, reset_bit = 9, offset = 0; UniNni = 0, PdspEnable = 1"
  41. +#define CH0_PARM "RxBufSize=1522, RxNumBuffers=32, RxServiceMax=50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640"
  42. +#define AAL5_PARM "id=aal5, base=0x03000000, offset=0, int_line=15, ch0=[" CH0_PARM "]"
  43. +#define SAR_PARM "id=sar, base=0x03000000, reset_bit=9, offset=0; UniNni=0, PdspEnable=1, Debug=0xFFFFFFFF"
  44. #define RESET_PARM "id=ResetControl, base=0xA8611600"
  45. -#define CH0_PARM "RxBufSize=1522, RxNumBuffers = 32, RxServiceMax = 50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640"
  46. #define MAX_PVC_TABLE_ENTRY 16
  47. @@ -817,9 +825,9 @@ int tn7sar_setup_oam_channel(Tn7AtmPriva
  48. pHalDev = (HAL_DEVICE *)priv->pSarHalDev;
  49. pauto_pvc = prom_getenv("autopvc_enable");
  50. - if(pauto_pvc) //CQ10273
  51. + if(pauto_pvc || mp_autopvc_enable != -1) //CQ10273
  52. {
  53. - auto_pvc =tn7sar_strtoul(pauto_pvc, NULL, 10);
  54. + auto_pvc = mp_autopvc_enable == -1 ? tn7sar_strtoul(pauto_pvc, NULL, 10) : mp_autopvc_enable;
  55. }
  56. memset(&chInfo, 0xff, sizeof(chInfo));
  57. @@ -985,9 +993,9 @@ int tn7sar_init(struct atm_dev *dev, Tn7
  58. /* read in oam lb timeout value */
  59. pLbTimeout = prom_getenv("oam_lb_timeout");
  60. - if(pLbTimeout)
  61. + if(pLbTimeout || mp_oam_lb_timeout != -1)
  62. {
  63. - lbTimeout =tn7sar_strtoul(pLbTimeout, NULL, 10);
  64. + lbTimeout = mp_oam_lb_timeout == -1 ? tn7sar_strtoul(pLbTimeout, NULL, 10) : mp_oam_lb_timeout;
  65. oamLbTimeout = lbTimeout;
  66. pHalFunc->Control(pHalDev,"OamLbTimeout", "Set", &lbTimeout);
  67. }