pn_dev.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * File: pn_dev.h
  3. *
  4. * Phonet network device
  5. *
  6. * Copyright (C) 2008 Nokia Corporation.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. */
  22. #ifndef PN_DEV_H
  23. #define PN_DEV_H
  24. struct phonet_device_list {
  25. struct list_head list;
  26. struct mutex lock;
  27. };
  28. struct phonet_device_list *phonet_device_list(struct net *net);
  29. struct phonet_device {
  30. struct list_head list;
  31. struct net_device *netdev;
  32. DECLARE_BITMAP(addrs, 64);
  33. struct rcu_head rcu;
  34. };
  35. int phonet_device_init(void);
  36. void phonet_device_exit(void);
  37. int phonet_netlink_register(void);
  38. struct net_device *phonet_device_get(struct net *net);
  39. int phonet_address_add(struct net_device *dev, u8 addr);
  40. int phonet_address_del(struct net_device *dev, u8 addr);
  41. u8 phonet_address_get(struct net_device *dev, u8 addr);
  42. int phonet_address_lookup(struct net *net, u8 addr);
  43. void phonet_address_notify(int event, struct net_device *dev, u8 addr);
  44. int phonet_route_add(struct net_device *dev, u8 daddr);
  45. int phonet_route_del(struct net_device *dev, u8 daddr);
  46. void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
  47. struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
  48. struct net_device *phonet_route_output(struct net *net, u8 daddr);
  49. #define PN_NO_ADDR 0xff
  50. extern const struct file_operations pn_sock_seq_fops;
  51. extern const struct file_operations pn_res_seq_fops;
  52. #endif