Skip to content

Commit

Permalink
iwlwifi: kill iwl_bus.h
Browse files Browse the repository at this point in the history
No one needs it any more

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
  • Loading branch information
Emmanuel Grumbach authored and Wey-Yi Guy committed Feb 27, 2012
1 parent ca77d53 commit 36a7922
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 188 deletions.
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "iwl-agn-calib.h"
#include "iwl-agn.h"
#include "iwl-shared.h"
#include "iwl-bus.h"
#include "iwl-trans.h"
#include "iwl-op-mode.h"

Expand Down
145 changes: 0 additions & 145 deletions drivers/net/wireless/iwlwifi/iwl-bus.h

This file was deleted.

1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#ifndef __iwl_debug_h__
#define __iwl_debug_h__

#include "iwl-bus.h"
#include "iwl-shared.h"
#include "iwl-devtrace.h"

Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "iwl-power.h"
#include "iwl-agn-rs.h"
#include "iwl-agn-tt.h"
#include "iwl-bus.h"
#include "iwl-trans.h"
#include "iwl-shared.h"
#include "iwl-op-mode.h"
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
#include "iwl-agn-calib.h"
#include "iwl-agn.h"
#include "iwl-shared.h"
#include "iwl-bus.h"
#include "iwl-trans.h"
#include "iwl-op-mode.h"

Expand Down
60 changes: 26 additions & 34 deletions drivers/net/wireless/iwlwifi/iwl-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
#include <linux/pci.h>
#include <linux/pci-aspm.h>

#include "iwl-bus.h"
#include "iwl-io.h"
#include "iwl-shared.h"
#include "iwl-trans.h"
#include "iwl-csr.h"
#include "iwl-cfg.h"
#include "iwl-drv.h"
#include "iwl-trans.h"

#define IWL_PCI_DEVICE(dev, subdev, cfg) \
.vendor = PCI_VENDOR_ID_INTEL, .device = (dev), \
Expand Down Expand Up @@ -263,94 +263,86 @@ MODULE_DEVICE_TABLE(pci, iwl_hw_card_ids);
static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
struct iwl_bus *bus;
struct iwl_shared *shrd;
struct iwl_trans *iwl_trans;
int err;

bus = kzalloc(sizeof(*bus), GFP_KERNEL);
if (!bus) {
dev_printk(KERN_ERR, &pdev->dev,
"Couldn't allocate iwl_pci_bus");
return -ENOMEM;
}

bus->shrd = kzalloc(sizeof(*bus->shrd), GFP_KERNEL);
if (!bus->shrd) {
shrd = kzalloc(sizeof(*iwl_trans->shrd), GFP_KERNEL);
if (!shrd) {
dev_printk(KERN_ERR, &pdev->dev,
"Couldn't allocate iwl_shared");
err = -ENOMEM;
goto out_free_bus;
}

bus->shrd->bus = bus;

pci_set_drvdata(pdev, bus);

#ifdef CONFIG_IWLWIFI_IDI
trans(bus) = iwl_trans_idi_alloc(bus->shrd, pdev, ent);
if (trans(bus) == NULL) {
iwl_trans = iwl_trans_idi_alloc(shrd, pdev, ent);
if (trans == NULL) {
err = -ENOMEM;
goto out_free_bus;
}

err = iwl_drv_start(bus->shrd, trans(bus), cfg);
shrd->trans = iwl_trans;
pci_set_drvdata(pdev, iwl_trans);

err = iwl_drv_start(shrd, iwl_trans, cfg);
#else
trans(bus) = iwl_trans_pcie_alloc(bus->shrd, pdev, ent);
if (trans(bus) == NULL) {
iwl_trans = iwl_trans_pcie_alloc(shrd, pdev, ent);
if (iwl_trans == NULL) {
err = -ENOMEM;
goto out_free_bus;
}

err = iwl_drv_start(bus->shrd, trans(bus), cfg);
shrd->trans = iwl_trans;
pci_set_drvdata(pdev, iwl_trans);

err = iwl_drv_start(shrd, iwl_trans, cfg);
#endif
if (err)
goto out_free_trans;

return 0;

out_free_trans:
iwl_trans_free(trans(bus));
iwl_trans_free(iwl_trans);
pci_set_drvdata(pdev, NULL);
out_free_bus:
kfree(bus->shrd);
kfree(bus);
kfree(shrd);
return err;
}

static void __devexit iwl_pci_remove(struct pci_dev *pdev)
{
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_shared *shrd = bus->shrd;
struct iwl_trans *iwl_trans = pci_get_drvdata(pdev);
struct iwl_shared *shrd = iwl_trans->shrd;

iwl_drv_stop(shrd);
iwl_trans_free(shrd->trans);

pci_set_drvdata(pdev, NULL);

kfree(bus->shrd);
kfree(bus);
kfree(shrd);
}

#ifdef CONFIG_PM_SLEEP

static int iwl_pci_suspend(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_shared *shrd = bus->shrd;
struct iwl_trans *iwl_trans = pci_get_drvdata(pdev);

/* Before you put code here, think about WoWLAN. You cannot check here
* whether WoWLAN is enabled or not, and your code will run even if
* WoWLAN is enabled - don't kill the NIC, someone may need it in Sx.
*/

return iwl_trans_suspend(shrd->trans);
return iwl_trans_suspend(iwl_trans);
}

static int iwl_pci_resume(struct device *device)
{
struct pci_dev *pdev = to_pci_dev(device);
struct iwl_bus *bus = pci_get_drvdata(pdev);
struct iwl_shared *shrd = bus->shrd;
struct iwl_trans *iwl_trans = pci_get_drvdata(pdev);

/* Before you put code here, think about WoWLAN. You cannot check here
* whether WoWLAN is enabled or not, and your code will run even if
Expand All @@ -363,7 +355,7 @@ static int iwl_pci_resume(struct device *device)
*/
pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);

return iwl_trans_resume(shrd->trans);
return iwl_trans_resume(iwl_trans);
}

static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume);
Expand Down
5 changes: 1 addition & 4 deletions drivers/net/wireless/iwlwifi/iwl-shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
* This implementation is iwl-pci.c
*/

struct iwl_bus;
struct iwl_priv;
struct iwl_trans;
struct iwl_sensitivity_ranges;
Expand Down Expand Up @@ -385,7 +384,6 @@ struct iwl_shared {
bool wowlan;
u8 valid_contexts;

struct iwl_bus *bus;
struct iwl_cfg *cfg;
struct iwl_priv *priv;
struct iwl_trans *trans;
Expand Down Expand Up @@ -416,10 +414,9 @@ struct iwl_shared {

};

/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */
#define priv(_m) ((_m)->shrd->priv)
#define cfg(_m) ((_m)->shrd->cfg)
#define bus(_m) ((_m)->shrd->bus)
#define nic(_m) ((_m)->shrd->nic)
#define trans(_m) ((_m)->shrd->trans)
#define hw_params(_m) ((_m)->shrd->hw_params)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
#include "iwl-agn.h"
#include "iwl-testmode.h"
#include "iwl-trans.h"
#include "iwl-bus.h"
#include "iwl-fh.h"


Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/iwlwifi/iwl-trans.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ extern const struct iwl_trans_ops trans_ops_pcie;
struct iwl_trans *iwl_trans_pcie_alloc(struct iwl_shared *shrd,
struct pci_dev *pdev,
const struct pci_device_id *ent);
int __must_check iwl_pci_register_driver(void);
void iwl_pci_unregister_driver(void);

extern const struct iwl_trans_ops trans_ops_idi;
struct iwl_trans *iwl_trans_idi_alloc(struct iwl_shared *shrd,
Expand Down

0 comments on commit 36a7922

Please sign in to comment.