--- sangam-atm-1.0.orig/tn7sar.c	2007-05-18 09:46:30.000000000 +0200
+++ sangam-atm-1.0/tn7sar.c	2009-12-17 19:10:27.628421613 +0100
@@ -42,7 +42,6 @@
  * UR8_MERGE_END CQ10700
  *******************************************************************************/
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -50,12 +49,19 @@
 #include <linux/delay.h>
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
-#include <asm/io.h>
-#include <asm/mips-boards/prom.h>
 #include <linux/proc_fs.h>
 #include <linux/string.h>
 #include <linux/ctype.h>
+#include <linux/version.h>
 
+#include <asm/io.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+#include <asm/ar7/ar7.h>
+#include <asm/ar7/prom.h>
+#else
+#include <asm/mach-ar7/ar7.h>
+#include <asm/mach-ar7/prom.h>
+#endif
 
 #define _CPHAL_AAL5
 #define _CPHAL_SAR
@@ -74,6 +80,8 @@ typedef void OS_SETUP;
 /* PDSP Firmware files */
 #include "tnetd7300_sar_firm.h"
 
+extern int mp_oam_lb_timeout;
+extern int mp_autopvc_enable;
 
 enum
 {
@@ -103,10 +111,10 @@ enum
 
 #define RESERVED_OAM_CHANNEL              15
 
-#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]"
-#define SAR_PARM "id=sar,base = 0x03000000, reset_bit = 9, offset = 0; UniNni = 0, PdspEnable = 1"
+#define CH0_PARM "RxBufSize=1522, RxNumBuffers=32, RxServiceMax=50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640"
+#define AAL5_PARM "id=aal5, base=0x03000000, offset=0, int_line=15, ch0=[" CH0_PARM "]"
+#define SAR_PARM "id=sar, base=0x03000000, reset_bit=9, offset=0; UniNni=0, PdspEnable=1, Debug=0xFFFFFFFF"
 #define RESET_PARM "id=ResetControl, base=0xA8611600"
-#define CH0_PARM "RxBufSize=1522, RxNumBuffers = 32, RxServiceMax = 50, TxServiceMax=50, TxNumBuffers=32, CpcsUU=0x5aa5, TxVc_CellRate=0x3000, TxVc_AtmHeader=0x00000640"
 
 #define MAX_PVC_TABLE_ENTRY 16
 
@@ -817,9 +825,9 @@ int tn7sar_setup_oam_channel(Tn7AtmPriva
   pHalDev  = (HAL_DEVICE *)priv->pSarHalDev;
 
   pauto_pvc = prom_getenv("autopvc_enable");
-  if(pauto_pvc)  //CQ10273
+  if(pauto_pvc || mp_autopvc_enable != -1)  //CQ10273
   {
-    auto_pvc =tn7sar_strtoul(pauto_pvc, NULL, 10);
+    auto_pvc = mp_autopvc_enable == -1 ? tn7sar_strtoul(pauto_pvc, NULL, 10) : mp_autopvc_enable;
   }
 
   memset(&chInfo, 0xff, sizeof(chInfo));
@@ -985,9 +993,9 @@ int tn7sar_init(struct atm_dev *dev, Tn7
 
   /* read in oam lb timeout value */
   pLbTimeout = prom_getenv("oam_lb_timeout");
-  if(pLbTimeout)
+  if(pLbTimeout || mp_oam_lb_timeout != -1)
   {
-    lbTimeout =tn7sar_strtoul(pLbTimeout, NULL, 10);
+    lbTimeout = mp_oam_lb_timeout == -1 ? tn7sar_strtoul(pLbTimeout, NULL, 10) : mp_oam_lb_timeout;
     oamLbTimeout = lbTimeout;
     pHalFunc->Control(pHalDev,"OamLbTimeout", "Set", &lbTimeout);
   }
