Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82b9a121 authored by Tomas Winkler's avatar Tomas Winkler Committed by John W. Linville
Browse files

iwlwifi: add struct iwl_cfg



This patch introduces struct iwl_cfg. struct iwl_cfg defines static
configuration for each device type and sku. It is passed as driver_data
to the bus probe function.
This patch also introduce new common header file iwl-core.h
which will represent core functionality of iwlwifi driver

3945ABG uses separate iwl-3945-dev.h header file for now

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 750fe639
Loading
Loading
Loading
Loading
+80 −0
Original line number Diff line number Diff line
/******************************************************************************
 *
 * This file is provided under a dual BSD/GPLv2 license.  When using or
 * redistributing this file, you may do so under either license.
 *
 * GPL LICENSE SUMMARY
 *
 * Copyright(c) 2008 Intel Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
 * USA
 *
 * The full GNU General Public License is included in this distribution
 * in the file called LICENSE.GPL.
 *
 * Contact Information:
 * Tomas Winkler <tomas.winkler@intel.com>
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 *
 * BSD LICENSE
 *
 * Copyright(c) 2005 - 2008 Intel Corporation. All rights reserved.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name Intel Corporation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *****************************************************************************/

#ifndef __iwl_3945_dev_h__
#define __iwl_3945_dev_h__

#define IWL_PCI_DEVICE(dev, subdev, cfg) \
	.vendor = PCI_VENDOR_ID_INTEL,  .device = (dev), \
	.subvendor = PCI_ANY_ID, .subdevice = (subdev), \
	.driver_data = (kernel_ulong_t)&(cfg)

#define IWL_SKU_G       0x1
#define IWL_SKU_A       0x2

struct iwl_3945_cfg {
	const char *name;
	const char *fw_name;
	unsigned int sku;
};

#endif /* __iwl_dev_h__ */
+17 −2
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <asm/unaligned.h>
#include <net/mac80211.h>

#include "iwl-3945-core.h"
#include "iwl-3945.h"
#include "iwl-helpers.h"
#include "iwl-3945-rs.h"
@@ -2523,9 +2524,23 @@ void iwl3945_hw_cancel_deferred_work(struct iwl3945_priv *priv)
	cancel_delayed_work(&priv->thermal_periodic);
}

static struct iwl_3945_cfg iwl3945_bg_cfg = {
	.name = "3945BG",
	.sku = IWL_SKU_G,
};

static struct iwl_3945_cfg iwl3945_abg_cfg = {
	.name = "3945ABG",
	.sku = IWL_SKU_A|IWL_SKU_G,
};

struct pci_device_id iwl3945_hw_card_ids[] = {
	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4222)},
	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4227)},
	{IWL_PCI_DEVICE(0x4222, 0x1005, iwl3945_bg_cfg)},
	{IWL_PCI_DEVICE(0x4222, 0x1034, iwl3945_bg_cfg)},
	{IWL_PCI_DEVICE(0x4222, 0x1044, iwl3945_bg_cfg)},
	{IWL_PCI_DEVICE(0x4227, 0x1014, iwl3945_bg_cfg)},
	{IWL_PCI_DEVICE(0x4222, PCI_ANY_ID, iwl3945_abg_cfg)},
	{IWL_PCI_DEVICE(0x4227, PCI_ANY_ID, iwl3945_abg_cfg)},
	{0}
};

+1 −1
Original line number Diff line number Diff line
@@ -682,6 +682,7 @@ struct iwl3945_priv {
	struct ieee80211_hw *hw;
	struct ieee80211_channel *ieee_channels;
	struct ieee80211_rate *ieee_rates;
	struct iwl_3945_cfg *cfg; /* device configuration */

	/* temporary frame storage list */
	struct list_head free_frames;
@@ -820,7 +821,6 @@ struct iwl3945_priv {
	int is_open;

	u8 mac80211_registered;
	int is_abg;

	u32 notif_missed_beacons;

+8 −2
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <linux/etherdevice.h>
#include <asm/unaligned.h>

#include "iwl-core.h"
#include "iwl-4965.h"
#include "iwl-helpers.h"

@@ -4820,9 +4821,14 @@ void iwl4965_hw_cancel_deferred_work(struct iwl4965_priv *priv)
	cancel_delayed_work(&priv->init_alive_start);
}

static struct iwl_cfg iwl4965_agn_cfg = {
	.name = "4965AGN",
	.sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N,
};

struct pci_device_id iwl4965_hw_card_ids[] = {
	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4229)},
	{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4230)},
	{IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)},
	{IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
	{0}
};

+1 −1
Original line number Diff line number Diff line
@@ -967,6 +967,7 @@ struct iwl4965_priv {
	struct ieee80211_hw *hw;
	struct ieee80211_channel *ieee_channels;
	struct ieee80211_rate *ieee_rates;
	struct iwl_cfg *cfg;

	/* temporary frame storage list */
	struct list_head free_frames;
@@ -1126,7 +1127,6 @@ struct iwl4965_priv {
	int is_open;

	u8 mac80211_registered;
	int is_abg;

	u32 notif_missed_beacons;

Loading