|
@@ -32,8 +32,6 @@
|
|
#include <linux/kernel.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
-#include <linux/pci.h>
|
|
|
|
-#include <linux/pci-aspm.h>
|
|
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/delay.h>
|
|
@@ -49,8 +47,6 @@
|
|
|
|
|
|
#include <asm/div64.h>
|
|
#include <asm/div64.h>
|
|
|
|
|
|
-#define DRV_NAME "iwlagn"
|
|
|
|
-
|
|
|
|
#include "iwl-eeprom.h"
|
|
#include "iwl-eeprom.h"
|
|
#include "iwl-dev.h"
|
|
#include "iwl-dev.h"
|
|
#include "iwl-core.h"
|
|
#include "iwl-core.h"
|
|
@@ -59,6 +55,7 @@
|
|
#include "iwl-sta.h"
|
|
#include "iwl-sta.h"
|
|
#include "iwl-agn-calib.h"
|
|
#include "iwl-agn-calib.h"
|
|
#include "iwl-agn.h"
|
|
#include "iwl-agn.h"
|
|
|
|
+#include "iwl-pci.h"
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
/******************************************************************************
|
|
@@ -440,10 +437,8 @@ static void iwl_bg_tx_flush(struct work_struct *work)
|
|
if (!iwl_is_ready_rf(priv))
|
|
if (!iwl_is_ready_rf(priv))
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (priv->cfg->ops->lib->txfifo_flush) {
|
|
|
|
- IWL_DEBUG_INFO(priv, "device request: flush all tx frames\n");
|
|
|
|
- iwlagn_dev_txfifo_flush(priv, IWL_DROP_ALL);
|
|
|
|
- }
|
|
|
|
|
|
+ IWL_DEBUG_INFO(priv, "device request: flush all tx frames\n");
|
|
|
|
+ iwlagn_dev_txfifo_flush(priv, IWL_DROP_ALL);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -497,9 +492,9 @@ static void iwl_rx_handle(struct iwl_priv *priv)
|
|
|
|
|
|
rxq->queue[i] = NULL;
|
|
rxq->queue[i] = NULL;
|
|
|
|
|
|
- pci_unmap_page(priv->pci_dev, rxb->page_dma,
|
|
|
|
|
|
+ dma_unmap_page(priv->bus.dev, rxb->page_dma,
|
|
PAGE_SIZE << priv->hw_params.rx_page_order,
|
|
PAGE_SIZE << priv->hw_params.rx_page_order,
|
|
- PCI_DMA_FROMDEVICE);
|
|
|
|
|
|
+ DMA_FROM_DEVICE);
|
|
pkt = rxb_addr(rxb);
|
|
pkt = rxb_addr(rxb);
|
|
|
|
|
|
len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
|
|
len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK;
|
|
@@ -581,9 +576,9 @@ static void iwl_rx_handle(struct iwl_priv *priv)
|
|
* rx_free list for reuse later. */
|
|
* rx_free list for reuse later. */
|
|
spin_lock_irqsave(&rxq->lock, flags);
|
|
spin_lock_irqsave(&rxq->lock, flags);
|
|
if (rxb->page != NULL) {
|
|
if (rxb->page != NULL) {
|
|
- rxb->page_dma = pci_map_page(priv->pci_dev, rxb->page,
|
|
|
|
|
|
+ rxb->page_dma = dma_map_page(priv->bus.dev, rxb->page,
|
|
0, PAGE_SIZE << priv->hw_params.rx_page_order,
|
|
0, PAGE_SIZE << priv->hw_params.rx_page_order,
|
|
- PCI_DMA_FROMDEVICE);
|
|
|
|
|
|
+ DMA_FROM_DEVICE);
|
|
list_add_tail(&rxb->list, &rxq->rx_free);
|
|
list_add_tail(&rxb->list, &rxq->rx_free);
|
|
rxq->free_count++;
|
|
rxq->free_count++;
|
|
} else
|
|
} else
|
|
@@ -939,22 +934,28 @@ static struct attribute_group iwl_attribute_group = {
|
|
*
|
|
*
|
|
******************************************************************************/
|
|
******************************************************************************/
|
|
|
|
|
|
-static void iwl_free_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
|
|
|
|
|
|
+static void iwl_free_fw_desc(struct iwl_priv *priv, struct fw_desc *desc)
|
|
{
|
|
{
|
|
if (desc->v_addr)
|
|
if (desc->v_addr)
|
|
- dma_free_coherent(&pci_dev->dev, desc->len,
|
|
|
|
|
|
+ dma_free_coherent(priv->bus.dev, desc->len,
|
|
desc->v_addr, desc->p_addr);
|
|
desc->v_addr, desc->p_addr);
|
|
desc->v_addr = NULL;
|
|
desc->v_addr = NULL;
|
|
desc->len = 0;
|
|
desc->len = 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void iwl_free_fw_img(struct pci_dev *pci_dev, struct fw_img *img)
|
|
|
|
|
|
+static void iwl_free_fw_img(struct iwl_priv *priv, struct fw_img *img)
|
|
|
|
+{
|
|
|
|
+ iwl_free_fw_desc(priv, &img->code);
|
|
|
|
+ iwl_free_fw_desc(priv, &img->data);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void iwl_dealloc_ucode(struct iwl_priv *priv)
|
|
{
|
|
{
|
|
- iwl_free_fw_desc(pci_dev, &img->code);
|
|
|
|
- iwl_free_fw_desc(pci_dev, &img->data);
|
|
|
|
|
|
+ iwl_free_fw_img(priv, &priv->ucode_rt);
|
|
|
|
+ iwl_free_fw_img(priv, &priv->ucode_init);
|
|
}
|
|
}
|
|
|
|
|
|
-static int iwl_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc,
|
|
|
|
|
|
+static int iwl_alloc_fw_desc(struct iwl_priv *priv, struct fw_desc *desc,
|
|
const void *data, size_t len)
|
|
const void *data, size_t len)
|
|
{
|
|
{
|
|
if (!len) {
|
|
if (!len) {
|
|
@@ -962,21 +963,16 @@ static int iwl_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
- desc->v_addr = dma_alloc_coherent(&pci_dev->dev, len,
|
|
|
|
|
|
+ desc->v_addr = dma_alloc_coherent(priv->bus.dev, len,
|
|
&desc->p_addr, GFP_KERNEL);
|
|
&desc->p_addr, GFP_KERNEL);
|
|
if (!desc->v_addr)
|
|
if (!desc->v_addr)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
+
|
|
desc->len = len;
|
|
desc->len = len;
|
|
memcpy(desc->v_addr, data, len);
|
|
memcpy(desc->v_addr, data, len);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
|
|
|
|
-{
|
|
|
|
- iwl_free_fw_img(priv->pci_dev, &priv->ucode_rt);
|
|
|
|
- iwl_free_fw_img(priv->pci_dev, &priv->ucode_init);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
struct iwlagn_ucode_capabilities {
|
|
struct iwlagn_ucode_capabilities {
|
|
u32 max_probe_length;
|
|
u32 max_probe_length;
|
|
u32 standard_phy_calibration_size;
|
|
u32 standard_phy_calibration_size;
|
|
@@ -1021,8 +1017,8 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
|
|
priv->firmware_name);
|
|
priv->firmware_name);
|
|
|
|
|
|
return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name,
|
|
return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name,
|
|
- &priv->pci_dev->dev, GFP_KERNEL, priv,
|
|
|
|
- iwl_ucode_callback);
|
|
|
|
|
|
+ priv->bus.dev,
|
|
|
|
+ GFP_KERNEL, priv, iwl_ucode_callback);
|
|
}
|
|
}
|
|
|
|
|
|
struct iwlagn_firmware_pieces {
|
|
struct iwlagn_firmware_pieces {
|
|
@@ -1443,19 +1439,19 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|
/* Runtime instructions and 2 copies of data:
|
|
/* Runtime instructions and 2 copies of data:
|
|
* 1) unmodified from disk
|
|
* 1) unmodified from disk
|
|
* 2) backup cache for save/restore during power-downs */
|
|
* 2) backup cache for save/restore during power-downs */
|
|
- if (iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_rt.code,
|
|
|
|
|
|
+ if (iwl_alloc_fw_desc(priv, &priv->ucode_rt.code,
|
|
pieces.inst, pieces.inst_size))
|
|
pieces.inst, pieces.inst_size))
|
|
goto err_pci_alloc;
|
|
goto err_pci_alloc;
|
|
- if (iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_rt.data,
|
|
|
|
|
|
+ if (iwl_alloc_fw_desc(priv, &priv->ucode_rt.data,
|
|
pieces.data, pieces.data_size))
|
|
pieces.data, pieces.data_size))
|
|
goto err_pci_alloc;
|
|
goto err_pci_alloc;
|
|
|
|
|
|
/* Initialization instructions and data */
|
|
/* Initialization instructions and data */
|
|
if (pieces.init_size && pieces.init_data_size) {
|
|
if (pieces.init_size && pieces.init_data_size) {
|
|
- if (iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_init.code,
|
|
|
|
|
|
+ if (iwl_alloc_fw_desc(priv, &priv->ucode_init.code,
|
|
pieces.init, pieces.init_size))
|
|
pieces.init, pieces.init_size))
|
|
goto err_pci_alloc;
|
|
goto err_pci_alloc;
|
|
- if (iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_init.data,
|
|
|
|
|
|
+ if (iwl_alloc_fw_desc(priv, &priv->ucode_init.data,
|
|
pieces.init_data, pieces.init_data_size))
|
|
pieces.init_data, pieces.init_data_size))
|
|
goto err_pci_alloc;
|
|
goto err_pci_alloc;
|
|
}
|
|
}
|
|
@@ -1524,7 +1520,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|
if (err)
|
|
if (err)
|
|
IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err);
|
|
IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err);
|
|
|
|
|
|
- err = sysfs_create_group(&priv->pci_dev->dev.kobj,
|
|
|
|
|
|
+ err = sysfs_create_group(&(priv->bus.dev->kobj),
|
|
&iwl_attribute_group);
|
|
&iwl_attribute_group);
|
|
if (err) {
|
|
if (err) {
|
|
IWL_ERR(priv, "failed to create sysfs device attributes\n");
|
|
IWL_ERR(priv, "failed to create sysfs device attributes\n");
|
|
@@ -1545,10 +1541,10 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
|
|
|
|
|
|
err_pci_alloc:
|
|
err_pci_alloc:
|
|
IWL_ERR(priv, "failed to allocate pci memory\n");
|
|
IWL_ERR(priv, "failed to allocate pci memory\n");
|
|
- iwl_dealloc_ucode_pci(priv);
|
|
|
|
|
|
+ iwl_dealloc_ucode(priv);
|
|
out_unbind:
|
|
out_unbind:
|
|
complete(&priv->_agn.firmware_loading_complete);
|
|
complete(&priv->_agn.firmware_loading_complete);
|
|
- device_release_driver(&priv->pci_dev->dev);
|
|
|
|
|
|
+ device_release_driver(priv->bus.dev);
|
|
release_firmware(ucode_raw);
|
|
release_firmware(ucode_raw);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2549,11 +2545,10 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
|
|
WIPHY_FLAG_DISABLE_BEACON_HINTS |
|
|
WIPHY_FLAG_DISABLE_BEACON_HINTS |
|
|
WIPHY_FLAG_IBSS_RSN;
|
|
WIPHY_FLAG_IBSS_RSN;
|
|
|
|
|
|
- /*
|
|
|
|
- * For now, disable PS by default because it affects
|
|
|
|
- * RX performance significantly.
|
|
|
|
- */
|
|
|
|
- hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
|
|
|
|
|
|
+ if (iwlagn_mod_params.power_save)
|
|
|
|
+ hw->wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT;
|
|
|
|
+ else
|
|
|
|
+ hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
|
|
|
|
|
|
hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
|
|
hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
|
|
/* we create the 802.11 header and a zero-length SSID element */
|
|
/* we create the 802.11 header and a zero-length SSID element */
|
|
@@ -3052,10 +3047,6 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
|
|
mutex_lock(&priv->mutex);
|
|
mutex_lock(&priv->mutex);
|
|
IWL_DEBUG_MAC80211(priv, "enter\n");
|
|
IWL_DEBUG_MAC80211(priv, "enter\n");
|
|
|
|
|
|
- /* do not support "flush" */
|
|
|
|
- if (!priv->cfg->ops->lib->txfifo_flush)
|
|
|
|
- goto done;
|
|
|
|
-
|
|
|
|
if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
|
|
if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
|
|
IWL_DEBUG_TX(priv, "Aborting flush due to device shutdown\n");
|
|
IWL_DEBUG_TX(priv, "Aborting flush due to device shutdown\n");
|
|
goto done;
|
|
goto done;
|
|
@@ -3071,7 +3062,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, bool drop)
|
|
*/
|
|
*/
|
|
if (drop) {
|
|
if (drop) {
|
|
IWL_DEBUG_MAC80211(priv, "send flush command\n");
|
|
IWL_DEBUG_MAC80211(priv, "send flush command\n");
|
|
- if (priv->cfg->ops->lib->txfifo_flush(priv, IWL_DROP_ALL)) {
|
|
|
|
|
|
+ if (iwlagn_txfifo_flush(priv, IWL_DROP_ALL)) {
|
|
IWL_ERR(priv, "flush request fail\n");
|
|
IWL_ERR(priv, "flush request fail\n");
|
|
goto done;
|
|
goto done;
|
|
}
|
|
}
|
|
@@ -3357,10 +3348,6 @@ struct ieee80211_ops iwlagn_hw_ops = {
|
|
|
|
|
|
static u32 iwl_hw_detect(struct iwl_priv *priv)
|
|
static u32 iwl_hw_detect(struct iwl_priv *priv)
|
|
{
|
|
{
|
|
- u8 rev_id;
|
|
|
|
-
|
|
|
|
- pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id);
|
|
|
|
- IWL_DEBUG_INFO(priv, "HW Revision ID = 0x%X\n", rev_id);
|
|
|
|
return iwl_read32(priv, CSR_HW_REV);
|
|
return iwl_read32(priv, CSR_HW_REV);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3485,32 +3472,39 @@ static void iwl_init_context(struct iwl_priv *priv)
|
|
BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
|
|
BUILD_BUG_ON(NUM_IWL_RXON_CTX != 2);
|
|
}
|
|
}
|
|
|
|
|
|
-static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
|
|
|
+int iwl_probe(void *bus_specific, struct iwl_bus_ops *bus_ops,
|
|
|
|
+ struct iwl_cfg *cfg)
|
|
{
|
|
{
|
|
int err = 0;
|
|
int err = 0;
|
|
struct iwl_priv *priv;
|
|
struct iwl_priv *priv;
|
|
struct ieee80211_hw *hw;
|
|
struct ieee80211_hw *hw;
|
|
- struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
|
|
|
|
- unsigned long flags;
|
|
|
|
- u16 pci_cmd, num_mac;
|
|
|
|
|
|
+ u16 num_mac;
|
|
u32 hw_rev;
|
|
u32 hw_rev;
|
|
|
|
|
|
/************************
|
|
/************************
|
|
* 1. Allocating HW data
|
|
* 1. Allocating HW data
|
|
************************/
|
|
************************/
|
|
-
|
|
|
|
hw = iwl_alloc_all(cfg);
|
|
hw = iwl_alloc_all(cfg);
|
|
if (!hw) {
|
|
if (!hw) {
|
|
err = -ENOMEM;
|
|
err = -ENOMEM;
|
|
- goto out; }
|
|
|
|
|
|
+ goto out;
|
|
|
|
+ }
|
|
|
|
+
|
|
priv = hw->priv;
|
|
priv = hw->priv;
|
|
|
|
+
|
|
|
|
+ priv->bus.priv = priv;
|
|
|
|
+ priv->bus.bus_specific = bus_specific;
|
|
|
|
+ priv->bus.ops = bus_ops;
|
|
|
|
+ priv->bus.irq = priv->bus.ops->get_irq(&priv->bus);
|
|
|
|
+ priv->bus.ops->set_drv_data(&priv->bus, priv);
|
|
|
|
+ priv->bus.dev = priv->bus.ops->get_dev(&priv->bus);
|
|
|
|
+
|
|
/* At this point both hw and priv are allocated. */
|
|
/* At this point both hw and priv are allocated. */
|
|
|
|
|
|
- SET_IEEE80211_DEV(hw, &pdev->dev);
|
|
|
|
|
|
+ SET_IEEE80211_DEV(hw, priv->bus.dev);
|
|
|
|
|
|
IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
|
|
IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
|
|
priv->cfg = cfg;
|
|
priv->cfg = cfg;
|
|
- priv->pci_dev = pdev;
|
|
|
|
priv->inta_mask = CSR_INI_SET_MASK;
|
|
priv->inta_mask = CSR_INI_SET_MASK;
|
|
|
|
|
|
/* is antenna coupling more than 35dB ? */
|
|
/* is antenna coupling more than 35dB ? */
|
|
@@ -3526,52 +3520,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
if (iwl_alloc_traffic_mem(priv))
|
|
if (iwl_alloc_traffic_mem(priv))
|
|
IWL_ERR(priv, "Not enough memory to generate traffic log\n");
|
|
IWL_ERR(priv, "Not enough memory to generate traffic log\n");
|
|
|
|
|
|
- /**************************
|
|
|
|
- * 2. Initializing PCI bus
|
|
|
|
- **************************/
|
|
|
|
- pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
|
|
|
|
- PCIE_LINK_STATE_CLKPM);
|
|
|
|
-
|
|
|
|
- if (pci_enable_device(pdev)) {
|
|
|
|
- err = -ENODEV;
|
|
|
|
- goto out_ieee80211_free_hw;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- pci_set_master(pdev);
|
|
|
|
-
|
|
|
|
- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
|
|
|
|
- if (!err)
|
|
|
|
- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(36));
|
|
|
|
- if (err) {
|
|
|
|
- err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
|
|
|
- if (!err)
|
|
|
|
- err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
|
|
|
|
- /* both attempts failed: */
|
|
|
|
- if (err) {
|
|
|
|
- IWL_WARN(priv, "No suitable DMA available.\n");
|
|
|
|
- goto out_pci_disable_device;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- err = pci_request_regions(pdev, DRV_NAME);
|
|
|
|
- if (err)
|
|
|
|
- goto out_pci_disable_device;
|
|
|
|
-
|
|
|
|
- pci_set_drvdata(pdev, priv);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- /***********************
|
|
|
|
- * 3. Read REV register
|
|
|
|
- ***********************/
|
|
|
|
- priv->hw_base = pci_iomap(pdev, 0, 0);
|
|
|
|
- if (!priv->hw_base) {
|
|
|
|
- err = -ENODEV;
|
|
|
|
- goto out_pci_release_regions;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- IWL_DEBUG_INFO(priv, "pci_resource_len = 0x%08llx\n",
|
|
|
|
- (unsigned long long) pci_resource_len(pdev, 0));
|
|
|
|
- IWL_DEBUG_INFO(priv, "pci_resource_base = %p\n", priv->hw_base);
|
|
|
|
|
|
|
|
/* these spin locks will be used in apm_ops.init and EEPROM access
|
|
/* these spin locks will be used in apm_ops.init and EEPROM access
|
|
* we should init now
|
|
* we should init now
|
|
@@ -3586,17 +3534,17 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
*/
|
|
*/
|
|
iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
|
|
iwl_write32(priv, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
|
|
|
|
|
|
|
|
+ /***********************
|
|
|
|
+ * 3. Read REV register
|
|
|
|
+ ***********************/
|
|
hw_rev = iwl_hw_detect(priv);
|
|
hw_rev = iwl_hw_detect(priv);
|
|
IWL_INFO(priv, "Detected %s, REV=0x%X\n",
|
|
IWL_INFO(priv, "Detected %s, REV=0x%X\n",
|
|
priv->cfg->name, hw_rev);
|
|
priv->cfg->name, hw_rev);
|
|
|
|
|
|
- /* We disable the RETRY_TIMEOUT register (0x41) to keep
|
|
|
|
- * PCI Tx retries from interfering with C3 CPU state */
|
|
|
|
- pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);
|
|
|
|
-
|
|
|
|
if (iwl_prepare_card_hw(priv)) {
|
|
if (iwl_prepare_card_hw(priv)) {
|
|
|
|
+ err = -EIO;
|
|
IWL_WARN(priv, "Failed, HW not ready\n");
|
|
IWL_WARN(priv, "Failed, HW not ready\n");
|
|
- goto out_iounmap;
|
|
|
|
|
|
+ goto out_free_traffic_mem;
|
|
}
|
|
}
|
|
|
|
|
|
/*****************
|
|
/*****************
|
|
@@ -3606,7 +3554,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
err = iwl_eeprom_init(priv, hw_rev);
|
|
err = iwl_eeprom_init(priv, hw_rev);
|
|
if (err) {
|
|
if (err) {
|
|
IWL_ERR(priv, "Unable to init EEPROM\n");
|
|
IWL_ERR(priv, "Unable to init EEPROM\n");
|
|
- goto out_iounmap;
|
|
|
|
|
|
+ goto out_free_traffic_mem;
|
|
}
|
|
}
|
|
err = iwl_eeprom_check_version(priv);
|
|
err = iwl_eeprom_check_version(priv);
|
|
if (err)
|
|
if (err)
|
|
@@ -3636,6 +3584,7 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
* 5. Setup HW constants
|
|
* 5. Setup HW constants
|
|
************************/
|
|
************************/
|
|
if (iwl_set_hw_params(priv)) {
|
|
if (iwl_set_hw_params(priv)) {
|
|
|
|
+ err = -ENOENT;
|
|
IWL_ERR(priv, "failed to set hw parameters\n");
|
|
IWL_ERR(priv, "failed to set hw parameters\n");
|
|
goto out_free_eeprom;
|
|
goto out_free_eeprom;
|
|
}
|
|
}
|
|
@@ -3652,19 +3601,13 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
/********************
|
|
/********************
|
|
* 7. Setup services
|
|
* 7. Setup services
|
|
********************/
|
|
********************/
|
|
- spin_lock_irqsave(&priv->lock, flags);
|
|
|
|
- iwl_disable_interrupts(priv);
|
|
|
|
- spin_unlock_irqrestore(&priv->lock, flags);
|
|
|
|
-
|
|
|
|
- pci_enable_msi(priv->pci_dev);
|
|
|
|
-
|
|
|
|
iwl_alloc_isr_ict(priv);
|
|
iwl_alloc_isr_ict(priv);
|
|
|
|
|
|
- err = request_irq(priv->pci_dev->irq, iwl_isr_ict,
|
|
|
|
- IRQF_SHARED, DRV_NAME, priv);
|
|
|
|
|
|
+ err = request_irq(priv->bus.irq, iwl_isr_ict, IRQF_SHARED,
|
|
|
|
+ DRV_NAME, priv);
|
|
if (err) {
|
|
if (err) {
|
|
- IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq);
|
|
|
|
- goto out_disable_msi;
|
|
|
|
|
|
+ IWL_ERR(priv, "Error allocating IRQ %d\n", priv->bus.irq);
|
|
|
|
+ goto out_uninit_drv;
|
|
}
|
|
}
|
|
|
|
|
|
iwl_setup_deferred_work(priv);
|
|
iwl_setup_deferred_work(priv);
|
|
@@ -3672,16 +3615,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
iwl_testmode_init(priv);
|
|
iwl_testmode_init(priv);
|
|
|
|
|
|
/*********************************************
|
|
/*********************************************
|
|
- * 8. Enable interrupts and read RFKILL state
|
|
|
|
|
|
+ * 8. Enable interrupts
|
|
*********************************************/
|
|
*********************************************/
|
|
|
|
|
|
- /* enable rfkill interrupt: hw bug w/a */
|
|
|
|
- pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd);
|
|
|
|
- if (pci_cmd & PCI_COMMAND_INTX_DISABLE) {
|
|
|
|
- pci_cmd &= ~PCI_COMMAND_INTX_DISABLE;
|
|
|
|
- pci_write_config_word(priv->pci_dev, PCI_COMMAND, pci_cmd);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
iwl_enable_rfkill_int(priv);
|
|
iwl_enable_rfkill_int(priv);
|
|
|
|
|
|
/* If platform's RF_KILL switch is NOT set to KILL */
|
|
/* If platform's RF_KILL switch is NOT set to KILL */
|
|
@@ -3707,41 +3643,30 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
out_destroy_workqueue:
|
|
out_destroy_workqueue:
|
|
destroy_workqueue(priv->workqueue);
|
|
destroy_workqueue(priv->workqueue);
|
|
priv->workqueue = NULL;
|
|
priv->workqueue = NULL;
|
|
- free_irq(priv->pci_dev->irq, priv);
|
|
|
|
- out_disable_msi:
|
|
|
|
|
|
+ free_irq(priv->bus.irq, priv);
|
|
iwl_free_isr_ict(priv);
|
|
iwl_free_isr_ict(priv);
|
|
- pci_disable_msi(priv->pci_dev);
|
|
|
|
|
|
+ out_uninit_drv:
|
|
iwl_uninit_drv(priv);
|
|
iwl_uninit_drv(priv);
|
|
out_free_eeprom:
|
|
out_free_eeprom:
|
|
iwl_eeprom_free(priv);
|
|
iwl_eeprom_free(priv);
|
|
- out_iounmap:
|
|
|
|
- pci_iounmap(pdev, priv->hw_base);
|
|
|
|
- out_pci_release_regions:
|
|
|
|
- pci_set_drvdata(pdev, NULL);
|
|
|
|
- pci_release_regions(pdev);
|
|
|
|
- out_pci_disable_device:
|
|
|
|
- pci_disable_device(pdev);
|
|
|
|
- out_ieee80211_free_hw:
|
|
|
|
|
|
+ out_free_traffic_mem:
|
|
iwl_free_traffic_mem(priv);
|
|
iwl_free_traffic_mem(priv);
|
|
ieee80211_free_hw(priv->hw);
|
|
ieee80211_free_hw(priv->hw);
|
|
out:
|
|
out:
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
-static void __devexit iwl_pci_remove(struct pci_dev *pdev)
|
|
|
|
|
|
+void __devexit iwl_remove(struct iwl_priv * priv)
|
|
{
|
|
{
|
|
- struct iwl_priv *priv = pci_get_drvdata(pdev);
|
|
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
- if (!priv)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
wait_for_completion(&priv->_agn.firmware_loading_complete);
|
|
wait_for_completion(&priv->_agn.firmware_loading_complete);
|
|
|
|
|
|
IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
|
|
IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
|
|
|
|
|
|
iwl_dbgfs_unregister(priv);
|
|
iwl_dbgfs_unregister(priv);
|
|
- sysfs_remove_group(&pdev->dev.kobj, &iwl_attribute_group);
|
|
|
|
|
|
+ sysfs_remove_group(&priv->bus.dev->kobj,
|
|
|
|
+ &iwl_attribute_group);
|
|
|
|
|
|
/* ieee80211_unregister_hw call wil cause iwl_mac_stop to
|
|
/* ieee80211_unregister_hw call wil cause iwl_mac_stop to
|
|
* to be called and iwl_down since we are removing the device
|
|
* to be called and iwl_down since we are removing the device
|
|
@@ -3771,7 +3696,7 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
|
|
|
|
|
|
iwl_synchronize_irq(priv);
|
|
iwl_synchronize_irq(priv);
|
|
|
|
|
|
- iwl_dealloc_ucode_pci(priv);
|
|
|
|
|
|
+ iwl_dealloc_ucode(priv);
|
|
|
|
|
|
if (priv->rxq.bd)
|
|
if (priv->rxq.bd)
|
|
iwlagn_rx_queue_free(priv, &priv->rxq);
|
|
iwlagn_rx_queue_free(priv, &priv->rxq);
|
|
@@ -3790,12 +3715,8 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
|
|
priv->workqueue = NULL;
|
|
priv->workqueue = NULL;
|
|
iwl_free_traffic_mem(priv);
|
|
iwl_free_traffic_mem(priv);
|
|
|
|
|
|
- free_irq(priv->pci_dev->irq, priv);
|
|
|
|
- pci_disable_msi(priv->pci_dev);
|
|
|
|
- pci_iounmap(pdev, priv->hw_base);
|
|
|
|
- pci_release_regions(pdev);
|
|
|
|
- pci_disable_device(pdev);
|
|
|
|
- pci_set_drvdata(pdev, NULL);
|
|
|
|
|
|
+ free_irq(priv->bus.irq, priv);
|
|
|
|
+ priv->bus.ops->set_drv_data(&priv->bus, NULL);
|
|
|
|
|
|
iwl_uninit_drv(priv);
|
|
iwl_uninit_drv(priv);
|
|
|
|
|
|
@@ -3812,206 +3733,6 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
|
|
* driver and module entry point
|
|
* driver and module entry point
|
|
*
|
|
*
|
|
*****************************************************************************/
|
|
*****************************************************************************/
|
|
-
|
|
|
|
-/* Hardware specific file defines the PCI IDs table for that hardware module */
|
|
|
|
-static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1201, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1301, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1204, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1304, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bgn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bgn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1206, iwl5100_abg_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1306, iwl5100_abg_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1221, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1321, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1224, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1324, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1225, iwl5100_bgn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1325, iwl5100_bgn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1226, iwl5100_abg_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4232, 0x1326, iwl5100_abg_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1211, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1311, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1214, iwl5100_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1314, iwl5100_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1215, iwl5100_bgn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1315, iwl5100_bgn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1216, iwl5100_abg_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4237, 0x1316, iwl5100_abg_cfg)}, /* Half Mini Card */
|
|
|
|
-
|
|
|
|
-/* 5300 Series WiFi */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1021, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1121, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1024, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1124, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1001, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1101, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1004, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4235, 0x1104, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4236, 0x1011, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4236, 0x1111, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4236, 0x1014, iwl5300_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x4236, 0x1114, iwl5300_agn_cfg)}, /* Half Mini Card */
|
|
|
|
-
|
|
|
|
-/* 5350 Series WiFi/WiMax */
|
|
|
|
- {IWL_PCI_DEVICE(0x423A, 0x1001, iwl5350_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423A, 0x1021, iwl5350_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423B, 0x1011, iwl5350_agn_cfg)}, /* Mini Card */
|
|
|
|
-
|
|
|
|
-/* 5150 Series Wifi/WiMax */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1201, iwl5150_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1301, iwl5150_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1206, iwl5150_abg_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
|
|
|
|
-
|
|
|
|
- {IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423D, 0x1216, iwl5150_abg_cfg)}, /* Mini Card */
|
|
|
|
- {IWL_PCI_DEVICE(0x423D, 0x1316, iwl5150_abg_cfg)}, /* Half Mini Card */
|
|
|
|
-
|
|
|
|
-/* 6x00 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 6x05 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 6x30 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x008A, 0x5305, iwl1030_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x008A, 0x5307, iwl1030_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x008A, 0x5325, iwl1030_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x008A, 0x5327, iwl1030_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x008B, 0x5315, iwl1030_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x008B, 0x5317, iwl1030_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0090, 0x5211, iwl6030_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0090, 0x5215, iwl6030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0090, 0x5216, iwl6030_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5201, iwl6030_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5205, iwl6030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5206, iwl6030_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5207, iwl6030_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5221, iwl6030_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5225, iwl6030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0091, 0x5226, iwl6030_2abg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 6x50 WiFi/WiMax Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0087, 0x1301, iwl6050_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0087, 0x1306, iwl6050_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0087, 0x1321, iwl6050_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0087, 0x1326, iwl6050_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0089, 0x1311, iwl6050_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0089, 0x1316, iwl6050_2abg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 6150 WiFi/WiMax Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0885, 0x1305, iwl6150_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0885, 0x1307, iwl6150_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0885, 0x1325, iwl6150_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0885, 0x1327, iwl6150_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0886, 0x1315, iwl6150_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0886, 0x1317, iwl6150_bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 1000 Series WiFi */
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1205, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1305, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1225, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1325, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0084, 0x1215, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0084, 0x1315, iwl1000_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1206, iwl1000_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1306, iwl1000_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1226, iwl1000_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0083, 0x1326, iwl1000_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0084, 0x1216, iwl1000_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0084, 0x1316, iwl1000_bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 100 Series WiFi */
|
|
|
|
- {IWL_PCI_DEVICE(0x08AE, 0x1005, iwl100_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x08AE, 0x1007, iwl100_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x08AF, 0x1015, iwl100_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x08AF, 0x1017, iwl100_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x08AE, 0x1025, iwl100_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x08AE, 0x1027, iwl100_bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 130 Series WiFi */
|
|
|
|
- {IWL_PCI_DEVICE(0x0896, 0x5005, iwl130_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0896, 0x5007, iwl130_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0897, 0x5015, iwl130_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0897, 0x5017, iwl130_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0896, 0x5025, iwl130_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0896, 0x5027, iwl130_bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 2x00 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0890, 0x4022, iwl2000_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0891, 0x4222, iwl2000_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0890, 0x4422, iwl2000_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0890, 0x4026, iwl2000_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0891, 0x4226, iwl2000_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0890, 0x4426, iwl2000_2bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 2x30 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0887, 0x4062, iwl2030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0888, 0x4262, iwl2030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0887, 0x4462, iwl2030_2bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0887, 0x4066, iwl2030_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0888, 0x4266, iwl2030_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0887, 0x4466, iwl2030_2bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 6x35 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4064, iwl6035_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088F, 0x4264, iwl6035_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4464, iwl6035_2abg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4066, iwl6035_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088F, 0x4266, iwl6035_2bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x088E, 0x4466, iwl6035_2bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 105 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0894, 0x0022, iwl105_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0895, 0x0222, iwl105_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0894, 0x0422, iwl105_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0894, 0x0026, iwl105_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0895, 0x0226, iwl105_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0894, 0x0426, iwl105_bg_cfg)},
|
|
|
|
-
|
|
|
|
-/* 135 Series */
|
|
|
|
- {IWL_PCI_DEVICE(0x0892, 0x0062, iwl135_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0893, 0x0262, iwl135_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0892, 0x0462, iwl135_bgn_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0892, 0x0066, iwl135_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0893, 0x0266, iwl135_bg_cfg)},
|
|
|
|
- {IWL_PCI_DEVICE(0x0892, 0x0466, iwl135_bg_cfg)},
|
|
|
|
-
|
|
|
|
- {0}
|
|
|
|
-};
|
|
|
|
-MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
|
|
|
|
-
|
|
|
|
-static struct pci_driver iwl_driver = {
|
|
|
|
- .name = DRV_NAME,
|
|
|
|
- .id_table = iwl_hw_card_ids,
|
|
|
|
- .probe = iwl_pci_probe,
|
|
|
|
- .remove = __devexit_p(iwl_pci_remove),
|
|
|
|
- .driver.pm = IWL_PM_OPS,
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
static int __init iwl_init(void)
|
|
static int __init iwl_init(void)
|
|
{
|
|
{
|
|
|
|
|
|
@@ -4025,12 +3746,10 @@ static int __init iwl_init(void)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
- ret = pci_register_driver(&iwl_driver);
|
|
|
|
- if (ret) {
|
|
|
|
- pr_err("Unable to initialize PCI module\n");
|
|
|
|
- goto error_register;
|
|
|
|
- }
|
|
|
|
|
|
+ ret = iwl_pci_register_driver();
|
|
|
|
|
|
|
|
+ if (ret)
|
|
|
|
+ goto error_register;
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
error_register:
|
|
error_register:
|
|
@@ -4040,7 +3759,7 @@ error_register:
|
|
|
|
|
|
static void __exit iwl_exit(void)
|
|
static void __exit iwl_exit(void)
|
|
{
|
|
{
|
|
- pci_unregister_driver(&iwl_driver);
|
|
|
|
|
|
+ iwl_pci_unregister_driver();
|
|
iwlagn_rate_control_unregister();
|
|
iwlagn_rate_control_unregister();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4107,6 +3826,16 @@ module_param_named(led_mode, iwlagn_mod_params.led_mode, int, S_IRUGO);
|
|
MODULE_PARM_DESC(led_mode, "0=system default, "
|
|
MODULE_PARM_DESC(led_mode, "0=system default, "
|
|
"1=On(RF On)/Off(RF Off), 2=blinking (default: 0)");
|
|
"1=On(RF On)/Off(RF Off), 2=blinking (default: 0)");
|
|
|
|
|
|
|
|
+module_param_named(power_save, iwlagn_mod_params.power_save,
|
|
|
|
+ bool, S_IRUGO);
|
|
|
|
+MODULE_PARM_DESC(power_save,
|
|
|
|
+ "enable WiFi power management (default: disable)");
|
|
|
|
+
|
|
|
|
+module_param_named(power_level, iwlagn_mod_params.power_level,
|
|
|
|
+ int, S_IRUGO);
|
|
|
|
+MODULE_PARM_DESC(power_level,
|
|
|
|
+ "default power save level (range from 1 - 5, default: 1)");
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* For now, keep using power level 1 instead of automatically
|
|
* For now, keep using power level 1 instead of automatically
|
|
* adjusting ...
|
|
* adjusting ...
|