core.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Wireless configuration interface internals.
  3. *
  4. * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
  5. */
  6. #ifndef __NET_WIRELESS_CORE_H
  7. #define __NET_WIRELESS_CORE_H
  8. #include <linux/mutex.h>
  9. #include <linux/list.h>
  10. #include <linux/netdevice.h>
  11. #include <net/genetlink.h>
  12. #include <net/wireless.h>
  13. #include <net/cfg80211.h>
  14. struct cfg80211_registered_device {
  15. struct cfg80211_ops *ops;
  16. struct list_head list;
  17. /* we hold this mutex during any call so that
  18. * we cannot do multiple calls at once, and also
  19. * to avoid the deregister call to proceed while
  20. * any call is in progress */
  21. struct mutex mtx;
  22. /* wiphy index, internal only */
  23. int idx;
  24. /* associate netdev list */
  25. struct mutex devlist_mtx;
  26. struct list_head netdev_list;
  27. /* must be last because of the way we do wiphy_priv(),
  28. * and it should at least be aligned to NETDEV_ALIGN */
  29. struct wiphy wiphy __attribute__((__aligned__(NETDEV_ALIGN)));
  30. };
  31. static inline
  32. struct cfg80211_registered_device *wiphy_to_dev(struct wiphy *wiphy)
  33. {
  34. BUG_ON(!wiphy);
  35. return container_of(wiphy, struct cfg80211_registered_device, wiphy);
  36. }
  37. extern struct mutex cfg80211_drv_mutex;
  38. extern struct list_head cfg80211_drv_list;
  39. /* free object */
  40. extern void cfg80211_dev_free(struct cfg80211_registered_device *drv);
  41. #endif /* __NET_WIRELESS_CORE_H */