kernel: add Intel/Lantiq VRX518 TC driver
[openwrt/staging/hauke.git] / package / kernel / lantiq / vrx518_tc / patches / 100-compat.patch
1 --- a/dcdp/atm_tc.c
2 +++ b/dcdp/atm_tc.c
3 @@ -44,9 +44,9 @@
4 #include <linux/atmioc.h>
5 #include <linux/skbuff.h>
6 #include "inc/dsl_tc.h"
7 -#include <net/datapath_proc_api.h>
8 +// #include <net/datapath_proc_api.h>
9 #include <linux/atm.h>
10 -#include <net/datapath_api.h>
11 +// #include <net/datapath_api.h>
12 #include <net/dc_ep.h>
13 #include<linux/sched.h>
14 #include<linux/kthread.h>
15 @@ -730,20 +730,16 @@ static void atm_aca_init(struct atm_priv
16 ACA_TXOUT_EN | ACA_RXIN_EN | ACA_RXOUT_EN, 1);
17 }
18
19 -static int print_datetime(char *buffer, const struct timespec *datetime)
20 +static int print_datetime(char *buffer, const struct timespec64 *datetime)
21 {
22 - struct timeval tv;
23 struct tm nowtm;
24 char tmbuf[64];
25 - s64 nsec;
26
27 if (buffer == NULL || datetime == NULL) {
28 pr_err("%s : Invalid arguments\n", __func__);
29 return -1;
30 }
31 - nsec = timespec_to_ns(datetime);
32 - tv = ns_to_timeval(nsec);
33 - time_to_tm(tv.tv_sec, 0, &nowtm);
34 + time64_to_tm(datetime->tv_sec, 0, &nowtm);
35 memset(tmbuf, 0, 64);
36
37 snprintf(tmbuf, sizeof(tmbuf), "%ld-%d-%d %d:%d:%d",
38 @@ -753,7 +749,7 @@ static int print_datetime(char *buffer,
39 nowtm.tm_hour,
40 nowtm.tm_min,
41 nowtm.tm_sec);
42 - snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)tv.tv_usec);
43 + snprintf(buffer, sizeof(buffer), "%s.%06d", tmbuf, (int)datetime->tv_nsec / 1000);
44
45 return 0;
46 }
47 @@ -1313,7 +1309,7 @@ static int ppe_send(struct atm_vcc *vcc,
48 /* assume LLC header + Ethernet ID: 6+2 */
49 if ((priv->conn[conn].mpoa_type == MPOA_TYPE_EOA_WO_FCS) ||
50 (priv->conn[conn].mpoa_type == MPOA_TYPE_EOA_W_FCS)) {
51 - if (__skb_put_padto(skb, ETH_ZLEN + 8))
52 + if (__skb_put_padto(skb, ETH_ZLEN + 8, false))
53 goto CHECK_SHOWTIME_FAIL;
54 }
55
56 @@ -1418,7 +1414,7 @@ int ppe_send_oam(struct atm_vcc *vcc, vo
57 struct atm_priv *priv = g_atm_tc;
58 struct sk_buff *skb;
59 unsigned int conn;
60 - dp_subif_t dp_id;
61 +// dp_subif_t dp_id;
62 #ifdef OAM_FIX_GRX750
63 unsigned char *dest_cell;
64 #endif
65 @@ -1465,8 +1461,8 @@ int ppe_send_oam(struct atm_vcc *vcc, vo
66 priv->tc_priv->param.oam_prio = 0;
67 qid = priv->conn[conn].prio_queue_map[priv->tc_priv->param.oam_prio];
68 vid = priv->conn[conn].subif_id;
69 - dp_id.subif = (vid & (~0x7f)) |
70 - ATM_DESC_SUBIF_ID(qid, mpoa_pt, mpoa_type);
71 +// dp_id.subif = (vid & (~0x7f)) |
72 +// ATM_DESC_SUBIF_ID(qid, mpoa_pt, mpoa_type);
73 #ifdef OAM_FIX_GRX750
74 dest_cell = kmalloc(CELL_SIZE, GFP_KERNEL);
75 if (dest_cell == NULL) {
76 @@ -1494,18 +1490,18 @@ int ppe_send_oam(struct atm_vcc *vcc, vo
77 #else
78 memcpy(skb->data, cell, CELL_SIZE);
79 #endif
80 - /* SET SUBIFID */
81 - skb->DW0 = (skb->DW0 & ~0x7FFF) | dp_id.subif;
82 - skb->dev = priv->conn[conn].dev;
83 - tc_dbg(priv->tc_priv, MSG_TX, "conn: %d, dev name: %s, qid: 0x%x len:%d\n",
84 - conn, skb->dev->name, dp_id.subif, skb->len);
85 - #ifdef OAM_FIX_GRX750
86 - if (priv->tc_priv->tc_ops.send(NULL,
87 - skb, dp_id.subif, ATM_OAM_PKT) == 0) {
88 - #else
89 +// /* SET SUBIFID */
90 +// skb->DW0 = (skb->DW0 & ~0x7FFF) | dp_id.subif;
91 +// skb->dev = priv->conn[conn].dev;
92 +// tc_dbg(priv->tc_priv, MSG_TX, "conn: %d, dev name: %s, qid: 0x%x len:%d\n",
93 +// conn, skb->dev->name, dp_id.subif, skb->len);
94 +// #ifdef OAM_FIX_GRX750
95 +// if (priv->tc_priv->tc_ops.send(NULL,
96 +// skb, dp_id.subif, ATM_OAM_PKT) == 0) {
97 +// #else
98 if (priv->tc_priv->tc_ops.send(NULL,
99 skb, qid, ATM_OAM_PKT) == 0) {
100 - #endif
101 +// #endif
102 priv->stats.oam_tx_pkts++;
103 priv->stats.oam_tx_bytes += skb->len;
104 priv->conn[conn].stats.oam_tx_pkts++;
105 @@ -1604,7 +1600,7 @@ static void oam_push(struct atm_priv *pr
106 conn = -1; /* invalid */
107 if (conn_valid(conn) && priv->conn[conn].vcc != NULL) {
108 vcc = priv->conn[conn].vcc;
109 - priv->conn[conn].access_time = current_kernel_time();
110 + ktime_get_coarse_ts64(&priv->conn[conn].access_time);
111
112 tc_dbg(priv->tc_priv, MSG_OAM_RX, "conn=%d, vpi: %d, vci:%d\n",
113 conn, header->vpi, header->vci);
114 @@ -2547,30 +2543,29 @@ static void ppe_atm_fw_hw_init(struct at
115 static int atm_dev_init(struct atm_priv *atm_priv, int ep_id)
116 {
117 int i, err;
118 - struct atm_dev *dev;
119 - dev = atm_dev_register(g_atm_dev_name,
120 - atm_priv->tc_priv->ep_dev[ep_id].dev,
121 - &g_ppe_atm_ops, -1, NULL);
122 - if (!dev) {
123 - err = -EIO;
124 - goto ATM_DEV_REGISTER_FAIL;
125 - }
126 - dev->ci_range.vpi_bits = 8;
127 - dev->ci_range.vci_bits = 16;
128 - /* assume 3200 cell rate
129 - * before get real information
130 - */
131 - dev->link_rate =
132 - DEFAULT_CELL_RATE;
133 - dev->dev_data = atm_priv;
134 - dev->phy_data =
135 - (void *)(unsigned long)0;
136
137 for (i = 0; i < ATM_PORT_NUMBER; i++) {
138 if (atm_priv->port[i].dev)
139 continue;
140 atm_priv->port[i].tx_max_cell_rate = DEFAULT_CELL_RATE;
141 - atm_priv->port[i].dev = dev;
142 + atm_priv->port[i].dev = atm_dev_register(g_atm_dev_name,
143 + atm_priv->tc_priv->ep_dev[ep_id].dev,
144 + &g_ppe_atm_ops, -1, NULL);
145 + if (!atm_priv->port[i].dev) {
146 + err = -EIO;
147 + goto ATM_DEV_REGISTER_FAIL;
148 + } else {
149 + atm_priv->port[i].dev->ci_range.vpi_bits = 8;
150 + atm_priv->port[i].dev->ci_range.vci_bits = 16;
151 + /* assume 3200 cell rate
152 + * before get real information
153 + */
154 + atm_priv->port[i].dev->link_rate =
155 + DEFAULT_CELL_RATE;
156 + atm_priv->port[i].dev->dev_data = atm_priv;
157 + atm_priv->port[i].dev->phy_data =
158 + (void *)(unsigned long)i;
159 + }
160 }
161 //TODO : check for SoC PMAC, current fix
162 #ifdef CONFIG_SOC_TYPE_XWAY
163 @@ -2985,7 +2980,8 @@ static unsigned int atm_get_pvc_id(struc
164 return -EINVAL;
165 }
166
167 - return (skb->DW0 >> 3) & 0xF;
168 +// return (skb->DW0 >> 3) & 0xF;
169 + return 1;
170 }
171
172 static int atm_get_qid_by_vcc(struct net_device *dev, struct sk_buff *skb,
173 @@ -3292,7 +3288,7 @@ static void atm_push(struct net_device *
174 += skb->len;
175 } else
176 priv->stats.aal5_rx_errors++;
177 - priv->conn[conn].access_time = current_kernel_time();
178 + ktime_get_coarse_ts64(&priv->conn[conn].access_time);
179 spin_unlock_bh(&priv->atm_lock);
180
181 vcc->push(vcc, skb);
182 --- a/dcdp/inc/atm_tc.h
183 +++ b/dcdp/inc/atm_tc.h
184 @@ -449,7 +449,7 @@ struct atm_port {
185 struct atm_pvc {
186 struct atm_vcc *vcc; /* opened VCC */
187 struct net_device *dev; /* net device associated with atm VCC */
188 - struct timespec access_time; /* time when last user cell arrived */
189 + struct timespec64 access_time; /* time when last user cell arrived */
190 int prio_queue_map[ATM_PRIO_Q_NUM];
191 unsigned int prio_tx_packets[ATM_PRIO_Q_NUM];
192 struct atm_stats stats;
193 --- a/dcdp/inc/tc_api.h
194 +++ b/dcdp/inc/tc_api.h
195 @@ -196,19 +196,6 @@ static inline void aca_ring_addr_init(st
196 ring->aca_cnt_phyaddr = ep_dev->phy_membase + addr;
197 }
198
199 -static inline int __skb_put_padto(struct sk_buff *skb, unsigned int len)
200 -{
201 - unsigned int size = skb->len;
202 -
203 - if (unlikely(size < len)) {
204 - len -= size;
205 - if (skb_pad(skb, len))
206 - return -ENOMEM;
207 - __skb_put(skb, len);
208 - }
209 - return 0;
210 -}
211 -
212 extern int showtime_stat(struct tc_priv *);
213 extern void dump_skb_info(struct tc_priv *, struct sk_buff *, u32);
214 extern void *tc_buf_alloc(void *, size_t, u32 *,
215 --- a/dcdp/inc/tc_proc.h
216 +++ b/dcdp/inc/tc_proc.h
217 @@ -23,6 +23,8 @@
218 #ifndef __TC_PROC_H__
219 #define __TC_PROC_H__
220
221 +#include <linux/version.h>
222 +
223 #define TC_PROC_DIR "driver/vrx518"
224 #define TC_PROC_ATM_DIR "atm"
225 #define TC_PROC_PTM_DIR "ptm"
226 @@ -41,7 +43,7 @@ enum {
227 struct tc_proc_list {
228 char proc_name[32];
229 umode_t mode;
230 - const struct file_operations *fops;
231 + const struct proc_ops *fops;
232 int is_folder;
233 };
234
235 --- a/dcdp/ptm_tc.c
236 +++ b/dcdp/ptm_tc.c
237 @@ -39,7 +39,7 @@
238 #include <linux/seq_file.h>
239 #include <linux/printk.h>
240 #include <linux/etherdevice.h>
241 -#include <net/datapath_proc_api.h>
242 +// #include <net/datapath_proc_api.h>
243
244 #include "inc/tc_main.h"
245 #include "inc/reg_addr.h"
246 @@ -182,8 +182,8 @@ static int ptm_get_qid(struct net_device
247 return qid;
248 }
249
250 -static struct rtnl_link_stats64 *ptm_get_stats(struct net_device *dev,
251 - struct rtnl_link_stats64 *storage)
252 +static void ptm_get_stats(struct net_device *dev,
253 + struct rtnl_link_stats64 *storage)
254 {
255 struct ptm_priv *ptm_tc = netdev_priv(dev);
256
257 @@ -191,8 +191,6 @@ static struct rtnl_link_stats64 *ptm_get
258 memcpy(storage, &ptm_tc->stats64, sizeof(ptm_tc->stats64));
259 else
260 storage->tx_errors += ptm_tc->stats64.tx_errors;
261 -
262 - return storage;
263 }
264
265 static int ptm_set_mac_address(struct net_device *dev, void *p)
266 @@ -209,7 +207,7 @@ static int ptm_set_mac_address(struct ne
267 return 0;
268 }
269
270 -static void ptm_tx_timeout(struct net_device *dev)
271 +static void ptm_tx_timeout(struct net_device *dev, unsigned int txqueue)
272 {
273 struct ptm_priv *ptm_tc = netdev_priv(dev);
274
275 @@ -503,7 +501,7 @@ static int ptm_xmit(struct sk_buff *skb,
276 if (!showtime_stat(ptm_tc->tc_priv))
277 goto PTM_XMIT_DROP;
278
279 - if (__skb_put_padto(skb, ETH_ZLEN))
280 + if (__skb_put_padto(skb, ETH_ZLEN, false))
281 goto PTM_XMIT_DROP;
282
283 dump_skb_info(ptm_tc->tc_priv, skb, (MSG_TX | MSG_TXDATA));
284 @@ -632,11 +630,8 @@ static int ptm_dev_init(struct tc_priv *
285 struct ptm_priv *ptm_tc;
286 const char macaddr[ETH_ALEN]
287 = {0xAC, 0x9A, 0x96, 0x11, 0x22, 0x33};
288 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,8,0)
289 - dev = alloc_netdev_mq(sizeof(*ptm_tc), "ptm%d", ptm_setup, 4);
290 -#else
291 - dev = alloc_netdev_mq(sizeof(*ptm_tc), "ptm%d", NET_NAME_ENUM, ptm_setup, 4);
292 -#endif
293 +
294 + dev = alloc_netdev_mq(sizeof(*ptm_tc), "dsl%d", NET_NAME_ENUM, ptm_setup, 4);
295 if (!dev) {
296 tc_dbg(tc_priv, MSG_INIT, "Cannot alloc net device\n");
297 return -ENOMEM;
298 @@ -2103,7 +2098,6 @@ static int ptm_showtime_exit(const unsig
299 struct ptm_ep_priv *priv = tc_ep_priv(idx);
300 u32 stop = ACA_TXIN_EN;
301 struct dc_ep_dev *ep;
302 - int i = 0;
303
304 tc_info(priv->tc_priv, MSG_EVENT, "Line[%d]: show time exit!\n", idx);
305 ep = priv->ep;
306 --- a/dcdp/tc_api.c
307 +++ b/dcdp/tc_api.c
308 @@ -52,18 +52,24 @@ static const char ppe_fw_name[] = "ppe_f
309 #define VRX518_PPE_FW_ID 0xB
310 #define MD5_LEN 16
311
312 +enum tc_multicast_groups {
313 + TC_MCGRP,
314 +};
315 +
316 +/* TC message multicast group */
317 +static const struct genl_multicast_group tc_ml_grps[] = {
318 + [TC_MCGRP] = { .name = TC_MCAST_GRP_NAME, },
319 +};
320 +
321 /* TC message genelink family */
322 static struct genl_family tc_gnl_family = {
323 - .id = GENL_ID_GENERATE, /* To generate an id for the family*/
324 +// .id = GENL_ID_GENERATE, /* To generate an id for the family*/
325 .hdrsize = 0,
326 .name = TC_FAMILY_NAME, /*family name, used by userspace application*/
327 .version = 1, /*version number */
328 .maxattr = TC_A_MAX - 1,
329 -};
330 -
331 -/* TC message multicast group */
332 -static struct genl_multicast_group tc_ml_grp = {
333 - .name = TC_MCAST_GRP_NAME,
334 + .mcgrps = tc_ml_grps,
335 + .n_mcgrps = ARRAY_SIZE(tc_ml_grps),
336 };
337
338 /**
339 @@ -568,7 +574,8 @@ int tc_ntlk_msg_send(struct tc_priv *pri
340 nla_put_u32(skb, TC_A_LINENO, ln_no);
341
342 genlmsg_end(skb, msg_head);
343 - ret = genlmsg_multicast(skb, pid, tc_ml_grp.id, GFP_KERNEL);
344 + ret = genlmsg_multicast(&tc_gnl_family, skb, pid, TC_MCGRP,
345 + GFP_KERNEL);
346 if (ret) {
347 tc_err(priv, MSG_EVENT, "Sent TC multicast message Fail!\n");
348 goto err1;
349 @@ -590,21 +597,11 @@ int tc_gentlk_init(struct tc_priv *priv)
350 return ret;
351 }
352
353 - ret = genl_register_mc_group(&tc_gnl_family, &tc_ml_grp);
354 - if (ret) {
355 - tc_err(priv, MSG_EVENT, "register mc group fail: %i, grp name: %s\n",
356 - ret, tc_ml_grp.name);
357 - genl_unregister_family(&tc_gnl_family);
358 - return ret;
359 - }
360 -
361 return 0;
362 }
363
364 void tc_gentlk_exit(void)
365 {
366 - /* unregister mc groups */
367 - genl_unregister_mc_group(&tc_gnl_family, &tc_ml_grp);
368 /*unregister the family*/
369 genl_unregister_family(&tc_gnl_family);
370 }
371 @@ -666,7 +663,7 @@ void dump_skb_info(struct tc_priv *tcpri
372 (u32)skb->end, skb->len);
373 tc_dbg(tcpriv, type,
374 "skb: clone: %d, users: %d\n",
375 - skb->cloned, atomic_read(&skb->users));
376 + skb->cloned, refcount_read(&skb->users));
377 tc_dbg(tcpriv, type,
378 "skb: nfrag: %d\n", skb_shinfo(skb)->nr_frags);
379
380 @@ -936,7 +933,6 @@ static int fw_md5_check(struct tc_priv *
381 }
382
383 desc->tfm = md5;
384 - desc->flags = 0;
385
386 ret = crypto_shash_init(desc);
387 if (ret) {
388 --- a/dcdp/tc_proc.c
389 +++ b/dcdp/tc_proc.c
390 @@ -22,7 +22,9 @@
391 *******************************************************************************/
392 #include <linux/fs.h>
393 #include <linux/seq_file.h>
394 -#include <net/datapath_api.h>
395 +// #include <net/datapath_api.h>
396 +#include <linux/etherdevice.h>
397 +#include <linux/atmdev.h>
398 #include <net/genetlink.h>
399 #include <linux/time.h>
400 #include "inc/tc_main.h"
401 @@ -353,7 +355,7 @@ static ssize_t mem_proc_write(struct fil
402 }
403 addr = set_val = repeat_cnt = 0;
404
405 - if (!access_ok(VERIFY_READ, buf, count))
406 + if (!access_ok(buf, count))
407 return -EFAULT;
408
409 len = count < sizeof(str) ? count : sizeof(str) - 1;
410 @@ -450,13 +452,12 @@ static int proc_read_mem_seq_open(struct
411 return single_open(file, proc_read_mem, NULL);
412 }
413
414 -static const struct file_operations mem_proc_fops = {
415 - .owner = THIS_MODULE,
416 - .open = proc_read_mem_seq_open,
417 - .read = seq_read,
418 - .llseek = seq_lseek,
419 - .release = single_release,
420 - .write = mem_proc_write,
421 +static const struct proc_ops mem_proc_fops = {
422 + .proc_open = proc_read_mem_seq_open,
423 + .proc_read = seq_read,
424 + .proc_lseek = seq_lseek,
425 + .proc_release = single_release,
426 + .proc_write = mem_proc_write,
427 };
428
429 static ssize_t pp32_proc_write(struct file *file, const char __user *buf,
430 @@ -748,13 +749,12 @@ static int proc_read_pp32_seq_open(struc
431 return single_open(file, proc_read_pp32, PDE_DATA(inode));
432 }
433
434 -static const struct file_operations pp32_proc_fops = {
435 - .owner = THIS_MODULE,
436 - .open = proc_read_pp32_seq_open,
437 - .read = seq_read,
438 - .llseek = seq_lseek,
439 - .release = single_release,
440 - .write = pp32_proc_write,
441 +static const struct proc_ops pp32_proc_fops = {
442 + .proc_open = proc_read_pp32_seq_open,
443 + .proc_read = seq_read,
444 + .proc_lseek = seq_lseek,
445 + .proc_release = single_release,
446 + .proc_write = pp32_proc_write,
447 };
448
449 static int proc_read_tc_cfg(struct seq_file *seq, void *v)
450 @@ -865,13 +865,12 @@ static int proc_read_tc_cfg_seq_open(str
451 return single_open(file, proc_read_tc_cfg, PDE_DATA(inode));
452 }
453
454 -static const struct file_operations tc_cfg_proc_fops = {
455 - .owner = THIS_MODULE,
456 - .open = proc_read_tc_cfg_seq_open,
457 - .read = seq_read,
458 - .llseek = seq_lseek,
459 - .release = single_release,
460 - .write = proc_write_cfg,
461 +static const struct proc_ops tc_cfg_proc_fops = {
462 + .proc_open = proc_read_tc_cfg_seq_open,
463 + .proc_read = seq_read,
464 + .proc_lseek = seq_lseek,
465 + .proc_release = single_release,
466 + .proc_write = proc_write_cfg,
467 };
468
469 static ssize_t proc_write_dbg(struct file *file, const char __user *buf,
470 @@ -951,13 +950,12 @@ static int proc_read_dbg_seq_open(struct
471 return single_open(file, proc_read_dbg, PDE_DATA(inode));
472 }
473
474 -static const struct file_operations tc_dbg_proc_fops = {
475 - .owner = THIS_MODULE,
476 - .open = proc_read_dbg_seq_open,
477 - .read = seq_read,
478 - .write = proc_write_dbg,
479 - .llseek = seq_lseek,
480 - .release = single_release,
481 +static const struct proc_ops tc_dbg_proc_fops = {
482 + .proc_open = proc_read_dbg_seq_open,
483 + .proc_read = seq_read,
484 + .proc_write = proc_write_dbg,
485 + .proc_lseek = seq_lseek,
486 + .proc_release = single_release,
487 };
488
489 static ssize_t proc_write_tc_switch(struct file *file, const char __user *buf,
490 @@ -1018,11 +1016,11 @@ proc_tc_switch_help:
491 return count;
492 }
493
494 -static const struct file_operations tc_switch_proc_fops = {
495 - .owner = THIS_MODULE,
496 - .write = proc_write_tc_switch,
497 - .llseek = noop_llseek,
498 +static const struct proc_ops tc_switch_proc_fops = {
499 + .proc_write = proc_write_tc_switch,
500 + .proc_lseek = noop_llseek,
501 };
502 +
503 static ssize_t proc_write_show_time(struct file *file, const char __user *buf,
504 size_t count, loff_t *data)
505 {
506 @@ -1077,10 +1075,9 @@ proc_show_time_help:
507 return count;
508 }
509
510 -static const struct file_operations tc_show_time_proc_fops = {
511 - .owner = THIS_MODULE,
512 - .write = proc_write_show_time,
513 - .llseek = noop_llseek,
514 +static const struct proc_ops tc_show_time_proc_fops = {
515 + .proc_write = proc_write_show_time,
516 + .proc_lseek = noop_llseek,
517 };
518
519 static int proc_read_ver(struct seq_file *seq, void *v)
520 @@ -1128,12 +1125,11 @@ static int proc_read_ver_seq_open(struct
521 return single_open(file, proc_read_ver, PDE_DATA(inode));
522 }
523
524 -static const struct file_operations tc_ver_proc_fops = {
525 - .owner = THIS_MODULE,
526 - .open = proc_read_ver_seq_open,
527 - .read = seq_read,
528 - .llseek = seq_lseek,
529 - .release = single_release,
530 +static const struct proc_ops tc_ver_proc_fops = {
531 + .proc_open = proc_read_ver_seq_open,
532 + .proc_read = seq_read,
533 + .proc_lseek = seq_lseek,
534 + .proc_release = single_release,
535 };
536
537 static int proc_read_soc(struct seq_file *seq, void *v)
538 @@ -1142,20 +1138,18 @@ static int proc_read_soc(struct seq_file
539
540 tcpriv = (struct tc_priv *)seq->private;
541
542 -#if 0
543 seq_printf(seq, "TXIN Base: 0x%08x, TXIN num: %d\n",
544 - tcpriv->cfg.txin_dbase,
545 - tcpriv->cfg.txin_dnum);
546 + tcpriv->cfg.txin.soc_phydbase,
547 + tcpriv->cfg.txin.soc_dnum);
548 seq_printf(seq, "TXOUT Base: 0x%08x, TXOUT num: %d\n",
549 - tcpriv->cfg.txout_dbase,
550 - tcpriv->cfg.txout_dnum);
551 + tcpriv->cfg.txout.soc_phydbase,
552 + tcpriv->cfg.txout.soc_dnum);
553 seq_printf(seq, "RXIN Base: 0x%08x, RXIN num: %d\n",
554 - tcpriv->cfg.rxin_dbase,
555 - tcpriv->cfg.rxin_dnum);
556 + tcpriv->cfg.rxin.soc_phydbase,
557 + tcpriv->cfg.rxin.soc_dnum);
558 seq_printf(seq, "RXOUT Base: 0x%08x, RXOUT num: %d\n",
559 - tcpriv->cfg.rxout_dbase,
560 - tcpriv->cfg.rxout_dnum);
561 -#endif
562 + tcpriv->cfg.rxout.soc_phydbase,
563 + tcpriv->cfg.rxout.soc_dnum);
564
565 return 0;
566 }
567 @@ -1165,15 +1159,13 @@ static int proc_read_soc_seq_open(struct
568 return single_open(file, proc_read_soc, PDE_DATA(inode));
569 }
570
571 -static const struct file_operations tc_soc_proc_fops = {
572 - .owner = THIS_MODULE,
573 - .open = proc_read_soc_seq_open,
574 - .read = seq_read,
575 - .llseek = seq_lseek,
576 - .release = single_release,
577 +static const struct proc_ops tc_soc_proc_fops = {
578 + .proc_open = proc_read_soc_seq_open,
579 + .proc_read = seq_read,
580 + .proc_lseek = seq_lseek,
581 + .proc_release = single_release,
582 };
583
584 -
585 static struct tc_proc_list tc_procs[] = {
586 {TC_PROC_DIR, 0, NULL, 1},
587 {"cfg", 0644, &tc_cfg_proc_fops, 0},
588 @@ -1241,13 +1233,12 @@ static int proc_read_ptm_wanmib_seq_open
589 return single_open(file, proc_read_ptm_wanmib, PDE_DATA(inode));
590 }
591
592 -static const struct file_operations ptm_wanmib_proc_fops = {
593 - .owner = THIS_MODULE,
594 - .open = proc_read_ptm_wanmib_seq_open,
595 - .read = seq_read,
596 - .write = proc_write_ptm_wanmib,
597 - .llseek = seq_lseek,
598 - .release = single_release,
599 +static const struct proc_ops ptm_wanmib_proc_fops = {
600 + .proc_open = proc_read_ptm_wanmib_seq_open,
601 + .proc_read = seq_read,
602 + .proc_write = proc_write_ptm_wanmib,
603 + .proc_lseek = seq_lseek,
604 + .proc_release = single_release,
605 };
606
607 static int proc_ptm_read_cfg(struct seq_file *seq, void *v)
608 @@ -1300,7 +1291,7 @@ static ssize_t ptm_cfg_proc_write(struct
609 return -EINVAL;
610 }
611
612 - if (!access_ok(VERIFY_READ, buf, count))
613 + if (!access_ok(buf, count))
614 return -EFAULT;
615
616 len = count < sizeof(str) ? count : sizeof(str) - 1;
617 @@ -1343,13 +1334,12 @@ proc_ptm_cfg_help:
618 }
619
620
621 -static const struct file_operations ptm_cfg_proc_fops = {
622 - .owner = THIS_MODULE,
623 - .open = proc_read_cfg_seq_open,
624 - .read = seq_read,
625 - .llseek = seq_lseek,
626 - .write = ptm_cfg_proc_write,
627 - .release = single_release,
628 +static const struct proc_ops ptm_cfg_proc_fops = {
629 + .proc_open = proc_read_cfg_seq_open,
630 + .proc_read = seq_read,
631 + .proc_lseek = seq_lseek,
632 + .proc_write = ptm_cfg_proc_write,
633 + .proc_release = single_release,
634 };
635
636 static ssize_t proc_ptm_write_prio(struct file *file, const char __user *buf,
637 @@ -1455,13 +1445,12 @@ static int proc_ptm_read_prio_seq_open(s
638 return single_open(file, proc_ptm_read_prio, PDE_DATA(inode));
639 }
640
641 -static const struct file_operations ptm_prio_proc_fops = {
642 - .owner = THIS_MODULE,
643 - .open = proc_ptm_read_prio_seq_open,
644 - .read = seq_read,
645 - .llseek = seq_lseek,
646 - .write = proc_ptm_write_prio,
647 - .release = single_release,
648 +static const struct proc_ops ptm_prio_proc_fops = {
649 + .proc_open = proc_ptm_read_prio_seq_open,
650 + .proc_read = seq_read,
651 + .proc_lseek = seq_lseek,
652 + .proc_write = proc_ptm_write_prio,
653 + .proc_release = single_release,
654 };
655
656 static int proc_ptm_read_bond_seq_open(struct inode *inode, struct file *file)
657 @@ -1469,12 +1458,11 @@ static int proc_ptm_read_bond_seq_open(s
658 return single_open(file, proc_ptm_read_bond, PDE_DATA(inode));
659 }
660
661 -static const struct file_operations ptm_bond_proc_fops = {
662 - .owner = THIS_MODULE,
663 - .open = proc_ptm_read_bond_seq_open,
664 - .read = seq_read,
665 - .llseek = seq_lseek,
666 - .release = single_release,
667 +static const struct proc_ops ptm_bond_proc_fops = {
668 + .proc_open = proc_ptm_read_bond_seq_open,
669 + .proc_read = seq_read,
670 + .proc_lseek = seq_lseek,
671 + .proc_release = single_release,
672 };
673
674 static int proc_ptm_read_bondmib_seq_open(struct inode *inode,
675 @@ -1483,13 +1471,12 @@ static int proc_ptm_read_bondmib_seq_ope
676 return single_open(file, proc_ptm_read_bondmib, PDE_DATA(inode));
677 }
678
679 -static const struct file_operations ptm_bondmib_proc_fops = {
680 - .owner = THIS_MODULE,
681 - .open = proc_ptm_read_bondmib_seq_open,
682 - .read = seq_read,
683 - .llseek = seq_lseek,
684 - .write = proc_ptm_write_bondmib,
685 - .release = single_release,
686 +static const struct proc_ops ptm_bondmib_proc_fops = {
687 + .proc_open = proc_ptm_read_bondmib_seq_open,
688 + .proc_read = seq_read,
689 + .proc_lseek = seq_lseek,
690 + .proc_write = proc_ptm_write_bondmib,
691 + .proc_release = single_release,
692 };
693
694 struct fwdbg_t {
695 @@ -1910,14 +1897,14 @@ static int proc_read_fwdbg_seq_open(stru
696 {
697 return single_open(file, proc_read_fwdbg, NULL);
698 }
699 -static const struct file_operations fwdbg_proc_fops = {
700 - .owner = THIS_MODULE,
701 - .open = proc_read_fwdbg_seq_open,
702 - .read = seq_read,
703 - .write = proc_write_fwdbg_seq,
704 - .llseek = seq_lseek,
705 - .release = single_release,
706 +static const struct proc_ops fwdbg_proc_fops = {
707 + .proc_open = proc_read_fwdbg_seq_open,
708 + .proc_read = seq_read,
709 + .proc_write = proc_write_fwdbg_seq,
710 + .proc_lseek = seq_lseek,
711 + .proc_release = single_release,
712 };
713 +
714 static struct tc_proc_list ptm_sl_procs[] = {
715 {TC_PROC_PTM_DIR, 0, NULL, 1},
716 {"mem", 0644, &mem_proc_fops, 0},
717 @@ -2077,7 +2064,7 @@ static ssize_t atm_cfg_proc_write(struct
718
719 priv = (struct atm_priv *)PDE_DATA(file_inode(file));
720
721 - if (!access_ok(VERIFY_READ, buf, count))
722 + if (!access_ok(buf, count))
723 return -EFAULT;
724
725 len = count < sizeof(str) ? count : sizeof(str) - 1;
726 @@ -2119,13 +2106,12 @@ proc_atm_cfg_help:
727 return count;
728 }
729
730 -static const struct file_operations atm_cfg_proc_fops = {
731 - .owner = THIS_MODULE,
732 - .open = proc_read_atm_cfg_seq_open,
733 - .read = seq_read,
734 - .write = atm_cfg_proc_write,
735 - .llseek = seq_lseek,
736 - .release = single_release,
737 +static const struct proc_ops atm_cfg_proc_fops = {
738 + .proc_open = proc_read_atm_cfg_seq_open,
739 + .proc_read = seq_read,
740 + .proc_write = atm_cfg_proc_write,
741 + .proc_lseek = seq_lseek,
742 + .proc_release = single_release,
743 };
744
745 static ssize_t proc_write_atm_wanmib(struct file *file, const char __user *buf,
746 @@ -2173,13 +2159,12 @@ static int proc_read_atm_wanmib_seq_open
747
748
749
750 -static const struct file_operations atm_wanmib_proc_fops = {
751 - .owner = THIS_MODULE,
752 - .open = proc_read_atm_wanmib_seq_open,
753 - .read = seq_read,
754 - .write = proc_write_atm_wanmib,
755 - .llseek = seq_lseek,
756 - .release = single_release,
757 +static const struct proc_ops atm_wanmib_proc_fops = {
758 + .proc_open = proc_read_atm_wanmib_seq_open,
759 + .proc_read = seq_read,
760 + .proc_write = proc_write_atm_wanmib,
761 + .proc_lseek = seq_lseek,
762 + .proc_release = single_release,
763 };
764
765 static int proc_read_htu_seq_open(struct inode *inode, struct file *file)
766 @@ -2187,12 +2172,11 @@ static int proc_read_htu_seq_open(struct
767 return single_open(file, proc_read_htu, PDE_DATA(inode));
768 }
769
770 -static const struct file_operations htu_proc_fops = {
771 - .owner = THIS_MODULE,
772 - .open = proc_read_htu_seq_open,
773 - .read = seq_read,
774 - .llseek = seq_lseek,
775 - .release = single_release,
776 +static const struct proc_ops htu_proc_fops = {
777 + .proc_open = proc_read_htu_seq_open,
778 + .proc_read = seq_read,
779 + .proc_lseek = seq_lseek,
780 + .proc_release = single_release,
781 };
782
783 static int proc_read_queue_seq_open(struct inode *inode, struct file *file)
784 @@ -2200,12 +2184,11 @@ static int proc_read_queue_seq_open(stru
785 return single_open(file, proc_read_queue, PDE_DATA(inode));
786 }
787
788 -static const struct file_operations queue_proc_fops = {
789 - .owner = THIS_MODULE,
790 - .open = proc_read_queue_seq_open,
791 - .read = seq_read,
792 - .llseek = seq_lseek,
793 - .release = single_release,
794 +static const struct proc_ops queue_proc_fops = {
795 + .proc_open = proc_read_queue_seq_open,
796 + .proc_read = seq_read,
797 + .proc_lseek = seq_lseek,
798 + .proc_release = single_release,
799 };
800
801 static void set_q_prio(struct atm_priv *priv,
802 @@ -2428,13 +2411,12 @@ static const struct seq_operations pvc_m
803 .show = pvc_mib_seq_show,
804 };
805
806 -static const struct file_operations atm_prio_proc_fops = {
807 - .owner = THIS_MODULE,
808 - .open = proc_atm_read_prio_seq_open,
809 - .read = seq_read,
810 - .llseek = seq_lseek,
811 - .write = proc_atm_write_prio,
812 - .release = single_release,
813 +static const struct proc_ops atm_prio_proc_fops = {
814 + .proc_open = proc_atm_read_prio_seq_open,
815 + .proc_read = seq_read,
816 + .proc_lseek = seq_lseek,
817 + .proc_write = proc_atm_write_prio,
818 + .proc_release = single_release,
819 };
820
821 static int proc_read_pvc_mib_seq_open(struct inode *inode, struct file *file)
822 @@ -2447,12 +2429,11 @@ static int proc_read_pvc_mib_seq_open(st
823 return ret;
824 }
825
826 -static const struct file_operations atm_pvc_mib_proc_fops = {
827 - .owner = THIS_MODULE,
828 - .open = proc_read_pvc_mib_seq_open,
829 - .read = seq_read,
830 - .llseek = seq_lseek,
831 - .release = seq_release,
832 +static const struct proc_ops atm_pvc_mib_proc_fops = {
833 + .proc_open = proc_read_pvc_mib_seq_open,
834 + .proc_read = seq_read,
835 + .proc_lseek = seq_lseek,
836 + .proc_release = seq_release,
837 };
838
839 static ssize_t proc_write_cell(struct file *file,
840 @@ -2592,13 +2573,12 @@ static int proc_read_cell_seq_open(struc
841 return single_open(file, proc_read_cell, NULL);
842 }
843
844 -static const struct file_operations atm_cell_proc_fops = {
845 - .owner = THIS_MODULE,
846 - .open = proc_read_cell_seq_open,
847 - .read = seq_read,
848 - .write = proc_write_cell,
849 - .llseek = seq_lseek,
850 - .release = single_release,
851 +static const struct proc_ops atm_cell_proc_fops = {
852 + .proc_open = proc_read_cell_seq_open,
853 + .proc_read = seq_read,
854 + .proc_write = proc_write_cell,
855 + .proc_lseek = seq_lseek,
856 + .proc_release = single_release,
857 };
858
859 static struct tc_proc_list atm_procs[] = {