From: Jonas Gorski Date: Fri, 13 Oct 2017 09:32:31 +0000 (+0200) Subject: ar7-atm: drop LINUX_VERSION tests X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=889b21f95414dcff942cb5f72d764d876b68ace2;p=openwrt%2Fstaging%2Fsvanheule.git ar7-atm: drop LINUX_VERSION tests Minimum supported kernel is 3.18, so we don't need to test for anything older. In addition, the API hasn't changed since then, so we don't need to check for any kernel version at all. This helps to keeps the amount of changes more managable. Signed-off-by: Jonas Gorski --- diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch index 9f1f0fdae4..a970574fe5 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -109,6 +109,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -446,7 +447,9 @@ static void avsar_release(struct device +@@ -446,7 +446,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -455,6 +458,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -455,6 +454,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch index 6bd8f48760..6d72b00544 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -71,10 +71,16 @@ - #include - #include +@@ -73,8 +73,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #include "tn7atm.h" --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -112,8 +112,13 @@ - #include +@@ -111,8 +111,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #include "tn7atm.h" --- a/tn7sar.c +++ b/tn7sar.c -@@ -52,10 +52,16 @@ - #include - #include +@@ -54,8 +54,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch index 11487bf7a6..87a1fde1c1 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,39 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -203,7 +203,11 @@ led_reg_t ledreg[2]; +@@ -197,7 +197,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3431,9 +3435,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); + ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3517,14 +3528,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); + ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +42,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3532,7 +3558,16 @@ ctl_table dslmod_table[] = { +@@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch index e8668b6c5e..2007b497c2 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -1876,7 +1876,11 @@ static int __init tn7atm_register (Tn7At +@@ -1870,7 +1870,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -466,14 +466,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -453,13 +453,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch index be81ee1253..6026d30c60 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch @@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -277,25 +277,15 @@ static int tn7atm_change_qos (struct atm +@@ -271,25 +271,15 @@ static int tn7atm_change_qos (struct atm static int tn7atm_detect (void); static int tn7atm_init (struct atm_dev *dev); static int tn7atm_irq_request (struct atm_dev *dev); @@ -147,15 +147,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -415,63 +405,67 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -412,60 +402,59 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -250,7 +242,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1709,75 +1703,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1703,75 +1692,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -301,15 +293,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -353,11 +345,11 @@ Signed-off-by: Jonas Gorski + + seq_printf (m, "tx_irq: %02d", priv->sar_irq); + seq_printf (m, "rx_irq: %02d", priv->dsl_irq); - -- return len; ++ + return 0; +} -+ + +- return len; +static int tn7atm_proc_private_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_private, PDE_DATA(inode)); @@ -374,7 +366,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -1900,10 +1900,8 @@ static int __init tn7atm_register (Tn7At +@@ -1890,10 +1885,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -386,7 +378,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -1914,56 +1912,64 @@ static int tn7atm_proc_version (char *bu +@@ -1904,56 +1897,64 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; @@ -472,7 +464,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2012,24 +2018,7 @@ static int __init tn7atm_detect (void) +@@ -2002,24 +2003,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -498,7 +490,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2501,63 +2490,10 @@ static int tn7atm_set_can_support_adsl2 +@@ -2491,63 +2475,10 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -564,7 +556,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2591,5 +2527,19 @@ static int tn7atm_proc_qos_write(struct +@@ -2581,5 +2512,19 @@ static int tn7atm_proc_qos_write(struct return count; } @@ -586,17 +578,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -221,6 +221,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -349,7 +352,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -339,7 +339,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -605,7 +587,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -649,11 +652,9 @@ void shim_osCriticalExit(void) +@@ -635,11 +635,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -618,7 +600,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -674,95 +675,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -660,95 +658,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -791,7 +773,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -825,59 +859,48 @@ static char *pUnknown= "Unknown"; +@@ -811,59 +842,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -874,7 +856,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -886,66 +909,53 @@ static int proc_adv_stats_header(char* b +@@ -872,66 +892,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -963,7 +945,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -968,29 +978,24 @@ static int getDiagDisplayMode() +@@ -954,29 +961,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -998,7 +980,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1001,26 +1006,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -987,26 +989,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1041,7 +1023,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1030,12 +1043,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1016,12 +1026,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1056,7 +1038,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1046,26 +1057,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1032,26 +1040,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1100,7 +1082,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1075,12 +1095,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1061,12 +1078,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1115,7 +1097,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1091,283 +1109,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1077,283 +1092,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1256,7 +1238,9 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_cmsgs, PDE_DATA(inode)); +} -+ + +- int len = 0; +- int limit = count - 80; +struct file_operations tn7dsl_proc_dbg_cmsgs_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_cmsgs_open, @@ -1264,9 +1248,7 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; - -- int len = 0; -- int limit = count - 80; ++ + +int tn7dsl_proc_dbg_rmsgs1(struct seq_file *m, void *data) +{ @@ -1544,7 +1526,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1375,80 +1397,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1361,80 +1380,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1648,7 +1630,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1456,9 +1456,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1442,9 +1439,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1659,7 +1641,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1466,57 +1464,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1452,57 +1447,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1732,7 +1714,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1528,12 +1514,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1514,12 +1497,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1747,7 +1729,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1549,283 +1535,213 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1535,283 +1518,213 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2129,7 +2111,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1859,16 +1775,26 @@ int tn7dsl_proc_modem(char* buf, char ** +@@ -1845,16 +1758,26 @@ int tn7dsl_proc_modem(char* buf, char ** if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2163,7 +2145,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2133,11 +2059,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2119,11 +2042,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2176,7 +2158,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2146,62 +2069,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2132,62 +2052,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2279,7 +2261,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4440,14 +4350,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4407,14 +4314,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2295,7 +2277,7 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4528,197 +4434,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4495,197 +4398,185 @@ int tn7dsl_proc_train_mode_export (char } @@ -2574,7 +2556,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4727,39 +4621,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4694,39 +4585,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2679,7 +2661,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4767,64 +4711,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4734,64 +4675,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2760,7 +2742,7 @@ Signed-off-by: Jonas Gorski } -@@ -4832,19 +4760,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4799,19 +4724,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2800,15 +2782,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1401,44 +1401,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1395,44 +1395,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -2883,7 +2861,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1447,21 +1473,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1441,21 +1463,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -2908,7 +2886,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1474,26 +1498,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1468,26 +1488,16 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -2939,7 +2917,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1502,9 +1516,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1496,9 +1506,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch index e8bdab63da..4588782c4f 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -346,7 +346,7 @@ static void tn7dsl_chng_modulation(void* +@@ -333,7 +333,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); @@ -9,7 +9,7 @@ void *buffer, size_t * lenp); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3325,7 +3325,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3308,7 +3308,7 @@ unsigned int tn7dsl_get_memory(unsigned @@ -18,21 +18,21 @@ void *buffer, size_t *lenp) { char *ptr; -@@ -3451,7 +3451,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3423,7 +3423,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3469,7 +3469,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3437,7 +3437,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch index 97a26cb417..f26b7e221c 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -788,7 +788,7 @@ static int __init tn7atm_irq_request (st +@@ -777,7 +777,7 @@ static int __init tn7atm_irq_request (st * Register SAR interrupt */ priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -806,7 +806,7 @@ static int __init tn7atm_irq_request (st +@@ -795,7 +795,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch index 6692f40f6a..53767e45be 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -117,6 +117,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -492,7 +493,9 @@ static void avsar_release(struct device +@@ -492,7 +492,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -501,6 +504,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -501,6 +500,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch index feb6ea8605..69b433b2b9 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -76,10 +76,16 @@ - #include - #include +@@ -78,8 +78,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #ifdef AR7_EFM --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -120,8 +120,13 @@ - #include +@@ -119,8 +119,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #ifdef AR7_EFM --- a/tn7sar.c +++ b/tn7sar.c -@@ -53,10 +53,16 @@ - #include - #include +@@ -55,8 +55,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch index 52ebbc1529..23045bb7b2 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,39 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -215,7 +215,11 @@ led_reg_t ledreg[2]; +@@ -209,7 +209,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3615,9 +3619,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3605,9 +3605,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); + ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3701,14 +3712,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3691,14 +3691,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); + ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +42,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3716,7 +3742,16 @@ ctl_table dslmod_table[] = { +@@ -3706,7 +3713,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch index f6dba4be9f..75de5a33e7 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -2009,7 +2009,11 @@ static int __init tn7atm_register (Tn7At +@@ -2003,7 +2003,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -512,14 +512,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -499,13 +499,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch index 747869bf7c..1d3d7583be 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch @@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -265,11 +265,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB +@@ -259,11 +259,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB #ifdef AR7_EFM extern void tn7dsl_disable_alarm(void); @@ -140,7 +140,7 @@ Signed-off-by: Jonas Gorski extern unsigned int g_efm_proc_ctl; extern struct net_device *mydev_efm; extern Tn7AtmPrivate *mypriv; -@@ -305,31 +303,17 @@ extern int tn7efm_register (Tn7AtmPrivat +@@ -299,31 +297,17 @@ extern int tn7efm_register (Tn7AtmPrivat static int tn7atm_irq_request (struct atm_dev *dev); #endif @@ -177,15 +177,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -456,78 +440,83 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -453,75 +437,75 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -301,7 +293,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1811,76 +1800,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1805,76 +1789,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -353,15 +345,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -426,7 +418,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -2033,10 +2027,8 @@ static int __init tn7atm_register (Tn7At +@@ -2023,10 +2012,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -438,7 +430,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -2051,58 +2043,52 @@ static int tn7atm_proc_version (char *bu +@@ -2041,58 +2028,52 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; #ifdef AR7_EFM @@ -517,7 +509,7 @@ Signed-off-by: Jonas Gorski pdspV1, pdspV2, (priv->curr_TC_mode== TC_MODE_ATM) ? '*' : ' '); tn7sar_get_EFM_firmware_version (&pdspV1, &pdspV2); -@@ -2114,26 +2100,37 @@ static int tn7atm_proc_version (char *bu +@@ -2104,26 +2085,37 @@ static int tn7atm_proc_version (char *bu #endif str = "EFM"; @@ -531,16 +523,16 @@ Signed-off-by: Jonas Gorski tn7atm_get_chipsetId(chipsetID); - len += sprintf (buf + len, "Chipset ID: [%s]\n",chipsetID); + seq_printf (m, "Chipset ID: [%s]\n",chipsetID); -+ -+ return 0; -+} - return len; ++ return 0; + } + +static int tn7atm_proc_version_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_version, PDE_DATA(inode)); - } - ++} ++ +static struct file_operations tn7atm_proc_version_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_version_open, @@ -560,7 +552,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2214,24 +2211,7 @@ static int __init tn7atm_detect (void) +@@ -2204,24 +2196,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -586,7 +578,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2711,73 +2691,18 @@ static int tn7atm_set_can_support_adsl2 +@@ -2701,73 +2676,18 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -599,10 +591,10 @@ Signed-off-by: Jonas Gorski +static int tn7atm_proc_qos_read(struct seq_file *m, void *data) { - if (!de || !de->low_ino) +- return 0; +- if (de->namelen != len) + seq_printf (m, "\nEnableQoS = %d\n", EnableQoS); return 0; -- if (de->namelen != len) -- return 0; - return !strncmp (name, de->name, len); -} - @@ -665,7 +657,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2812,7 +2737,7 @@ static int tn7atm_proc_qos_write(struct +@@ -2802,7 +2722,7 @@ static int tn7atm_proc_qos_write(struct } // [KT] @@ -674,7 +666,7 @@ Signed-off-by: Jonas Gorski { char local_buf[10]; -@@ -2843,5 +2768,33 @@ int tn7atm_proc_turbodsl_write(struct fi +@@ -2833,5 +2753,33 @@ int tn7atm_proc_turbodsl_write(struct fi return count; } @@ -710,17 +702,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -233,6 +233,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -366,7 +369,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -356,7 +356,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -729,7 +711,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -698,11 +701,9 @@ void shim_osCriticalExit(void) +@@ -684,11 +684,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -742,7 +724,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -723,95 +724,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -709,95 +707,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -915,7 +897,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -874,59 +908,48 @@ static char *pUnknown= "Unknown"; +@@ -860,59 +891,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -975,15 +957,15 @@ Signed-off-by: Jonas Gorski printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len); - return len; + return 0; - } - --static int proc_adv_stats_header(char* buf, int limit) ++} ++ + +static int tn7dsl_proc_adv_stats_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_adv_stats, PDE_DATA(inode)); -+} -+ + } + +-static int proc_adv_stats_header(char* buf, int limit) +struct file_operations tn7dsl_proc_adv_stats_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_adv_stats_open, @@ -996,7 +978,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -935,66 +958,53 @@ static int proc_adv_stats_header(char* b +@@ -921,66 +941,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -1084,7 +1066,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -1017,29 +1027,24 @@ static int getDiagDisplayMode() +@@ -1003,29 +1010,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -1118,7 +1100,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1050,26 +1055,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -1036,26 +1038,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1161,7 +1143,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1079,12 +1092,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1065,12 +1075,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1176,7 +1158,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1095,26 +1106,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1081,26 +1089,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1220,7 +1202,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1124,12 +1144,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1110,12 +1127,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1235,7 +1217,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1140,283 +1158,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1126,283 +1141,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1455,9 +1437,7 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_rmsgs1, PDE_DATA(inode)); +} - -- int len = 0; -- int limit = count - 80; ++ +struct file_operations tn7dsl_proc_dbg_rmsgs1_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_rmsgs1_open, @@ -1465,7 +1445,9 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; -+ + +- int len = 0; +- int limit = count - 80; + +int tn7dsl_proc_dbg_rmsgs2(struct seq_file *m, void *data) +{ @@ -1636,12 +1618,12 @@ Signed-off-by: Jonas Gorski - return len; + return 0; - } ++} + +static int tn7dsl_proc_dbg_rmsgs4_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_dbg_rmsgs4, PDE_DATA(inode)); -+} + } + +struct file_operations tn7dsl_proc_dbg_rmsgs4_fops = { + .owner = THIS_MODULE, @@ -1664,7 +1646,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1424,80 +1446,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1410,80 +1429,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1768,7 +1750,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1505,9 +1505,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1491,9 +1488,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1779,7 +1761,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1515,59 +1513,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1501,59 +1496,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1851,7 +1833,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1581,12 +1565,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1567,12 +1548,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1866,7 +1848,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1602,294 +1586,223 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1588,294 +1569,223 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2259,7 +2241,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1923,22 +1836,31 @@ extern int tn7efm_get_currTCmode(void); +@@ -1909,22 +1819,31 @@ extern int tn7efm_get_currTCmode(void); if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2301,7 +2283,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2203,11 +2125,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2189,11 +2108,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2314,7 +2296,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2216,62 +2135,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2202,62 +2118,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2417,7 +2399,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4624,14 +4530,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4591,14 +4494,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2433,13 +2415,12 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4712,197 +4614,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4679,197 +4578,185 @@ int tn7dsl_proc_train_mode_export (char } - if(len <= count) -+ for (i = 0; (i < num_entries) ; i++) - { +- { - for (i = ctr; ((i < num_entries)&& (len <= count)) ; i++) - { - /* @@ -2453,21 +2434,22 @@ Signed-off-by: Jonas Gorski - else - break; - } -+ seq_printf(m, "%s\t\t\t%#x\n", -+ dsl_modes[i].mode_name, dsl_modes[i].mode_value); - } - +- } +- - /* - * Data was completely written - */ - if (i >= num_entries) -- { ++ for (i = 0; (i < num_entries) ; i++) + { - /* - * We are done with this - */ - *eof = 1; - ctr = 0; -- } ++ seq_printf(m, "%s\t\t\t%#x\n", ++ dsl_modes[i].mode_name, dsl_modes[i].mode_value); + } - else - { - /* @@ -2475,7 +2457,7 @@ Signed-off-by: Jonas Gorski - * terminate the buffer. - */ - *(cp + len) = '\0'; -- + - /* - * Save the value of the counter for the next read for the rest of the - * data. @@ -2712,7 +2694,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4911,39 +4801,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4878,39 +4765,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2817,7 +2799,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4951,64 +4891,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4918,64 +4855,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2897,7 +2879,7 @@ Signed-off-by: Jonas Gorski } -@@ -5016,19 +4940,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4983,19 +4904,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2937,15 +2919,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1553,44 +1553,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1547,44 +1547,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -3020,7 +2998,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1599,21 +1625,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1593,21 +1615,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -3045,7 +3023,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1626,26 +1650,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1620,26 +1640,16 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -3076,7 +3054,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1654,9 +1668,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1648,9 +1658,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch index a29bae80a4..43da567b5f 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -363,7 +363,7 @@ static void tn7dsl_chng_modulation(void* +@@ -350,7 +350,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); @@ -9,7 +9,7 @@ void *buffer, size_t * lenp); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3505,7 +3505,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3488,7 +3488,7 @@ unsigned int tn7dsl_get_memory(unsigned @@ -18,21 +18,21 @@ void *buffer, size_t *lenp) { char *ptr; -@@ -3631,7 +3631,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3603,7 +3603,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3649,7 +3649,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3617,7 +3617,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch index bc913a78a8..426d593191 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -856,7 +856,7 @@ static int __init tn7atm_irq_request (st +@@ -845,7 +845,7 @@ static int __init tn7atm_irq_request (st priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -880,7 +880,7 @@ static int __init tn7atm_irq_request (st +@@ -869,7 +869,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */