mpc.h 1.9 KB

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