mctp.h 834 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * MCTP per-net structures
  4. */
  5. #ifndef __NETNS_MCTP_H__
  6. #define __NETNS_MCTP_H__
  7. #include <linux/mutex.h>
  8. #include <linux/types.h>
  9. struct netns_mctp {
  10. /* Only updated under RTNL, entries freed via RCU */
  11. struct list_head routes;
  12. /* Bound sockets: list of sockets bound by type.
  13. * This list is updated from non-atomic contexts (under bind_lock),
  14. * and read (under rcu) in packet rx
  15. */
  16. struct mutex bind_lock;
  17. struct hlist_head binds;
  18. /* tag allocations. This list is read and updated from atomic contexts,
  19. * but elements are free()ed after a RCU grace-period
  20. */
  21. spinlock_t keys_lock;
  22. struct hlist_head keys;
  23. /* MCTP network */
  24. unsigned int default_net;
  25. /* neighbour table */
  26. struct mutex neigh_lock;
  27. struct list_head neighbours;
  28. };
  29. #endif /* __NETNS_MCTP_H__ */