aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKolekar, Abhijeet <abhijeet.kolekar@intel.com>2008-12-18 21:37:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:03 -0500
commit5747d47fb469613901e76a1380daf14901e76092 (patch)
tree0e870726ffbff966e06f374528459a364c77fc63 /drivers
parenteaa686c37d12aac37f955eb7643a62370c84ee12 (diff)
iwl3945: include iwl-core.h
Use iwl-core.h instead of iwl-3945-core.h. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-core.h104
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h30
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c52
4 files changed, 32 insertions, 156 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-core.h b/drivers/net/wireless/iwlwifi/iwl-3945-core.h
deleted file mode 100644
index 6f463555402..00000000000
--- a/drivers/net/wireless/iwlwifi/iwl-3945-core.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/******************************************************************************
2 *
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
5 *
6 * GPL LICENSE SUMMARY
7 *
8 * Copyright(c) 2008 Intel Corporation. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
22 * USA
23 *
24 * The full GNU General Public License is included in this distribution
25 * in the file called LICENSE.GPL.
26 *
27 * Contact Information:
28 * Intel Linux Wireless <ilw@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
30 *
31 * BSD LICENSE
32 *
33 * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 *
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
45 * distribution.
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
49 *
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 *****************************************************************************/
62
63#ifndef __iwl_3945_dev_h__
64#define __iwl_3945_dev_h__
65
66#define IWL_PCI_DEVICE(dev, subdev, cfg) \
67 .vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \
68 .subvendor = PCI_ANY_ID, .subdevice = (subdev), \
69 .driver_data = (kernel_ulong_t)&(cfg)
70
71#define IWL_SKU_G 0x1
72#define IWL_SKU_A 0x2
73
74/**
75 * struct iwl_3945_cfg
76 * @fw_name_pre: Firmware filename prefix. The api version and extension
77 * (.ucode) will be added to filename before loading from disk. The
78 * filename is constructed as fw_name_pre<api>.ucode.
79 * @ucode_api_max: Highest version of uCode API supported by driver.
80 * @ucode_api_min: Lowest version of uCode API supported by driver.
81 *
82 * We enable the driver to be backward compatible wrt API version. The
83 * driver specifies which APIs it supports (with @ucode_api_max being the
84 * highest and @ucode_api_min the lowest). Firmware will only be loaded if
85 * it has a supported API version. The firmware's API version will be
86 * stored in @iwl_priv, enabling the driver to make runtime changes based
87 * on firmware version used.
88 *
89 * For example,
90 * if (IWL_UCODE_API(priv->ucode_ver) >= 2) {
91 * Driver interacts with Firmware API version >= 2.
92 * } else {
93 * Driver interacts with Firmware API version 1.
94 * }
95 */
96struct iwl_3945_cfg {
97 const char *name;
98 const char *fw_name_pre;
99 const unsigned int ucode_api_max;
100 const unsigned int ucode_api_min;
101 unsigned int sku;
102};
103
104#endif /* __iwl_dev_h__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 14f0923a475..8c40f669978 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -38,11 +38,11 @@
38#include <asm/unaligned.h> 38#include <asm/unaligned.h>
39#include <net/mac80211.h> 39#include <net/mac80211.h>
40 40
41#include "iwl-3945-core.h"
42#include "iwl-3945-fh.h" 41#include "iwl-3945-fh.h"
43#include "iwl-commands.h" 42#include "iwl-commands.h"
44#include "iwl-3945.h" 43#include "iwl-3945.h"
45#include "iwl-helpers.h" 44#include "iwl-helpers.h"
45#include "iwl-core.h"
46#include "iwl-agn-rs.h" 46#include "iwl-agn-rs.h"
47 47
48#define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ 48#define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 7c3a20a986b..a3cc43dd845 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -205,6 +205,36 @@ struct iwl_cfg {
205 const struct iwl_mod_params *mod_params; 205 const struct iwl_mod_params *mod_params;
206}; 206};
207 207
208/**
209 * struct iwl_3945_cfg
210 * @fw_name_pre: Firmware filename prefix. The api version and extension
211 * (.ucode) will be added to filename before loading from disk. The
212 * filename is constructed as fw_name_pre<api>.ucode.
213 * @ucode_api_max: Highest version of uCode API supported by driver.
214 * @ucode_api_min: Lowest version of uCode API supported by driver.
215 *
216 * We enable the driver to be backward compatible wrt API version. The
217 * driver specifies which APIs it supports (with @ucode_api_max being the
218 * highest and @ucode_api_min the lowest). Firmware will only be loaded if
219 * it has a supported API version. The firmware's API version will be
220 * stored in @iwl_priv, enabling the driver to make runtime changes based
221 * on firmware version used.
222 *
223 * For example,
224 * if (IWL_UCODE_API(priv->ucode_ver) >= 2) {
225 * Driver interacts with Firmware API version >= 2.
226 * } else {
227 * Driver interacts with Firmware API version 1.
228 * }
229 */
230struct iwl_3945_cfg {
231 const char *name;
232 const char *fw_name_pre;
233 const unsigned int ucode_api_max;
234 const unsigned int ucode_api_min;
235 unsigned int sku;
236};
237
208/*************************** 238/***************************
209 * L i b * 239 * L i b *
210 ***************************/ 240 ***************************/
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 063ee65e7ec..c3fd7c651ba 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -48,11 +48,11 @@
48 48
49#define DRV_NAME "iwl3945" 49#define DRV_NAME "iwl3945"
50 50
51#include "iwl-3945-core.h"
52#include "iwl-commands.h" 51#include "iwl-commands.h"
53#include "iwl-3945.h" 52#include "iwl-3945.h"
54#include "iwl-3945-fh.h" 53#include "iwl-3945-fh.h"
55#include "iwl-helpers.h" 54#include "iwl-helpers.h"
55#include "iwl-core.h"
56#include "iwl-dev.h" 56#include "iwl-dev.h"
57 57
58static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv, 58static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv,
@@ -491,56 +491,6 @@ static inline int iwl3945_is_ready_rf(struct iwl3945_priv *priv)
491/*************** HOST COMMAND QUEUE FUNCTIONS *****/ 491/*************** HOST COMMAND QUEUE FUNCTIONS *****/
492 492
493#define IWL_CMD(x) case x: return #x 493#define IWL_CMD(x) case x: return #x
494
495static const char *get_cmd_string(u8 cmd)
496{
497 switch (cmd) {
498 IWL_CMD(REPLY_ALIVE);
499 IWL_CMD(REPLY_ERROR);
500 IWL_CMD(REPLY_RXON);
501 IWL_CMD(REPLY_RXON_ASSOC);
502 IWL_CMD(REPLY_QOS_PARAM);
503 IWL_CMD(REPLY_RXON_TIMING);
504 IWL_CMD(REPLY_ADD_STA);
505 IWL_CMD(REPLY_REMOVE_STA);
506 IWL_CMD(REPLY_REMOVE_ALL_STA);
507 IWL_CMD(REPLY_3945_RX);
508 IWL_CMD(REPLY_TX);
509 IWL_CMD(REPLY_RATE_SCALE);
510 IWL_CMD(REPLY_LEDS_CMD);
511 IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
512 IWL_CMD(RADAR_NOTIFICATION);
513 IWL_CMD(REPLY_QUIET_CMD);
514 IWL_CMD(REPLY_CHANNEL_SWITCH);
515 IWL_CMD(CHANNEL_SWITCH_NOTIFICATION);
516 IWL_CMD(REPLY_SPECTRUM_MEASUREMENT_CMD);
517 IWL_CMD(SPECTRUM_MEASURE_NOTIFICATION);
518 IWL_CMD(POWER_TABLE_CMD);
519 IWL_CMD(PM_SLEEP_NOTIFICATION);
520 IWL_CMD(PM_DEBUG_STATISTIC_NOTIFIC);
521 IWL_CMD(REPLY_SCAN_CMD);
522 IWL_CMD(REPLY_SCAN_ABORT_CMD);
523 IWL_CMD(SCAN_START_NOTIFICATION);
524 IWL_CMD(SCAN_RESULTS_NOTIFICATION);
525 IWL_CMD(SCAN_COMPLETE_NOTIFICATION);
526 IWL_CMD(BEACON_NOTIFICATION);
527 IWL_CMD(REPLY_TX_BEACON);
528 IWL_CMD(WHO_IS_AWAKE_NOTIFICATION);
529 IWL_CMD(QUIET_NOTIFICATION);
530 IWL_CMD(REPLY_TX_PWR_TABLE_CMD);
531 IWL_CMD(MEASURE_ABORT_NOTIFICATION);
532 IWL_CMD(REPLY_BT_CONFIG);
533 IWL_CMD(REPLY_STATISTICS_CMD);
534 IWL_CMD(STATISTICS_NOTIFICATION);
535 IWL_CMD(REPLY_CARD_STATE_CMD);
536 IWL_CMD(CARD_STATE_NOTIFICATION);
537 IWL_CMD(MISSED_BEACONS_NOTIFICATION);
538 default:
539 return "UNKNOWN";
540
541 }
542}
543
544#define HOST_COMPLETE_TIMEOUT (HZ / 2) 494#define HOST_COMPLETE_TIMEOUT (HZ / 2)
545 495
546/** 496/**