Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _MPC_H_
0003 #define _MPC_H_
0004 
0005 #include <linux/types.h>
0006 #include <linux/atm.h>
0007 #include <linux/atmmpc.h>
0008 #include <linux/skbuff.h>
0009 #include <linux/spinlock.h>
0010 #include "mpoa_caches.h"
0011 
0012 /* kernel -> mpc-daemon */
0013 int msg_to_mpoad(struct k_message *msg, struct mpoa_client *mpc);
0014 
0015 struct mpoa_client {
0016     struct mpoa_client *next;
0017     struct net_device *dev;      /* lec in question                     */
0018     int dev_num;                 /* e.g. 2 for lec2                     */
0019 
0020     struct atm_vcc *mpoad_vcc;   /* control channel to mpoad            */
0021     uint8_t mps_ctrl_addr[ATM_ESA_LEN];  /* MPS control ATM address     */
0022     uint8_t our_ctrl_addr[ATM_ESA_LEN];  /* MPC's control ATM address   */
0023 
0024     rwlock_t ingress_lock;
0025     const struct in_cache_ops *in_ops; /* ingress cache operations      */
0026     in_cache_entry *in_cache;    /* the ingress cache of this MPC       */
0027 
0028     rwlock_t egress_lock;
0029     const struct eg_cache_ops *eg_ops; /* egress cache operations       */
0030     eg_cache_entry *eg_cache;    /* the egress  cache of this MPC       */
0031 
0032     uint8_t *mps_macs;           /* array of MPS MAC addresses, >=1     */
0033     int number_of_mps_macs;      /* number of the above MAC addresses   */
0034     struct mpc_parameters parameters;  /* parameters for this client    */
0035 
0036     const struct net_device_ops *old_ops;
0037     struct net_device_ops new_ops;
0038 };
0039 
0040 
0041 struct atm_mpoa_qos {
0042     struct atm_mpoa_qos *next;
0043     __be32 ipaddr;
0044     struct atm_qos qos;
0045 };
0046 
0047 
0048 /* MPOA QoS operations */
0049 struct atm_mpoa_qos *atm_mpoa_add_qos(__be32 dst_ip, struct atm_qos *qos);
0050 struct atm_mpoa_qos *atm_mpoa_search_qos(__be32 dst_ip);
0051 int atm_mpoa_delete_qos(struct atm_mpoa_qos *qos);
0052 
0053 /* Display QoS entries. This is for the procfs */
0054 struct seq_file;
0055 void atm_mpoa_disp_qos(struct seq_file *m);
0056 
0057 #ifdef CONFIG_PROC_FS
0058 int mpc_proc_init(void);
0059 void mpc_proc_clean(void);
0060 #else
0061 #define mpc_proc_init() (0)
0062 #define mpc_proc_clean() do { } while(0)
0063 #endif
0064 
0065 #endif /* _MPC_H_ */