^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _MPC_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _MPC_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <linux/atm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/atmmpc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/skbuff.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/spinlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include "mpoa_caches.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) /* kernel -> mpc-daemon */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct mpoa_client {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct mpoa_client *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct net_device *dev; /* lec in question */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) int dev_num; /* e.g. 2 for lec2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct atm_vcc *mpoad_vcc; /* control channel to mpoad */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) uint8_t mps_ctrl_addr[ATM_ESA_LEN]; /* MPS control ATM address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) uint8_t our_ctrl_addr[ATM_ESA_LEN]; /* MPC's control ATM address */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) rwlock_t ingress_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) const struct in_cache_ops *in_ops; /* ingress cache operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) in_cache_entry *in_cache; /* the ingress cache of this MPC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) rwlock_t egress_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) const struct eg_cache_ops *eg_ops; /* egress cache operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) eg_cache_entry *eg_cache; /* the egress cache of this MPC */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) uint8_t *mps_macs; /* array of MPS MAC addresses, >=1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int number_of_mps_macs; /* number of the above MAC addresses */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct mpc_parameters parameters; /* parameters for this client */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) const struct net_device_ops *old_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct net_device_ops new_ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct atm_mpoa_qos {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct atm_mpoa_qos *next;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) __be32 ipaddr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct atm_qos qos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /* MPOA QoS operations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct atm_mpoa_qos *atm_mpoa_search_qos(__be32 dst_ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) int atm_mpoa_delete_qos(struct atm_mpoa_qos *qos);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /* Display QoS entries. This is for the procfs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) struct seq_file;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) void atm_mpoa_disp_qos(struct seq_file *m);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #ifdef CONFIG_PROC_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int mpc_proc_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) void mpc_proc_clean(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define mpc_proc_init() (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define mpc_proc_clean() do { } while(0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #endif /* _MPC_H_ */