iwl-core.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /******************************************************************************
  2. *
  3. * GPL LICENSE SUMMARY
  4. *
  5. * Copyright(c) 2008 Intel Corporation. All rights reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of version 2 of the GNU General Public License as
  9. * published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
  19. * USA
  20. *
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * Contact Information:
  25. * Tomas Winkler <tomas.winkler@intel.com>
  26. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  27. *****************************************************************************/
  28. #include <linux/kernel.h>
  29. #include <linux/module.h>
  30. #include <linux/version.h>
  31. #include <net/mac80211.h>
  32. struct iwl_priv; /* FIXME: remove */
  33. #include "iwl-debug.h"
  34. #include "iwl-eeprom.h"
  35. #include "iwl-core.h"
  36. #include "iwl-4965.h" /* FIXME: remove */
  37. MODULE_DESCRIPTION("iwl core");
  38. MODULE_VERSION(IWLWIFI_VERSION);
  39. MODULE_AUTHOR(DRV_COPYRIGHT);
  40. MODULE_LICENSE("GPL");
  41. #ifdef CONFIG_IWLWIFI_DEBUG
  42. u32 iwl_debug_level;
  43. EXPORT_SYMBOL(iwl_debug_level);
  44. #endif
  45. /* This function both allocates and initializes hw and priv. */
  46. struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
  47. struct ieee80211_ops *hw_ops)
  48. {
  49. struct iwl_priv *priv;
  50. /* mac80211 allocates memory for this device instance, including
  51. * space for this driver's private structure */
  52. struct ieee80211_hw *hw =
  53. ieee80211_alloc_hw(sizeof(struct iwl_priv), hw_ops);
  54. if (hw == NULL) {
  55. IWL_ERROR("Can not allocate network device\n");
  56. goto out;
  57. }
  58. priv = hw->priv;
  59. priv->hw = hw;
  60. out:
  61. return hw;
  62. }
  63. EXPORT_SYMBOL(iwl_alloc_all);