aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-core.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 3a9fc905e6bc..244318af53fc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -29,12 +29,15 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/version.h> 31#include <linux/version.h>
32#include <net/mac80211.h>
32 33
33struct iwl_priv; /* FIXME: remove */ 34struct iwl_priv; /* FIXME: remove */
34#include "iwl-debug.h" 35#include "iwl-debug.h"
35#include "iwl-eeprom.h" 36#include "iwl-eeprom.h"
36#include "iwl-core.h" 37#include "iwl-core.h"
37 38
39#include "iwl-4965.h" /* FIXME: remove */
40
38MODULE_DESCRIPTION("iwl core"); 41MODULE_DESCRIPTION("iwl core");
39MODULE_VERSION(IWLWIFI_VERSION); 42MODULE_VERSION(IWLWIFI_VERSION);
40MODULE_AUTHOR(DRV_COPYRIGHT); 43MODULE_AUTHOR(DRV_COPYRIGHT);
@@ -44,3 +47,27 @@ MODULE_LICENSE("GPL");
44u32 iwl_debug_level; 47u32 iwl_debug_level;
45EXPORT_SYMBOL(iwl_debug_level); 48EXPORT_SYMBOL(iwl_debug_level);
46#endif 49#endif
50
51/* This function both allocates and initializes hw and priv. */
52struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg,
53 struct ieee80211_ops *hw_ops)
54{
55 struct iwl_priv *priv;
56
57 /* mac80211 allocates memory for this device instance, including
58 * space for this driver's private structure */
59 struct ieee80211_hw *hw =
60 ieee80211_alloc_hw(sizeof(struct iwl_priv), hw_ops);
61 if (hw == NULL) {
62 IWL_ERROR("Can not allocate network device\n");
63 goto out;
64 }
65
66 priv = hw->priv;
67 priv->hw = hw;
68
69out:
70 return hw;
71}
72EXPORT_SYMBOL(iwl_alloc_all);
73