Ticket #2101: 100-compile_fix.patch

File 100-compile_fix.patch, 19.4 KB (added by rootkit85@…, 9 years ago)

patch for 2.6.22 kernel

  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/cppi_cpaal5.c sangam_atm-07.01.00.10/cppi_cpaal5.c
    old new  
    352352           { 
    353353            /* malloc failed, add this RCB to Needs Buffer List */ 
    354354            TempRcb->FragCount = 1;                                             /*MJH+030417*/ 
    355             (HAL_RCB *)TempRcb->Eop = TempRcb;                                  /* GSG +030430 */ 
     355            TempRcb->Eop = TempRcb;                                             /* GSG +030430 */ 
    356356 
    357357            if(HalDev->NeedsCount < MAX_NEEDS)                                  /* +MJH 030410 */ 
    358358              {                                                                 /* +MJH 030410 */ 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/dsl_hal_api.c sangam_atm-07.01.00.10/dsl_hal_api.c
    old new  
    229229*  10/4/06  JZ     CQ10979: Request for TR-069 Support for RP7.1 
    230230*  UR8_MERGE_END   CQ10979* 
    231231******************************************************************************/ 
    232 #include <dev_host_interface.h> 
    233 #include <dsl_hal_register.h> 
    234 #include <dsl_hal_support.h> 
     232#include "dev_host_interface.h" 
     233#include "dsl_hal_register.h" 
     234#include "dsl_hal_support.h" 
    235235 
    236236#ifndef NO_ADV_STATS 
    237 #include <dsl_hal_logtable.h> 
     237#include "dsl_hal_logtable.h" 
    238238#endif 
    239239 
    240 #include <dsl_hal_version.h> 
     240#include "dsl_hal_version.h" 
    241241 
    242242static unsigned int hybrid_selected; 
    243243static unsigned int showtimeFlag = FALSE; 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/dsl_hal_support.c sangam_atm-07.01.00.10/dsl_hal_support.c
    old new  
    140140*                                          oamFeature are overriden 
    141141// UR8_MERGE_END CQ10774 Ram 
    142142*******************************************************************************/ 
    143 #include <dev_host_interface.h> 
    144 #include <dsl_hal_register.h> 
    145 #include <dsl_hal_support.h> 
     143#include "dev_host_interface.h" 
     144#include "dsl_hal_register.h" 
     145#include "dsl_hal_support.h" 
    146146 
    147147#define NUM_READ_RETRIES 3 
    148148static unsigned int dslhal_support_adsl2ByteSwap32(unsigned int in32Bits); 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/dsl_hal_support.h sangam_atm-07.01.00.10/dsl_hal_support.h
    old new  
    4949*    04Nov05     0.11.00            CPH    Fixed T1413 mode got Zero DS/US rate when DSL_BIT_TMODE is set. 
    5050*******************************************************************************/ 
    5151 
    52 #include <dsl_hal_api.h> 
     52#include "dsl_hal_api.h" 
    5353 
    5454#define virtual2Physical(a)    (((int)a)&~0xe0000000) 
    5555/* External Function Prototype Declarations */ 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/Makefile sangam_atm-07.01.00.10/Makefile
    old new  
    1 # File: drivers/atm/ti_evm3/Makefile 
    21# 
    3 # Makefile for the Texas Instruments EVM3 ADSL/ATM driver. 
     2# Makefile for the TIATM device driver. 
    43# 
    5 # 
    6 # Copyright (c) 2000 Texas Instruments Incorporated. 
    7 #       Jeff Harrell (jharrell@telogy.com) 
    8 #       Viren Balar  (vbalar@ti.com) 
    9 #       Victor Wells (vwells@telogy.com) 
    10 # 
    11 include $(TOPDIR)/Rules.make 
    12  
    13  
    14  
    15  
    16  
    17  
    184 
     5CONFIG_SANGAM_ATM=m 
     6#EXTRA_CFLAGS += -DEL -I. -DPOST_SILICON -DCOMMON_NSP -DCONFIG_LED_MODULE -DDEREGISTER_LED -DNO_ACT 
     7EXTRA_CFLAGS += -DEL -I$(PWD) -DPOST_SILICON -DCOMMON_NSP -DNO_ACT -D__NO__VOICE_PATCH__ -DEL 
     8obj-$(CONFIG_SANGAM_ATM) := tiatm.o 
     9tiatm-objs += cpsar.o aal5sar.o tn7sar.o tn7atm.o tn7dsl.o dsl_hal_api.o dsl_hal_support.o 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/tn7atm.c sangam_atm-07.01.00.10/tn7atm.c
    old new  
    5858 *    UR8_MERGE_END   CQ10979* 
    5959*********************************************************************************************/ 
    6060 
    61 #include <linux/config.h> 
    6261#include <linux/kernel.h> 
    6362#include <linux/module.h> 
    6463#include <linux/init.h> 
     
    6766#include <linux/spinlock.h> 
    6867#include <linux/smp_lock.h> 
    6968#include <asm/io.h> 
    70 #include <asm/mips-boards/prom.h> 
     69#include <asm/ar7/ar7.h> 
    7170#include <linux/proc_fs.h> 
    7271#include <linux/string.h> 
    7372#include <linux/ctype.h> 
     
    7978#include "dsl_hal_register.h" 
    8079 
    8180#ifdef MODULE 
     81MODULE_LICENSE("GPL"); 
    8282MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver"); 
    8383MODULE_AUTHOR ("Zhicheng Tang"); 
    8484#endif 
     
    9797 
    9898/*end of externs */ 
    9999 
    100 #ifndef TI_STATIC_ALLOCATIONS 
    101 #define TI_STATIC_ALLOCATIONS 
    102 #endif 
     100//#ifndef TI_STATIC_ALLOCATIONS 
     101//#define TI_STATIC_ALLOCATIONS 
     102//#endif 
    103103 
    104104#define tn7atm_kfree_skb(x)     dev_kfree_skb(x) 
    105105 
     
    111111/* prototypes */ 
    112112static int tn7atm_set_can_support_adsl2 (int can); 
    113113 
    114 static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci); 
     114static int tn7atm_open (struct atm_vcc *vcc); 
    115115 
    116116static void tn7atm_close (struct atm_vcc *vcc); 
    117117 
     
    254254        getsockopt:     NULL, 
    255255        setsockopt:     NULL, 
    256256        send:           tn7atm_send, 
    257         sg_send:        NULL, 
    258257        phy_put:        NULL, 
    259258        phy_get:        NULL, 
    260259        change_qos:     tn7atm_change_qos, 
    261260}; 
    262261 
    263 const char drv_proc_root_folder[] = "avalanche/"; 
     262const char drv_proc_root_folder[] = "avalanche"; 
    264263static struct proc_dir_entry *root_proc_dir_entry = NULL; 
    265264#define DRV_PROC_MODE 0644 
    266265static int proc_root_already_exists = TRUE; 
     
    549548 
    550549/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    551550 * 
    552  *  Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci) 
    553  * 
    554  *  Description: retrieve VPI/VCI for connection 
    555  * 
    556  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 
    557 static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci) 
    558 { 
    559   struct atm_vcc *walk; 
    560  
    561   /* 
    562    * find a free VPI 
    563    */ 
    564   if (*vpi == ATM_VPI_ANY) 
    565   { 
    566  
    567     for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) 
    568     { 
    569  
    570       if ((walk->vci == *vci) && (walk->vpi == *vpi)) 
    571       { 
    572         (*vpi)++; 
    573         walk = vcc->dev->vccs; 
    574       } 
    575     } 
    576   } 
    577  
    578   /* 
    579    * find a free VCI 
    580    */ 
    581   if (*vci == ATM_VCI_ANY) 
    582   { 
    583  
    584     for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; 
    585          walk = walk->next) 
    586     { 
    587  
    588       if ((walk->vpi = *vpi) && (walk->vci == *vci)) 
    589       { 
    590         *vci = walk->vci + 1; 
    591         walk = vcc->dev->vccs; 
    592       } 
    593     } 
    594   } 
    595  
    596   return 0; 
    597 } 
    598  
    599  
    600 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    601  * 
    602551 *  Function: int tn7atm_sar_irq(void) 
    603552 * 
    604553 *  Description: tnetd73xx SAR interrupt. 
     
    694643  { 
    695644    def_sar_inter_pace = os_atoi (ptr); 
    696645  } 
    697   avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, 
    698                             def_sar_inter_pace); 
     646/*  avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, 
     647                            def_sar_inter_pace);*/ 
    699648 
    700649  /* 
    701650   * Reigster Receive interrupt A 
     
    865814#define ATM_VBR_RT     5 
    866815#endif 
    867816 
    868 int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci) 
     817int tn7atm_open (struct atm_vcc *vcc) 
    869818{ 
    870819  tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm; 
    871820  int rc; 
    872821  //int flags; 
     822  tn7atm_activate_vc_parm.pcr = 0x20000; 
     823  tn7atm_activate_vc_parm.scr = 0x20000; 
     824  tn7atm_activate_vc_parm.mbs = 0x20000; 
     825  tn7atm_activate_vc_parm.cdvt = 10000; 
    873826 
    874827  dgprintf(1, "tn7atm_open()\n"); 
    875828 
     
    881834    return -1; 
    882835  } 
    883836 
    884   MOD_INC_USE_COUNT; 
    885  
    886   /* find a free VPI/VCI */ 
    887   tn7atm_walk_vccs(vcc, &vpi, &vci); 
     837//  MOD_INC_USE_COUNT; 
    888838 
    889   vcc->vpi = vpi; 
    890   vcc->vci = vci; 
    891  
    892   if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC)) 
     839  if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC)) 
    893840  { 
    894     MOD_DEC_USE_COUNT; 
     841//    MOD_DEC_USE_COUNT; 
    895842    return -EBUSY; 
    896843  } 
    897844 
    898   tn7atm_activate_vc_parm.vpi = vpi; 
    899   tn7atm_activate_vc_parm.vci = vci; 
     845  tn7atm_activate_vc_parm.vpi = vcc->vpi; 
     846  tn7atm_activate_vc_parm.vci = vcc->vci; 
    900847 
    901   if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI)) 
     848  if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI)) 
    902849  { 
    903850    /* always use (max_dma_chan+1) for clear eoc */ 
    904851    tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN; 
     
    906853    /* check to see whether clear eoc is opened or not */ 
    907854    if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse) 
    908855    { 
    909       MOD_DEC_USE_COUNT; 
     856//      MOD_DEC_USE_COUNT; 
    910857      printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan); 
    911858      return -EBUSY; 
    912859    } 
     
    915862    if (rc) 
    916863    { 
    917864      printk("tn7atm_open: failed to setup clear_eoc\n"); 
    918       MOD_DEC_USE_COUNT; 
     865//      MOD_DEC_USE_COUNT; 
    919866      return -EBUSY; 
    920867    } 
    921868    tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan); 
     
    924871  } 
    925872  else  /* PVC channel setup */ 
    926873  { 
    927     if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI)) 
     874    if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI)) 
    928875    { 
    929876      tn7atm_activate_vc_parm.chan = 14;   /* always use chan 14 for MII PVC-base romote mgmt */ 
    930877    } 
    931878    else 
    932879    { 
    933        rc = tn7atm_lut_find(vpi, vci); 
     880       rc = tn7atm_lut_find(vcc->vpi, vcc->vci); 
    934881      /* check to see whether PVC is opened or not */ 
    935882      if(ATM_NO_DMA_CHAN != rc) 
    936883      { 
    937         MOD_DEC_USE_COUNT; 
     884//        MOD_DEC_USE_COUNT; 
    938885        printk("PVC already opened. dmachan = %d\n", rc); 
    939886        return -EBUSY; 
    940887      } 
     
    966913       tn7atm_activate_vc_parm.priority = 2; 
    967914       break; 
    968915 
     916#if 0 
    969917     case ATM_VBR: /* Variable Bit Rate-Non RealTime*/ 
    970918       tn7atm_activate_vc_parm.qos = 1; 
    971919       tn7atm_activate_vc_parm.priority = 1; 
     
    987935           tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr; 
    988936       tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv; 
    989937       break; 
     938#endif 
    990939 
    991940     default: 
    992941         tn7atm_activate_vc_parm.qos = 2; 
     
    1014963   if (rc < 0) 
    1015964   { 
    1016965      printk("failed to activate hw channel\n"); 
    1017       MOD_DEC_USE_COUNT; 
     966//      MOD_DEC_USE_COUNT; 
    1018967      tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan); 
    1019968      //spin_unlock_irqrestore(&chan_init_lock, flags); 
    1020969      return -EBUSY; 
     
    11041053  tn7atm_lut_clear (vcc, dmachan); 
    11051054  //spin_unlock_irqrestore (&closeLock, closeFlag); 
    11061055 
    1107   MOD_DEC_USE_COUNT; 
     1056//  MOD_DEC_USE_COUNT; 
    11081057 
    11091058  dgprintf (1, "Leave tn7atm_close\n"); 
    11101059} 
     
    15181467                                 * firewall is on */ 
    15191468 
    15201469  dgprintf (3, "pushing the skb...\n"); 
    1521  
    1522   skb->stamp = vcc->timestamp = xtime; 
     1470  __net_timestamp(skb); 
    15231471 
    15241472  xdump ((unsigned char *) skb->data, skb->len, 5); 
    15251473 
     
    17151663 
    17161664  kfree (dev->dev_data); 
    17171665 
    1718   // atm_dev_deregister (dev); 
    1719   shutdown_atm_dev (dev); 
     1666  atm_dev_deregister (dev); 
    17201667 
    17211668  /* 
    17221669   * remove proc entries 
     
    18751822  /* 
    18761823   * Set up proc entry for atm stats 
    18771824   */ 
    1878   if (tn7atm_xlate_proc_name 
    1879       (drv_proc_root_folder, &root_proc_dir_entry, &residual)) 
    1880   { 
    18811825    printk ("Creating new root folder %s in the proc for the driver stats \n", 
    18821826            drv_proc_root_folder); 
    18831827    root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL); 
     
    18871831      return -ENOMEM; 
    18881832    } 
    18891833    proc_root_already_exists = FALSE; 
    1890   } 
    18911834 
    18921835  /* 
    18931836   * AV: Clean-up. Moved all the definitions to the data structure. 
     
    24692412    return count; 
    24702413} 
    24712414 
    2472 #ifdef MODULE 
    24732415module_init (tn7atm_detect); 
    24742416module_exit (tn7atm_exit); 
    2475 #endif /* MODULE */ 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/tn7atm.h sangam_atm-07.01.00.10/tn7atm.h
    old new  
    1919//#include  "mips_support.h" 
    2020#include  <linux/list.h> 
    2121 
    22 #include <linux/config.h> 
     22#define MIPS_EXCEPTION_OFFSET 8 
     23#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET) 
    2324 
    2425#ifdef CONFIG_MODVERSIONS 
    2526#include <linux/modversions.h> 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/tn7dsl.c sangam_atm-07.01.00.10/tn7dsl.c
    old new  
    8888*  10/4/06  JZ     CQ10979: Request for TR-069 Support for RP7.1 
    8989*  UR8_MERGE_END   CQ10979* 
    9090 *********************************************************************************************/ 
    91 #include <linux/config.h> 
    9291#include <linux/kernel.h> 
    9392#include <linux/module.h> 
    9493#include <linux/init.h> 
     
    9796#include <linux/spinlock.h> 
    9897#include <linux/smp_lock.h> 
    9998#include <asm/io.h> 
    100 #include <asm/mips-boards/prom.h> 
     99#include <asm/ar7/ar7.h> 
    101100#include <linux/proc_fs.h> 
    102101#include <linux/string.h> 
    103102#include <linux/ctype.h> 
     
    105104#include <linux/timer.h> 
    106105#include <linux/vmalloc.h> 
    107106#include <linux/file.h> 
     107#include <linux/firmware.h> 
     108 
    108109/* Modules specific header files */ 
    109110#include "tn7atm.h" 
    110111#include "tn7api.h" 
     
    312313static int tn7dsl_proc_snr_print (char *buf, int count, int *eof, int data); 
    313314/* end of internal functions */ 
    314315 
     316int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num, 
     317                            unsigned int pace_value) 
     318{ 
     319        printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value); 
     320        return 0; 
     321} 
     322 
     323 
    315324int os_atoi(const char *pStr) 
    316325{ 
    317326  int MulNeg = (*pStr == '-' ? -1 : 1); 
     
    348357#endif 
    349358} 
    350359 
    351 int strcmp(const char *s1, const char *s2) 
    352 { 
    353  
    354   int size = strlen(s1); 
    355  
    356   return(strncmp(s1, s2, size)); 
    357 } 
    358  
    359 int strncmp(const char *s1, const char *s2, size_t size) 
    360 { 
    361   int i = 0; 
    362   int max_size = (int)size; 
    363  
    364   while((s1[i] != 0) && i < max_size) 
    365   { 
    366     if(s2[i] == 0) 
    367     { 
    368       return -1; 
    369     } 
    370     if(s1[i] != s2[i]) 
    371     { 
    372        return 1; 
    373     } 
    374     i++; 
    375   } 
    376   if(s2[i] != 0) 
    377   { 
    378     return 1; 
    379   } 
    380  
    381   return 0; 
    382 } 
    383  
    384360// * UR8_MERGE_START CQ10640   Jack Zhang 
    385361int tn7dsl_dump_dsp_memory(char *input_str) //cph99 
    386362  { 
     
    430406  return CpuFrequency; 
    431407} 
    432408 
    433 int shim_osLoadFWImage(unsigned char *ptr) 
     409static void avsar_release(struct device *dev) 
    434410{ 
    435   unsigned int bytesRead; 
    436   mm_segment_t  oldfs; 
    437   static struct file *filp; 
    438   unsigned int imageLength=0x5ffff; 
    439  
    440  
    441   dgprintf(4, "tn7dsl_read_dsp()\n"); 
    442  
    443   dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH); 
    444  
    445   filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); 
    446   if(filp ==NULL) 
    447   { 
    448     printk("Failed: Could not open DSP binary file\n"); 
    449           return -1; 
    450   } 
    451  
    452   if (filp->f_dentry != NULL) 
    453   { 
    454     if (filp->f_dentry->d_inode != NULL) 
    455     { 
    456       printk ("DSP binary filesize = %d bytes\n", 
    457               (int) filp->f_dentry->d_inode->i_size); 
    458       imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200; 
    459     } 
    460   } 
    461  
    462   if (filp->f_op->read==NULL) 
    463           return -1;  /* File(system) doesn't allow reads */ 
    464  
    465   /* 
    466    * Disable parameter checking 
    467    */ 
    468   oldfs = get_fs(); 
    469   set_fs(KERNEL_DS); 
    470  
    471   /* 
    472    * Now read bytes from postion "StartPos" 
    473    */ 
    474   filp->f_pos = 0; 
    475  
    476   bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos); 
    477  
    478   dgprintf(4,"file length = %d\n", bytesRead); 
    479  
    480   set_fs(oldfs); 
    481  
    482   /* 
    483    * Close the file 
    484    */ 
    485   fput(filp); 
    486  
    487   return bytesRead; 
     411        printk(KERN_DEBUG "avsar firmware released\n"); 
    488412} 
    489413 
     414static struct device avsar = { 
     415        .bus_id    = "vlynq", 
     416        .release   = avsar_release, 
     417}; 
    490418 
    491 unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset, 
    492                                      unsigned int secLength) 
     419int shim_osLoadFWImage(unsigned char *ptr) 
    493420{ 
    494   unsigned int bytesRead; 
    495   mm_segment_t  oldfs; 
    496   struct file *filp; 
    497  
    498   dgprintf(4,"shim_read_overlay_page\n"); 
    499   //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength); 
    500  
    501   filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); 
    502   if(filp ==NULL) 
    503   { 
    504     printk("Failed: Could not open DSP binary file\n"); 
    505           return -1; 
    506   } 
    507  
    508   if (filp->f_op->read==NULL) 
    509           return -1;  /* File(system) doesn't allow reads */ 
    510  
    511   /* 
    512    * Now read bytes from postion "StartPos" 
    513    */ 
    514  
    515   if(filp->f_op->llseek) 
    516     filp->f_op->llseek(filp,secOffset, 0); 
    517   oldfs = get_fs(); 
    518   set_fs(KERNEL_DS); 
    519   filp->f_pos = secOffset; 
    520   bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos); 
     421        const struct firmware *fw_entry; 
    521422 
    522   set_fs(oldfs); 
    523   /* 
    524    * Close the file 
    525    */ 
    526   fput(filp); 
    527   return bytesRead; 
     423        printk("requesting firmware image \"ar0700xx.bin\"\n"); 
     424        if(device_register(&avsar) < 0) { 
     425                printk(KERN_ERR 
     426                        "avsar: device_register fails\n"); 
     427                return -1; 
     428        } 
     429 
     430        if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { 
     431                printk(KERN_ERR 
     432                        "avsar: Firmware not available\n"); 
     433                device_unregister(&avsar); 
     434                return -1; 
     435        } 
     436        device_unregister(&avsar); 
     437        if(fw_entry->size > 0x5ffff) { 
     438                        printk(KERN_ERR 
     439                        "avsar: Firmware too big (%d bytes)\n", fw_entry->size); 
     440                        release_firmware(fw_entry); 
     441                        return -1; 
     442                } 
     443        memcpy(ptr, fw_entry->data, fw_entry->size); 
     444        release_firmware(fw_entry); 
     445        return fw_entry->size; 
     446} 
     447 
     448unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength) 
     449{ 
     450        const struct firmware *fw_entry; 
     451 
     452        printk("requesting firmware image \"ar0700xx.bin\"\n"); 
     453        if(device_register(&avsar) < 0) { 
     454                printk(KERN_ERR 
     455                        "avsar: device_register fails\n"); 
     456                return -1; 
     457        } 
     458 
     459        if(request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { 
     460                printk(KERN_ERR 
     461                        "avsar: Firmware not available\n"); 
     462                device_unregister(&avsar); 
     463                return -1; 
     464        } 
     465        device_unregister(&avsar); 
     466        if(fw_entry->size > secLength) { 
     467                printk(KERN_ERR 
     468                        "avsar: Firmware too big (%d bytes)\n", fw_entry->size); 
     469                release_firmware(fw_entry); 
     470                return -1; 
     471        } 
     472        memcpy(ptr + secOffset, fw_entry->data, secLength); 
     473        release_firmware(fw_entry); 
     474        return fw_entry->size; 
    528475} 
    529476 
    530477int shim_osLoadDebugFWImage(unsigned char *ptr) 
     
    33673314   */ 
    33683315  if(write) 
    33693316    { 
    3370     ret = proc_dostring(ctl, write, filp, buffer, lenp); 
     3317    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); 
    33713318 
    33723319    switch (ctl->ctl_name) 
    33733320      { 
     
    34533400  else 
    34543401    { 
    34553402    len += sprintf(info+len, mod_req); 
    3456     ret = proc_dostring(ctl, write, filp, buffer, lenp); 
     3403    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); 
    34573404    } 
    34583405  return ret; 
    34593406} 
     
    34833430  if (initialized == 1) 
    34843431    return; 
    34853432 
    3486   dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1); 
    3487   dslmod_root_table->child->de->owner = THIS_MODULE; 
     3433  dslmod_sysctl_header = register_sysctl_table(dslmod_root_table); 
    34883434 
    34893435  /* 
    34903436   * set the defaults 
  • sangam_atm-07.01.00.10

    diff -urN sangam_atm-07.01.00.10.orig/tn7sar.c sangam_atm-07.01.00.10/tn7sar.c
    old new  
    4242 * UR8_MERGE_END CQ10700 
    4343 *******************************************************************************/ 
    4444 
    45 #include <linux/config.h> 
    4645#include <linux/kernel.h> 
    4746#include <linux/module.h> 
    4847#include <linux/init.h> 
     
    5150#include <linux/spinlock.h> 
    5251#include <linux/smp_lock.h> 
    5352#include <asm/io.h> 
    54 #include <asm/mips-boards/prom.h> 
     53#include <asm/ar7/ar7.h> 
    5554#include <linux/proc_fs.h> 
    5655#include <linux/string.h> 
    5756#include <linux/ctype.h>