aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2012-05-16 16:54:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-05 15:32:13 -0400
commitcc5f7e39761382d3a44be70bb665c2c78ae15dac (patch)
tree6651c35803805e8dadda1b57313134fc5ce41c4d /drivers/net/wireless/iwlwifi
parentc08ce20c7eedb9406c55a1c59acc2c84812c8e82 (diff)
iwlwifi: implement dynamic opmode loading
This is the next step in splitting up the driver, making the uCode API dependent pieces of it live in separate modules. Right now there's only one so it's not user-selectable, but we're actively working on more. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/Kconfig5
-rw-r--r--drivers/net/wireless/iwlwifi/Makefile32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debug.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-devtrace.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c112
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-io.c19
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-op-mode.h3
8 files changed, 172 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig
index 2463c0626438..727fbb5db9da 100644
--- a/drivers/net/wireless/iwlwifi/Kconfig
+++ b/drivers/net/wireless/iwlwifi/Kconfig
@@ -6,6 +6,7 @@ config IWLWIFI
6 select LEDS_CLASS 6 select LEDS_CLASS
7 select LEDS_TRIGGERS 7 select LEDS_TRIGGERS
8 select MAC80211_LEDS 8 select MAC80211_LEDS
9 select IWLDVM
9 ---help--- 10 ---help---
10 Select to build the driver supporting the: 11 Select to build the driver supporting the:
11 12
@@ -41,6 +42,10 @@ config IWLWIFI
41 say M here and read <file:Documentation/kbuild/modules.txt>. The 42 say M here and read <file:Documentation/kbuild/modules.txt>. The
42 module will be called iwlwifi. 43 module will be called iwlwifi.
43 44
45config IWLDVM
46 tristate "Intel Wireless WiFi"
47 depends on IWLWIFI
48
44menu "Debugging Options" 49menu "Debugging Options"
45 depends on IWLWIFI 50 depends on IWLWIFI
46 51
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile
index d615eacbf050..f284ea850bb2 100644
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
@@ -1,27 +1,31 @@
1# DVM
2obj-$(CONFIG_IWLDVM) += iwldvm.o
3iwldvm-objs := iwl-agn.o iwl-agn-rs.o iwl-mac80211.o
4iwldvm-objs += iwl-ucode.o iwl-agn-tx.o
5iwldvm-objs += iwl-agn-lib.o iwl-agn-calib.o
6iwldvm-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-rx.o
7iwldvm-objs += iwl-eeprom.o iwl-power.o
8iwldvm-objs += iwl-scan.o iwl-led.o
9iwldvm-objs += iwl-agn-rxon.o iwl-agn-devices.o
10iwldvm-objs += iwl-notif-wait.o
11
12iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
13iwldvm-$(CONFIG_IWLWIFI_DEVICE_TESTMODE) += iwl-testmode.o
14
15CFLAGS_iwl-devtrace.o := -I$(src)
16
1# WIFI 17# WIFI
2obj-$(CONFIG_IWLWIFI) += iwlwifi.o 18obj-$(CONFIG_IWLWIFI) += iwlwifi.o
3iwlwifi-objs := iwl-agn.o iwl-agn-rs.o iwl-mac80211.o
4iwlwifi-objs += iwl-ucode.o iwl-agn-tx.o iwl-debug.o
5iwlwifi-objs += iwl-agn-lib.o iwl-agn-calib.o iwl-io.o
6iwlwifi-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-rx.o
7
8iwlwifi-objs += iwl-eeprom.o iwl-power.o
9iwlwifi-objs += iwl-scan.o iwl-led.o
10iwlwifi-objs += iwl-agn-rxon.o iwl-agn-devices.o
11iwlwifi-objs += iwl-5000.o 19iwlwifi-objs += iwl-5000.o
12iwlwifi-objs += iwl-6000.o 20iwlwifi-objs += iwl-6000.o
13iwlwifi-objs += iwl-1000.o 21iwlwifi-objs += iwl-1000.o
14iwlwifi-objs += iwl-2000.o 22iwlwifi-objs += iwl-2000.o
23iwlwifi-objs += iwl-io.o
15iwlwifi-objs += iwl-pci.o 24iwlwifi-objs += iwl-pci.o
16iwlwifi-objs += iwl-drv.o 25iwlwifi-objs += iwl-drv.o
17iwlwifi-objs += iwl-notif-wait.o 26iwlwifi-objs += iwl-debug.o
18iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o 27iwlwifi-objs += iwl-trans-pcie.o iwl-trans-pcie-rx.o iwl-trans-pcie-tx.o
19 28
20
21iwlwifi-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
22iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o 29iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TRACING) += iwl-devtrace.o
23iwlwifi-$(CONFIG_IWLWIFI_DEVICE_TESTMODE) += iwl-testmode.o
24
25CFLAGS_iwl-devtrace.o := -I$(src)
26 30
27ccflags-y += -D__CHECK_ENDIAN__ 31ccflags-y += -D__CHECK_ENDIAN__
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ec36e2b020b6..5149e6f72945 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -78,7 +78,6 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
78MODULE_VERSION(DRV_VERSION); 78MODULE_VERSION(DRV_VERSION);
79MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); 79MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
80MODULE_LICENSE("GPL"); 80MODULE_LICENSE("GPL");
81MODULE_ALIAS("iwlagn");
82 81
83void iwl_update_chain_flags(struct iwl_priv *priv) 82void iwl_update_chain_flags(struct iwl_priv *priv)
84{ 83{
@@ -2344,24 +2343,25 @@ static int __init iwl_init(void)
2344 goto error_rc_register; 2343 goto error_rc_register;
2345 } 2344 }
2346 2345
2347 ret = iwl_pci_register_driver(); 2346 ret = iwl_opmode_register("iwldvm", &iwl_dvm_ops);
2348 if (ret) 2347 if (ret) {
2349 goto error_pci_register; 2348 pr_err("Unable to register op_mode: %d\n", ret);
2349 goto error_opmode_register;
2350 }
2350 return ret; 2351 return ret;
2351 2352
2352error_pci_register: 2353error_opmode_register:
2353 iwlagn_rate_control_unregister(); 2354 iwlagn_rate_control_unregister();
2354error_rc_register: 2355error_rc_register:
2355 kmem_cache_destroy(iwl_tx_cmd_pool); 2356 kmem_cache_destroy(iwl_tx_cmd_pool);
2356 return ret; 2357 return ret;
2357} 2358}
2359module_init(iwl_init);
2358 2360
2359static void __exit iwl_exit(void) 2361static void __exit iwl_exit(void)
2360{ 2362{
2361 iwl_pci_unregister_driver(); 2363 iwl_opmode_deregister("iwldvm");
2362 iwlagn_rate_control_unregister(); 2364 iwlagn_rate_control_unregister();
2363 kmem_cache_destroy(iwl_tx_cmd_pool); 2365 kmem_cache_destroy(iwl_tx_cmd_pool);
2364} 2366}
2365
2366module_exit(iwl_exit); 2367module_exit(iwl_exit);
2367module_init(iwl_init);
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.c b/drivers/net/wireless/iwlwifi/iwl-debug.c
index 2d1b42847b9b..0f8fcd1d4fe2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.c
@@ -62,6 +62,7 @@
62 *****************************************************************************/ 62 *****************************************************************************/
63 63
64#include <linux/interrupt.h> 64#include <linux/interrupt.h>
65#include <linux/export.h>
65#include "iwl-debug.h" 66#include "iwl-debug.h"
66#include "iwl-devtrace.h" 67#include "iwl-devtrace.h"
67 68
@@ -81,8 +82,11 @@ void __iwl_ ##fn(struct device *dev, const char *fmt, ...) \
81} 82}
82 83
83__iwl_fn(warn) 84__iwl_fn(warn)
85EXPORT_SYMBOL_GPL(__iwl_warn);
84__iwl_fn(info) 86__iwl_fn(info)
87EXPORT_SYMBOL_GPL(__iwl_info);
85__iwl_fn(crit) 88__iwl_fn(crit)
89EXPORT_SYMBOL_GPL(__iwl_crit);
86 90
87void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only, 91void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
88 const char *fmt, ...) 92 const char *fmt, ...)
@@ -103,6 +107,7 @@ void __iwl_err(struct device *dev, bool rfkill_prefix, bool trace_only,
103 trace_iwlwifi_err(&vaf); 107 trace_iwlwifi_err(&vaf);
104 va_end(args); 108 va_end(args);
105} 109}
110EXPORT_SYMBOL_GPL(__iwl_err);
106 111
107#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING) 112#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWLWIFI_DEVICE_TRACING)
108void __iwl_dbg(struct device *dev, 113void __iwl_dbg(struct device *dev,
@@ -125,4 +130,5 @@ void __iwl_dbg(struct device *dev,
125 trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf); 130 trace_iwlwifi_dbg(level, in_interrupt(), function, &vaf);
126 va_end(args); 131 va_end(args);
127} 132}
133EXPORT_SYMBOL_GPL(__iwl_dbg);
128#endif 134#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.c b/drivers/net/wireless/iwlwifi/iwl-devtrace.c
index 91f45e71e0a2..70191ddbd8f6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-devtrace.c
+++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.c
@@ -42,4 +42,9 @@ EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_event);
42EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_error); 42EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_error);
43EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_cont_event); 43EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_cont_event);
44EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_wrap_event); 44EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dev_ucode_wrap_event);
45EXPORT_TRACEPOINT_SYMBOL(iwlwifi_info);
46EXPORT_TRACEPOINT_SYMBOL(iwlwifi_warn);
47EXPORT_TRACEPOINT_SYMBOL(iwlwifi_crit);
48EXPORT_TRACEPOINT_SYMBOL(iwlwifi_err);
49EXPORT_TRACEPOINT_SYMBOL(iwlwifi_dbg);
45#endif 50#endif
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index d742900969ea..cdfdfaec395e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -77,8 +77,33 @@
77/* private includes */ 77/* private includes */
78#include "iwl-fw-file.h" 78#include "iwl-fw-file.h"
79 79
80/******************************************************************************
81 *
82 * module boiler plate
83 *
84 ******************************************************************************/
85
86/*
87 * module name, copyright, version, etc.
88 */
89#define DRV_DESCRIPTION "Intel(R) Wireless WiFi driver for Linux"
90
91#ifdef CONFIG_IWLWIFI_DEBUG
92#define VD "d"
93#else
94#define VD
95#endif
96
97#define DRV_VERSION IWLWIFI_VERSION VD
98
99MODULE_DESCRIPTION(DRV_DESCRIPTION);
100MODULE_VERSION(DRV_VERSION);
101MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
102MODULE_LICENSE("GPL");
103
80/** 104/**
81 * struct iwl_drv - drv common data 105 * struct iwl_drv - drv common data
106 * @list: list of drv structures using this opmode
82 * @fw: the iwl_fw structure 107 * @fw: the iwl_fw structure
83 * @op_mode: the running op_mode 108 * @op_mode: the running op_mode
84 * @trans: transport layer 109 * @trans: transport layer
@@ -89,6 +114,7 @@
89 * @request_firmware_complete: the firmware has been obtained from user space 114 * @request_firmware_complete: the firmware has been obtained from user space
90 */ 115 */
91struct iwl_drv { 116struct iwl_drv {
117 struct list_head list;
92 struct iwl_fw fw; 118 struct iwl_fw fw;
93 119
94 struct iwl_op_mode *op_mode; 120 struct iwl_op_mode *op_mode;
@@ -102,7 +128,17 @@ struct iwl_drv {
102 struct completion request_firmware_complete; 128 struct completion request_firmware_complete;
103}; 129};
104 130
131#define DVM_OP_MODE 0
132#define MVM_OP_MODE 1
105 133
134static struct iwlwifi_opmode_table {
135 const char *name; /* name: iwldvm, iwlmvm, etc */
136 const struct iwl_op_mode_ops *ops; /* pointer to op_mode ops */
137 struct list_head drv; /* list of devices using this op_mode */
138} iwlwifi_opmode_table[] = { /* ops set when driver is initialized */
139 { .name = "iwldvm", .ops = NULL },
140 { .name = "iwlmvm", .ops = NULL },
141};
106 142
107/* 143/*
108 * struct fw_sec: Just for the image parsing proccess. 144 * struct fw_sec: Just for the image parsing proccess.
@@ -721,7 +757,6 @@ static int validate_sec_sizes(struct iwl_drv *drv,
721 return 0; 757 return 0;
722} 758}
723 759
724
725/** 760/**
726 * iwl_ucode_callback - callback when firmware was loaded 761 * iwl_ucode_callback - callback when firmware was loaded
727 * 762 *
@@ -733,6 +768,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
733 struct iwl_drv *drv = context; 768 struct iwl_drv *drv = context;
734 struct iwl_fw *fw = &drv->fw; 769 struct iwl_fw *fw = &drv->fw;
735 struct iwl_ucode_header *ucode; 770 struct iwl_ucode_header *ucode;
771 struct iwlwifi_opmode_table *op;
736 int err; 772 int err;
737 struct iwl_firmware_pieces pieces; 773 struct iwl_firmware_pieces pieces;
738 const unsigned int api_max = drv->cfg->ucode_api_max; 774 const unsigned int api_max = drv->cfg->ucode_api_max;
@@ -863,10 +899,17 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
863 release_firmware(ucode_raw); 899 release_firmware(ucode_raw);
864 complete(&drv->request_firmware_complete); 900 complete(&drv->request_firmware_complete);
865 901
866 drv->op_mode = iwl_dvm_ops.start(drv->trans, drv->cfg, &drv->fw); 902 op = &iwlwifi_opmode_table[DVM_OP_MODE];
867 903
868 if (!drv->op_mode) 904 /* add this device to the list of devices using this op_mode */
869 goto out_free_fw; 905 list_add_tail(&drv->list, &op->drv);
906
907 if (op->ops) {
908 const struct iwl_op_mode_ops *ops = op->ops;
909 drv->op_mode = ops->start(drv->trans, drv->cfg, &drv->fw);
910 } else {
911 request_module_nowait("%s", op->name);
912 }
870 913
871 return; 914 return;
872 915
@@ -938,6 +981,67 @@ struct iwl_mod_params iwlwifi_mod_params = {
938 .auto_agg = true, 981 .auto_agg = true,
939 /* the rest are 0 by default */ 982 /* the rest are 0 by default */
940}; 983};
984EXPORT_SYMBOL_GPL(iwlwifi_mod_params);
985
986int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
987{
988 int i;
989 struct iwl_drv *drv;
990
991 for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) {
992 if (strcmp(iwlwifi_opmode_table[i].name, name))
993 continue;
994 iwlwifi_opmode_table[i].ops = ops;
995 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list)
996 drv->op_mode = ops->start(drv->trans, drv->cfg,
997 &drv->fw);
998 return 0;
999 }
1000 return -EIO;
1001}
1002EXPORT_SYMBOL_GPL(iwl_opmode_register);
1003
1004void iwl_opmode_deregister(const char *name)
1005{
1006 int i;
1007 struct iwl_drv *drv;
1008
1009 for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) {
1010 if (strcmp(iwlwifi_opmode_table[i].name, name))
1011 continue;
1012 iwlwifi_opmode_table[i].ops = NULL;
1013
1014 /* call the stop routine for all devices */
1015 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) {
1016 if (drv->op_mode) {
1017 iwl_op_mode_stop(drv->op_mode);
1018 drv->op_mode = NULL;
1019 }
1020 }
1021 return;
1022 }
1023}
1024EXPORT_SYMBOL_GPL(iwl_opmode_deregister);
1025
1026static int __init iwl_drv_init(void)
1027{
1028 int i;
1029
1030 for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++)
1031 INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv);
1032
1033 pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n");
1034 pr_info(DRV_COPYRIGHT "\n");
1035
1036 return iwl_pci_register_driver();
1037}
1038module_init(iwl_drv_init);
1039
1040static void __exit iwl_drv_exit(void)
1041{
1042 iwl_pci_unregister_driver();
1043}
1044module_exit(iwl_drv_exit);
941 1045
942#ifdef CONFIG_IWLWIFI_DEBUG 1046#ifdef CONFIG_IWLWIFI_DEBUG
943module_param_named(debug, iwlwifi_mod_params.debug_level, uint, 1047module_param_named(debug, iwlwifi_mod_params.debug_level, uint,
diff --git a/drivers/net/wireless/iwlwifi/iwl-io.c b/drivers/net/wireless/iwlwifi/iwl-io.c
index 081dd34d2387..ee93274214d6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-io.c
+++ b/drivers/net/wireless/iwlwifi/iwl-io.c
@@ -27,6 +27,7 @@
27 *****************************************************************************/ 27 *****************************************************************************/
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/export.h>
30 31
31#include "iwl-io.h" 32#include "iwl-io.h"
32#include"iwl-csr.h" 33#include"iwl-csr.h"
@@ -52,6 +53,7 @@ void iwl_set_bit(struct iwl_trans *trans, u32 reg, u32 mask)
52 __iwl_set_bit(trans, reg, mask); 53 __iwl_set_bit(trans, reg, mask);
53 spin_unlock_irqrestore(&trans->reg_lock, flags); 54 spin_unlock_irqrestore(&trans->reg_lock, flags);
54} 55}
56EXPORT_SYMBOL_GPL(iwl_set_bit);
55 57
56void iwl_clear_bit(struct iwl_trans *trans, u32 reg, u32 mask) 58void iwl_clear_bit(struct iwl_trans *trans, u32 reg, u32 mask)
57{ 59{
@@ -61,6 +63,7 @@ void iwl_clear_bit(struct iwl_trans *trans, u32 reg, u32 mask)
61 __iwl_clear_bit(trans, reg, mask); 63 __iwl_clear_bit(trans, reg, mask);
62 spin_unlock_irqrestore(&trans->reg_lock, flags); 64 spin_unlock_irqrestore(&trans->reg_lock, flags);
63} 65}
66EXPORT_SYMBOL_GPL(iwl_clear_bit);
64 67
65int iwl_poll_bit(struct iwl_trans *trans, u32 addr, 68int iwl_poll_bit(struct iwl_trans *trans, u32 addr,
66 u32 bits, u32 mask, int timeout) 69 u32 bits, u32 mask, int timeout)
@@ -76,6 +79,7 @@ int iwl_poll_bit(struct iwl_trans *trans, u32 addr,
76 79
77 return -ETIMEDOUT; 80 return -ETIMEDOUT;
78} 81}
82EXPORT_SYMBOL_GPL(iwl_poll_bit);
79 83
80int iwl_grab_nic_access_silent(struct iwl_trans *trans) 84int iwl_grab_nic_access_silent(struct iwl_trans *trans)
81{ 85{
@@ -117,6 +121,7 @@ int iwl_grab_nic_access_silent(struct iwl_trans *trans)
117 121
118 return 0; 122 return 0;
119} 123}
124EXPORT_SYMBOL_GPL(iwl_grab_nic_access_silent);
120 125
121bool iwl_grab_nic_access(struct iwl_trans *trans) 126bool iwl_grab_nic_access(struct iwl_trans *trans)
122{ 127{
@@ -130,6 +135,7 @@ bool iwl_grab_nic_access(struct iwl_trans *trans)
130 135
131 return true; 136 return true;
132} 137}
138EXPORT_SYMBOL_GPL(iwl_grab_nic_access);
133 139
134void iwl_release_nic_access(struct iwl_trans *trans) 140void iwl_release_nic_access(struct iwl_trans *trans)
135{ 141{
@@ -144,6 +150,7 @@ void iwl_release_nic_access(struct iwl_trans *trans)
144 */ 150 */
145 mmiowb(); 151 mmiowb();
146} 152}
153EXPORT_SYMBOL_GPL(iwl_release_nic_access);
147 154
148u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg) 155u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg)
149{ 156{
@@ -158,6 +165,7 @@ u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg)
158 165
159 return value; 166 return value;
160} 167}
168EXPORT_SYMBOL_GPL(iwl_read_direct32);
161 169
162void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value) 170void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value)
163{ 171{
@@ -170,6 +178,7 @@ void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value)
170 } 178 }
171 spin_unlock_irqrestore(&trans->reg_lock, flags); 179 spin_unlock_irqrestore(&trans->reg_lock, flags);
172} 180}
181EXPORT_SYMBOL_GPL(iwl_write_direct32);
173 182
174int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask, 183int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
175 int timeout) 184 int timeout)
@@ -185,6 +194,7 @@ int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
185 194
186 return -ETIMEDOUT; 195 return -ETIMEDOUT;
187} 196}
197EXPORT_SYMBOL_GPL(iwl_poll_direct_bit);
188 198
189static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg) 199static inline u32 __iwl_read_prph(struct iwl_trans *trans, u32 reg)
190{ 200{
@@ -211,6 +221,7 @@ u32 iwl_read_prph(struct iwl_trans *trans, u32 reg)
211 spin_unlock_irqrestore(&trans->reg_lock, flags); 221 spin_unlock_irqrestore(&trans->reg_lock, flags);
212 return val; 222 return val;
213} 223}
224EXPORT_SYMBOL_GPL(iwl_read_prph);
214 225
215void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val) 226void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val)
216{ 227{
@@ -223,6 +234,7 @@ void iwl_write_prph(struct iwl_trans *trans, u32 addr, u32 val)
223 } 234 }
224 spin_unlock_irqrestore(&trans->reg_lock, flags); 235 spin_unlock_irqrestore(&trans->reg_lock, flags);
225} 236}
237EXPORT_SYMBOL_GPL(iwl_write_prph);
226 238
227void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) 239void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
228{ 240{
@@ -236,6 +248,7 @@ void iwl_set_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
236 } 248 }
237 spin_unlock_irqrestore(&trans->reg_lock, flags); 249 spin_unlock_irqrestore(&trans->reg_lock, flags);
238} 250}
251EXPORT_SYMBOL_GPL(iwl_set_bits_prph);
239 252
240void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg, 253void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
241 u32 bits, u32 mask) 254 u32 bits, u32 mask)
@@ -250,6 +263,7 @@ void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 reg,
250 } 263 }
251 spin_unlock_irqrestore(&trans->reg_lock, flags); 264 spin_unlock_irqrestore(&trans->reg_lock, flags);
252} 265}
266EXPORT_SYMBOL_GPL(iwl_set_bits_mask_prph);
253 267
254void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask) 268void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
255{ 269{
@@ -264,6 +278,7 @@ void iwl_clear_bits_prph(struct iwl_trans *trans, u32 reg, u32 mask)
264 } 278 }
265 spin_unlock_irqrestore(&trans->reg_lock, flags); 279 spin_unlock_irqrestore(&trans->reg_lock, flags);
266} 280}
281EXPORT_SYMBOL_GPL(iwl_clear_bits_prph);
267 282
268void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr, 283void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr,
269 void *buf, int words) 284 void *buf, int words)
@@ -281,6 +296,7 @@ void _iwl_read_targ_mem_words(struct iwl_trans *trans, u32 addr,
281 } 296 }
282 spin_unlock_irqrestore(&trans->reg_lock, flags); 297 spin_unlock_irqrestore(&trans->reg_lock, flags);
283} 298}
299EXPORT_SYMBOL_GPL(_iwl_read_targ_mem_words);
284 300
285u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr) 301u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr)
286{ 302{
@@ -290,6 +306,7 @@ u32 iwl_read_targ_mem(struct iwl_trans *trans, u32 addr)
290 306
291 return value; 307 return value;
292} 308}
309EXPORT_SYMBOL_GPL(iwl_read_targ_mem);
293 310
294int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr, 311int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr,
295 void *buf, int words) 312 void *buf, int words)
@@ -310,8 +327,10 @@ int _iwl_write_targ_mem_words(struct iwl_trans *trans, u32 addr,
310 327
311 return result; 328 return result;
312} 329}
330EXPORT_SYMBOL_GPL(_iwl_write_targ_mem_words);
313 331
314int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val) 332int iwl_write_targ_mem(struct iwl_trans *trans, u32 addr, u32 val)
315{ 333{
316 return _iwl_write_targ_mem_words(trans, addr, &val, 1); 334 return _iwl_write_targ_mem_words(trans, addr, &val, 1);
317} 335}
336EXPORT_SYMBOL_GPL(iwl_write_targ_mem);
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
index 4ef742b28e08..cec133c87ad8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
@@ -145,6 +145,9 @@ struct iwl_op_mode_ops {
145 void (*wimax_active)(struct iwl_op_mode *op_mode); 145 void (*wimax_active)(struct iwl_op_mode *op_mode);
146}; 146};
147 147
148int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops);
149void iwl_opmode_deregister(const char *name);
150
148/** 151/**
149 * struct iwl_op_mode - operational mode 152 * struct iwl_op_mode - operational mode
150 * 153 *