1 From 2826b9f6aa1ad2ac4c2846bbce10eb3378014555 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Thu, 26 Sep 2013 12:28:35 +0200
4 Subject: [PATCH 3/3] update proc code to fix compilation for 3.10
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
9 tn7atm.c | 330 ++++++--------
10 tn7dsl.c | 1447 ++++++++++++++++++++++++++++++--------------------------------
12 4 files changed, 922 insertions(+), 1009 deletions(-)
16 @@ -86,27 +86,26 @@ void * tn7atm_memcpy(void * dst, void co
18 void tn7dsl_exit(void);
19 int tn7dsl_init(void *priv);
20 -int tn7dsl_proc_eoc(char* buf, char **start, off_t offset, int count,int *eof, void *data);
21 -int tn7dsl_proc_stats(char* buf, char **start, off_t offset, int count,int *eof, void *data);
22 +extern struct file_operations tn7dsl_proc_eoc_fops;
23 +extern struct file_operations tn7dsl_proc_stats_fops;
25 //#define ADV_DIAG_STATS 1 //CQ10275 To enable Adv Stats
28 -int tn7dsl_proc_adv_stats(char* buf, char **start, off_t offset, int count,int *eof, void *data);
29 -int tn7dsl_proc_adv_stats1(char* buf, char **start, off_t offset, int count,int *eof, void *data);
30 -int tn7dsl_proc_adv_stats2(char* buf, char **start, off_t offset, int count,int *eof, void *data);
31 -int tn7dsl_proc_adv_stats3(char* buf, char **start, off_t offset, int count,int *eof, void *data);
32 +extern struct file_operations tn7dsl_proc_adv_stats_fops;
33 +extern struct file_operations tn7dsl_proc_adv1_stats_fops;
34 +extern struct file_operations tn7dsl_proc_adv2_stats_fops;
35 +extern struct file_operations tn7dsl_proc_adv3_stats_fops;
36 //UR8_MERGE_START CQ10682 Jack Zhang
37 -int tn7dsl_proc_dbg_cmsgs(char* buf, char **start, off_t offset, int count,int *eof, void *data);
38 -int tn7dsl_proc_dbg_rmsgs1(char* buf, char **start, off_t offset, int count,int *eof, void *data);
39 -int tn7dsl_proc_dbg_rmsgs2(char* buf, char **start, off_t offset, int count,int *eof, void *data);
40 -int tn7dsl_proc_dbg_rmsgs3(char* buf, char **start, off_t offset, int count,int *eof, void *data);
41 -int tn7dsl_proc_dbg_rmsgs4(char* buf, char **start, off_t offset, int count,int *eof, void *data);
42 +extern struct file_operations tn7dsl_proc_dbg_cmsgs_fops;
43 +extern struct file_operations tn7dsl_proc_dbg_cmsgs1_fops;
44 +extern struct file_operations tn7dsl_proc_dbg_cmsgs2_fops;
45 +extern struct file_operations tn7dsl_proc_dbg_cmsgs3_fops;
46 +extern struct file_operations tn7dsl_proc_dbg_cmsgs4_fops;
47 //UR8_MERGE_END CQ10682*
48 #endif //ADV_DIAG_STATS
50 -int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data);
51 -int tn7dsl_proc_modem(char* buf, char **start, off_t offset, int count,int *eof, void *data);
52 +extern struct file_operations tn7dsl_proc_modem_fops;
53 int tn7dsl_handle_interrupt(void);
55 void tn7dsl_dslmod_sysctl_register(void);
56 @@ -127,31 +126,31 @@ unsigned int tn7dsl_get_memory(unsigned
57 int os_atoi(const char *pStr);
58 int os_atoh(const char *pStr);
59 unsigned long os_atoul(const char *pStr);
60 -int tn7dsl_proc_snr0(char* buf, char **start, off_t offset, int count, int *eof, void *data);
61 -int tn7dsl_proc_snr1(char* buf, char **start, off_t offset, int count, int *eof, void *data);
62 -int tn7dsl_proc_snr2(char* buf, char **start, off_t offset, int count, int *eof, void *data);
63 -int tn7dsl_proc_bit_allocation(char* buf, char **start, off_t offset, int count, int *eof, void *data);
64 -int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data);
65 -int tn7dsl_proc_generic_read_result(char* buf, char **start, off_t offset, int count, int *eof, void *data);
66 -int tn7dsl_proc_train_mode_export(char* buf, char **start, off_t offset, int count,int *eof, void *data);
67 +extern struct file_operations tn7dsl_proc_snr0_fops;
68 +extern struct file_operations tn7dsl_proc_snr1_fops;
69 +extern struct file_operations tn7dsl_proc_snr2_fops;
70 +extern struct file_operations tn7dsl_proc_bit_allocation_fops;
71 +extern struct file_operations tn7dsl_proc_ds_noise_fops;
72 +extern struct file_operations tn7dsl_proc_generic_read_result_fops;
73 +extern struct file_operations tn7dsl_proc_train_mode_export_fops;
76 -int tn7dsl_proc_SNRpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data);
77 -int tn7dsl_proc_QLNpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data);
78 +extern struct file_operations tn7dsl_proc_SNRpsds_fops;
79 +extern struct file_operations tn7dsl_proc_QLNpsds_fops;
80 // * UR8_MERGE_START CQ10979 Jack Zhang
82 -//int tn7dsl_proc_HLINpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data);
83 -int tn7dsl_proc_HLINpsds1(char* buf, char **start, off_t offset, int count,int *eof, void *data);
84 -int tn7dsl_proc_HLINpsds2(char* buf, char **start, off_t offset, int count,int *eof, void *data);
85 -int tn7dsl_proc_HLINpsds3(char* buf, char **start, off_t offset, int count,int *eof, void *data);
86 -int tn7dsl_proc_HLINpsds4(char* buf, char **start, off_t offset, int count,int *eof, void *data);
87 +//extern struct file_operations tn7dsl_proc_HLINpsds_fops;
88 +extern struct file_operations tn7dsl_proc_HLINpsds1_fops;
89 +extern struct file_operations tn7dsl_proc_HLINpsds2_fops;
90 +extern struct file_operations tn7dsl_proc_HLINpsds3_fops;
91 +extern struct file_operations tn7dsl_proc_HLINpsds4_fops;
93 // * UR8_MERGE_END CQ10979*
94 // * UR8_MERGE_START CQ11057 Jack Zhang
97 -//int tn7dsl_proc_PMDus(char* buf, char **start, off_t offset, int count,int *eof, void *data);
98 -int tn7dsl_proc_PMDus(char* buf, char **start, off_t offset, int count,int *eof, void *data);
99 +//extern struct file_operations tn7dsl_proc_PMDus_fops;
100 +extern struct file_operations tn7dsl_proc_PMDus_fops;
102 // * UR8_MERGE_END CQ11057 *
104 @@ -168,9 +167,9 @@ void tn7sar_get_sar_version(Tn7AtmPrivat
105 int tn7sar_get_near_end_loopback_count(unsigned int *pF4count, unsigned int *pF5count);
106 int tn7sar_oam_generation(void *privContext, int chan, int type, int vpi, int vci, int timeout);
107 int tn7sar_get_stats(void *priv1);
108 -int tn7sar_proc_sar_stat(char* buf, char **start, off_t offset, int count,int *eof, void *data);
109 +extern struct file_operations tn7sar_proc_sar_stat_fops;
110 void tn7sar_get_sar_firmware_version(unsigned int *pdsp_version_ms, unsigned int *pdsp_version_ls);
111 -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data);
112 -int tn7sar_proc_pvc_table(char* buf, char **start, off_t offset, int count,int *eof, void *data);
113 +extern struct file_operations tn7sar_proc_oam_ping_fops;
114 +extern struct file_operations tn7sar_proc_pvc_table_fops;
115 int tn7sar_tx_flush(void *privContext, int chan, int queue, int skip);
119 @@ -277,25 +277,15 @@ static int tn7atm_change_qos (struct atm
120 static int tn7atm_detect (void);
121 static int tn7atm_init (struct atm_dev *dev);
122 static int tn7atm_irq_request (struct atm_dev *dev);
123 -static int tn7atm_proc_version (char *buf, char **start, off_t offset,
124 - int count, int *eof, void *data);
126 +static struct file_operations tn7atm_proc_version_fops;
127 static void tn7atm_exit (void);
128 -static int tn7atm_proc_channels (char *buf, char **start, off_t offset,
129 - int count, int *eof, void *data);
130 -static int tn7atm_proc_private (char *buf, char **start, off_t offset,
131 - int count, int *eof, void *data);
132 +static struct file_operations tn7atm_proc_channels_fops;
133 +static struct file_operations tn7atm_proc_private_fops;
134 inline static int tn7atm_queue_packet_to_sar (void *vcc1, void *skb1,
137 -static int tn7atm_xlate_proc_name (const char *name,
138 - struct proc_dir_entry **ret,
139 - const char **residual);
140 -static int tn7atm_proc_match (int len, const char *name,
141 - struct proc_dir_entry *de);
142 -static int tn7atm_proc_qos_read (char *buf, char **start, off_t offset,
143 - int count, int *eof, void *data);
144 -static int tn7atm_proc_qos_write (struct file *fp, const char *buf,
145 - unsigned long count, void *data);
146 +static struct file_operations tn7atm_proc_qos_fops;
148 //CT - Added function to return chipset Id
149 void tn7atm_get_chipsetId (char *pVerId);
150 @@ -415,63 +405,67 @@ const char drv_proc_root_folder[] = "ava
151 static struct proc_dir_entry *root_proc_dir_entry = NULL;
152 #define DRV_PROC_MODE 0644
153 static int proc_root_already_exists = TRUE;
155 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
156 +#define PDE_DATA(inode) PDE(inode)->data
161 const unsigned char name[32];
162 - int (*read_func) (char* , char **, off_t , int ,int *, void *);
163 - int (*write_func) (struct file *, const char * , unsigned long , void *);
164 + struct file_operations *fops;
167 - {"avsar_ver", tn7atm_proc_version, NULL},
168 - {"avsar_channels", tn7atm_proc_channels, NULL},
169 - {"avsar_sarhal_stats", tn7sar_proc_sar_stat, NULL},
170 - {"avsar_oam_ping", tn7sar_proc_oam_ping, NULL},
171 - {"avsar_pvc_table", tn7sar_proc_pvc_table, NULL},
172 - {"avsar_rxsnr0", tn7dsl_proc_snr0, NULL},
173 - {"avsar_rxsnr1", tn7dsl_proc_snr1, NULL},
174 - {"avsar_rxsnr2", tn7dsl_proc_snr2, NULL},
175 - {"clear_eoc_stats", tn7dsl_proc_eoc, NULL},
176 - {"avsar_bit_allocation_table", tn7dsl_proc_bit_allocation, NULL},
177 - {"avsar_dsl_modulation_schemes",tn7dsl_proc_train_mode_export, NULL},
178 + {"avsar_ver", &tn7atm_proc_version_fops},
179 + {"avsar_channels", &tn7atm_proc_channels_fops},
180 + {"avsar_sarhal_stats", &tn7sar_proc_sar_stat_fops},
181 + {"avsar_oam_ping", &tn7sar_proc_oam_ping_fops},
182 + {"avsar_pvc_table", &tn7sar_proc_pvc_table_fops},
183 + {"avsar_rxsnr0", &tn7dsl_proc_snr0_fops},
184 + {"avsar_rxsnr1", &tn7dsl_proc_snr1_fops},
185 + {"avsar_rxsnr2", &tn7dsl_proc_snr2_fops},
186 + {"clear_eoc_stats", &tn7dsl_proc_eoc_fops},
187 + {"avsar_bit_allocation_table", &tn7dsl_proc_bit_allocation_fops},
188 + {"avsar_dsl_modulation_schemes",&tn7dsl_proc_train_mode_export_fops},
190 - {"avsar_SNRpsds", tn7dsl_proc_SNRpsds, NULL},
191 - {"avsar_QLNpsds", tn7dsl_proc_QLNpsds, NULL},
192 + {"avsar_SNRpsds", &tn7dsl_proc_SNRpsds_fops},
193 + {"avsar_QLNpsds", &tn7dsl_proc_QLNpsds_fops},
194 // * UR8_MERGE_START CQ10979 Jack Zhang
196 -// {"avsar_HLINpsds", tn7dsl_proc_HLINpsds, NULL},
197 - {"avsar_HLINpsds1", tn7dsl_proc_HLINpsds1, NULL},
198 - {"avsar_HLINpsds2", tn7dsl_proc_HLINpsds2, NULL},
199 - {"avsar_HLINpsds3", tn7dsl_proc_HLINpsds3, NULL},
200 - {"avsar_HLINpsds4", tn7dsl_proc_HLINpsds4, NULL},
201 +// {"avsar_HLINpsds", &tn7dsl_proc_HLINpsds_fops},
202 + {"avsar_HLINpsds1", &tn7dsl_proc_HLINpsds1_fops},
203 + {"avsar_HLINpsds2", &tn7dsl_proc_HLINpsds2_fops},
204 + {"avsar_HLINpsds3", &tn7dsl_proc_HLINpsds3_fops},
205 + {"avsar_HLINpsds4", &tn7dsl_proc_HLINpsds4_fops},
206 #endif //TR69_HLIN_IN
207 // * UR8_MERGE_END CQ10979*
208 // * UR8_MERGE_START CQ11057 Jack Zhang
211 - {"avsar_PMDTestus", tn7dsl_proc_PMDus, NULL},
212 -// {"avsar_PMDTestus1", tn7dsl_proc_PMDus1, NULL},
213 + {"avsar_PMDTestus", &tn7dsl_proc_PMDus_fops},
214 +// {"avsar_PMDTestus1", &tn7dsl_proc_PMDus1_fops},
216 // * UR8_MERGE_END CQ11057 *
218 - {"avsar_private", tn7atm_proc_private, NULL},
219 - {"avsar_modem_training", tn7dsl_proc_modem, NULL},
220 - {"avsar_modem_stats", tn7dsl_proc_stats, tn7dsl_proc_write_stats},
221 + {"avsar_private", &tn7atm_proc_private_fops},
222 + {"avsar_modem_training", &tn7dsl_proc_modem_fops},
223 + {"avsar_modem_stats", &tn7dsl_proc_stats_fops},
225 #ifdef ADV_DIAG_STATS //CQ10275
226 -//for 2.6 {"avsar_modem_adv_stats", tn7dsl_proc_adv_stats, NULL},
227 +//for 2.6 {"avsar_modem_adv_stats", &tn7dsl_proc_adv_stats_fops},
228 //For 2.4 kernel, due to proc file system size limitation
229 - {"avsar_modem_adv_stats1", tn7dsl_proc_adv_stats1, NULL},
230 - {"avsar_modem_adv_stats2", tn7dsl_proc_adv_stats2, NULL},
231 - {"avsar_modem_adv_stats3", tn7dsl_proc_adv_stats3, NULL},
232 + {"avsar_modem_adv_stats1", &tn7dsl_proc_adv_stats1_fops},
233 + {"avsar_modem_adv_stats2", &tn7dsl_proc_adv_stats2_fops},
234 + {"avsar_modem_adv_stats3", &tn7dsl_proc_adv_stats3_fops},
235 //UR8_MERGE_START CQ10682 Jack Zhang
236 - {"avsar_modem_dbg_cmsgs", tn7dsl_proc_dbg_cmsgs, NULL},
237 - {"avsar_modem_dbg_rmsgs1", tn7dsl_proc_dbg_rmsgs1, NULL},
238 - {"avsar_modem_dbg_rmsgs2", tn7dsl_proc_dbg_rmsgs2, NULL},
239 - {"avsar_modem_dbg_rmsgs3", tn7dsl_proc_dbg_rmsgs3, NULL},
240 - {"avsar_modem_dbg_rmsgs4", tn7dsl_proc_dbg_rmsgs4, NULL},
241 + {"avsar_modem_dbg_cmsgs", &tn7dsl_proc_dbg_cmsgs_fops},
242 + {"avsar_modem_dbg_rmsgs1", &tn7dsl_proc_dbg_rmsgs1_fops},
243 + {"avsar_modem_dbg_rmsgs2", &tn7dsl_proc_dbg_rmsgs2_fops},
244 + {"avsar_modem_dbg_rmsgs3", &tn7dsl_proc_dbg_rmsgs3_fops},
245 + {"avsar_modem_dbg_rmsgs4", &tn7dsl_proc_dbg_rmsgs4_fops},
246 // UR8_MERGE_END CQ10682*
247 #endif //ADV_DIAG_STATS
248 - {"avsar_qos_enable", tn7atm_proc_qos_read, tn7atm_proc_qos_write}
249 + {"avsar_qos_enable", &tn7atm_proc_qos_fops}
253 @@ -1709,75 +1703,81 @@ int tn7atm_receive (void *os_dev, int ch
257 -static int tn7atm_proc_channels (char *buf, char **start, off_t offset,
258 - int count, int *eof, void *data)
259 +static int tn7atm_proc_channels (struct seq_file *m, void *data)
262 - int limit = count - 80;
268 - dev = (struct atm_dev *) data;
269 + dev = (struct atm_dev *) m->private;
270 priv = (Tn7AtmPrivate *) dev->dev_data;
273 - len += sprintf (buf + len, "Chan Inuse ChanID VPI VCI \n");
276 - sprintf (buf + len,
277 + seq_printf (m, "Chan Inuse ChanID VPI VCI \n");
279 "------------------------------------------------------------------\n");
281 for (i = 0; i <= MAX_DMA_CHAN; i++)
285 - len += sprintf (buf + len,
286 - " %02d %05d %05d %05d %05d \n",
287 - i, priv->lut[i].inuse, priv->lut[i].chanid,
288 - priv->lut[i].vpi, priv->lut[i].vci);
291 + " %02d %05d %05d %05d %05d \n",
292 + i, priv->lut[i].inuse, priv->lut[i].chanid,
293 + priv->lut[i].vpi, priv->lut[i].vci);
298 - sprintf (buf + len,
300 "------------------------------------------------------------------\n");
306 +static int tn7atm_proc_channels_open(struct inode *inode, struct file *file)
308 + return single_open(file, tn7atm_proc_channels, PDE_DATA(inode));
311 -static int tn7atm_proc_private (char *buf, char **start, off_t offset,
312 - int count, int *eof, void *data)
313 +static struct file_operations tn7atm_proc_channels_fops = {
314 + .owner = THIS_MODULE,
315 + .open = tn7atm_proc_channels_open,
317 + .llseek = seq_lseek,
318 + .release = single_release,
322 +static int tn7atm_proc_private (struct seq_file *m, void *data)
325 - int limit = count - 80;
329 - dev = (struct atm_dev *) data;
330 + dev = (struct atm_dev *) m->private;
331 priv = (Tn7AtmPrivate *) dev->dev_data;
334 - len += sprintf (buf + len, "\nPrivate Data Structure(%s):\n", priv->name);
336 - len += sprintf (buf + len, "----------------------------------------\n");
338 - len += sprintf (buf + len, "priv: 0x%p\n", priv);
340 - len += sprintf (buf + len, "next: 0x%p", priv->next);
342 - len += sprintf (buf + len, "\tdev: 0x%p\n", priv->dev);
345 - len += sprintf (buf + len, "tx_irq: %02d", priv->sar_irq);
347 - len += sprintf (buf + len, "rx_irq: %02d", priv->dsl_irq);
348 + seq_printf (m, "\nPrivate Data Structure(%s):\n", priv->name);
349 + seq_printf (m, "----------------------------------------\n");
350 + seq_printf (m, "priv: 0x%p\n", priv);
351 + seq_printf (m, "next: 0x%p", priv->next);
352 + seq_printf (m, "\tdev: 0x%p\n", priv->dev);
354 + seq_printf (m, "tx_irq: %02d", priv->sar_irq);
355 + seq_printf (m, "rx_irq: %02d", priv->dsl_irq);
361 +static int tn7atm_proc_private_open(struct inode *inode, struct file *file)
363 + return single_open(file, tn7atm_proc_private, PDE_DATA(inode));
366 +static struct file_operations tn7atm_proc_private_fops = {
367 + .owner = THIS_MODULE,
368 + .open = tn7atm_proc_private_open,
370 + .llseek = seq_lseek,
371 + .release = single_release,
374 void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr,
377 @@ -1900,10 +1900,8 @@ static int __init tn7atm_register (Tn7At
381 -static int tn7atm_proc_version (char *buf, char **start, off_t offset,
382 - int count, int *eof, void *data)
383 +static int tn7atm_proc_version (struct seq_file *m, void *data)
388 char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id
389 @@ -1914,56 +1912,64 @@ static int tn7atm_proc_version (char *bu
391 priv = mydev->dev_data;
394 - sprintf (buf + len, "ATM Driver version:[%d.%02d.%02d.%02d]\n",
395 - LINUXATM_VERSION_MAJOR, LINUXATM_VERSION_MINOR,
396 - LINUXATM_VERSION_BUGFIX, LINUXATM_VERSION_BUILDNUM);
397 + seq_printf (m, "ATM Driver version:[%d.%02d.%02d.%02d]\n",
398 + LINUXATM_VERSION_MAJOR, LINUXATM_VERSION_MINOR,
399 + LINUXATM_VERSION_BUGFIX, LINUXATM_VERSION_BUILDNUM);
401 tn7dsl_get_dslhal_version (dslVer);
404 - sprintf (buf + len, "DSL HAL version: [%d.%02d.%02d.%02d]\n", dslVer[0],
405 - dslVer[1], dslVer[2], dslVer[3]);
406 + seq_printf (m, "DSL HAL version: [%d.%02d.%02d.%02d]\n", dslVer[0],
407 + dslVer[1], dslVer[2], dslVer[3]);
408 tn7dsl_get_dsp_version (dspVer);
411 - sprintf (buf + len, "DSP Datapump version: [%d.%02d.%02d.%02d] ",
412 - dspVer[4], dspVer[5], dspVer[6], dspVer[7]);
413 + seq_printf (m, "DSP Datapump version: [%d.%02d.%02d.%02d] ",
414 + dspVer[4], dspVer[5], dspVer[6], dspVer[7]);
415 if (dspVer[8] == 2) // annex B
416 - len += sprintf (buf + len, "Annex B\n");
417 + seq_printf (m, "Annex B\n");
418 else if (dspVer[8] == 3) // annex c
419 - len += sprintf (buf + len, "Annex c\n");
420 + seq_printf (m, "Annex c\n");
422 - len += sprintf (buf + len, "Annex A\n");
423 + seq_printf (m, "Annex A\n");
425 tn7sar_get_sar_version (priv, &pSarVer);
427 - len += sprintf (buf + len, "SAR HAL version: [");
428 + seq_printf (m, "SAR HAL version: [");
429 for (i = 0; i < 8; i++)
431 - len += sprintf (buf + len, "%c", pSarVer[i + 7]);
432 + seq_printf (m, "%c", pSarVer[i + 7]);
434 - len += sprintf (buf + len, "]\n");
435 + seq_printf (m, "]\n");
437 tn7sar_get_sar_firmware_version (&pdspV1, &pdspV2);
438 - len += sprintf (buf + len, "PDSP Firmware version:[%01x.%02x]\n",
439 + seq_printf (m, "PDSP Firmware version:[%01x.%02x]\n",
442 //CT CQ10076 - Added code to report chipset ID using proc file system
443 tn7atm_get_chipsetId(chipsetID);
444 - len += sprintf (buf + len, "Chipset ID: [%s]\n",chipsetID);
445 + seq_printf (m, "Chipset ID: [%s]\n",chipsetID);
451 +static int tn7atm_proc_version_open(struct inode *inode, struct file *file)
453 + return single_open(file, tn7atm_proc_version, PDE_DATA(inode));
456 +static struct file_operations tn7atm_proc_version_fops = {
457 + .owner = THIS_MODULE,
458 + .open = tn7atm_proc_version_open,
460 + .llseek = seq_lseek,
461 + .release = single_release,
465 /* Device detection */
467 static int __init tn7atm_detect (void)
470 - struct proc_dir_entry *dsl_wr_file = NULL; /* Only for ones with a write
473 const char *residual;
475 @@ -2012,24 +2018,7 @@ static int __init tn7atm_detect (void)
477 for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++)
479 - /* Only if we have a write function, we create a normal proc file. */
480 - if(proc_if[ctr].write_func)
482 - dsl_wr_file = create_proc_entry (proc_if[ctr].name, DRV_PROC_MODE, root_proc_dir_entry);
485 - dsl_wr_file->read_proc = proc_if[ctr].read_func;
486 - dsl_wr_file->write_proc = proc_if[ctr].write_func;
487 - dsl_wr_file->data = (void *)mydev; //UR8_MERGE_START_END CQ10700 Manjula K
489 - dsl_wr_file = NULL;
493 - /* Create a read-only entry. */
494 - create_proc_read_entry (proc_if[ctr].name, 0, root_proc_dir_entry,
495 - proc_if[ctr].read_func, mydev);
497 + proc_create_data(proc_if[ctr].name, DRV_PROC_MODE, root_proc_dir_entry, proc_if[ctr].fops, (void *)mydev);
500 tn7dsl_dslmod_sysctl_register ();
501 @@ -2501,63 +2490,10 @@ static int tn7atm_set_can_support_adsl2
506 - * This function matches a name such as "serial", and that specified by the
509 -static int tn7atm_proc_match (int len, const char *name,
510 - struct proc_dir_entry *de)
511 +static int tn7atm_proc_qos_read(struct seq_file *m, void *data)
513 - if (!de || !de->low_ino)
515 - if (de->namelen != len)
516 + seq_printf (m, "\nEnableQoS = %d\n", EnableQoS);
518 - return !strncmp (name, de->name, len);
522 - * This function parses a name such as "tty/driver/serial", and
523 - * returns the struct proc_dir_entry for "/proc/tty/driver", and
524 - * returns "serial" in residual.
526 -static int tn7atm_xlate_proc_name (const char *name,
527 - struct proc_dir_entry **ret,
528 - const char **residual)
530 - const char *cp = name, *next;
531 - struct proc_dir_entry *de;
533 - extern struct proc_dir_entry proc_root;
538 - next = strchr (cp, '/');
543 - for (de = de->subdir; de; de = de->next)
545 - if (tn7atm_proc_match (len, cp, de))
558 -static int tn7atm_proc_qos_read(char *buf, char **start, off_t offset, int count, int *eof, void *data)
562 - len += sprintf (buf + len, "\nEnableQoS = %d\n", EnableQoS);
566 static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data)
567 @@ -2591,5 +2527,19 @@ static int tn7atm_proc_qos_write(struct
571 +static int tn7atm_proc_qos_open(struct inode *inode, struct file *file)
573 + return single_open(file, tn7atm_proc_qos_read, PDE_DATA(inode));
576 +static struct file_operations tn7atm_proc_qos_fops = {
577 + .owner = THIS_MODULE,
578 + .open = tn7atm_proc_qos_open,
580 + .llseek = seq_lseek,
581 + .release = single_release,
582 + .write = tn7atm_proc_qos_write,
585 module_init (tn7atm_detect);
586 module_exit (tn7atm_exit);
589 @@ -221,6 +221,9 @@ static struct led_funcs ledreg[2];
591 #define tn7dsl_kfree_skb(x) dev_kfree_skb(x)
593 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
594 +#define PDE_DATA(inode) PDE(inode)->data
597 //---------------------------------------------
598 // Begin Clear EOC definitions
599 @@ -349,7 +352,7 @@ static void tn7dsl_register_dslss_led(vo
600 void tn7dsl_dslmod_sysctl_register(void);
601 void tn7dsl_dslmod_sysctl_unregister(void);
602 static int tn7dsl_clear_eoc_receive(void);
603 -static int tn7dsl_proc_snr_print (char *buf, int count, int *eof, int data);
604 +static int tn7dsl_proc_snr_print (struct seq_file *m, int data);
605 /* end of internal functions */
607 // UR8_MERGE_START CQ11054 Jack Zhang
608 @@ -649,11 +652,9 @@ void shim_osCriticalExit(void)
609 spin_unlock_irqrestore(&shimLock, flags);
612 -static int tn7dsl_proc_snr_print (char *buf, int count, int *eof, int data)
613 +static int tn7dsl_proc_snr_print (struct seq_file *m, int data)
617 - int limit = count - 80;
619 int bin = (int) data;
620 unsigned short *rxSnrPerBin;
621 @@ -674,95 +675,128 @@ static int tn7dsl_proc_snr_print (char *
626 - len += sprintf (buf + len, "\nInvalid bin selected Bin%d :\n", bin);
629 + seq_printf (m, "\nInvalid bin selected Bin%d :\n", bin);
634 - len += sprintf (buf + len, "\nAR7 DSL Modem Rx SNR Per Bin for Bin%d :\n", bin);
635 + seq_printf (m, "\nAR7 DSL Modem Rx SNR Per Bin for Bin%d :\n", bin);
637 for (i=0; i<pIhw->AppData.max_ds_tones/16; i++)
643 - sprintf (buf + len, "%04x ",
644 + seq_printf (m, "%04x ",
645 (unsigned short) rxSnrPerBin[i * 16 + j]);
648 - len += sprintf(buf+len, "\n");
650 + seq_printf(m, "\n");
658 //@Added SNR per bin info per customer request. 05-14-2004
659 -int tn7dsl_proc_snr0 (char *buf, char **start, off_t offset, int count,
660 - int *eof, void *data)
661 +static int tn7dsl_proc_snr0 (struct seq_file *m, void *data)
663 - return tn7dsl_proc_snr_print(buf, count, eof, 0);
664 + return tn7dsl_proc_snr_print(m, 0);
667 -int tn7dsl_proc_snr1 (char *buf, char **start, off_t offset, int count,
668 - int *eof, void *data)
669 +static int tn7dsl_proc_snr0_open(struct inode *inode, struct file *file)
671 - return tn7dsl_proc_snr_print(buf, count, eof, 1);
672 + return single_open(file, tn7dsl_proc_snr0, PDE_DATA(inode));
675 +struct file_operations tn7dsl_proc_snr0_fops = {
676 + .owner = THIS_MODULE,
677 + .open = tn7dsl_proc_snr0_open,
679 + .llseek = seq_lseek,
680 + .release = single_release,
683 +static int tn7dsl_proc_snr1 (struct seq_file *m, void *data)
685 + return tn7dsl_proc_snr_print(m, 1);
688 -int tn7dsl_proc_snr2 (char *buf, char **start, off_t offset, int count,
689 - int *eof, void *data)
690 +static int tn7dsl_proc_snr1_open(struct inode *inode, struct file *file)
692 - return tn7dsl_proc_snr_print(buf, count, eof, 2);
693 + return single_open(file, tn7dsl_proc_snr1, PDE_DATA(inode));
696 +struct file_operations tn7dsl_proc_snr1_fops = {
697 + .owner = THIS_MODULE,
698 + .open = tn7dsl_proc_snr1_open,
700 + .llseek = seq_lseek,
701 + .release = single_release,
704 +static int tn7dsl_proc_snr2 (struct seq_file *m, void *data)
706 + return tn7dsl_proc_snr_print(m, 2);
709 +static int tn7dsl_proc_snr2_open(struct inode *inode, struct file *file)
711 + return single_open(file, tn7dsl_proc_snr2, PDE_DATA(inode));
714 +struct file_operations tn7dsl_proc_snr2_fops = {
715 + .owner = THIS_MODULE,
716 + .open = tn7dsl_proc_snr2_open,
718 + .llseek = seq_lseek,
719 + .release = single_release,
722 //@Added bit allocation table per customer request. 05-14-2004
723 -int tn7dsl_proc_bit_allocation (char *buf, char **start, off_t offset,
724 - int count, int *eof, void *data)
725 +static int tn7dsl_proc_bit_allocation (struct seq_file *m, void *data)
729 - int limit = count - 80;
733 - len += sprintf(buf+len, "\nAR7 DSL Modem US Bit Allocation:");
734 + seq_printf(m, "\nAR7 DSL Modem US Bit Allocation:");
736 for(i=0; i<pIhw->AppData.max_us_tones; i++)
741 - len += sprintf(buf+len, "\n");
742 + seq_printf(m, "\n");
746 - sprintf (buf + len, "%02x ",
747 - (unsigned char) pIhw->AppData.BitAllocTblUstrm[i]);
748 + seq_printf (m, "%02x ",
749 + (unsigned char) pIhw->AppData.BitAllocTblUstrm[i]);
753 - len += sprintf(buf+len, "\n\nAR7 DSL Modem DS Bit Allocation:\n");
754 + seq_printf(m, "\n\nAR7 DSL Modem DS Bit Allocation:\n");
756 for (i=0; i<pIhw->AppData.max_ds_tones/16; i++)
762 - sprintf (buf + len, "%02x ",
763 - (unsigned char) pIhw->AppData.BitAllocTblDstrm[i * 16 +
765 + seq_printf (m, "%02x ",
766 + (unsigned char) pIhw->AppData.BitAllocTblDstrm[i * 16 +
770 - len += sprintf(buf+len, "\n");
771 + seq_printf(m, "\n");
778 +int tn7dsl_proc_bit_allocation_open(struct inode *inode, struct file *file)
780 + return single_open(file, tn7dsl_proc_bit_allocation, PDE_DATA(inode));
783 +struct file_operations tn7dsl_proc_bit_allocation_fops = {
784 + .owner = THIS_MODULE,
785 + .open = tn7dsl_proc_bit_allocation_open,
787 + .llseek = seq_lseek,
788 + .release = single_release,
792 int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count,
793 int *eof, void *data)
794 @@ -825,59 +859,48 @@ static char *pUnknown= "Unknown";
795 #ifdef ADV_DIAG_STATS //CQ10275, CQ10449
796 //UR8_MERGE_START CQ10449 Jack Zhang
798 -static int proc_adv_stats_header(char* buf, int limit);
799 +static int proc_adv_stats_header(struct seq_file *m);
801 -int tn7dsl_proc_adv_stats(char* buf, char **start, off_t offset, int count,
802 - int *eof, void *data)
803 +static int tn7dsl_proc_adv_stats(struct seq_file *m, void *data)
807 - int limit = count - 80;
808 //char *cp = buf + offset;
812 - static int ctr = 0;
814 // printk("proc_adv_stats: buf=0x%X, ctr=%d, offset=%d, count=%d, eof=%d\n",
815 // (unsigned int)buf, ctr, offset, count, *eof);
818 - len = proc_adv_stats_header( cp, limit);
821 - len += sprintf(cp+len, "\n\tBin No.\tBits:\tMargin:\tSNR\n");
828 + proc_adv_stats_header(m);
830 + seq_printf(m, "\n\tBin No.\tBits:\tMargin:\tSNR\n");
832 for( i =strt; i<512; i++)
836 - len += sprintf(cp+len, "\t%u\t%u\t%u\t%d\n", i,
837 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
838 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
839 (unsigned int)pIhw->AppData.marginTblDstrm[i],
840 (int)pIhw->AppData.rxSnrPerBin0[i]);
846 - *(cp + len) = '\0';
847 - printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len);
853 printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len);
859 +static int tn7dsl_proc_adv_stats_open(struct inode *inode, struct file *file)
861 + return single_open(file, tn7dsl_proc_adv_stats, PDE_DATA(inode));
864 -static int proc_adv_stats_header(char* buf, int limit)
865 +struct file_operations tn7dsl_proc_adv_stats_fops = {
866 + .owner = THIS_MODULE,
867 + .open = tn7dsl_proc_adv_stats_open,
869 + .llseek = seq_lseek,
870 + .release = single_release,
873 +static int proc_adv_stats_header(struct seq_file *m)
877 @@ -886,66 +909,53 @@ static int proc_adv_stats_header(char* b
880 dslhal_api_gatherStatistics(pIhw);
882 - len += sprintf(buf+len, "\nAR7 DSL Modem Advanced Statistics:\n");
883 + seq_printf(m, "\nAR7 DSL Modem Advanced Statistics:\n");
886 + if(pIhw->lConnected != 1)
888 - if(pIhw->lConnected != 1)
890 - pIhw->AppData.USConRate = 0;
891 - pIhw->AppData.DSConRate = 0;
894 - sprintf (buf + len,
895 + pIhw->AppData.USConRate = 0;
896 + pIhw->AppData.DSConRate = 0;
899 "\t[Connection Rate]\tUS:\t%u\tDS:\t%u\n",
900 (unsigned int)pIhw->AppData.USConRate,
901 (unsigned int)pIhw->AppData.DSConRate );
904 // UR8_MERGE_START CQ11054 Jack Zhang
905 + if (dslhal_api_getHighPrecision())
907 - if (dslhal_api_getHighPrecision())
910 - sprintf (buf + len, "\t[Margin]\tUS:\t%d.%u\tDS:\t\t%d.%u\n",
911 - gInt(pIhw->AppData.usMargin), gDot1(pIhw->AppData.usMargin),
912 - gInt(pIhw->AppData.dsMargin), gDot1(pIhw->AppData.dsMargin));
917 - sprintf (buf + len, "\t[Margin]\tUS:\t%u\tDS:\t\t%u\n",
918 - (unsigned int)pIhw->AppData.usMargin,
919 - (unsigned int)pIhw->AppData.dsMargin/2 );
921 + seq_printf (m, "\t[Margin]\tUS:\t%d.%u\tDS:\t\t%d.%u\n",
922 + gInt(pIhw->AppData.usMargin), gDot1(pIhw->AppData.usMargin),
923 + gInt(pIhw->AppData.dsMargin), gDot1(pIhw->AppData.dsMargin));
927 + seq_printf (m, "\t[Margin]\tUS:\t%u\tDS:\t\t%u\n",
928 + (unsigned int)pIhw->AppData.usMargin,
929 + (unsigned int)pIhw->AppData.dsMargin/2 );
931 // UR8_MERGE_END CQ11054*
934 * Downstream/Upstream Interleaved Errors
937 - len += sprintf(buf+len, "\t[Interleave path] US (TX):\tCRC: \t%u\tFEC: \t%u\n",
938 + seq_printf(m, "\t[Interleave path] US (TX):\tCRC: \t%u\tFEC: \t%u\n",
939 (unsigned int)pIhw->AppData.usICRC_errors,
940 (unsigned int)pIhw->AppData.usIFEC_errors);
942 - len += sprintf(buf+len, "\t[Interleave path] DS (RX):\tCRC: \t%u\tFEC: \t%u\n",
943 + seq_printf(m, "\t[Interleave path] DS (RX):\tCRC: \t%u\tFEC: \t%u\n",
944 (unsigned int)pIhw->AppData.dsICRC_errors,
945 (unsigned int)pIhw->AppData.dsIFEC_errors);
947 * Upstream/Downstream Fast Errors
950 - len += sprintf(buf+len, "\t[Fast path] US (TX): \tCRC: \t%u\tFEC: \t%u\n",
951 + seq_printf(m, "\t[Fast path] US (TX): \tCRC: \t%u\tFEC: \t%u\n",
952 (unsigned int)pIhw->AppData.usFCRC_errors,
953 (unsigned int)pIhw->AppData.usFFEC_errors);
955 - len += sprintf(buf+len, "\t[Fast path] DS (RX):\tCRC: \t%u\tFEC: \t%u\n",
956 + seq_printf(m, "\t[Fast path] DS (RX):\tCRC: \t%u\tFEC: \t%u\n",
957 (unsigned int)pIhw->AppData.dsFCRC_errors,
958 (unsigned int)pIhw->AppData.dsFFEC_errors);
965 static int getDiagDisplayMode()
966 @@ -968,29 +978,24 @@ static int getDiagDisplayMode()
970 -int tn7dsl_proc_adv_stats1(char* buf, char **start, off_t offset, int count,
971 - int *eof, void *data)
972 +int tn7dsl_proc_adv_stats1(struct seq_file *m, void *data)
976 - int limit = count - 80;
978 int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+
979 unsigned char SNRpsds[512];
982 - len = proc_adv_stats_header( buf+len, limit);
983 + proc_adv_stats_header( m);
984 mode = getDiagDisplayMode();
987 - len += sprintf(buf+len, "\tBin No.\tBits:\tMargin:\tSNR (Part 1 of 3)\n");
989 + seq_printf(m, "\tBin No.\tBits:\tMargin:\tSNR (Part 1 of 3)\n");
993 for( i =32; i<128; i++)
996 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
997 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
998 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
999 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1000 (int)pIhw->AppData.rxSnrPerBin0[i]);
1001 @@ -1001,26 +1006,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch
1002 if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
1004 dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
1008 for( i =32; i<128; i++)
1011 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
1012 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
1013 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
1014 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1015 (i<pIhw->AppData.max_ds_tones)?(unsigned char)SNRpsds[i]:0);
1022 -int tn7dsl_proc_adv_stats2(char* buf, char **start, off_t offset, int count,
1023 - int *eof, void *data)
1024 +static int tn7dsl_proc_adv_stats1_open(struct inode *inode, struct file *file)
1026 + return single_open(file, tn7dsl_proc_adv_stats1, PDE_DATA(inode));
1030 - int limit = count - 80;
1031 +struct file_operations tn7dsl_proc_adv_stats1_fops = {
1032 + .owner = THIS_MODULE,
1033 + .open = tn7dsl_proc_adv_stats1_open,
1035 + .llseek = seq_lseek,
1036 + .release = single_release,
1039 +int tn7dsl_proc_adv_stats2(struct seq_file *m, void *data)
1042 int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+
1043 unsigned char SNRpsds[512];
1044 @@ -1030,12 +1043,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
1045 if( mode==1) //ADSL1
1047 dslhal_api_gatherStatistics(pIhw);
1049 - len += sprintf(buf+len, "\tBin No.\tBits:\tMargin:\tSNR (Part 2 of 3):\n");
1050 + seq_printf(m, "\tBin No.\tBits:\tMargin:\tSNR (Part 2 of 3):\n");
1051 for( i =128; i<320; i++)
1054 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
1055 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
1056 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
1057 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1058 (int)pIhw->AppData.rxSnrPerBin0[i]);
1059 @@ -1046,26 +1057,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch
1060 if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
1062 dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
1066 for( i =128; i<320; i++)
1069 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
1070 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
1071 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
1072 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1073 (i<pIhw->AppData.max_ds_tones)?(unsigned char)SNRpsds[i]:0);
1080 -int tn7dsl_proc_adv_stats3(char* buf, char **start, off_t offset, int count,
1081 - int *eof, void *data)
1082 +static int tn7dsl_proc_adv_stats2_open(struct inode *inode, struct file *file)
1084 + return single_open(file, tn7dsl_proc_adv_stats2, PDE_DATA(inode));
1087 +struct file_operations tn7dsl_proc_adv_stats2_fops = {
1088 + .owner = THIS_MODULE,
1089 + .open = tn7dsl_proc_adv_stats2_open,
1091 + .llseek = seq_lseek,
1092 + .release = single_release,
1095 +int tn7dsl_proc_adv_stats3(struct seq_file *m, void *data)
1099 - int limit = count - 80;
1101 int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+
1102 unsigned char SNRpsds[512];
1103 @@ -1075,12 +1095,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
1104 if( mode==1) //ADSL1
1106 dslhal_api_gatherStatistics(pIhw);
1108 - len += sprintf(buf+len, "\tBin No.\tBits:\tMargin:\tSNR (Part 3 of 3):\n");
1109 + seq_printf(m, "\tBin No.\tBits:\tMargin:\tSNR (Part 3 of 3):\n");
1110 for( i =320; i<512; i++)
1113 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
1114 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
1115 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
1116 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1117 (int)pIhw->AppData.rxSnrPerBin0[i]);
1118 @@ -1091,283 +1109,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch
1119 if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
1121 dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
1125 for( i =320; i<512; i++)
1128 - len += sprintf(buf+len, "\t%u\t%u\t%u\t%d\n", i,
1129 + seq_printf(m, "\t%u\t%u\t%u\t%d\n", i,
1130 (unsigned int)pIhw->AppData.BitAllocTblDstrm[i],
1131 (unsigned int)pIhw->AppData.marginTblDstrm[i],
1132 (i<pIhw->AppData.max_ds_tones)?(unsigned char)SNRpsds[i]:0);
1136 - len += sprintf(buf+len, "[End of Stats]\n");
1138 + seq_printf(m, "[End of Stats]\n");
1141 -//UR8_MERGE_END CQ10449
1142 -//UR8_MERGE_START CQ10682 Jack Zhang
1143 -int tn7dsl_proc_dbg_cmsgs(char* buf, char **start, off_t offset, int count,
1144 - int *eof, void *data)
1146 +static int tn7dsl_proc_adv_stats3_open(struct inode *inode, struct file *file)
1148 + return single_open(file, tn7dsl_proc_adv_stats3, PDE_DATA(inode));
1152 - int limit = count - 80;
1153 +struct file_operations tn7dsl_proc_adv_stats3_fops = {
1154 + .owner = THIS_MODULE,
1155 + .open = tn7dsl_proc_adv_stats3_open,
1157 + .llseek = seq_lseek,
1158 + .release = single_release,
1161 +//UR8_MERGE_END CQ10449
1162 +//UR8_MERGE_START CQ10682 Jack Zhang
1163 +int tn7dsl_proc_dbg_cmsgs(struct seq_file *m, void *data)
1167 dslhal_api_gatherStatistics(pIhw);
1170 - len += sprintf(buf+len, "Training Messages (C-Msgs 1-5)..\n");
1171 + seq_printf(m, "Training Messages (C-Msgs 1-5)..\n");
1174 - len += sprintf(buf+len, "ADSL2 DELT C-Msg1Ld \t Message Length:%d\n",
1175 + seq_printf(m, "ADSL2 DELT C-Msg1Ld \t Message Length:%d\n",
1176 pIhw->adsl2DiagnosticMessages.cMsg1LdLen);
1177 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.cMsg1LdLen;rc++)
1180 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg1Ld[rc]);
1181 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg1Ld[rc]);
1182 if(rc!=0 && (rc%16==0))
1184 - len += sprintf(buf+len, "\n");
1185 + seq_printf(m, "\n");
1188 - len += sprintf(buf+len, "\nADSL2 DELT C-Msg2Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg2LdLen);
1189 + seq_printf(m, "\nADSL2 DELT C-Msg2Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg2LdLen);
1191 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.cMsg2LdLen;rc++)
1194 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg2Ld[rc]);
1195 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg2Ld[rc]);
1196 if(rc!=0 && (rc%16==0))
1198 - len += sprintf(buf+len, "\n");
1199 + seq_printf(m, "\n");
1203 - len += sprintf(buf+len, "\nADSL2 DELT C-Msg3Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg3LdLen);
1204 + seq_printf(m, "\nADSL2 DELT C-Msg3Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg3LdLen);
1206 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.cMsg3LdLen;rc++)
1209 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg3Ld[rc]);
1210 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg3Ld[rc]);
1211 if(rc!=0 && (rc%16==0))
1213 - len += sprintf(buf+len, "\n");
1214 + seq_printf(m, "\n");
1218 - len += sprintf(buf+len, "\nADSL2 DELT C-Msg4Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg4LdLen);
1219 + seq_printf(m, "\nADSL2 DELT C-Msg4Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg4LdLen);
1221 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.cMsg4LdLen;rc++)
1224 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg4Ld[rc]);
1225 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg4Ld[rc]);
1226 if(rc!=0 && (rc%16==0))
1228 - len += sprintf(buf+len, "\n");
1229 + seq_printf(m, "\n");
1233 - len += sprintf(buf+len, "\nADSL2 DELT C-Msg5Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg5LdLen);
1234 + seq_printf(m, "\nADSL2 DELT C-Msg5Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.cMsg5LdLen);
1236 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.cMsg5LdLen;rc++)
1239 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg5Ld[rc]);
1240 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.cMsg5Ld[rc]);
1241 if(rc!=0 && (rc%16==0))
1243 - len += sprintf(buf+len, "\n");
1244 + seq_printf(m, "\n");
1247 - len += sprintf(buf+len, "\n");
1249 + seq_printf(m, "\n");
1253 -int tn7dsl_proc_dbg_rmsgs1(char* buf, char **start, off_t offset, int count,
1254 - int *eof, void *data)
1255 +static int tn7dsl_proc_dbg_cmsgs_open(struct inode *inode, struct file *file)
1257 + return single_open(file, tn7dsl_proc_dbg_cmsgs, PDE_DATA(inode));
1260 +struct file_operations tn7dsl_proc_dbg_cmsgs_fops = {
1261 + .owner = THIS_MODULE,
1262 + .open = tn7dsl_proc_dbg_cmsgs_open,
1264 + .llseek = seq_lseek,
1265 + .release = single_release,
1269 - int limit = count - 80;
1271 +int tn7dsl_proc_dbg_rmsgs1(struct seq_file *m, void *data)
1276 dslhal_api_gatherStatistics(pIhw);
1279 - len += sprintf(buf+len, "Training Messages (R-Msgs 1-3)..\n");
1280 + seq_printf(m, "Training Messages (R-Msgs 1-3)..\n");
1283 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg1Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsg1LdLen);
1284 + seq_printf(m, "\nADSL2 DELT R-Msg1Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsg1LdLen);
1286 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsg1LdLen;rc++)
1289 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg1Ld[rc]);
1290 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg1Ld[rc]);
1291 if(rc!=0 && (rc%16==0))
1293 - len += sprintf(buf+len, "\n");
1294 + seq_printf(m, "\n");
1298 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg2Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1299 + seq_printf(m, "\nADSL2 DELT R-Msg2Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1301 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1304 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg2Ld[rc]);
1305 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg2Ld[rc]);
1306 if(rc!=0 && (rc%16==0))
1308 - len += sprintf(buf+len, "\n");
1309 + seq_printf(m, "\n");
1313 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg3Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1314 + seq_printf(m, "\nADSL2 DELT R-Msg3Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1315 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1318 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg3Ld[rc]);
1319 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg3Ld[rc]);
1320 if(rc!=0 && (rc%16==0))
1322 - len += sprintf(buf+len, "\n");
1323 + seq_printf(m, "\n");
1326 - len += sprintf(buf+len, "\n");
1328 + seq_printf(m, "\n");
1332 -int tn7dsl_proc_dbg_rmsgs2(char* buf, char **start, off_t offset, int count,
1333 - int *eof, void *data)
1334 +static int tn7dsl_proc_dbg_rmsgs1_open(struct inode *inode, struct file *file)
1336 + return single_open(file, tn7dsl_proc_dbg_rmsgs1, PDE_DATA(inode));
1340 - int limit = count - 80;
1341 +struct file_operations tn7dsl_proc_dbg_rmsgs1_fops = {
1342 + .owner = THIS_MODULE,
1343 + .open = tn7dsl_proc_dbg_rmsgs1_open,
1345 + .llseek = seq_lseek,
1346 + .release = single_release,
1350 +int tn7dsl_proc_dbg_rmsgs2(struct seq_file *m, void *data)
1355 dslhal_api_gatherStatistics(pIhw);
1358 - len += sprintf(buf+len, "Training Messages (R-Msgs 4-5)..\n");
1359 + seq_printf(m, "Training Messages (R-Msgs 4-5)..\n");
1362 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg4Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1363 + seq_printf(m, "\nADSL2 DELT R-Msg4Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1364 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1367 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg4Ld[rc]);
1368 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg4Ld[rc]);
1369 if(rc!=0 && (rc%16==0))
1371 - len += sprintf(buf+len, "\n");
1372 + len += sprintf(m, "\n");
1376 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg5Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1377 + seq_printf(m, "\nADSL2 DELT R-Msg5Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1378 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1381 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg5Ld[rc]);
1382 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg5Ld[rc]);
1383 if(rc!=0 && (rc%16==0))
1385 - len += sprintf(buf+len, "\n");
1386 + seq_printf(m, "\n");
1390 - len += sprintf(buf+len, "\n");
1392 + seq_printf(m, "\n");
1396 -int tn7dsl_proc_dbg_rmsgs3(char* buf, char **start, off_t offset, int count,
1397 - int *eof, void *data)
1398 +static int tn7dsl_proc_dbg_rmsgs2_open(struct inode *inode, struct file *file)
1400 + return single_open(file, tn7dsl_proc_dbg_rmsgs2, PDE_DATA(inode));
1404 - int limit = count - 80;
1405 +struct file_operations _fops = {
1406 + .owner = THIS_MODULE,
1407 + .open = tn7dsl_proc_dbg_rmsgs2_open,
1409 + .llseek = seq_lseek,
1410 + .release = single_release,
1413 +int tn7dsl_proc_dbg_rmsgs3(struct seq_file *m, void *data)
1418 dslhal_api_gatherStatistics(pIhw);
1421 - len += sprintf(buf+len, "Training Messages (R-Msgs 6-7)..\n");
1422 + seq_printf(m, "Training Messages (R-Msgs 6-7)..\n");
1425 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg6Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1426 + seq_printf(m, "\nADSL2 DELT R-Msg6Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1427 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1430 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg6Ld[rc]);
1431 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg6Ld[rc]);
1432 if(rc!=0 && (rc%16==0))
1434 - len += sprintf(buf+len, "\n");
1435 + seq_printf(m, "\n");
1438 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg7Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1439 + seq_printf(m, "\nADSL2 DELT R-Msg7Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1440 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1443 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg7Ld[rc]);
1444 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg7Ld[rc]);
1445 if(rc!=0 && (rc%16==0))
1447 - len += sprintf(buf+len, "\n");
1448 + seq_printf(m, "\n");
1451 - len += sprintf(buf+len, "\n");
1452 + seq_printf(m, "\n");
1458 -int tn7dsl_proc_dbg_rmsgs4(char* buf, char **start, off_t offset, int count,
1459 - int *eof, void *data)
1460 +static int tn7dsl_proc_dbg_rmsgs3_open(struct inode *inode, struct file *file)
1462 + return single_open(file, tn7dsl_proc_dbg_rmsgs3, PDE_DATA(inode));
1466 - int limit = count - 80;
1467 +struct file_operations tn7dsl_proc_dbg_rmsgs3_fops = {
1468 + .owner = THIS_MODULE,
1469 + .open = tn7dsl_proc_dbg_rmsgs3_open,
1471 + .llseek = seq_lseek,
1472 + .release = single_release,
1475 +int tn7dsl_proc_dbg_rmsgs4(struct seq_file *m, void *data)
1480 dslhal_api_gatherStatistics(pIhw);
1483 - len += sprintf(buf+len, "Training Messages (R-Msgs 8-9)..\n");
1484 + seq_printf(m, "Training Messages (R-Msgs 8-9)..\n");
1487 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg8Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1488 + seq_printf(m, "\nADSL2 DELT R-Msg8Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1489 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1492 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg8Ld[rc]);
1493 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg8Ld[rc]);
1494 if(rc!=0 && (rc%16==0))
1496 - len += sprintf(buf+len, "\n");
1497 + seq_printf(m, "\n");
1501 - len += sprintf(buf+len, "\nADSL2 DELT R-Msg9Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1502 + seq_printf(m, "\nADSL2 DELT R-Msg9Ld \t Message Length:%d\n",pIhw->adsl2DiagnosticMessages.rMsgxLdLen);
1503 for(rc=0;rc<pIhw->adsl2DiagnosticMessages.rMsgxLdLen;rc++)
1506 - len += sprintf(buf+len, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg9Ld[rc]);
1507 + seq_printf(m, " %02x",(unsigned char)pIhw->adsl2DiagnosticMessages.rMsg9Ld[rc]);
1508 if(rc!=0 && (rc%16==0))
1510 - len += sprintf(buf+len, "\n");
1511 + seq_printf(m, "\n");
1514 - len += sprintf(buf+len, "\n");
1515 + seq_printf(m, "\n");
1521 +static int tn7dsl_proc_dbg_rmsgs4_open(struct inode *inode, struct file *file)
1523 + return single_open(file, tn7dsl_proc_dbg_rmsgs4, PDE_DATA(inode));
1526 +struct file_operations tn7dsl_proc_dbg_rmsgs4_fops = {
1527 + .owner = THIS_MODULE,
1528 + .open = tn7dsl_proc_dbg_rmsgs4_open,
1530 + .llseek = seq_lseek,
1531 + .release = single_release,
1534 //UR8_MERGE_END CQ10682*
1535 #endif //ADV_DIAG_STATS
1537 -int tn7dsl_proc_stats(char* buf, char **start, off_t offset, int count,
1538 - int *eof, void *data)
1539 +static int tn7dsl_proc_stats(struct seq_file *m, void *data)
1543 - int limit = count - 80;
1544 int F4count, F5count;
1545 unsigned int maxRate=0;
1546 unsigned int us_maxRate=0;
1547 @@ -1375,80 +1397,58 @@ int tn7dsl_proc_stats(char* buf, char **
1548 //UR8_MERGE_START CQ10700 Manjula K
1549 struct atm_dev *dev;
1550 Tn7AtmPrivate *priv;
1551 - dev = (struct atm_dev *)data;
1552 + int offset[2] = { 32, 0 };
1553 + unsigned int usBitswap, dsBitswap;
1554 + dev = (struct atm_dev *)m->private;
1555 priv = (Tn7AtmPrivate *)dev->dev_data;
1556 //UR8_MERGE_END CQ10700
1563 dslhal_api_gatherStatistics(pIhw);
1565 - len += sprintf(buf+len, "\nAR7 DSL Modem Statistics:\n");
1567 - len += sprintf(buf+len, "--------------------------------\n");
1568 + seq_printf(m, "\nAR7 DSL Modem Statistics:\n");
1569 + seq_printf(m, "--------------------------------\n");
1571 * us and ds Connection Rates
1574 - len += sprintf(buf+len, "[DSL Modem Stats]\n");
1575 + seq_printf(m, "[DSL Modem Stats]\n");
1579 + if(pIhw->lConnected != 1)
1581 - if(pIhw->lConnected != 1)
1583 - pIhw->AppData.USConRate = 0;
1584 - pIhw->AppData.DSConRate = 0;
1587 - sprintf (buf + len,
1588 - "\tUS Connection Rate:\t%u\tDS Connection Rate:\t%u\n",
1589 - (unsigned int)pIhw->AppData.USConRate,
1590 - (unsigned int)pIhw->AppData.DSConRate );
1591 + pIhw->AppData.USConRate = 0;
1592 + pIhw->AppData.DSConRate = 0;
1596 + "\tUS Connection Rate:\t%u\tDS Connection Rate:\t%u\n",
1597 + (unsigned int)pIhw->AppData.USConRate,
1598 + (unsigned int)pIhw->AppData.DSConRate );
1599 // UR8_MERGE_START CQ11054 Jack Zhang
1601 - if (dslhal_api_getHighPrecision())
1604 - sprintf (buf + len, "\tDS Line Attenuation:\t%u.%u\tDS Margin:\t\t%d.%u\n",
1605 + if (dslhal_api_getHighPrecision())
1606 + seq_printf (m, "\tDS Line Attenuation:\t%u.%u\tDS Margin:\t\t%d.%u\n",
1607 gInt(pIhw->AppData.dsLineAttn), gDot1(pIhw->AppData.dsLineAttn),
1608 gInt(pIhw->AppData.dsMargin), gDot1(pIhw->AppData.dsMargin));
1612 - sprintf (buf + len, "\tDS Line Attenuation:\t%u\tDS Margin:\t\t%u\n",
1614 + seq_printf (m, "\tDS Line Attenuation:\t%u\tDS Margin:\t\t%u\n",
1615 (unsigned int)pIhw->AppData.dsLineAttn/2,
1616 (unsigned int)pIhw->AppData.dsMargin/2 );
1619 // UR8_MERGE_END CQ11054*
1622 // UR8_MERGE_START CQ11054 Jack Zhang
1624 - if (dslhal_api_getHighPrecision())
1627 - sprintf (buf + len, "\tUS Line Attenuation:\t%u.%u\tUS Margin:\t\t%d.%u\n",
1628 + if (dslhal_api_getHighPrecision())
1629 + seq_printf (m, "\tUS Line Attenuation:\t%u.%u\tUS Margin:\t\t%d.%u\n",
1630 gInt(pIhw->AppData.usLineAttn), gDot1(pIhw->AppData.usLineAttn),
1631 gInt(pIhw->AppData.usMargin), gDot1(pIhw->AppData.usMargin));
1636 - sprintf (buf + len, "\tUS Line Attenuation:\t%u\tUS Margin:\t\t%u\n",
1638 + seq_printf (m, "\tUS Line Attenuation:\t%u\tUS Margin:\t\t%u\n",
1639 (unsigned int)pIhw->AppData.usLineAttn/2,
1640 (unsigned int)pIhw->AppData.usMargin );
1643 // UR8_MERGE_END CQ11054*
1646 - len += sprintf(buf+len, "\tUS Payload :\t\t%u\tDS Payload:\t\t%u\n",
1647 + seq_printf(m, "\tUS Payload :\t\t%u\tDS Payload:\t\t%u\n",
1648 ((unsigned int) pIhw->AppData.usAtm_count[0] +
1649 (unsigned int) pIhw->AppData.usAtm_count[1]) * 48,
1650 ((unsigned int) pIhw->AppData.dsGood_count[0] +
1651 @@ -1456,9 +1456,7 @@ int tn7dsl_proc_stats(char* buf, char **
1657 - sprintf (buf + len,
1659 "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n",
1660 (unsigned int)pIhw->AppData.usSuperFrmCnt,
1661 (unsigned int)pIhw->AppData.dsSuperFrmCnt );
1662 @@ -1466,57 +1464,45 @@ int tn7dsl_proc_stats(char* buf, char **
1667 + if(pIhw->AppData.bState < 5)
1669 - if(pIhw->AppData.bState < 5)
1671 - pIhw->AppData.usTxPower = 0;
1672 - pIhw->AppData.dsTxPower = 0;
1675 - sprintf (buf + len,
1676 + pIhw->AppData.usTxPower = 0;
1677 + pIhw->AppData.dsTxPower = 0;
1680 +// UR8_MERGE_START - CQ11579 - Jeremy #1
1681 "\tUS Transmit Power :\t%u\tDS Transmit Power:\t%u\n",
1682 (unsigned int)pIhw->AppData.usTxPower/256,
1683 (unsigned int)pIhw->AppData.dsTxPower/256 );
1685 +// UR8_MERGE_END - CQ11579
1690 - len += sprintf(buf+len, "\tLOS errors:\t\t%u\tSEF errors:\t\t%u\n",
1691 + seq_printf(m, "\tLOS errors:\t\t%u\tSEF errors:\t\t%u\n",
1692 (unsigned int)pIhw->AppData.LOS_errors,
1693 (unsigned int)pIhw->AppData.SEF_errors );
1695 //UR8_MERGE_START Report_SES Manjula K
1698 - len += sprintf(buf+len, "\tErrored Seconds:\t%u\tSeverely Err Secs:\t%u\n",
1699 + seq_printf(m, "\tErrored Seconds:\t%u\tSeverely Err Secs:\t%u\n",
1700 (unsigned int)pIhw->AppData.erroredSeconds,
1701 (unsigned int)pIhw->AppData.severelyerrsecs );
1702 //UR8_MERGE_END Report_SES
1705 - len += sprintf(buf+len, "\tFrame mode:\t\t%u\tMax Frame mode:\t\t%u\n",
1707 + seq_printf(m, "\tFrame mode:\t\t%u\tMax Frame mode:\t\t%u\n",
1708 (unsigned int)pIhw->AppData.FrmMode,
1709 (unsigned int)pIhw->AppData.MaxFrmMode );
1712 - sprintf (buf + len, "\tTrained Path:\t\t%u\tUS Peak Cell Rate:\t%u\n",
1713 + seq_printf (m, "\tTrained Path:\t\t%u\tUS Peak Cell Rate:\t%u\n",
1714 (unsigned int)pIhw->AppData.TrainedPath,
1715 (unsigned int)pIhw->AppData.USConRate*1000/8/53 );
1718 - sprintf (buf + len, "\tTrained Mode:\t\t%u\tSelected Mode:\t\t%u\n",
1719 + seq_printf (m, "\tTrained Mode:\t\t%u\tSelected Mode:\t\t%u\n",
1720 (unsigned int) pIhw->AppData.TrainedMode,
1721 (unsigned int) pIhw->AppData.StdMode);
1725 - sprintf (buf + len, "\tATUC Vendor Code:\t%X\tATUC Revision:\t%u\n",
1726 + seq_printf (m, "\tATUC Vendor Code:\t%X\tATUC Revision:\t%u\n",
1727 (unsigned int) pIhw->AppData.atucVendorId,
1728 pIhw->AppData.atucRevisionNum);
1730 - len += sprintf(buf+len, "\tHybrid Selected:\t%u\tTrellis:\t\t%u\n",
1731 + seq_printf(m, "\tHybrid Selected:\t%u\tTrellis:\t\t%u\n",
1732 (unsigned int)pIhw->AppData.currentHybridNum, trellis);
1734 //@Added Maximum attainable bit rate information. 05-14-2004
1735 @@ -1528,12 +1514,12 @@ int tn7dsl_proc_stats(char* buf, char **
1739 - int offset[2] = {5, 1};
1740 + int dspOffset[2] = { 5, 1 };
1741 unsigned char rMsgsRA[12];
1742 int numPayloadBytes = 0;
1744 dslhal_api_dspInterfaceRead (pIhw, (unsigned int) pIhw->pmainAddr, 2,
1745 - (unsigned int *) &offset,
1746 + (unsigned int *) &dspOffset,
1747 (unsigned char *) &rMsgsRA[0], 12);
1749 maxRate = (unsigned int)pIhw->AppData.DSConRate;
1750 @@ -1549,283 +1535,213 @@ int tn7dsl_proc_stats(char* buf, char **
1756 - sprintf (buf + len,
1758 "\tShowtime Count:\t\t%u\tDS Max Attainable Bit Rate: %u kbps\n",
1759 (unsigned int)pIhw->AppData.showtimeCount, maxRate);
1763 - int offset[2] = {32, 0};
1764 - unsigned int usBitswap, dsBitswap;
1765 + tn7dsl_generic_read(2, (unsigned int *)&offset);
1766 + dsBitswap = dslReg & dslhal_support_byteSwap32(0x000000ff);
1768 - tn7dsl_generic_read(2, (unsigned int *)&offset);
1769 - dsBitswap = dslReg & dslhal_support_byteSwap32(0x000000ff);
1771 + tn7dsl_generic_read(2, (unsigned int *)&offset);
1772 + usBitswap = dslReg & dslhal_support_byteSwap32(0x000000ff);
1775 - tn7dsl_generic_read(2, (unsigned int *)&offset);
1776 - usBitswap = dslReg & dslhal_support_byteSwap32(0x000000ff);
1778 - if(pIhw->AppData.dsl_modulation > 5)
1780 - sprintf (buf + len,
1781 + if(pIhw->AppData.dsl_modulation > 5)
1783 "\tBitSwap:\t\t%u\tUS Max Attainable Bit Rate: %u bps\n",
1784 (unsigned int)(usBitswap && dsBitswap), us_maxRate);
1787 - sprintf (buf + len,
1790 "\tBitSwap:\t\t%u\tUS Max Attainable Bit Rate:\tn/a\n",
1791 (unsigned int)(usBitswap && dsBitswap));
1797 - sprintf (buf + len, "\tAnnex: \t\t\t%s\tpsd_mask_qualifier: 0x%04x\n",
1798 + seq_printf (m, "\tAnnex: \t\t\t%s\tpsd_mask_qualifier: 0x%04x\n",
1799 tn7dsl_AnnexFromNum(pIhw->AppData.annex_selected),
1800 pIhw->AppData.psd_mask_qualifier);
1802 // UR8_MERGE_START CQ10979 Jack Zhang
1803 // UR8_MERGE_START CQ10978 Jack Zhang
1806 - sprintf (buf + len, "\tPower Management Status: L%d\tDS HLINSC: %d\n",
1807 + seq_printf (m, "\tPower Management Status: L%d\tDS HLINSC: %d\n",
1808 pIhw->AppData.pwrStatus, pIhw->AppData.dsHLINSC);
1809 // UR8_MERGE_END CQ10978*
1813 - sprintf (buf + len, "\tUS ACTPSD: \t\t%d\tDS ACTPSD: %d\n",
1814 + seq_printf (m, "\tUS ACTPSD: \t\t%d\tDS ACTPSD: %d\n",
1815 pIhw->AppData.usACTPSD, pIhw->AppData.dsACTPSD);
1819 - sprintf (buf + len, "\tTotal init. errors: \t%d\tTotal init. timeouts: %d\n",
1820 + seq_printf (m, "\tTotal init. errors: \t%d\tTotal init. timeouts: %d\n",
1821 pIhw->AppData.totalInitErrs, pIhw->AppData.totalInitTOs);
1825 - sprintf (buf + len, "\tShowtime init. errors: \t%d\tShowtime init. timeouts: %d\n",
1826 + seq_printf (m, "\tShowtime init. errors: \t%d\tShowtime init. timeouts: %d\n",
1827 pIhw->AppData.showtimeInitErrs, pIhw->AppData.showtimeInitTOs);
1831 - sprintf (buf + len, "\tLast showtime init. errors: %ld\tLast showtime init. timeouts: %ld\n",
1832 + seq_printf (m, "\tLast showtime init. errors: %ld\tLast showtime init. timeouts: %ld\n",
1833 pIhw->AppData.lastshowInitErrs, pIhw->AppData.lastshowInitTOs);
1834 // UR8_MERGE_END CQ10979*
1838 - len += sprintf(buf+len,"\tATUC ghsVid: ");
1839 - for (i=0; i<8; i++)
1840 - len+= sprintf(buf+len, " %02x", pIhw->AppData.ghsATUCVendorId[i]);
1842 + seq_printf(m,"\tATUC ghsVid: ");
1843 + for (i=0; i<8; i++)
1844 + seq_printf(m, " %02x", pIhw->AppData.ghsATUCVendorId[i]);
1848 - len += sprintf (buf + len, "\n");
1850 + seq_printf (m, "\n");
1855 - sprintf (buf + len,
1857 "\tT1413Vid: %02x %02x\t\tT1413Rev: %02x\t\tVendorRev: %02x\n",
1858 pIhw->AppData.t1413ATUC.VendorId[0],
1859 pIhw->AppData.t1413ATUC.VendorId[1],
1860 pIhw->AppData.t1413ATUC.t1413Revision,
1861 pIhw->AppData.t1413ATUC.VendorRevision);
1866 - len += sprintf(buf+len,"\tATUR ghsVid: ");
1867 - for (i=0; i<8; i++)
1868 - len+= sprintf(buf+len, " %02x", pIhw->AppData.ghsATURVendorId[i]);
1870 + seq_printf(m,"\tATUR ghsVid: ");
1871 + for (i=0; i<8; i++)
1872 + seq_printf(m, " %02x", pIhw->AppData.ghsATURVendorId[i]);
1876 - len += sprintf (buf + len, "\n");
1878 + seq_printf (m, "\n");
1883 - sprintf (buf + len,
1885 "\tT1413Vid: %02x %02x\tT1413Rev: %02x\tVendorRev: %02x\n",
1886 pIhw->AppData.t1413ATUR.VendorId[0],
1887 pIhw->AppData.t1413ATUR.VendorId[1],
1888 pIhw->AppData.t1413ATUR.t1413Revision,
1889 pIhw->AppData.t1413ATUR.VendorRevision);
1894 * Upstream Interleaved Errors
1897 - len += sprintf(buf+len, "\n\t[Upstream (TX) Interleave path]\n");
1899 - len += sprintf(buf+len, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1900 + seq_printf(m, "\n\t[Upstream (TX) Interleave path]\n");
1901 + seq_printf(m, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1902 (unsigned int)pIhw->AppData.usICRC_errors,
1903 (unsigned int)pIhw->AppData.usIFEC_errors,
1904 (unsigned int)pIhw->AppData.usINCD_error);
1906 - len += sprintf(buf+len, "\tLCD: \t%u\tHEC: \t%u\n",
1907 + seq_printf(m, "\tLCD: \t%u\tHEC: \t%u\n",
1908 (unsigned int)pIhw->AppData.usILCD_errors,
1909 (unsigned int)pIhw->AppData.usIHEC_errors);
1911 * Downstream Interleaved Errors
1914 - len += sprintf(buf+len, "\n\t[Downstream (RX) Interleave path]\n");
1916 - len += sprintf(buf+len, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1917 + seq_printf(m, "\n\t[Downstream (RX) Interleave path]\n");
1918 + seq_printf(m, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1919 (unsigned int)pIhw->AppData.dsICRC_errors,
1920 (unsigned int)pIhw->AppData.dsIFEC_errors,
1921 (unsigned int)pIhw->AppData.dsINCD_error);
1923 - len += sprintf(buf+len, "\tLCD: \t%u\tHEC: \t%u\n",
1924 + seq_printf(m, "\tLCD: \t%u\tHEC: \t%u\n",
1925 (unsigned int)pIhw->AppData.dsILCD_errors,
1926 (unsigned int)pIhw->AppData.dsIHEC_errors);
1928 * Upstream Fast Errors
1931 - len += sprintf(buf+len, "\n\t[Upstream (TX) Fast path]\n");
1933 - len += sprintf(buf+len, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1934 + seq_printf(m, "\n\t[Upstream (TX) Fast path]\n");
1935 + seq_printf(m, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1936 (unsigned int)pIhw->AppData.usFCRC_errors,
1937 (unsigned int)pIhw->AppData.usFFEC_errors,
1938 (unsigned int)pIhw->AppData.usFNCD_error);
1940 - len += sprintf(buf+len, "\tLCD: \t%u\tHEC: \t%u\n",
1941 + seq_printf(m, "\tLCD: \t%u\tHEC: \t%u\n",
1942 (unsigned int)pIhw->AppData.usFLCD_errors,
1943 (unsigned int)pIhw->AppData.usFHEC_errors);
1945 * Downstream Fast Errors
1948 - len += sprintf(buf+len, "\n\t[Downstream (RX) Fast path]\n");
1950 - len += sprintf(buf+len, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1951 + seq_printf(m, "\n\t[Downstream (RX) Fast path]\n");
1952 + seq_printf(m, "\tCRC: \t%u\tFEC: \t%u\tNCD: \t%u\n",
1953 (unsigned int)pIhw->AppData.dsFCRC_errors,
1954 (unsigned int)pIhw->AppData.dsFFEC_errors,
1955 (unsigned int)pIhw->AppData.dsFNCD_error);
1957 - len += sprintf(buf+len, "\tLCD: \t%u\tHEC: \t%u\n",
1958 - (unsigned int)pIhw->AppData.dsFLCD_errors,
1959 - (unsigned int)pIhw->AppData.dsFHEC_errors);
1960 + seq_printf(m, "\tLCD: \t%u\tHEC: \t%u\n",
1961 + (unsigned int)pIhw->AppData.dsFLCD_errors,
1962 + (unsigned int)pIhw->AppData.dsFHEC_errors);
1965 * ATM stats upstream
1968 - len += sprintf(buf+len, "\n[ATM Stats]");
1970 - len += sprintf(buf+len, "\n\t[Upstream/TX]\n");
1973 - sprintf (buf + len, "\tGood Cell Cnt:\t%u\n\tIdle Cell Cnt:\t%u\n\n",
1974 - (unsigned int) pIhw->AppData.usAtm_count[0] +
1975 - (unsigned int) pIhw->AppData.usAtm_count[1],
1976 - (unsigned int) pIhw->AppData.usIdle_count[0] +
1977 - (unsigned int) pIhw->AppData.usIdle_count[1]);
1978 -//UR8_MERGE_START CQ10700 Manjula K
1981 - sprintf (buf + len,
1982 + seq_printf(m, "\n[ATM Stats]");
1983 + seq_printf(m, "\n\t[Upstream/TX]\n");
1984 + seq_printf (m, "\tGood Cell Cnt:\t%u\n\tIdle Cell Cnt:\t%u\n\n",
1985 + (unsigned int) pIhw->AppData.usAtm_count[0] +
1986 + (unsigned int) pIhw->AppData.usAtm_count[1],
1987 + (unsigned int) pIhw->AppData.usIdle_count[0] +
1988 + (unsigned int) pIhw->AppData.usIdle_count[1]);
1989 +//UR8_MERGE_START CQ10700 Manjula K
1991 "\tTx Packets Dropped Count:\t%lu\n\tTx Bad Packets Count:\t%lu\n",
1992 priv->stats.tx_dropped, priv->stats.tx_errors);
1993 //UR8_MERGE_END CQ10700
1995 * ATM stats downstream
1998 - len += sprintf(buf+len, "\n\t[Downstream/RX)]\n");
2001 - sprintf (buf + len,
2002 - "\tGood Cell Cnt:\t%u\n\tIdle Cell Cnt:\t%u\n\tBad Hec Cell Cnt:\t%u\n",
2003 - (unsigned int) pIhw->AppData.dsGood_count[0] +
2004 - (unsigned int) pIhw->AppData.dsGood_count[1],
2005 - (unsigned int) pIhw->AppData.dsIdle_count[0] +
2006 - (unsigned int) pIhw->AppData.dsIdle_count[1],
2007 - (unsigned int) pIhw->AppData.dsBadHec_count[0] +
2008 - (unsigned int) pIhw->AppData.dsBadHec_count[1]);
2010 - len += sprintf(buf+len, "\tOverflow Dropped Cell Cnt:\t%u\n",
2011 - (unsigned int) pIhw->AppData.dsOVFDrop_count[0] +
2012 - (unsigned int) pIhw->AppData.dsOVFDrop_count[1]);
2014 - //UR8_MERGE_START CQ10700 Manjula K
2017 - sprintf (buf + len,
2018 - "\tRx Packets Dropped Count:\t%lu\n\tRx Bad Packets Count:\t%lu\n\n",
2019 - priv->stats.rx_dropped, priv->stats.rx_errors);
2020 + seq_printf(m, "\n\t[Downstream/RX)]\n");
2022 + "\tGood Cell Cnt:\t%u\n\tIdle Cell Cnt:\t%u\n\tBad Hec Cell Cnt:\t%u\n",
2023 + (unsigned int) pIhw->AppData.dsGood_count[0] +
2024 + (unsigned int) pIhw->AppData.dsGood_count[1],
2025 + (unsigned int) pIhw->AppData.dsIdle_count[0] +
2026 + (unsigned int) pIhw->AppData.dsIdle_count[1],
2027 + (unsigned int) pIhw->AppData.dsBadHec_count[0] +
2028 + (unsigned int) pIhw->AppData.dsBadHec_count[1]);
2029 + seq_printf(m, "\tOverflow Dropped Cell Cnt:\t%u\n",
2030 + (unsigned int) pIhw->AppData.dsOVFDrop_count[0] +
2031 + (unsigned int) pIhw->AppData.dsOVFDrop_count[1]);
2033 + //UR8_MERGE_START CQ10700 Manjula K
2035 + "\tRx Packets Dropped Count:\t%lu\n\tRx Bad Packets Count:\t%lu\n\n",
2036 + priv->stats.rx_dropped, priv->stats.rx_errors);
2037 //UR8_MERGE_END CQ10700
2039 tn7sar_get_stats(pIhw->pOsContext);
2041 - len += sprintf(buf+len, "\n[SAR AAL5 Stats]\n");
2043 - len += sprintf(buf+len, "\tTx PDU's:\t%u\n\tRx PDU's:\t%u\n",
2044 - sarStat.txPktCnt, sarStat.rxPktCnt);
2047 - sprintf (buf + len, "\tTx Total Bytes:\t%u\n\tRx Total Bytes:\t%u\n",
2048 - sarStat.txBytes, sarStat.rxBytes);
2051 - sprintf (buf + len,
2052 - "\tTx Total Error Counts:\t%u\n\tRx Total Error Counts:\t%u\n\n",
2053 - sarStat.txErrors, sarStat.rxErrors);
2054 + seq_printf(m, "\n[SAR AAL5 Stats]\n");
2055 + seq_printf(m, "\tTx PDU's:\t%u\n\tRx PDU's:\t%u\n",
2056 + sarStat.txPktCnt, sarStat.rxPktCnt);
2057 + seq_printf (m, "\tTx Total Bytes:\t%u\n\tRx Total Bytes:\t%u\n",
2058 + sarStat.txBytes, sarStat.rxBytes);
2060 + "\tTx Total Error Counts:\t%u\n\tRx Total Error Counts:\t%u\n\n",
2061 + sarStat.txErrors, sarStat.rxErrors);
2067 - len += sprintf(buf+len, "\n[OAM Stats]\n");
2068 + seq_printf(m, "\n[OAM Stats]\n");
2070 tn7sar_get_near_end_loopback_count(&F4count, &F5count);
2075 - sprintf (buf + len,
2076 - "\tNear End F5 Loop Back Count:\t%u\n\tNear End F4 Loop Back Count:\t%u\n\tFar End F5 Loop Back Count:\t%u\n\tFar End F4 Loop Back Count:\t%u\n",
2078 + "\tNear End F5 Loop Back Count:\t%u\n\tNear End F4 Loop Back Count:\t%u\n\tFar End F5 Loop Back Count:\t%u\n\tFar End F4 Loop Back Count:\t%u\n",
2079 F5count, F4count, oamFarLBCount[0] + oamFarLBCount[2],
2080 oamFarLBCount[1] + oamFarLBCount[3]);
2083 #define USE_OAM_DROP_COUNT //CQ10273
2084 //Read OAM ping responses count:
2085 #ifdef USE_OAM_DROP_COUNT
2089 - sprintf (buf + len,
2090 - "\tSAR OAM Retry in 0x%X cycles, Drop Count=%d\n",
2091 - tn7dsl_get_memory(0xa30085cc), tn7dsl_get_memory(0xa30085c4)); */
2093 + "\tSAR OAM Retry in 0x%X cycles, Drop Count=%d\n",
2094 + tn7dsl_get_memory(0xa30085cc), tn7dsl_get_memory(0xa30085c4)); */
2096 - len += sprintf (buf + len, "\tSAR OAM Ping Response Drop Count=%d\n",
2097 - tn7dsl_get_memory(0xa30085b0));
2099 + seq_printf (m, "\tSAR OAM Ping Response Drop Count=%d\n",
2100 + tn7dsl_get_memory(0xa30085b0));
2101 #endif // USE_OAM_DROP_COUNT
2107 -int tn7dsl_proc_modem(char* buf, char **start, off_t offset, int count,
2108 - int *eof, void *data)
2109 +static int tn7dsl_proc_stats_open(struct inode *inode, struct file *file)
2111 + return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode));
2115 - int limit = count - 80;
2116 +int tn7dsl_proc_write_stats (struct file *fp, const char *buf, unsigned long count, void *data);
2118 +struct file_operations tn7dsl_proc_stats_fops = {
2119 + .owner = THIS_MODULE,
2120 + .open = tn7dsl_proc_stats_open,
2122 + .llseek = seq_lseek,
2123 + .release = single_release,
2124 + .write = tn7dsl_proc_write_stats,
2127 +static int tn7dsl_proc_modem(struct seq_file *m, void *data)
2132 @@ -1859,16 +1775,26 @@ int tn7dsl_proc_modem(char* buf, char **
2134 if(pIhw->lConnected == 1)
2137 - len += sprintf(buf+len,"%s\n",state);
2139 - len += sprintf(buf+len, "%d\n", dslReg);
2141 - len += sprintf(buf+len, "failTrains=%d\n", pIhw->AppData.trainFails);
2142 + seq_printf(m,"%s\n",state);
2143 + seq_printf(m, "%d\n", dslReg);
2144 + seq_printf(m, "failTrains=%d\n", pIhw->AppData.trainFails);
2150 +static int tn7dsl_proc_modem_open(struct inode *inode, struct file *file)
2152 + return single_open(file, tn7dsl_proc_modem, PDE_DATA(inode));
2155 +struct file_operations tn7dsl_proc_modem_fops = {
2156 + .owner = THIS_MODULE,
2157 + .open = tn7dsl_proc_modem_open,
2159 + .llseek = seq_lseek,
2160 + .release = single_release,
2163 /**********************************************************************
2165 ** tn7dsl_hdlc_update_crc() -- Calculate CRC *
2166 @@ -2133,11 +2059,8 @@ static int tn7dsl_hdlc_rx_process(unsign
2170 -int tn7dsl_proc_eoc (char *buf, char **start, off_t OffSet, int count,
2171 - int *eof, void *data)
2172 +static int tn7dsl_proc_eoc (struct seq_file *m, void *data)
2175 - int limit = count - 80;
2176 int offset[2] = {34, 0}; // point to buffer parameter data structure
2177 clearEocParm_t peoc;
2179 @@ -2146,62 +2069,49 @@ int tn7dsl_proc_eoc (char *buf, char **s
2180 (unsigned char *) &peoc,
2181 sizeof (clearEocParm_t));
2184 - len += sprintf(buf+len, "\nClear EOC Channel:\n\n");
2186 - len += sprintf(buf+len, " Enabled:\t%d\n", dslhal_support_byteSwap32(peoc.clearEocEnabled));
2188 - len += sprintf(buf+len, " TxBuf[0]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[0]));
2190 - len += sprintf(buf+len, " TxBuf[1]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[1]));
2192 - len += sprintf(buf+len, " TxBuf[2]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[2]));
2194 - len += sprintf(buf+len, " TxBuf[3]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[3]));
2196 - len += sprintf(buf+len, " RxBuf[0]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[0]));
2198 - len += sprintf(buf+len, " RxBuf[1]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[1]));
2200 - len += sprintf(buf+len, " RxBuf[2]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[2]));
2202 - len += sprintf(buf+len, " RxBuf[3]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[3]));
2204 - len += sprintf(buf+len, " txRdIndex:\t%d\n", dslhal_support_byteSwap32(peoc.txRdIndex));
2206 - len += sprintf(buf+len, " txWrIndex:\t%d\n", dslhal_support_byteSwap32(peoc.txWrIndex));
2208 - len += sprintf(buf+len, " rxRdIndex:\t%d\n", dslhal_support_byteSwap32(peoc.rxRdIndex));
2210 - len += sprintf(buf+len, " rxWrIndex:\t%d\n\n", dslhal_support_byteSwap32(peoc.rxWrIndex));
2212 - len += sprintf(buf+len, " TotalTxPkts:\t%d\n", EocTxTotalPackets);
2214 - len += sprintf(buf+len, " TotalRxPkts:\t%d\n", EocRxTotalPackets);
2216 - len += sprintf(buf+len, " TotalTxBytes:\t%d\n", EocTxTotalBytes);
2218 - len += sprintf(buf+len, " TotalRxBytes:\t%d\n\n", EocRxTotalBytes);
2220 - len += sprintf(buf+len, " ErrBufFull:\t%d\n", ErrEocBufFull);
2222 - len += sprintf(buf+len, " ErrBufIndx:\t%d\n", ErrEocBufIndex);
2224 - len += sprintf(buf+len, " ErrBufMax:\t%d\n", ErrEocBufMax);
2226 - len += sprintf(buf+len, " ErrMsgMax:\t%d\n", ErrEocMsgOversized);
2228 - len += sprintf(buf+len, " ErrTxHDLC:\t%d\n", ErrEocTxHdlcCRC);
2230 - len += sprintf(buf+len, " ErrRxHDLC:\t%d\n", ErrEocRxHdlcCRC);
2232 - len += sprintf(buf+len, " ErrRxSnmp:\t%d\n", ErrEocRxHdlcFraming);
2234 - len += sprintf(buf+len, " ErrRxPush:\t%d\n\n", ErrEocRxPush);
2235 + seq_printf(m, "\nClear EOC Channel:\n\n");
2236 + seq_printf(m, " Enabled:\t%d\n", dslhal_support_byteSwap32(peoc.clearEocEnabled));
2237 + seq_printf(m, " TxBuf[0]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[0]));
2238 + seq_printf(m, " TxBuf[1]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[1]));
2239 + seq_printf(m, " TxBuf[2]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[2]));
2240 + seq_printf(m, " TxBuf[3]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pTxBufDesc[3]));
2241 + seq_printf(m, " RxBuf[0]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[0]));
2242 + seq_printf(m, " RxBuf[1]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[1]));
2243 + seq_printf(m, " RxBuf[2]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[2]));
2244 + seq_printf(m, " RxBuf[3]:\t0x%08x\n", dslhal_support_byteSwap32((unsigned int)peoc.pRxBufDesc[3]));
2245 + seq_printf(m, " txRdIndex:\t%d\n", dslhal_support_byteSwap32(peoc.txRdIndex));
2246 + seq_printf(m, " txWrIndex:\t%d\n", dslhal_support_byteSwap32(peoc.txWrIndex));
2247 + seq_printf(m, " rxRdIndex:\t%d\n", dslhal_support_byteSwap32(peoc.rxRdIndex));
2248 + seq_printf(m, " rxWrIndex:\t%d\n\n", dslhal_support_byteSwap32(peoc.rxWrIndex));
2249 + seq_printf(m, " TotalTxPkts:\t%d\n", EocTxTotalPackets);
2250 + seq_printf(m, " TotalRxPkts:\t%d\n", EocRxTotalPackets);
2251 + seq_printf(m, " TotalTxBytes:\t%d\n", EocTxTotalBytes);
2252 + seq_printf(m, " TotalRxBytes:\t%d\n\n", EocRxTotalBytes);
2253 + seq_printf(m, " ErrBufFull:\t%d\n", ErrEocBufFull);
2254 + seq_printf(m, " ErrBufIndx:\t%d\n", ErrEocBufIndex);
2255 + seq_printf(m, " ErrBufMax:\t%d\n", ErrEocBufMax);
2256 + seq_printf(m, " ErrMsgMax:\t%d\n", ErrEocMsgOversized);
2257 + seq_printf(m, " ErrTxHDLC:\t%d\n", ErrEocTxHdlcCRC);
2258 + seq_printf(m, " ErrRxHDLC:\t%d\n", ErrEocRxHdlcCRC);
2259 + seq_printf(m, " ErrRxSnmp:\t%d\n", ErrEocRxHdlcFraming);
2260 + seq_printf(m, " ErrRxPush:\t%d\n\n", ErrEocRxPush);
2266 +static int tn7dsl_proc_eoc_open(struct inode *inode, struct file *file)
2268 + return single_open(file, tn7dsl_proc_eoc, PDE_DATA(inode));
2271 +struct file_operations tn7dsl_proc_eoc_fops = {
2272 + .owner = THIS_MODULE,
2273 + .open = tn7dsl_proc_eoc_open,
2275 + .llseek = seq_lseek,
2276 + .release = single_release,
2279 int tn7dsl_clear_eoc_setup(void)
2282 @@ -4440,14 +4350,10 @@ int tn7dsl_proc_write_stats (struct file
2286 -int tn7dsl_proc_train_mode_export (char *buf, char **start, off_t offset,
2287 - int count, int *eof, void *data)
2288 +static int tn7dsl_proc_train_mode_export (struct seq_file *m, void *data)
2292 - char *cp = buf + offset;
2294 - static int ctr = 0;
2298 @@ -4528,197 +4434,185 @@ int tn7dsl_proc_train_mode_export (char
2303 + for (i = 0; (i < num_entries) ; i++)
2305 - for (i = ctr; ((i < num_entries)&& (len <= count)) ; i++)
2308 - * Write the current string only if we can fit it into the buffer
2310 - if((strlen(dsl_modes[i].mode_name) + 6 + len) <= count)
2312 - len += snprintf(cp+len, (count - len), "%s\t\t\t%#x\n",
2313 - dsl_modes[i].mode_name, dsl_modes[i].mode_value);
2318 + seq_printf(m, "%s\t\t\t%#x\n",
2319 + dsl_modes[i].mode_name, dsl_modes[i].mode_value);
2323 - * Data was completely written
2325 - if (i >= num_entries)
2328 - * We are done with this
2336 - * We have not been able to write the complete data, and we have to nul
2337 - * terminate the buffer.
2339 - *(cp + len) = '\0';
2342 - * Save the value of the counter for the next read for the rest of the
2352 -#ifndef NO_ADV_STATS
2353 -int tn7dsl_proc_SNRpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2354 +static int tn7dsl_proc_train_mode_export_open(struct inode *inode, struct file *file)
2358 + return single_open(file, tn7dsl_proc_train_mode_export, PDE_DATA(inode));
2361 +struct file_operations tn7dsl_proc_train_mode_export_fops = {
2362 + .owner = THIS_MODULE,
2363 + .open = tn7dsl_proc_train_mode_export_open,
2365 + .llseek = seq_lseek,
2366 + .release = single_release,
2369 - int limit = count - 80;
2370 +#ifndef NO_ADV_STATS
2371 +int tn7dsl_proc_SNRpsds(struct seq_file *m, void *data)
2374 unsigned char SNRpsds[512];
2377 - len += sprintf(buf+len, "\nAR7 SNRpsds:");
2378 + seq_printf(m, "\nAR7 SNRpsds:");
2380 if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1))
2382 dgprintf(4, "dslhal_api_getSNRpsds failed!\n");
2387 for (i=0; i<pIhw->AppData.max_ds_tones; i++)
2392 - len += sprintf(buf+len, "\n");
2393 + seq_printf(m, "\n");
2397 - len += sprintf(buf+len, "%d ", (unsigned char)SNRpsds[i]);
2398 + seq_printf(m, "%d ", (unsigned char)SNRpsds[i]);
2402 - len += sprintf(buf+len, "\n");
2403 + seq_printf(m, "\n");
2411 +static int tn7dsl_proc_SNRpsds_open(struct inode *inode, struct file *file)
2413 + return single_open(file, tn7dsl_proc_SNRpsds, PDE_DATA(inode));
2416 +struct file_operations tn7dsl_proc_SNRpsds_fops = {
2417 + .owner = THIS_MODULE,
2418 + .open = tn7dsl_proc_SNRpsds_open,
2420 + .llseek = seq_lseek,
2421 + .release = single_release,
2426 #ifndef NO_ADV_STATS
2427 -int tn7dsl_proc_QLNpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2428 +static int tn7dsl_proc_QLNpsds(struct seq_file *m, void *data)
2432 - int limit = count - 80;
2433 unsigned char QLNpsds[512];
2437 - len += sprintf(buf+len, "\nAR7 QLNpsds:");
2438 + seq_printf(m, "\nAR7 QLNpsds:");
2440 // call API instead of access internal buf directly
2441 if (dslhal_api_getQLNpsds(pIhw, QLNpsds, 0))
2443 dgprintf(4, "dslhal_api_getQLNpsds failed!\n");
2448 for (i=0; i<pIhw->AppData.max_ds_tones; i++)
2453 - len += sprintf(buf+len, "\n");
2454 + seq_printf(m, "\n");
2458 - len += sprintf(buf+len, "%d ", (unsigned char)QLNpsds[i]);
2459 + seq_printf(m, "%d ", (unsigned char)QLNpsds[i]);
2463 - len += sprintf(buf+len, "\n");
2464 + seq_printf(m, "\n");
2471 +static int tn7dsl_proc_QLNpsds_open(struct inode *inode, struct file *file)
2473 + return single_open(file, tn7dsl_proc_QLNpsds, PDE_DATA(inode));
2476 +struct file_operations tn7dsl_proc_QLNpsds_fops = {
2477 + .owner = THIS_MODULE,
2478 + .open = tn7dsl_proc_QLNpsds_open,
2480 + .llseek = seq_lseek,
2481 + .release = single_release,
2486 // UR8_MERGE_START CQ10979 Jack Zhang
2488 #ifndef NO_ADV_STATS
2489 -int tn7dsl_proc_HLINpsds(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2490 +static int tn7dsl_proc_HLINpsds(struct seq_file *m, void *data)
2494 - int limit = count - 80;
2495 short HLINpsds[2*512];
2499 - len += sprintf(buf+len, "\nAR7 HLINpsds:");
2500 + seq_printf(m, "\nAR7 HLINpsds:");
2502 // call API instead of access internal buf directly
2503 if (dslhal_api_getHLINpsds(pIhw, (unsigned char *)HLINpsds, 1))
2505 dgprintf(4, "dslhal_api_getHLINpsds failed!\n");
2510 for (i=0; i<pIhw->AppData.max_ds_tones; i++)
2515 - len += sprintf(buf+len, "\n");
2516 + seq_printf(m, "\n");
2520 - len += sprintf(buf+len, "(%d,%d) ", HLINpsds[2*i], HLINpsds[2*i+1]);
2521 + seq_printf(m, "(%d,%d) ", HLINpsds[2*i], HLINpsds[2*i+1]);
2525 - len += sprintf(buf+len, "\n");
2526 + seq_printf(m, "\n");
2533 -static int tn7dsl_proc_HLINpsdsIndx(char* buf, char **start, off_t offset, int count,int *eof, void *data, int indx)
2534 +static int tn7dsl_proc_HLINpsds_open(struct inode *inode, struct file *file)
2537 + return single_open(file, tn7dsl_proc_HLINpsds, PDE_DATA(inode));
2540 - int limit = count - 80;
2541 +struct file_operations tn7dsl_proc_HLINpsds_fops = {
2542 + .owner = THIS_MODULE,
2543 + .open = tn7dsl_proc_HLINpsds_open,
2545 + .llseek = seq_lseek,
2546 + .release = single_release,
2549 +static int tn7dsl_proc_HLINpsdsIndx(struct seq_file *m, void *data, int indx)
2551 short HLINpsds[2*512];
2553 int start=0, dim=128;
2556 - len += sprintf(buf+len, "\nAR7 HLINpsds: (section %d)", indx);
2557 + seq_printf(m, "\nAR7 HLINpsds: (section %d)", indx);
2559 if((indx > 2) && (pIhw->AppData.max_ds_tones <= 256))
2562 - len += sprintf(buf+len, "\n[End of data]");
2564 + seq_printf(m, "\n[End of data]");
2568 // call API instead of access internal buf directly
2569 if (dslhal_api_getHLINpsds(pIhw, (unsigned char *)HLINpsds, 1))
2571 dgprintf(4, "dslhal_api_getHLINpsds failed!\n");
2576 start = (indx -1) * 128;
2577 @@ -4727,39 +4621,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char
2582 - len += sprintf(buf+len, "\n%d: ", i);
2583 + seq_printf(m, "\n%d: ", i);
2587 - len += sprintf(buf+len, "(%d,%d) ", HLINpsds[2*i], HLINpsds[2*i+1]);
2588 + seq_printf(m, "(%d,%d) ", HLINpsds[2*i], HLINpsds[2*i+1]);
2592 - len += sprintf(buf+len, "\n");
2593 + seq_printf(m, "\n");
2599 +static int tn7dsl_proc_HLINpsds1(struct seq_file *m, void *data)
2601 + return tn7dsl_proc_HLINpsdsIndx(m, data, 1);
2604 +static int tn7dsl_proc_HLINpsds2(struct seq_file *m, void *data)
2606 + return tn7dsl_proc_HLINpsdsIndx(m, data, 2);
2609 +static int tn7dsl_proc_HLINpsds3(struct seq_file *m, void *data)
2611 + return tn7dsl_proc_HLINpsdsIndx(m, data, 3);
2614 +static int tn7dsl_proc_HLINpsds4(struct seq_file *m, void *data)
2616 + return tn7dsl_proc_HLINpsdsIndx(m, data, 4);
2619 -int tn7dsl_proc_HLINpsds1(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2620 +static int tn7dsl_proc_HLINpsds1_open(struct inode *inode, struct file *file)
2622 - return tn7dsl_proc_HLINpsdsIndx(buf, start, offset, count,eof, data, 1);
2623 + return single_open(file, tn7dsl_proc_HLINpsds1, PDE_DATA(inode));
2626 -int tn7dsl_proc_HLINpsds2(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2627 +static int tn7dsl_proc_HLINpsds2_open(struct inode *inode, struct file *file)
2629 - return tn7dsl_proc_HLINpsdsIndx(buf, start, offset, count,eof, data, 2);
2630 + return single_open(file, tn7dsl_proc_HLINpsds2, PDE_DATA(inode));
2633 -int tn7dsl_proc_HLINpsds3(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2634 +static int tn7dsl_proc_HLINpsds3_open(struct inode *inode, struct file *file)
2636 - return tn7dsl_proc_HLINpsdsIndx(buf, start, offset, count,eof, data, 3);
2637 + return single_open(file, tn7dsl_proc_HLINpsds3, PDE_DATA(inode));
2640 -int tn7dsl_proc_HLINpsds4(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2641 +static int tn7dsl_proc_HLINpsds4_open(struct inode *inode, struct file *file)
2643 - return tn7dsl_proc_HLINpsdsIndx(buf, start, offset, count,eof, data, 4);
2644 + return single_open(file, tn7dsl_proc_HLINpsds4, PDE_DATA(inode));
2647 +struct file_operations tn7dsl_proc_HLINpsds1_fops = {
2648 + .owner = THIS_MODULE,
2649 + .open = tn7dsl_proc_HLINpsds1_open,
2651 + .llseek = seq_lseek,
2652 + .release = single_release,
2655 +struct file_operations tn7dsl_proc_HLINpsds2_fops = {
2656 + .owner = THIS_MODULE,
2657 + .open = tn7dsl_proc_HLINpsds2_open,
2659 + .llseek = seq_lseek,
2660 + .release = single_release,
2663 +struct file_operations tn7dsl_proc_HLINpsds3_fops = {
2664 + .owner = THIS_MODULE,
2665 + .open = tn7dsl_proc_HLINpsds3_open,
2667 + .llseek = seq_lseek,
2668 + .release = single_release,
2671 +struct file_operations tn7dsl_proc_HLINpsds4_fops = {
2672 + .owner = THIS_MODULE,
2673 + .open = tn7dsl_proc_HLINpsds4_open,
2675 + .llseek = seq_lseek,
2676 + .release = single_release,
2680 #endif //TR69_HLIN_IN
2681 // UR8_MERGE_END CQ10979*
2682 @@ -4767,64 +4711,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha
2683 // * UR8_MERGE_START CQ11057 Jack Zhang
2685 #ifndef NO_ADV_STATS
2686 -int tn7dsl_proc_PMDus(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2687 +static int tn7dsl_proc_PMDus(struct seq_file *m, void *data)
2691 - int limit = count - 80;
2693 CoPMDTestParams_t co_pmdtest_params;
2696 - len += sprintf(buf+len, "\nAR7 US PMD Test:\n");
2698 + seq_printf(m, "\nAR7 US PMD Test:\n");
2700 // call API instead of access internal buf directly
2701 if (dslhal_api_getPMDTestus(pIhw, &co_pmdtest_params, 0) != DSLHAL_ERROR_NO_ERRORS)
2703 dgprintf(4, "dslhal_api_getPMDTestus failed!\n");
2709 - len += sprintf(buf+len, "LATN=%d\n", co_pmdtest_params.co_latn);
2710 + seq_printf(m, "LATN=%d\n", co_pmdtest_params.co_latn);
2713 - len += sprintf(buf+len, "SATN=%d\n", co_pmdtest_params.co_satn);
2714 + seq_printf(m, "SATN=%d\n", co_pmdtest_params.co_satn);
2717 - len += sprintf(buf+len, "SNRM=%d\n", co_pmdtest_params.usMargin);
2718 + seq_printf(m, "SNRM=%d\n", co_pmdtest_params.usMargin);
2721 - len += sprintf(buf+len, "attndr=%ld\n", co_pmdtest_params.co_attndr);
2722 + seq_printf(m, "attndr=%ld\n", co_pmdtest_params.co_attndr);
2725 - len += sprintf(buf+len, "NearActatp=%d\n", co_pmdtest_params.co_near_actatp);
2726 + seq_printf(m, "NearActatp=%d\n", co_pmdtest_params.co_near_actatp);
2729 - len += sprintf(buf+len, "FarActatp=%d\n", co_pmdtest_params.co_far_actatp);
2730 + seq_printf(m, "FarActatp=%d\n", co_pmdtest_params.co_far_actatp);
2733 for (i=0; i<pIhw->AppData.max_us_tones; i++)
2738 - len += sprintf(buf+len, "\nHLOG(%3d):", i);
2741 - len += sprintf(buf+len, " %d", co_pmdtest_params.TestParmCOHlogfMsg[i]);
2742 + seq_printf(m, "\nHLOG(%3d):", i);
2744 + seq_printf(m, " %d", co_pmdtest_params.TestParmCOHlogfMsg[i]);
2748 for (i=0; i<pIhw->AppData.max_us_tones; i++)
2753 - len += sprintf(buf+len, "\nQLN(%3d):", i);
2756 - len += sprintf(buf+len, " %d", co_pmdtest_params.TestParmCOQLNfMsg[i]);
2757 + seq_printf(m, "\nQLN(%3d):", i);
2759 + seq_printf(m, " %d", co_pmdtest_params.TestParmCOQLNfMsg[i]);
2763 @@ -4832,19 +4760,28 @@ int tn7dsl_proc_PMDus(char* buf, char **
2764 for (i=0; i<pIhw->AppData.max_us_tones; i++)
2769 - len += sprintf(buf+len, "\nSNR(%3d):", i);
2772 - len += sprintf(buf+len, " %d", co_pmdtest_params.TestParmCOSNRfMsg[i]);
2773 + seq_printf(m, "\nSNR(%3d):", i);
2774 + seq_printf(m, " %d", co_pmdtest_params.TestParmCOSNRfMsg[i]);
2778 - len += sprintf(buf+len, "\n");
2779 + seq_printf(m, "\n");
2785 +static int tn7dsl_proc_PMDus_open(struct inode *inode, struct file *file)
2787 + return single_open(file, tn7dsl_proc_PMDus, PDE_DATA(inode));
2790 +struct file_operations tn7dsl_proc_PMDus_fops = {
2791 + .owner = THIS_MODULE,
2792 + .open = tn7dsl_proc_PMDus_open,
2794 + .llseek = seq_lseek,
2795 + .release = single_release,
2798 #endif //NO_ADV_STATS
2799 #endif //TR69_PMD_IN
2800 // * UR8_MERGE_END CQ11057 *
2803 @@ -1401,44 +1401,70 @@ int tn7sar_oam_generation(void *privCont
2807 -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2808 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
2809 +#define PDE_DATA(inode) PDE(inode)->data
2812 +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data)
2815 unsigned int oam_ps = oamPingStatus;
2817 if( oam_ps == OAM_PING_PENDING_RECVD )
2818 oam_ps = OAM_PING_PENDING; //jz CQ9861: Only export the PENDING status, not internal state
2820 - len += sprintf(buf+len, "%d\n", oam_ps); //oamPingStatus);
2821 + seq_printf(m, "%d\n", oam_ps); //oamPingStatus);
2827 -int tn7sar_proc_pvc_table(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2828 +static int tn7sar_proc_oam_ping_open(struct inode *inode, struct file *file)
2830 + return single_open(file, tn7sar_proc_oam_ping, PDE_DATA(inode));
2833 +struct file_operations tn7sar_proc_oam_ping_fops = {
2834 + .owner = THIS_MODULE,
2835 + .open = tn7sar_proc_oam_ping_open,
2837 + .llseek = seq_lseek,
2838 + .release = single_release,
2842 +static int tn7sar_proc_pvc_table(struct seq_file *m, void *data)
2849 if(pvc_result[i].bInUse)
2851 - len += sprintf(buf+len, "%d,%d\n", pvc_result[i].vpi,pvc_result[i].vci);
2852 + seq_printf(m, "%d,%d\n", pvc_result[i].vpi,pvc_result[i].vci);
2856 - len += sprintf(buf+len, "0,0\n");
2857 + seq_printf(m, "0,0\n");
2864 +static int tn7sar_proc_pvc_table_open(struct inode *inode, struct file *file)
2866 + return single_open(file, tn7sar_proc_pvc_table, PDE_DATA(inode));
2869 +struct file_operations tn7sar_proc_pvc_table_fops = {
2870 + .owner = THIS_MODULE,
2871 + .open = tn7sar_proc_pvc_table_open,
2873 + .llseek = seq_lseek,
2874 + .release = single_release,
2878 -int tn7sar_proc_sar_stat(char* buf, char **start, off_t offset, int count,int *eof, void *data)
2879 +static int tn7sar_proc_sar_stat(struct seq_file *m, void *data)
2882 - int limit = count - 80;
2883 struct atm_dev *dev;
2884 Tn7AtmPrivate *priv;
2886 @@ -1447,21 +1473,19 @@ int tn7sar_proc_sar_stat(char* buf, char
2887 unsigned int *pStateBase, *pSarStat;
2888 HAL_FUNCTIONS *pHalFunc;
2889 HAL_DEVICE *pHalDev;
2892 - dev = (struct atm_dev *)data;
2893 + dev = (struct atm_dev *)m->private;
2894 priv = (Tn7AtmPrivate *)dev->dev_data;
2896 pHalFunc = (HAL_FUNCTIONS *)priv->pSarHalFunc;
2897 pHalDev = (HAL_DEVICE *)priv->pSarHalDev;
2899 - len += sprintf(buf+len, "SAR HAL Statistics");
2900 + seq_printf(m, "SAR HAL Statistics");
2901 for(i=0;i<MAX_DMA_CHAN;i++)
2903 if(priv->lut[i].inuse)
2906 - len += sprintf(buf+len, "\nChannel %d:\n",priv->lut[i].chanid);
2907 + seq_printf(m, "\nChannel %d:\n",priv->lut[i].chanid);
2911 @@ -1474,26 +1498,16 @@ int tn7sar_proc_sar_stat(char* buf, char
2913 if((char *)*pSarStat == NULL)
2917 - dBytes = sprintf(buf+len, "%s: ",(char *) *pSarStat);
2922 + k += seq_printf(m, "%s: ",(char *) *pSarStat);
2926 - dBytes = sprintf(buf+len, "%s; \n",(char *) *pSarStat);
2930 + k += seq_printf(m, "%s; \n",(char *) *pSarStat);
2937 - len += sprintf(buf+len, "\n");
2938 + seq_printf(m, "\n");
2942 @@ -1502,9 +1516,22 @@ int tn7sar_proc_sar_stat(char* buf, char
2950 +static int tn7sar_proc_sar_stat_open(struct inode *inode, struct file *file)
2952 + return single_open(file, tn7sar_proc_sar_stat, PDE_DATA(inode));
2955 +struct file_operations tn7sar_proc_sar_stat_fops = {
2956 + .owner = THIS_MODULE,
2957 + .open = tn7sar_proc_sar_stat_open,
2959 + .llseek = seq_lseek,
2960 + .release = single_release,
2963 void tn7sar_get_sar_firmware_version(unsigned int *pdsp_version_ms, unsigned int *pdsp_version_ls)