pn_dev.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * File: pn_dev.h
  4. *
  5. * Phonet network device
  6. *
  7. * Copyright (C) 2008 Nokia Corporation.
  8. */
  9. #ifndef PN_DEV_H
  10. #define PN_DEV_H
  11. #include <linux/list.h>
  12. #include <linux/mutex.h>
  13. struct net;
  14. struct phonet_device_list {
  15. struct list_head list;
  16. struct mutex lock;
  17. };
  18. struct phonet_device_list *phonet_device_list(struct net *net);
  19. struct phonet_device {
  20. struct list_head list;
  21. struct net_device *netdev;
  22. DECLARE_BITMAP(addrs, 64);
  23. struct rcu_head rcu;
  24. };
  25. int phonet_device_init(void);
  26. void phonet_device_exit(void);
  27. int phonet_netlink_register(void);
  28. struct net_device *phonet_device_get(struct net *net);
  29. int phonet_address_add(struct net_device *dev, u8 addr);
  30. int phonet_address_del(struct net_device *dev, u8 addr);
  31. u8 phonet_address_get(struct net_device *dev, u8 addr);
  32. int phonet_address_lookup(struct net *net, u8 addr);
  33. void phonet_address_notify(int event, struct net_device *dev, u8 addr);
  34. int phonet_route_add(struct net_device *dev, u8 daddr);
  35. int phonet_route_del(struct net_device *dev, u8 daddr);
  36. void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
  37. struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
  38. struct net_device *phonet_route_output(struct net *net, u8 daddr);
  39. #define PN_NO_ADDR 0xff
  40. extern const struct seq_operations pn_sock_seq_ops;
  41. extern const struct seq_operations pn_res_seq_ops;
  42. #endif