source: trunk/package/ar7-atm/patches-D7.05.01.00/100-compile_fix.patch @ 20039

Last change on this file since 20039 was 20039, checked in by florian, 6 years ago

[ar7] add support for new ar7-atm version D7.05.00.00 (#6515)

  • Property svn:eol-style set to native
File size: 22.4 KB
  • sangam_atm-D7.05.01.00

    old new  
    360360           { 
    361361            /* malloc failed, add this RCB to Needs Buffer List */ 
    362362            TempRcb->FragCount = 1;                                             /*MJH+030417*/ 
    363             (HAL_RCB *)TempRcb->Eop = TempRcb;                                  /* GSG +030430 */ 
     363            TempRcb->Eop = TempRcb;                                             /* GSG +030430 */ 
    364364 
    365365            if(HalDev->NeedsCount < MAX_NEEDS)                                  /* +MJH 030410 */ 
    366366              {                                                                 /* +MJH 030410 */ 
  • sangam_atm-D7.05.01.00

    old new  
    273273*  09/15/07  CPH    CQ11466  Added EFM support 
    274274*  09/27/07  EYin   CQ11929: Added NFEC/INP/Lp/Rp reporting for only ADSL2/2+ mode. 
    275275******************************************************************************/ 
    276 #include <dev_host_interface.h> 
    277 #include <dsl_hal_register.h> 
    278 #include <dsl_hal_support.h> 
     276#include "dev_host_interface.h" 
     277#include "dsl_hal_register.h" 
     278#include "dsl_hal_support.h" 
    279279 
    280280#ifndef NO_ADV_STATS 
    281 #include <dsl_hal_logtable.h> 
     281#include "dsl_hal_logtable.h" 
    282282#endif 
    283283 
    284 #include <dsl_hal_version.h> 
     284#include "dsl_hal_version.h" 
    285285 
    286286//  UR8_MERGE_START CQ11054   Jack Zhang 
    287287static unsigned int highprecision_selected = 0;  //By default we use low precision for backward compt. 
  • sangam_atm-D7.05.01.00

    old new  
    142142*  UR8_MERGE_START_END CQ11922 Tim 
    143143*    04Sep07     0.14.00            Tim    CQ11922: Added support for new scratchram for INP NDR tables 
    144144*******************************************************************************/ 
    145 #include <dev_host_interface.h> 
    146 #include <dsl_hal_register.h> 
    147 #include <dsl_hal_support.h> 
     145#include "dev_host_interface.h" 
     146#include "dsl_hal_register.h" 
     147#include "dsl_hal_support.h" 
    148148 
    149149#define NUM_READ_RETRIES 3 
    150150static unsigned int dslhal_support_adsl2ByteSwap32(unsigned int in32Bits); 
  • sangam_atm-D7.05.01.00

    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-D7.05.01.00

    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-D7.05.01.00

    old new  
    6666 *    09/18/07 CPH    CQ11466  Added EFM Support 
    6767*********************************************************************************************/ 
    6868 
    69 #include <linux/config.h> 
    7069#include <linux/kernel.h> 
    7170#include <linux/module.h> 
    7271#include <linux/init.h> 
     
    7473#include <linux/delay.h> 
    7574#include <linux/spinlock.h> 
    7675#include <linux/smp_lock.h> 
    77 #include <asm/io.h> 
    78 #include <asm/mips-boards/prom.h> 
    7976#include <linux/proc_fs.h> 
    8077#include <linux/string.h> 
    8178#include <linux/ctype.h> 
     79 
     80#include <asm/io.h> 
     81#include <asm/ar7/ar7.h> 
     82#include <asm/ar7/prom.h> 
     83 
    8284#include "dsl_hal_api.h" 
    8385#ifdef AR7_EFM 
    8486#include "tn7efm.h" 
     
    9092#include "dsl_hal_register.h" 
    9193 
    9294#ifdef MODULE 
     95MODULE_LICENSE("GPL"); 
    9396MODULE_DESCRIPTION ("Tnetd73xx ATM Device Driver"); 
    9497MODULE_AUTHOR ("Zhicheng Tang"); 
    9598#endif 
     
    108111 
    109112/*end of externs */ 
    110113 
    111 #ifndef TI_STATIC_ALLOCATIONS 
    112 #define TI_STATIC_ALLOCATIONS 
    113 #endif 
     114//#ifndef TI_STATIC_ALLOCATIONS 
     115//#define TI_STATIC_ALLOCATIONS 
     116//#endif 
    114117 
    115118#define tn7atm_kfree_skb(x)     dev_kfree_skb(x) 
    116119 
     
    135138/* prototypes */ 
    136139static int tn7atm_set_can_support_adsl2 (int can); 
    137140 
    138 static int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci); 
     141static int tn7atm_open (struct atm_vcc *vcc); 
    139142 
    140143void tn7atm_close (struct atm_vcc *vcc); 
    141144 
     
    298301        getsockopt:     NULL, 
    299302        setsockopt:     NULL, 
    300303        send:           tn7atm_send, 
    301         sg_send:        NULL, 
    302304        phy_put:        NULL, 
    303305        phy_get:        NULL, 
    304306        change_qos:     tn7atm_change_qos, 
    305307}; 
    306308 
    307 const char drv_proc_root_folder[] = "avalanche/"; 
     309const char drv_proc_root_folder[] = "avalanche"; 
    308310static struct proc_dir_entry *root_proc_dir_entry = NULL; 
    309311#define DRV_PROC_MODE 0644 
    310312static int proc_root_already_exists = TRUE; 
     
    626628 
    627629/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    628630 * 
    629  *  Function: int tn7atm_walk_vccs(struct atm_dev *dev, short *vcc, int *vci) 
    630  * 
    631  *  Description: retrieve VPI/VCI for connection 
    632  * 
    633  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ 
    634 static int tn7atm_walk_vccs (struct atm_vcc *vcc, short *vpi, int *vci) 
    635 { 
    636   struct atm_vcc *walk; 
    637  
    638   /* 
    639    * find a free VPI 
    640    */ 
    641   if (*vpi == ATM_VPI_ANY) 
    642   { 
    643  
    644     for (*vpi = 0, walk = vcc->dev->vccs; walk; walk = walk->next) 
    645     { 
    646  
    647       if ((walk->vci == *vci) && (walk->vpi == *vpi)) 
    648       { 
    649         (*vpi)++; 
    650         walk = vcc->dev->vccs; 
    651       } 
    652     } 
    653   } 
    654  
    655   /* 
    656    * find a free VCI 
    657    */ 
    658   if (*vci == ATM_VCI_ANY) 
    659   { 
    660  
    661     for (*vci = ATM_NOT_RSV_VCI, walk = vcc->dev->vccs; walk; 
    662          walk = walk->next) 
    663     { 
    664  
    665       if ((walk->vpi = *vpi) && (walk->vci == *vci)) 
    666       { 
    667         *vci = walk->vci + 1; 
    668         walk = vcc->dev->vccs; 
    669       } 
    670     } 
    671   } 
    672  
    673   return 0; 
    674 } 
    675  
    676  
    677 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    678  * 
    679631 *  Function: int tn7atm_sar_irq(void) 
    680632 * 
    681633 *  Description: tnetd73xx SAR interrupt. 
     
    766718 
    767719  priv->sar_irq = LNXINTNUM (ATM_SAR_INT);      /* Interrupt line # */ 
    768720 
    769   if (request_irq (priv->sar_irq, tn7atm_sar_irq, SA_INTERRUPT, "SAR ", dev)) 
     721  if (request_irq (priv->sar_irq, tn7atm_sar_irq, IRQF_DISABLED, "SAR ", dev)) 
    770722    printk ("Could not register tn7atm_sar_irq\n"); 
    771723 
    772724  /* 
     
    777729  { 
    778730    def_sar_inter_pace = os_atoi (ptr); 
    779731  } 
    780   avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, 
    781                             def_sar_inter_pace); 
     732  /* avalanche_request_pacing (priv->sar_irq, ATM_SAR_INT_PACING_BLOCK_NUM, 
     733                            def_sar_inter_pace); */ 
    782734 
    783735 
    784736#ifdef AR7_EFM 
     
    790742   * Reigster Receive interrupt A 
    791743   */ 
    792744  priv->dsl_irq = LNXINTNUM (ATM_DSL_INT);      /* Interrupt line # */ 
    793   if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, SA_INTERRUPT, "DSL ", dev)) 
     745  if (request_irq (priv->dsl_irq, tn7atm_dsl_irq, IRQF_DISABLED, "DSL ", dev)) 
    794746    printk ("Could not register tn7atm_dsl_irq\n"); 
    795747 
    796748/***** VRB Tasklet Mode ****/ 
     
    958910#define ATM_VBR_RT     5 
    959911#endif 
    960912 
    961 int tn7atm_open (struct atm_vcc *vcc, short vpi, int vci) 
     913int tn7atm_open (struct atm_vcc *vcc) 
    962914{ 
    963915  tn7atm_activate_vc_parm_t tn7atm_activate_vc_parm; 
    964916  int rc; 
    965917  //int flags; 
     918  tn7atm_activate_vc_parm.pcr = 0x20000; 
     919  tn7atm_activate_vc_parm.scr = 0x20000; 
     920  tn7atm_activate_vc_parm.mbs = 0x20000; 
     921  tn7atm_activate_vc_parm.cdvt = 10000; 
    966922 
    967923  dgprintf(1, "tn7atm_open()\n"); 
    968924 
     
    974930    return -1; 
    975931  } 
    976932 
    977   MOD_INC_USE_COUNT; 
     933//  MOD_INC_USE_COUNT; 
    978934 
    979   /* find a free VPI/VCI */ 
    980   tn7atm_walk_vccs(vcc, &vpi, &vci); 
    981  
    982   vcc->vpi = vpi; 
    983   vcc->vci = vci; 
    984  
    985   if ((vci == ATM_VCI_UNSPEC) || (vpi == ATM_VCI_UNSPEC)) 
     935  if ((vcc->vci == ATM_VCI_UNSPEC) || (vcc->vpi == ATM_VCI_UNSPEC)) 
    986936  { 
    987     MOD_DEC_USE_COUNT; 
     937//    MOD_DEC_USE_COUNT; 
    988938    return -EBUSY; 
    989939  } 
    990940 
    991   tn7atm_activate_vc_parm.vpi = vpi; 
    992   tn7atm_activate_vc_parm.vci = vci; 
     941  tn7atm_activate_vc_parm.vpi = vcc->vpi; 
     942  tn7atm_activate_vc_parm.vci = vcc->vci; 
    993943 
    994   if ((vpi == CLEAR_EOC_VPI) && (vci == CLEAR_EOC_VCI)) 
     944  if ((vcc->vpi == CLEAR_EOC_VPI) && (vcc->vci == CLEAR_EOC_VCI)) 
    995945  { 
    996946    /* always use (max_dma_chan+1) for clear eoc */ 
    997947    tn7atm_activate_vc_parm.chan = EOC_DMA_CHAN; 
     
    999949    /* check to see whether clear eoc is opened or not */ 
    1000950    if (tn7atm_activate_vc_parm.priv->lut[tn7atm_activate_vc_parm.chan].inuse) 
    1001951    { 
    1002       MOD_DEC_USE_COUNT; 
     952//      MOD_DEC_USE_COUNT; 
    1003953      printk("tn7atm_open: Clear EOC channel (dmachan=%d) already in use.\n", tn7atm_activate_vc_parm.chan); 
    1004954      return -EBUSY; 
    1005955    } 
     
    1008958    if (rc) 
    1009959    { 
    1010960      printk("tn7atm_open: failed to setup clear_eoc\n"); 
    1011       MOD_DEC_USE_COUNT; 
     961//      MOD_DEC_USE_COUNT; 
    1012962      return -EBUSY; 
    1013963    } 
    1014964    tn7atm_set_lut(tn7atm_activate_vc_parm.priv,vcc, tn7atm_activate_vc_parm.chan); 
     
    1017967  } 
    1018968  else  /* PVC channel setup */ 
    1019969  { 
    1020     if ((vpi==REMOTE_MGMT_VPI) && (vci==REMOTE_MGMT_VCI)) 
     970    if ((vcc->vpi==REMOTE_MGMT_VPI) && (vcc->vci==REMOTE_MGMT_VCI)) 
    1021971    { 
    1022972      tn7atm_activate_vc_parm.chan = 14;   /* always use chan 14 for MII PVC-base romote mgmt */ 
    1023973    } 
    1024974    else 
    1025975    { 
    1026        rc = tn7atm_lut_find(vpi, vci); 
     976       rc = tn7atm_lut_find(vcc->vpi, vcc->vci); 
    1027977      /* check to see whether PVC is opened or not */ 
    1028978      if(ATM_NO_DMA_CHAN != rc) 
    1029979      { 
    1030         MOD_DEC_USE_COUNT; 
     980//        MOD_DEC_USE_COUNT; 
    1031981        printk("PVC already opened. dmachan = %d\n", rc); 
    1032982        return -EBUSY; 
    1033983      } 
     
    10591009       tn7atm_activate_vc_parm.priority = 2; 
    10601010       break; 
    10611011 
     1012#if 0 
    10621013     case ATM_VBR: /* Variable Bit Rate-Non RealTime*/ 
    10631014       tn7atm_activate_vc_parm.qos = 1; 
    10641015       tn7atm_activate_vc_parm.priority = 1; 
     
    10801031           tn7atm_activate_vc_parm.mbs = vcc->qos.txtp.max_pcr; 
    10811032       tn7atm_activate_vc_parm.cdvt = vcc->qos.txtp.max_cdv; 
    10821033       break; 
     1034#endif 
    10831035 
    10841036     default: 
    10851037         tn7atm_activate_vc_parm.qos = 2; 
     
    11071059   if (rc < 0) 
    11081060   { 
    11091061      printk("failed to activate hw channel\n"); 
    1110       MOD_DEC_USE_COUNT; 
     1062//      MOD_DEC_USE_COUNT; 
    11111063      tn7atm_lut_clear(vcc, tn7atm_activate_vc_parm.chan); 
    11121064      //spin_unlock_irqrestore(&chan_init_lock, flags); 
    11131065      return -EBUSY; 
     
    11971149  tn7atm_lut_clear (vcc, dmachan); 
    11981150  //spin_unlock_irqrestore (&closeLock, closeFlag); 
    11991151 
    1200   MOD_DEC_USE_COUNT; 
     1152//  MOD_DEC_USE_COUNT; 
    12011153 
    12021154  dgprintf (1, "Leave tn7atm_close\n"); 
    12031155} 
     
    16301582                                 * firewall is on */ 
    16311583 
    16321584  dgprintf (3, "pushing the skb...\n"); 
    1633  
    1634   skb->stamp = vcc->timestamp = xtime; 
     1585  __net_timestamp(skb); 
    16351586 
    16361587  xdump ((unsigned char *) skb->data, skb->len, 5); 
    16371588 
     
    18541805 
    18551806  kfree (dev->dev_data); 
    18561807 
    1857   // atm_dev_deregister (dev); 
    1858   shutdown_atm_dev (dev); 
     1808  atm_dev_deregister (dev); 
    18591809 
    18601810  /* 
    18611811   * remove proc entries 
     
    20862036   * Set up proc entry for atm stats 
    20872037   */ 
    20882038 
    2089   if (tn7atm_xlate_proc_name 
    2090       (drv_proc_root_folder, &root_proc_dir_entry, &residual)) 
    2091   { 
    20922039    printk ("Creating new root folder %s in the proc for the driver stats \n", 
    20932040            drv_proc_root_folder); 
    20942041    root_proc_dir_entry = proc_mkdir (drv_proc_root_folder, NULL); 
     
    20982045      return -ENOMEM; 
    20992046    } 
    21002047    proc_root_already_exists = FALSE; 
    2101   } 
    21022048 
    21032049 
    21042050  /* 
     
    27312677    return count; 
    27322678} 
    27332679 
    2734 #ifdef MODULE 
    27352680module_init (tn7atm_detect); 
    27362681module_exit (tn7atm_exit); 
    2737 #endif /* MODULE */ 
  • sangam_atm-D7.05.01.00

    old new  
    2020//#include  "mips_support.h" 
    2121#include  <linux/list.h> 
    2222 
    23 #include <linux/config.h> 
     23#define MIPS_EXCEPTION_OFFSET 8 
     24#define LNXINTNUM(x)((x) + MIPS_EXCEPTION_OFFSET) 
    2425 
    2526#ifdef CONFIG_MODVERSIONS 
    2627#include <linux/modversions.h> 
  • sangam_atm-D7.05.01.00

    old new  
    102102*  UR8_MERGE_END   CQ11813 
    103103*  09/18/07 CPH   CQ11466: Added EFM support. 
    104104 *********************************************************************************************/ 
    105 #include <linux/config.h> 
    106105#include <linux/kernel.h> 
    107106#include <linux/module.h> 
    108107#include <linux/init.h> 
     
    110109#include <linux/delay.h> 
    111110#include <linux/spinlock.h> 
    112111#include <linux/smp_lock.h> 
    113 #include <asm/io.h> 
    114 #include <asm/mips-boards/prom.h> 
    115112#include <linux/proc_fs.h> 
    116113#include <linux/string.h> 
    117114#include <linux/ctype.h> 
     
    119116#include <linux/timer.h> 
    120117#include <linux/vmalloc.h> 
    121118#include <linux/file.h> 
     119#include <linux/firmware.h> 
     120 
     121#include <asm/io.h> 
     122#include <asm/ar7/ar7.h> 
     123#include <asm/ar7/prom.h> 
     124 
    122125/* Modules specific header files */ 
    123126#ifdef AR7_EFM 
    124127#include "tn7efm.h" 
     
    185188static struct led_funcs ledreg[2]; 
    186189#endif 
    187190 
    188 #define DEV_DSLMOD       1 
     191#define DEV_DSLMOD       CTL_UNNUMBERED 
    189192#define MAX_STR_SIZE     256 
    190193#define DSL_MOD_SIZE     256 
    191194 
     
    316319static volatile int bshutdown; 
    317320static char info[MAX_STR_SIZE]; 
    318321/* Used for DSL Polling enable */ 
    319 static DECLARE_MUTEX_LOCKED (adsl_sem_overlay); 
     322static struct semaphore adsl_sem_overlay; 
    320323 
    321324//kthread_t overlay_thread; 
    322325/* end of module wide declars */ 
     
    369372  return val; 
    370373} 
    371374 
     375int avalanche_request_intr_pacing(int irq_nr, unsigned int blk_num, 
     376                            unsigned int pace_value) 
     377{ 
     378        printk("avalanche_request_pacing(%d, %u, %u); // not implemented\n", irq_nr, blk_num, pace_value); 
     379        return 0; 
     380} 
     381 
     382 
    372383int os_atoi(const char *pStr) 
    373384{ 
    374385  int MulNeg = (*pStr == '-' ? -1 : 1); 
     
    405416#endif 
    406417} 
    407418 
    408 int strcmp(const char *s1, const char *s2) 
    409 { 
    410  
    411   int size = strlen(s1); 
    412  
    413   return(strncmp(s1, s2, size)); 
    414 } 
    415  
    416 int strncmp(const char *s1, const char *s2, size_t size) 
    417 { 
    418   int i = 0; 
    419   int max_size = (int)size; 
    420  
    421   while((s1[i] != 0) && i < max_size) 
    422   { 
    423     if(s2[i] == 0) 
    424     { 
    425       return -1; 
    426     } 
    427     if(s1[i] != s2[i]) 
    428     { 
    429        return 1; 
    430     } 
    431     i++; 
    432   } 
    433   if(s2[i] != 0) 
    434   { 
    435     return 1; 
    436   } 
    437  
    438   return 0; 
    439 } 
    440  
    441419// * UR8_MERGE_START CQ10640   Jack Zhang 
    442420int tn7dsl_dump_dsp_memory(char *input_str) //cph99 
    443421  { 
     
    487465  return CpuFrequency; 
    488466} 
    489467 
    490 int shim_osLoadFWImage(unsigned char *ptr) 
     468static void avsar_release(struct device *dev) 
    491469{ 
    492   unsigned int bytesRead; 
    493   mm_segment_t  oldfs; 
    494   static struct file *filp; 
    495   unsigned int imageLength=0x5ffff; 
    496  
    497 #ifdef AR7_EFM 
    498   int dp_alt=0; 
    499   char *ptr1=NULL; 
    500 #ifdef EFM_DEBUG   
    501   char *ptr2=NULL; 
    502   char *ptr3=NULL; 
    503 #endif     
    504  
    505   if ((ptr1 = prom_getenv("DSL_DP_ALT")) != NULL) 
    506   { 
    507     dp_alt=os_atoi(ptr1); 
    508     if (dp_alt==1) 
    509     { 
    510       filp = filp_open(DSP_DEBUG_FIRMWARE_PATH,00,O_RDONLY); 
    511       if (!IS_ERR(filp)) 
    512       { 
    513           strcpy (DSP_FIRMWARE_PATH, DSP_DEBUG_FIRMWARE_PATH); 
    514       } 
    515     } 
    516 #ifdef EFM_DEBUG     
    517     else if (dp_alt==2) 
    518     { 
    519       if ((ptr2 = prom_getenv("DSL_DP")) != NULL) 
    520       { 
    521         if (!strncmp(ptr2, "DSL_DP", 6)) 
    522         { // indirect naming 
    523           if ((ptr3 = prom_getenv(ptr2)) != NULL) 
    524           filp = filp_open(ptr3,00,O_RDONLY); 
    525           ptr2 = ptr3; // redirect ptr2 to ptr3 
    526         } 
    527  
    528         filp = filp_open(ptr2,00,O_RDONLY); 
    529         if (!IS_ERR(filp)) 
    530         { 
    531           strcpy (DSP_FIRMWARE_PATH, ptr2); 
    532         } 
    533       } 
    534     } 
    535     printk("dp_path=%s\n", DSP_FIRMWARE_PATH); 
    536 #endif     
    537   } 
    538 #endif 
    539  
    540   dgprintf(4, "tn7dsl_read_dsp()\n"); 
    541  
    542   dgprintf(4,"open file %s\n", DSP_FIRMWARE_PATH); 
    543  
    544   filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); 
    545   if(IS_ERR(filp)) 
    546   { 
    547     printk("Failed: Could not open DSP binary file\n"); 
    548           return -1; 
    549   } 
    550  
    551   if (filp->f_dentry != NULL) 
    552   { 
    553     if (filp->f_dentry->d_inode != NULL) 
    554     { 
    555       printk ("DSP binary filesize = %d bytes\n", 
    556               (int) filp->f_dentry->d_inode->i_size); 
    557       imageLength = (unsigned int)filp->f_dentry->d_inode->i_size + 0x200; 
    558     } 
    559   } 
    560  
    561   if (filp->f_op->read==NULL) 
    562           return -1;  /* File(system) doesn't allow reads */ 
    563  
    564   /* 
    565    * Disable parameter checking 
    566    */ 
    567   oldfs = get_fs(); 
    568   set_fs(KERNEL_DS); 
    569  
    570   /* 
    571    * Now read bytes from postion "StartPos" 
    572    */ 
    573   filp->f_pos = 0; 
    574  
    575   bytesRead = filp->f_op->read(filp,ptr,imageLength,&filp->f_pos); 
    576  
    577   dgprintf(4,"file length = %d\n", bytesRead); 
    578  
    579   set_fs(oldfs); 
    580  
    581   /* 
    582    * Close the file 
    583    */ 
    584   fput(filp); 
    585  
    586   return bytesRead; 
     470        printk(KERN_DEBUG "avsar firmware released\n"); 
    587471} 
    588472 
     473static struct device avsar = { 
     474        .bus_id    = "vlynq", 
     475        .release   = avsar_release, 
     476}; 
    589477 
    590 unsigned int shim_read_overlay_page (void *ptr, unsigned int secOffset, 
    591                                      unsigned int secLength) 
     478int shim_osLoadFWImage(unsigned char *ptr) 
    592479{ 
    593   unsigned int bytesRead; 
    594   mm_segment_t  oldfs; 
    595   struct file *filp; 
    596  
    597   dgprintf(4,"shim_read_overlay_page\n"); 
    598   //dgprintf(4,"sec offset=%d, sec length =%d\n", secOffset, secLength); 
     480        const struct firmware *fw_entry; 
     481        size_t size; 
    599482 
    600   filp=filp_open(DSP_FIRMWARE_PATH,00,O_RDONLY); 
    601   if(filp ==NULL) 
    602   { 
    603     printk("Failed: Could not open DSP binary file\n"); 
    604           return -1; 
    605   } 
    606  
    607   if (filp->f_op->read==NULL) 
    608           return -1;  /* File(system) doesn't allow reads */ 
    609  
    610   /* 
    611    * Now read bytes from postion "StartPos" 
    612    */ 
     483        printk("requesting firmware image \"ar0700xx.bin\"\n"); 
     484        if(device_register(&avsar) < 0) { 
     485                printk(KERN_ERR 
     486                        "avsar: device_register fails\n"); 
     487                return -1; 
     488        } 
     489 
     490        if (request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { 
     491                printk(KERN_ERR 
     492                        "avsar: Firmware not available\n"); 
     493                device_unregister(&avsar); 
     494                return -1; 
     495        } 
     496        size = fw_entry->size; 
     497        device_unregister(&avsar); 
     498        if (size > 0x6ffff) { 
     499                printk(KERN_ERR 
     500                        "avsar: Firmware too big (%d bytes)\n", size); 
     501                        release_firmware(fw_entry); 
     502                        return -1; 
     503        } 
     504        memcpy(ptr, fw_entry->data, size); 
     505        release_firmware(fw_entry); 
     506        return size; 
     507} 
     508 
     509unsigned int shim_read_overlay_page(void *ptr, unsigned int secOffset, unsigned int secLength) 
     510{ 
     511        const struct firmware *fw_entry; 
     512 
     513        printk("requesting firmware image \"ar0700xx.bin\"\n"); 
     514        if (device_register(&avsar) < 0) { 
     515                printk(KERN_ERR 
     516                        "avsar: device_register fails\n"); 
     517                return -1; 
     518        } 
     519 
     520        if (request_firmware(&fw_entry, "ar0700xx.bin", &avsar)) { 
     521                printk(KERN_ERR 
     522                        "avsar: Firmware not available\n"); 
     523                device_unregister(&avsar); 
     524                return -1; 
     525        } 
     526 
     527        device_unregister(&avsar); 
     528        if (fw_entry->size > secLength) { 
     529                printk(KERN_ERR 
     530                        "avsar: Firmware too big (%d bytes)\n", fw_entry->size); 
     531                release_firmware(fw_entry); 
     532                return -1; 
     533        } 
     534        memcpy(ptr + secOffset, fw_entry->data, secLength); 
     535        release_firmware(fw_entry); 
     536        return secLength; 
     537} 
    613538 
    614   if(filp->f_op->llseek) 
    615     filp->f_op->llseek(filp,secOffset, 0); 
    616   oldfs = get_fs(); 
    617   set_fs(KERNEL_DS); 
    618   filp->f_pos = secOffset; 
    619   bytesRead = filp->f_op->read(filp,ptr,secLength,&filp->f_pos); 
    620539 
    621   set_fs(oldfs); 
    622   /* 
    623    * Close the file 
    624    */ 
    625   fput(filp); 
    626   return bytesRead; 
    627 } 
    628540 
    629541int shim_osLoadDebugFWImage(unsigned char *ptr) 
    630542{ 
     
    32873199  int high_precision_selected = 0; 
    32883200//  UR8_MERGE_END   CQ11054* 
    32893201 
     3202  sema_init(&adsl_sem_overlay, 0); 
    32903203  /* 
    32913204   * start dsl 
    32923205   */ 
     
    36653578   */ 
    36663579  if(write) 
    36673580    { 
    3668     ret = proc_dostring(ctl, write, filp, buffer, lenp); 
     3581    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); 
    36693582 
    36703583    switch (ctl->ctl_name) 
    36713584      { 
     
    37513664  else 
    37523665    { 
    37533666    len += sprintf(info+len, mod_req); 
    3754     ret = proc_dostring(ctl, write, filp, buffer, lenp); 
     3667    ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); 
    37553668    } 
    37563669  return ret; 
    37573670} 
    37583671 
    37593672 
    37603673ctl_table dslmod_table[] = { 
    3761   {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, &dslmod_sysctl} 
     3674  {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} 
    37623675  , 
    37633676  {0} 
    37643677  }; 
     
    37813694  if (initialized == 1) 
    37823695    return; 
    37833696 
    3784   dslmod_sysctl_header = register_sysctl_table(dslmod_root_table, 1); 
    3785   dslmod_root_table->child->de->owner = THIS_MODULE; 
     3697  dslmod_sysctl_header = register_sysctl_table(dslmod_root_table); 
    37863698 
    37873699  /* 
    37883700   * set the defaults 
  • sangam_atm-D7.05.01.00

    old new  
    4343 * 09/18/07 CPH   CQ11466: Added EFM support. 
    4444 *******************************************************************************/ 
    4545 
    46 #include <linux/config.h> 
    4746#include <linux/kernel.h> 
    4847#include <linux/module.h> 
    4948#include <linux/init.h> 
     
    5150#include <linux/delay.h> 
    5251#include <linux/spinlock.h> 
    5352#include <linux/smp_lock.h> 
    54 #include <asm/io.h> 
    55 #include <asm/mips-boards/prom.h> 
    5653#include <linux/proc_fs.h> 
    5754#include <linux/string.h> 
    5855#include <linux/ctype.h> 
    5956 
     57#include <asm/io.h> 
     58#include <asm/ar7/ar7.h> 
     59#include <asm/ar7/prom.h> 
    6060 
    6161#define _CPHAL_AAL5 
    6262#define _CPHAL_SAR 
Note: See TracBrowser for help on using the repository browser.