blob: 454abd07651ad87250a71de2dcda9d5441add8da [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#ifndef _MPC_H_
3#define _MPC_H_
4
5#include <linux/types.h>
6#include <linux/atm.h>
7#include <linux/atmmpc.h>
8#include <linux/skbuff.h>
9#include <linux/spinlock.h>
10#include "mpoa_caches.h"
11
12/* kernel -> mpc-daemon */
13int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);
14
15struct mpoa_client {
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090016 struct mpoa_client *next;
17 struct net_device *dev; /* lec in question */
18 int dev_num; /* e.g. 2 for lec2 */
Stephen Hemminger788dee02009-03-20 19:35:28 +000019
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090020 struct atm_vcc *mpoad_vcc; /* control channel to mpoad */
21 uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */
22 uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090024 rwlock_t ingress_lock;
Julia Lawall4dd191b2015-11-21 18:28:05 +010025 const struct in_cache_ops *in_ops; /* ingress cache operations */
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090026 in_cache_entry *in_cache; /* the ingress cache of this MPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090028 rwlock_t egress_lock;
Julia Lawall4dd191b2015-11-21 18:28:05 +010029 const struct eg_cache_ops *eg_ops; /* egress cache operations */
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090030 eg_cache_entry *eg_cache; /* the egress cache of this MPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090032 uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */
33 int number_of_mps_macs; /* number of the above MAC addresses */
34 struct mpc_parameters parameters; /* parameters for this client */
Stephen Hemminger788dee02009-03-20 19:35:28 +000035
36 const struct net_device_ops *old_ops;
37 struct net_device_ops new_ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038};
39
40
41struct atm_mpoa_qos {
YOSHIFUJI Hideakif7d57452007-02-09 23:24:29 +090042 struct atm_mpoa_qos *next;
43 __be32 ipaddr;
44 struct atm_qos qos;
Linus Torvalds1da177e2005-04-16 15:20:36 -070045};
46
47
48/* MPOA QoS operations */
Al Viro30d492d2006-11-14 21:11:29 -080049struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos);
50struct atm_mpoa_qos *atm_mpoa_search_qos(__be32 dst_ip);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051int atm_mpoa_delete_qos(struct atm_mpoa_qos *qos);
52
53/* Display QoS entries. This is for the procfs */
54struct seq_file;
55void atm_mpoa_disp_qos(struct seq_file *m);
56
Adrian Bunk69263bc2006-09-22 14:28:11 -070057#ifdef CONFIG_PROC_FS
58int mpc_proc_init(void);
59void mpc_proc_clean(void);
60#else
61#define mpc_proc_init() (0)
62#define mpc_proc_clean() do { } while(0)
63#endif
64
Linus Torvalds1da177e2005-04-16 15:20:36 -070065#endif /* _MPC_H_ */