projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] hostap: Fix hostap_pci build with PRISM2_IO_DEBUG
[powerpc.git]
/
drivers
/
net
/
wireless
/
hostap
/
hostap_pci.c
diff --git
a/drivers/net/wireless/hostap/hostap_pci.c
b/drivers/net/wireless/hostap/hostap_pci.c
index
3a20898
..
0d7305d
100644
(file)
--- a/
drivers/net/wireless/hostap/hostap_pci.c
+++ b/
drivers/net/wireless/hostap/hostap_pci.c
@@
-31,6
+31,13
@@
MODULE_DESCRIPTION("Support for Intersil Prism2.5-based 802.11 wireless LAN "
"PCI cards.");
MODULE_SUPPORTED_DEVICE("Intersil Prism2.5-based WLAN PCI cards");
MODULE_LICENSE("GPL");
"PCI cards.");
MODULE_SUPPORTED_DEVICE("Intersil Prism2.5-based WLAN PCI cards");
MODULE_LICENSE("GPL");
+MODULE_VERSION(PRISM2_VERSION);
+
+
+/* struct local_info::hw_priv */
+struct hostap_pci_priv {
+ void __iomem *mem_start;
+};
/* FIX: do we need mb/wmb/rmb with memory operations? */
/* FIX: do we need mb/wmb/rmb with memory operations? */
@@
-52,30
+59,34
@@
static struct pci_device_id prism2_pci_id_table[] __devinitdata = {
static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
{
struct hostap_interface *iface;
static inline void hfa384x_outb_debug(struct net_device *dev, int a, u8 v)
{
struct hostap_interface *iface;
+ struct hostap_pci_priv *hw_priv;
local_info_t *local;
unsigned long flags;
iface = netdev_priv(dev);
local = iface->local;
local_info_t *local;
unsigned long flags;
iface = netdev_priv(dev);
local = iface->local;
+ hw_priv = local->hw_priv;
spin_lock_irqsave(&local->lock, flags);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
spin_lock_irqsave(&local->lock, flags);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTB, a, v);
- writeb(v,
local
->mem_start + a);
+ writeb(v,
hw_priv
->mem_start + a);
spin_unlock_irqrestore(&local->lock, flags);
}
static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
{
struct hostap_interface *iface;
spin_unlock_irqrestore(&local->lock, flags);
}
static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
{
struct hostap_interface *iface;
+ struct hostap_pci_priv *hw_priv;
local_info_t *local;
unsigned long flags;
u8 v;
iface = netdev_priv(dev);
local = iface->local;
local_info_t *local;
unsigned long flags;
u8 v;
iface = netdev_priv(dev);
local = iface->local;
+ hw_priv = local->hw_priv;
spin_lock_irqsave(&local->lock, flags);
spin_lock_irqsave(&local->lock, flags);
- v = readb(
local
->mem_start + a);
+ v = readb(
hw_priv
->mem_start + a);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
spin_unlock_irqrestore(&local->lock, flags);
return v;
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INB, a, v);
spin_unlock_irqrestore(&local->lock, flags);
return v;
@@
-84,30
+95,34
@@
static inline u8 hfa384x_inb_debug(struct net_device *dev, int a)
static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
{
struct hostap_interface *iface;
static inline void hfa384x_outw_debug(struct net_device *dev, int a, u16 v)
{
struct hostap_interface *iface;
+ struct hostap_pci_priv *hw_priv;
local_info_t *local;
unsigned long flags;
iface = netdev_priv(dev);
local = iface->local;
local_info_t *local;
unsigned long flags;
iface = netdev_priv(dev);
local = iface->local;
+ hw_priv = local->hw_priv;
spin_lock_irqsave(&local->lock, flags);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
spin_lock_irqsave(&local->lock, flags);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_OUTW, a, v);
- writew(v,
local
->mem_start + a);
+ writew(v,
hw_priv
->mem_start + a);
spin_unlock_irqrestore(&local->lock, flags);
}
static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
{
struct hostap_interface *iface;
spin_unlock_irqrestore(&local->lock, flags);
}
static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
{
struct hostap_interface *iface;
+ struct hostap_pci_priv *hw_priv;
local_info_t *local;
unsigned long flags;
u16 v;
iface = netdev_priv(dev);
local = iface->local;
local_info_t *local;
unsigned long flags;
u16 v;
iface = netdev_priv(dev);
local = iface->local;
+ hw_priv = local->hw_priv;
spin_lock_irqsave(&local->lock, flags);
spin_lock_irqsave(&local->lock, flags);
- v = readw(
local
->mem_start + a);
+ v = readw(
hw_priv
->mem_start + a);
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
spin_unlock_irqrestore(&local->lock, flags);
return v;
prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INW, a, v);
spin_unlock_irqrestore(&local->lock, flags);
return v;
@@
-125,37
+140,37
@@
static inline u16 hfa384x_inw_debug(struct net_device *dev, int a)
static inline void hfa384x_outb(struct net_device *dev, int a, u8 v)
{
struct hostap_interface *iface;
static inline void hfa384x_outb(struct net_device *dev, int a, u8 v)
{
struct hostap_interface *iface;
-
local_info_t *local
;
+
struct hostap_pci_priv *hw_priv
;
iface = netdev_priv(dev);
iface = netdev_priv(dev);
-
local = iface->local
;
- writeb(v,
local
->mem_start + a);
+
hw_priv = iface->local->hw_priv
;
+ writeb(v,
hw_priv
->mem_start + a);
}
static inline u8 hfa384x_inb(struct net_device *dev, int a)
{
struct hostap_interface *iface;
}
static inline u8 hfa384x_inb(struct net_device *dev, int a)
{
struct hostap_interface *iface;
-
local_info_t *local
;
+
struct hostap_pci_priv *hw_priv
;
iface = netdev_priv(dev);
iface = netdev_priv(dev);
-
local = iface->local
;
- return readb(
local
->mem_start + a);
+
hw_priv = iface->local->hw_priv
;
+ return readb(
hw_priv
->mem_start + a);
}
static inline void hfa384x_outw(struct net_device *dev, int a, u16 v)
{
struct hostap_interface *iface;
}
static inline void hfa384x_outw(struct net_device *dev, int a, u16 v)
{
struct hostap_interface *iface;
-
local_info_t *local
;
+
struct hostap_pci_priv *hw_priv
;
iface = netdev_priv(dev);
iface = netdev_priv(dev);
-
local = iface->local
;
- writew(v,
local
->mem_start + a);
+
hw_priv = iface->local->hw_priv
;
+ writew(v,
hw_priv
->mem_start + a);
}
static inline u16 hfa384x_inw(struct net_device *dev, int a)
{
struct hostap_interface *iface;
}
static inline u16 hfa384x_inw(struct net_device *dev, int a)
{
struct hostap_interface *iface;
-
local_info_t *local
;
+
struct hostap_pci_priv *hw_priv
;
iface = netdev_priv(dev);
iface = netdev_priv(dev);
-
local = iface->local
;
- return readw(
local
->mem_start + a);
+
hw_priv = iface->local->hw_priv
;
+ return readw(
hw_priv
->mem_start + a);
}
#define HFA384X_OUTB(v,a) hfa384x_outb(dev, (a), (v))
}
#define HFA384X_OUTB(v,a) hfa384x_outb(dev, (a), (v))
@@
-270,8
+285,6
@@
static struct prism2_helper_functions prism2_pci_funcs =
{
.card_present = NULL,
.cor_sreset = prism2_pci_cor_sreset,
{
.card_present = NULL,
.cor_sreset = prism2_pci_cor_sreset,
- .dev_open = NULL,
- .dev_close = NULL,
.genesis_reset = prism2_pci_genesis_reset,
.hw_type = HOSTAP_HW_PCI,
};
.genesis_reset = prism2_pci_genesis_reset,
.hw_type = HOSTAP_HW_PCI,
};
@@
-287,6
+300,12
@@
static int prism2_pci_probe(struct pci_dev *pdev,
static int cards_found /* = 0 */;
int irq_registered = 0;
struct hostap_interface *iface;
static int cards_found /* = 0 */;
int irq_registered = 0;
struct hostap_interface *iface;
+ struct hostap_pci_priv *hw_priv;
+
+ hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL);
+ if (hw_priv == NULL)
+ return -ENOMEM;
+ memset(hw_priv, 0, sizeof(*hw_priv));
if (pci_enable_device(pdev))
return -EIO;
if (pci_enable_device(pdev))
return -EIO;
@@
-304,19
+323,17
@@
static int prism2_pci_probe(struct pci_dev *pdev,
goto fail;
}
goto fail;
}
-#ifdef PRISM2_BUS_MASTER
- pci_set_master(pdev);
-#endif /* PRISM2_BUS_MASTER */
-
- dev = prism2_init_local_data(&prism2_pci_funcs, cards_found);
+ dev = prism2_init_local_data(&prism2_pci_funcs, cards_found,
+ &pdev->dev);
if (dev == NULL)
goto fail;
iface = netdev_priv(dev);
local = iface->local;
if (dev == NULL)
goto fail;
iface = netdev_priv(dev);
local = iface->local;
+ local->hw_priv = hw_priv;
cards_found++;
dev->irq = pdev->irq;
cards_found++;
dev->irq = pdev->irq;
-
local
->mem_start = mem;
+
hw_priv
->mem_start = mem;
prism2_pci_cor_sreset(local);
prism2_pci_cor_sreset(local);
@@
-341,6
+358,8
@@
static int prism2_pci_probe(struct pci_dev *pdev,
return hostap_hw_ready(dev);
fail:
return hostap_hw_ready(dev);
fail:
+ kfree(hw_priv);
+
if (irq_registered && dev)
free_irq(dev->irq, dev);
if (irq_registered && dev)
free_irq(dev->irq, dev);
@@
-351,6
+370,9
@@
static int prism2_pci_probe(struct pci_dev *pdev,
err_out_disable:
pci_disable_device(pdev);
err_out_disable:
pci_disable_device(pdev);
+ kfree(hw_priv);
+ if (local)
+ local->hw_priv = NULL;
prism2_free_local_data(dev);
return -ENODEV;
prism2_free_local_data(dev);
return -ENODEV;
@@
-362,9
+384,11
@@
static void prism2_pci_remove(struct pci_dev *pdev)
struct net_device *dev;
struct hostap_interface *iface;
void __iomem *mem_start;
struct net_device *dev;
struct hostap_interface *iface;
void __iomem *mem_start;
+ struct hostap_pci_priv *hw_priv;
dev = pci_get_drvdata(pdev);
iface = netdev_priv(dev);
dev = pci_get_drvdata(pdev);
iface = netdev_priv(dev);
+ hw_priv = iface->local->hw_priv;
/* Reset the hardware, and ensure interrupts are disabled. */
prism2_pci_cor_sreset(iface->local);
/* Reset the hardware, and ensure interrupts are disabled. */
prism2_pci_cor_sreset(iface->local);
@@
-373,7
+397,9
@@
static void prism2_pci_remove(struct pci_dev *pdev)
if (dev->irq)
free_irq(dev->irq, dev);
if (dev->irq)
free_irq(dev->irq, dev);
- mem_start = iface->local->mem_start;
+ mem_start = hw_priv->mem_start;
+ kfree(hw_priv);
+ iface->local->hw_priv = NULL;
prism2_free_local_data(dev);
iounmap(mem_start);
prism2_free_local_data(dev);
iounmap(mem_start);
@@
-385,7
+411,7
@@
static void prism2_pci_remove(struct pci_dev *pdev)
#ifdef CONFIG_PM
#ifdef CONFIG_PM
-static int prism2_pci_suspend(struct pci_dev *pdev,
u32
state)
+static int prism2_pci_suspend(struct pci_dev *pdev,
pm_message_t
state)
{
struct net_device *dev = pci_get_drvdata(pdev);
{
struct net_device *dev = pci_get_drvdata(pdev);
@@
-396,7
+422,7
@@
static int prism2_pci_suspend(struct pci_dev *pdev, u32 state)
prism2_suspend(dev);
pci_save_state(pdev);
pci_disable_device(pdev);
prism2_suspend(dev);
pci_save_state(pdev);
pci_disable_device(pdev);
- pci_set_power_state(pdev,
3
);
+ pci_set_power_state(pdev,
PCI_D3hot
);
return 0;
}
return 0;
}
@@
-421,7
+447,7
@@
static int prism2_pci_resume(struct pci_dev *pdev)
MODULE_DEVICE_TABLE(pci, prism2_pci_id_table);
static struct pci_driver prism2_pci_drv_id = {
MODULE_DEVICE_TABLE(pci, prism2_pci_id_table);
static struct pci_driver prism2_pci_drv_id = {
- .name = "
prism2
_pci",
+ .name = "
hostap
_pci",
.id_table = prism2_pci_id_table,
.probe = prism2_pci_probe,
.remove = prism2_pci_remove,
.id_table = prism2_pci_id_table,
.probe = prism2_pci_probe,
.remove = prism2_pci_remove,