* [PATCH 01/24] iwlegacy: dump stack when fail to gain access to the device
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 02/24] iwlegacy: always check if got h/w access before write Stanislaw Gruszka
` (22 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Print dump stack when the device is not responding. This should give
some more clue about the reason of failure. Also change the message we
print, since "MAC in deep sleep" is kinda confusing.
On the way add unlikely(), as fail to gain NIC access is hmm ...
unlikely.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/common.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 04ec38e..3900967 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -111,9 +111,10 @@ _il_grab_nic_access(struct il_priv *il)
_il_poll_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN,
(CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY |
CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000);
- if (ret < 0) {
+ if (unlikely(ret < 0)) {
val = _il_rd(il, CSR_GP_CNTRL);
- IL_ERR("MAC is in deep sleep!. CSR_GP_CNTRL = 0x%08X\n", val);
+ WARN_ONCE(1, "Timeout waiting for ucode processor access "
+ "(CSR_GP_CNTRL 0x%08x)\n", val);
_il_wr(il, CSR_RESET, CSR_RESET_REG_FLAG_FORCE_NMI);
return -EIO;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 02/24] iwlegacy: always check if got h/w access before write
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 01/24] iwlegacy: dump stack when fail to gain access to the device Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 03/24] iwlegacy: cleanup/fix memory barriers Stanislaw Gruszka
` (21 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Before we write to the device register always check if
_il_grap_nic_access() was successful.
Change type return type _il_grap_nic_access() to bool, and
add likely()/unlikely() statements.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/iwlegacy/common.c | 10 +++++-----
drivers/net/wireless/iwlegacy/common.h | 27 +++++++++++++++------------
3 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 235812a..90c9bfb 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -3778,7 +3778,7 @@ il4965_perform_ct_kill_task(struct il_priv *il)
_il_rd(il, CSR_UCODE_DRV_GP1);
spin_lock_irqsave(&il->reg_lock, flags);
- if (!_il_grab_nic_access(il))
+ if (likely(_il_grab_nic_access(il)))
_il_release_nic_access(il);
spin_unlock_irqrestore(&il->reg_lock, flags);
}
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 3900967..6dbd11f 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -81,7 +81,7 @@ il_clear_bit(struct il_priv *p, u32 r, u32 m)
}
EXPORT_SYMBOL(il_clear_bit);
-int
+bool
_il_grab_nic_access(struct il_priv *il)
{
int ret;
@@ -116,10 +116,10 @@ _il_grab_nic_access(struct il_priv *il)
WARN_ONCE(1, "Timeout waiting for ucode processor access "
"(CSR_GP_CNTRL 0x%08x)\n", val);
_il_wr(il, CSR_RESET, CSR_RESET_REG_FLAG_FORCE_NMI);
- return -EIO;
+ return false;
}
- return 0;
+ return true;
}
EXPORT_SYMBOL_GPL(_il_grab_nic_access);
@@ -161,7 +161,7 @@ il_wr_prph(struct il_priv *il, u32 addr, u32 val)
unsigned long reg_flags;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- if (!_il_grab_nic_access(il)) {
+ if (likely(_il_grab_nic_access(il))) {
_il_wr_prph(il, addr, val);
_il_release_nic_access(il);
}
@@ -194,7 +194,7 @@ il_write_targ_mem(struct il_priv *il, u32 addr, u32 val)
unsigned long reg_flags;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- if (!_il_grab_nic_access(il)) {
+ if (likely(_il_grab_nic_access(il))) {
_il_wr(il, HBUS_TARG_MEM_WADDR, addr);
wmb();
_il_wr(il, HBUS_TARG_MEM_WDAT, val);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 7080956..1dfaa58 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -2103,7 +2103,7 @@ irqreturn_t il_isr(int irq, void *data);
extern void il_set_bit(struct il_priv *p, u32 r, u32 m);
extern void il_clear_bit(struct il_priv *p, u32 r, u32 m);
-extern int _il_grab_nic_access(struct il_priv *il);
+extern bool _il_grab_nic_access(struct il_priv *il);
extern int _il_poll_bit(struct il_priv *il, u32 addr, u32 bits, u32 mask, int timeout);
extern int il_poll_bit(struct il_priv *il, u32 addr, u32 mask, int timeout);
extern u32 il_rd_prph(struct il_priv *il, u32 reg);
@@ -2168,7 +2168,7 @@ il_wr(struct il_priv *il, u32 reg, u32 value)
unsigned long reg_flags;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- if (!_il_grab_nic_access(il)) {
+ if (likely(_il_grab_nic_access(il))) {
_il_wr(il, reg, value);
_il_release_nic_access(il);
}
@@ -2197,9 +2197,10 @@ il_set_bits_prph(struct il_priv *il, u32 reg, u32 mask)
unsigned long reg_flags;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- _il_grab_nic_access(il);
- _il_wr_prph(il, reg, (_il_rd_prph(il, reg) | mask));
- _il_release_nic_access(il);
+ if (likely(_il_grab_nic_access(il))) {
+ _il_wr_prph(il, reg, (_il_rd_prph(il, reg) | mask));
+ _il_release_nic_access(il);
+ }
spin_unlock_irqrestore(&il->reg_lock, reg_flags);
}
@@ -2209,9 +2210,10 @@ il_set_bits_mask_prph(struct il_priv *il, u32 reg, u32 bits, u32 mask)
unsigned long reg_flags;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- _il_grab_nic_access(il);
- _il_wr_prph(il, reg, ((_il_rd_prph(il, reg) & mask) | bits));
- _il_release_nic_access(il);
+ if (likely(_il_grab_nic_access(il))) {
+ _il_wr_prph(il, reg, ((_il_rd_prph(il, reg) & mask) | bits));
+ _il_release_nic_access(il);
+ }
spin_unlock_irqrestore(&il->reg_lock, reg_flags);
}
@@ -2222,10 +2224,11 @@ il_clear_bits_prph(struct il_priv *il, u32 reg, u32 mask)
u32 val;
spin_lock_irqsave(&il->reg_lock, reg_flags);
- _il_grab_nic_access(il);
- val = _il_rd_prph(il, reg);
- _il_wr_prph(il, reg, (val & ~mask));
- _il_release_nic_access(il);
+ if (likely(_il_grab_nic_access(il))) {
+ val = _il_rd_prph(il, reg);
+ _il_wr_prph(il, reg, (val & ~mask));
+ _il_release_nic_access(il);
+ }
spin_unlock_irqrestore(&il->reg_lock, reg_flags);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 03/24] iwlegacy: cleanup/fix memory barriers
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 01/24] iwlegacy: dump stack when fail to gain access to the device Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 02/24] iwlegacy: always check if got h/w access before write Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 04/24] iwlegacy: use writeb,writel,readl directly Stanislaw Gruszka
` (20 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
wmb(), rmb() are not needed when writel(), readl() are used as
accessors for MMIO. We use them indirectly via iowrite32(),
ioread32().
What is needed mmiowb(), for synchronizing writes coming from
different CPUs on PCIe bridge (see in patch comments). This
fortunately is not needed on x86, where mmiowb() is just
defined as compiler barrier. As iwlegacy devices are most likely
not used on anything other than x86, this is not so important
fix.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/common.c | 2 --
drivers/net/wireless/iwlegacy/common.h | 9 +++++++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 6dbd11f..50308da 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -179,7 +179,6 @@ il_read_targ_mem(struct il_priv *il, u32 addr)
_il_grab_nic_access(il);
_il_wr(il, HBUS_TARG_MEM_RADDR, addr);
- rmb();
value = _il_rd(il, HBUS_TARG_MEM_RDAT);
_il_release_nic_access(il);
@@ -196,7 +195,6 @@ il_write_targ_mem(struct il_priv *il, u32 addr, u32 val)
spin_lock_irqsave(&il->reg_lock, reg_flags);
if (likely(_il_grab_nic_access(il))) {
_il_wr(il, HBUS_TARG_MEM_WADDR, addr);
- wmb();
_il_wr(il, HBUS_TARG_MEM_WDAT, val);
_il_release_nic_access(il);
}
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 1dfaa58..df9b5b4 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -2146,6 +2146,13 @@ static inline void
_il_release_nic_access(struct il_priv *il)
{
_il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
+ /*
+ * In above we are reading CSR_GP_CNTRL register, what will flush any
+ * previous writes, but still want write, which clear MAC_ACCESS_REQ
+ * bit, be performed on PCI bus before any other writes scheduled on
+ * different CPUs (after we drop reg_lock).
+ */
+ mmiowb();
}
static inline u32
@@ -2179,7 +2186,6 @@ static inline u32
_il_rd_prph(struct il_priv *il, u32 reg)
{
_il_wr(il, HBUS_TARG_PRPH_RADDR, reg | (3 << 24));
- rmb();
return _il_rd(il, HBUS_TARG_PRPH_RDAT);
}
@@ -2187,7 +2193,6 @@ static inline void
_il_wr_prph(struct il_priv *il, u32 addr, u32 val)
{
_il_wr(il, HBUS_TARG_PRPH_WADDR, ((addr & 0x0000FFFF) | (3 << 24)));
- wmb();
_il_wr(il, HBUS_TARG_PRPH_WDAT, val);
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 04/24] iwlegacy: use writeb,writel,readl directly
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (2 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 03/24] iwlegacy: cleanup/fix memory barriers Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 05/24] iwlegacy: regulatory_bands is not an ops Stanislaw Gruszka
` (19 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
That change will save us some CPU cycles at run time. Having
port-based I/O seems to be not possible for PCIe devices.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 6 +++---
drivers/net/wireless/iwlegacy/4965-mac.c | 6 +++---
drivers/net/wireless/iwlegacy/common.h | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index aa8f5c0..63ec05b 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3655,7 +3655,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/***********************
* 3. Read REV Register
* ********************/
- il->hw_base = pci_iomap(pdev, 0, 0);
+ il->hw_base = pci_ioremap_bar(pdev, 0);
if (!il->hw_base) {
err = -ENODEV;
goto out_pci_release_regions;
@@ -3780,7 +3780,7 @@ out_unset_hw_params:
out_eeprom_free:
il_eeprom_free(il);
out_iounmap:
- pci_iounmap(pdev, il->hw_base);
+ iounmap(il->hw_base);
out_pci_release_regions:
pci_release_regions(pdev);
out_pci_disable_device:
@@ -3860,7 +3860,7 @@ il3945_pci_remove(struct pci_dev *pdev)
free_irq(pdev->irq, il);
pci_disable_msi(pdev);
- pci_iounmap(pdev, il->hw_base);
+ iounmap(il->hw_base);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 90c9bfb..7bf78bf 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6224,7 +6224,7 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/***********************
* 3. Read REV register
***********************/
- il->hw_base = pci_iomap(pdev, 0, 0);
+ il->hw_base = pci_ioremap_bar(pdev, 0);
if (!il->hw_base) {
err = -ENODEV;
goto out_pci_release_regions;
@@ -6356,7 +6356,7 @@ out_disable_msi:
out_free_eeprom:
il_eeprom_free(il);
out_iounmap:
- pci_iounmap(pdev, il->hw_base);
+ iounmap(il->hw_base);
out_pci_release_regions:
pci_set_drvdata(pdev, NULL);
pci_release_regions(pdev);
@@ -6438,7 +6438,7 @@ il4965_pci_remove(struct pci_dev *pdev)
free_irq(il->pci_dev->irq, il);
pci_disable_msi(il->pci_dev);
- pci_iounmap(pdev, il->hw_base);
+ iounmap(il->hw_base);
pci_release_regions(pdev);
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index df9b5b4..fd2a4ee 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -2114,20 +2114,20 @@ extern void il_write_targ_mem(struct il_priv *il, u32 addr, u32 val);
static inline void
_il_write8(struct il_priv *il, u32 ofs, u8 val)
{
- iowrite8(val, il->hw_base + ofs);
+ writeb(val, il->hw_base + ofs);
}
#define il_write8(il, ofs, val) _il_write8(il, ofs, val)
static inline void
_il_wr(struct il_priv *il, u32 ofs, u32 val)
{
- iowrite32(val, il->hw_base + ofs);
+ writel(val, il->hw_base + ofs);
}
static inline u32
_il_rd(struct il_priv *il, u32 ofs)
{
- return ioread32(il->hw_base + ofs);
+ return readl(il->hw_base + ofs);
}
static inline void
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 05/24] iwlegacy: regulatory_bands is not an ops
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (3 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 04/24] iwlegacy: use writeb,writel,readl directly Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 06/24] iwlegacy: gather all 4965 handlers in one place Stanislaw Gruszka
` (18 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945.c | 39 ++++++++++++++++++++-----------
drivers/net/wireless/iwlegacy/4965.c | 19 +++++++++------
drivers/net/wireless/iwlegacy/common.c | 10 +++-----
drivers/net/wireless/iwlegacy/common.h | 3 +-
4 files changed, 42 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 6c1ae5f..66a5dc0 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -2646,18 +2646,9 @@ static struct il_lib_ops il3945_lib = {
.config = il3945_nic_config,
},
.eeprom_ops = {
- .regulatory_bands = {
- EEPROM_REGULATORY_BAND_1_CHANNELS,
- EEPROM_REGULATORY_BAND_2_CHANNELS,
- EEPROM_REGULATORY_BAND_3_CHANNELS,
- EEPROM_REGULATORY_BAND_4_CHANNELS,
- EEPROM_REGULATORY_BAND_5_CHANNELS,
- EEPROM_REGULATORY_BAND_NO_HT40,
- EEPROM_REGULATORY_BAND_NO_HT40,
- },
- .acquire_semaphore = il3945_eeprom_acquire_semaphore,
- .release_semaphore = il3945_eeprom_release_semaphore,
- },
+ .acquire_semaphore = il3945_eeprom_acquire_semaphore,
+ .release_semaphore = il3945_eeprom_release_semaphore,
+ },
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
@@ -2707,7 +2698,17 @@ static struct il_cfg il3945_bg_cfg = {
.set_l0s = false,
.use_bsm = true,
.led_compensation = 64,
- .wd_timeout = IL_DEF_WD_TIMEOUT
+ .wd_timeout = IL_DEF_WD_TIMEOUT,
+
+ .regulatory_bands = {
+ EEPROM_REGULATORY_BAND_1_CHANNELS,
+ EEPROM_REGULATORY_BAND_2_CHANNELS,
+ EEPROM_REGULATORY_BAND_3_CHANNELS,
+ EEPROM_REGULATORY_BAND_4_CHANNELS,
+ EEPROM_REGULATORY_BAND_5_CHANNELS,
+ EEPROM_REGULATORY_BAND_NO_HT40,
+ EEPROM_REGULATORY_BAND_NO_HT40,
+ },
};
static struct il_cfg il3945_abg_cfg = {
@@ -2726,7 +2727,17 @@ static struct il_cfg il3945_abg_cfg = {
.set_l0s = false,
.use_bsm = true,
.led_compensation = 64,
- .wd_timeout = IL_DEF_WD_TIMEOUT
+ .wd_timeout = IL_DEF_WD_TIMEOUT,
+
+ .regulatory_bands = {
+ EEPROM_REGULATORY_BAND_1_CHANNELS,
+ EEPROM_REGULATORY_BAND_2_CHANNELS,
+ EEPROM_REGULATORY_BAND_3_CHANNELS,
+ EEPROM_REGULATORY_BAND_4_CHANNELS,
+ EEPROM_REGULATORY_BAND_5_CHANNELS,
+ EEPROM_REGULATORY_BAND_NO_HT40,
+ EEPROM_REGULATORY_BAND_NO_HT40,
+ },
};
DEFINE_PCI_DEVICE_TABLE(il3945_hw_card_ids) = {
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 79e4e79..aea84bf 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -2217,14 +2217,6 @@ static struct il_lib_ops il4965_lib = {
.config = il4965_nic_config,
},
.eeprom_ops = {
- .regulatory_bands = {
- EEPROM_REGULATORY_BAND_1_CHANNELS,
- EEPROM_REGULATORY_BAND_2_CHANNELS,
- EEPROM_REGULATORY_BAND_3_CHANNELS,
- EEPROM_REGULATORY_BAND_4_CHANNELS,
- EEPROM_REGULATORY_BAND_5_CHANNELS,
- EEPROM_4965_REGULATORY_BAND_24_HT40_CHANNELS,
- EEPROM_4965_REGULATORY_BAND_52_HT40_CHANNELS},
.acquire_semaphore = il4965_eeprom_acquire_semaphore,
.release_semaphore = il4965_eeprom_release_semaphore,
},
@@ -2288,6 +2280,17 @@ struct il_cfg il4965_cfg = {
.ucode_tracing = true,
.sensitivity_calib_by_driver = true,
.chain_noise_calib_by_driver = true,
+
+ .regulatory_bands = {
+ EEPROM_REGULATORY_BAND_1_CHANNELS,
+ EEPROM_REGULATORY_BAND_2_CHANNELS,
+ EEPROM_REGULATORY_BAND_3_CHANNELS,
+ EEPROM_REGULATORY_BAND_4_CHANNELS,
+ EEPROM_REGULATORY_BAND_5_CHANNELS,
+ EEPROM_4965_REGULATORY_BAND_24_HT40_CHANNELS,
+ EEPROM_4965_REGULATORY_BAND_52_HT40_CHANNELS
+ },
+
};
/* Module firmware */
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 50308da..5a7ad52 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -798,8 +798,8 @@ il_init_band_reference(const struct il_priv *il, int eep_band,
const struct il_eeprom_channel **eeprom_ch_info,
const u8 **eeprom_ch_idx)
{
- u32 offset =
- il->ops->lib->eeprom_ops.regulatory_bands[eep_band - 1];
+ u32 offset = il->cfg->regulatory_bands[eep_band - 1];
+
switch (eep_band) {
case 1: /* 2.4GHz band */
*eeprom_ch_count = ARRAY_SIZE(il_eeprom_band_1);
@@ -1000,10 +1000,8 @@ il_init_channel_map(struct il_priv *il)
}
/* Check if we do have HT40 channels */
- if (il->ops->lib->eeprom_ops.regulatory_bands[5] ==
- EEPROM_REGULATORY_BAND_NO_HT40 &&
- il->ops->lib->eeprom_ops.regulatory_bands[6] ==
- EEPROM_REGULATORY_BAND_NO_HT40)
+ if (il->cfg->regulatory_bands[5] == EEPROM_REGULATORY_BAND_NO_HT40 &&
+ il->cfg->regulatory_bands[6] == EEPROM_REGULATORY_BAND_NO_HT40)
return 0;
/* Two additional EEPROM bands for 2.4 and 5 GHz HT40 channels */
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index fd2a4ee..37bc406 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -426,7 +426,6 @@ struct il_eeprom_calib_info {
#define EEPROM_REGULATORY_BAND_NO_HT40 (0)
struct il_eeprom_ops {
- const u32 regulatory_bands[7];
int (*acquire_semaphore) (struct il_priv *il);
void (*release_semaphore) (struct il_priv *il);
};
@@ -1769,6 +1768,8 @@ struct il_cfg {
const bool ucode_tracing;
const bool sensitivity_calib_by_driver;
const bool chain_noise_calib_by_driver;
+
+ const u32 regulatory_bands[7];
};
/***************************
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 06/24] iwlegacy: gather all 4965 handlers in one place
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (4 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 05/24] iwlegacy: regulatory_bands is not an ops Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 07/24] iwlegacy: move debugfs_ops to il_priv Stanislaw Gruszka
` (17 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Handers belongs logically into 4965-mac.c file.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 307 +++++++++++++++++++++++++++++-
drivers/net/wireless/iwlegacy/4965.c | 312 ------------------------------
drivers/net/wireless/iwlegacy/4965.h | 9 -
drivers/net/wireless/iwlegacy/common.h | 2 -
4 files changed, 305 insertions(+), 325 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 7bf78bf..4560021 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -2548,6 +2548,308 @@ il4965_tx_status_reply_compressed_ba(struct il_priv *il, struct il_ht_agg *agg,
return 0;
}
+static inline bool
+il4965_is_tx_success(u32 status)
+{
+ status &= TX_STATUS_MSK;
+ return (status == TX_STATUS_SUCCESS || status == TX_STATUS_DIRECT_DONE);
+}
+
+static u8
+il4965_find_station(struct il_priv *il, const u8 *addr)
+{
+ int i;
+ int start = 0;
+ int ret = IL_INVALID_STATION;
+ unsigned long flags;
+
+ if (il->iw_mode == NL80211_IFTYPE_ADHOC)
+ start = IL_STA_ID;
+
+ if (is_broadcast_ether_addr(addr))
+ return il->hw_params.bcast_id;
+
+ spin_lock_irqsave(&il->sta_lock, flags);
+ for (i = start; i < il->hw_params.max_stations; i++)
+ if (il->stations[i].used &&
+ (!compare_ether_addr(il->stations[i].sta.sta.addr, addr))) {
+ ret = i;
+ goto out;
+ }
+
+ D_ASSOC("can not find STA %pM total %d\n", addr, il->num_stations);
+
+out:
+ /*
+ * It may be possible that more commands interacting with stations
+ * arrive before we completed processing the adding of
+ * station
+ */
+ if (ret != IL_INVALID_STATION &&
+ (!(il->stations[ret].used & IL_STA_UCODE_ACTIVE) ||
+ ((il->stations[ret].used & IL_STA_UCODE_ACTIVE) &&
+ (il->stations[ret].used & IL_STA_UCODE_INPROGRESS)))) {
+ IL_ERR("Requested station info for sta %d before ready.\n",
+ ret);
+ ret = IL_INVALID_STATION;
+ }
+ spin_unlock_irqrestore(&il->sta_lock, flags);
+ return ret;
+}
+
+static int
+il4965_get_ra_sta_id(struct il_priv *il, struct ieee80211_hdr *hdr)
+{
+ if (il->iw_mode == NL80211_IFTYPE_STATION)
+ return IL_AP_ID;
+ else {
+ u8 *da = ieee80211_get_DA(hdr);
+
+ return il4965_find_station(il, da);
+ }
+}
+
+static inline u32
+il4965_get_scd_ssn(struct il4965_tx_resp *tx_resp)
+{
+ return le32_to_cpup(&tx_resp->u.status + tx_resp->frame_count) & MAX_SN;
+}
+
+static inline u32
+il4965_tx_status_to_mac80211(u32 status)
+{
+ status &= TX_STATUS_MSK;
+
+ switch (status) {
+ case TX_STATUS_SUCCESS:
+ case TX_STATUS_DIRECT_DONE:
+ return IEEE80211_TX_STAT_ACK;
+ case TX_STATUS_FAIL_DEST_PS:
+ return IEEE80211_TX_STAT_TX_FILTERED;
+ default:
+ return 0;
+ }
+}
+
+/**
+ * il4965_tx_status_reply_tx - Handle Tx response for frames in aggregation queue
+ */
+static int
+il4965_tx_status_reply_tx(struct il_priv *il, struct il_ht_agg *agg,
+ struct il4965_tx_resp *tx_resp, int txq_id,
+ u16 start_idx)
+{
+ u16 status;
+ struct agg_tx_status *frame_status = tx_resp->u.agg_status;
+ struct ieee80211_tx_info *info = NULL;
+ struct ieee80211_hdr *hdr = NULL;
+ u32 rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags);
+ int i, sh, idx;
+ u16 seq;
+ if (agg->wait_for_ba)
+ D_TX_REPLY("got tx response w/o block-ack\n");
+
+ agg->frame_count = tx_resp->frame_count;
+ agg->start_idx = start_idx;
+ agg->rate_n_flags = rate_n_flags;
+ agg->bitmap = 0;
+
+ /* num frames attempted by Tx command */
+ if (agg->frame_count == 1) {
+ /* Only one frame was attempted; no block-ack will arrive */
+ status = le16_to_cpu(frame_status[0].status);
+ idx = start_idx;
+
+ D_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
+ agg->frame_count, agg->start_idx, idx);
+
+ info = IEEE80211_SKB_CB(il->txq[txq_id].skbs[idx]);
+ info->status.rates[0].count = tx_resp->failure_frame + 1;
+ info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+ info->flags |= il4965_tx_status_to_mac80211(status);
+ il4965_hwrate_to_tx_control(il, rate_n_flags, info);
+
+ D_TX_REPLY("1 Frame 0x%x failure :%d\n", status & 0xff,
+ tx_resp->failure_frame);
+ D_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags);
+
+ agg->wait_for_ba = 0;
+ } else {
+ /* Two or more frames were attempted; expect block-ack */
+ u64 bitmap = 0;
+ int start = agg->start_idx;
+ struct sk_buff *skb;
+
+ /* Construct bit-map of pending frames within Tx win */
+ for (i = 0; i < agg->frame_count; i++) {
+ u16 sc;
+ status = le16_to_cpu(frame_status[i].status);
+ seq = le16_to_cpu(frame_status[i].sequence);
+ idx = SEQ_TO_IDX(seq);
+ txq_id = SEQ_TO_QUEUE(seq);
+
+ if (status &
+ (AGG_TX_STATE_FEW_BYTES_MSK |
+ AGG_TX_STATE_ABORT_MSK))
+ continue;
+
+ D_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n",
+ agg->frame_count, txq_id, idx);
+
+ skb = il->txq[txq_id].skbs[idx];
+ if (WARN_ON_ONCE(skb == NULL))
+ return -1;
+ hdr = (struct ieee80211_hdr *) skb->data;
+
+ sc = le16_to_cpu(hdr->seq_ctrl);
+ if (idx != (SEQ_TO_SN(sc) & 0xff)) {
+ IL_ERR("BUG_ON idx doesn't match seq control"
+ " idx=%d, seq_idx=%d, seq=%d\n", idx,
+ SEQ_TO_SN(sc), hdr->seq_ctrl);
+ return -1;
+ }
+
+ D_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n", i, idx,
+ SEQ_TO_SN(sc));
+
+ sh = idx - start;
+ if (sh > 64) {
+ sh = (start - idx) + 0xff;
+ bitmap = bitmap << sh;
+ sh = 0;
+ start = idx;
+ } else if (sh < -64)
+ sh = 0xff - (start - idx);
+ else if (sh < 0) {
+ sh = start - idx;
+ start = idx;
+ bitmap = bitmap << sh;
+ sh = 0;
+ }
+ bitmap |= 1ULL << sh;
+ D_TX_REPLY("start=%d bitmap=0x%llx\n", start,
+ (unsigned long long)bitmap);
+ }
+
+ agg->bitmap = bitmap;
+ agg->start_idx = start;
+ D_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n",
+ agg->frame_count, agg->start_idx,
+ (unsigned long long)agg->bitmap);
+
+ if (bitmap)
+ agg->wait_for_ba = 1;
+ }
+ return 0;
+}
+
+/**
+ * il4965_hdl_tx - Handle standard (non-aggregation) Tx response
+ */
+static void
+il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)
+{
+ struct il_rx_pkt *pkt = rxb_addr(rxb);
+ u16 sequence = le16_to_cpu(pkt->hdr.sequence);
+ int txq_id = SEQ_TO_QUEUE(sequence);
+ int idx = SEQ_TO_IDX(sequence);
+ struct il_tx_queue *txq = &il->txq[txq_id];
+ struct sk_buff *skb;
+ struct ieee80211_hdr *hdr;
+ struct ieee80211_tx_info *info;
+ struct il4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
+ u32 status = le32_to_cpu(tx_resp->u.status);
+ int uninitialized_var(tid);
+ int sta_id;
+ int freed;
+ u8 *qc = NULL;
+ unsigned long flags;
+
+ if (idx >= txq->q.n_bd || il_queue_used(&txq->q, idx) == 0) {
+ IL_ERR("Read idx for DMA queue txq_id (%d) idx %d "
+ "is out of range [0-%d] %d %d\n", txq_id, idx,
+ txq->q.n_bd, txq->q.write_ptr, txq->q.read_ptr);
+ return;
+ }
+
+ txq->time_stamp = jiffies;
+
+ skb = txq->skbs[txq->q.read_ptr];
+ info = IEEE80211_SKB_CB(skb);
+ memset(&info->status, 0, sizeof(info->status));
+
+ hdr = (struct ieee80211_hdr *) skb->data;
+ if (ieee80211_is_data_qos(hdr->frame_control)) {
+ qc = ieee80211_get_qos_ctl(hdr);
+ tid = qc[0] & 0xf;
+ }
+
+ sta_id = il4965_get_ra_sta_id(il, hdr);
+ if (txq->sched_retry && unlikely(sta_id == IL_INVALID_STATION)) {
+ IL_ERR("Station not known\n");
+ return;
+ }
+
+ spin_lock_irqsave(&il->sta_lock, flags);
+ if (txq->sched_retry) {
+ const u32 scd_ssn = il4965_get_scd_ssn(tx_resp);
+ struct il_ht_agg *agg = NULL;
+ WARN_ON(!qc);
+
+ agg = &il->stations[sta_id].tid[tid].agg;
+
+ il4965_tx_status_reply_tx(il, agg, tx_resp, txq_id, idx);
+
+ /* check if BAR is needed */
+ if (tx_resp->frame_count == 1 &&
+ !il4965_is_tx_success(status))
+ info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
+
+ if (txq->q.read_ptr != (scd_ssn & 0xff)) {
+ idx = il_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
+ D_TX_REPLY("Retry scheduler reclaim scd_ssn "
+ "%d idx %d\n", scd_ssn, idx);
+ freed = il4965_tx_queue_reclaim(il, txq_id, idx);
+ if (qc)
+ il4965_free_tfds_in_queue(il, sta_id, tid,
+ freed);
+
+ if (il->mac80211_registered &&
+ il_queue_space(&txq->q) > txq->q.low_mark &&
+ agg->state != IL_EMPTYING_HW_QUEUE_DELBA)
+ il_wake_queue(il, txq);
+ }
+ } else {
+ info->status.rates[0].count = tx_resp->failure_frame + 1;
+ info->flags |= il4965_tx_status_to_mac80211(status);
+ il4965_hwrate_to_tx_control(il,
+ le32_to_cpu(tx_resp->rate_n_flags),
+ info);
+
+ D_TX_REPLY("TXQ %d status %s (0x%08x) "
+ "rate_n_flags 0x%x retries %d\n", txq_id,
+ il4965_get_tx_fail_reason(status), status,
+ le32_to_cpu(tx_resp->rate_n_flags),
+ tx_resp->failure_frame);
+
+ freed = il4965_tx_queue_reclaim(il, txq_id, idx);
+ if (qc && likely(sta_id != IL_INVALID_STATION))
+ il4965_free_tfds_in_queue(il, sta_id, tid, freed);
+ else if (sta_id == IL_INVALID_STATION)
+ D_TX_REPLY("Station not known\n");
+
+ if (il->mac80211_registered &&
+ il_queue_space(&txq->q) > txq->q.low_mark)
+ il_wake_queue(il, txq);
+ }
+ if (qc && likely(sta_id != IL_INVALID_STATION))
+ il4965_txq_check_empty(il, sta_id, tid, txq_id);
+
+ il4965_check_abort_status(il, tx_resp->frame_count, status);
+
+ spin_unlock_irqrestore(&il->sta_lock, flags);
+}
+
/**
* translate ucode response to mac80211 tx status control values
*/
@@ -3868,10 +4170,11 @@ il4965_setup_handlers(struct il_priv *il)
/* Rx handlers */
il->handlers[N_RX_PHY] = il4965_hdl_rx_phy;
il->handlers[N_RX_MPDU] = il4965_hdl_rx;
+ il->handlers[N_RX] = il4965_hdl_rx;
/* block ack */
il->handlers[N_COMPRESSED_BA] = il4965_hdl_compressed_ba;
- /* Set up hardware specific Rx handlers */
- il->ops->lib->handler_setup(il);
+ /* Tx response */
+ il->handlers[C_TX] = il4965_hdl_tx;
}
/**
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index aea84bf..cf49a7a 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1737,317 +1737,6 @@ il4965_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data)
return (u16) sizeof(struct il4965_addsta_cmd);
}
-static inline u32
-il4965_get_scd_ssn(struct il4965_tx_resp *tx_resp)
-{
- return le32_to_cpup(&tx_resp->u.status + tx_resp->frame_count) & MAX_SN;
-}
-
-static inline u32
-il4965_tx_status_to_mac80211(u32 status)
-{
- status &= TX_STATUS_MSK;
-
- switch (status) {
- case TX_STATUS_SUCCESS:
- case TX_STATUS_DIRECT_DONE:
- return IEEE80211_TX_STAT_ACK;
- case TX_STATUS_FAIL_DEST_PS:
- return IEEE80211_TX_STAT_TX_FILTERED;
- default:
- return 0;
- }
-}
-
-static inline bool
-il4965_is_tx_success(u32 status)
-{
- status &= TX_STATUS_MSK;
- return (status == TX_STATUS_SUCCESS || status == TX_STATUS_DIRECT_DONE);
-}
-
-/**
- * il4965_tx_status_reply_tx - Handle Tx response for frames in aggregation queue
- */
-static int
-il4965_tx_status_reply_tx(struct il_priv *il, struct il_ht_agg *agg,
- struct il4965_tx_resp *tx_resp, int txq_id,
- u16 start_idx)
-{
- u16 status;
- struct agg_tx_status *frame_status = tx_resp->u.agg_status;
- struct ieee80211_tx_info *info = NULL;
- struct ieee80211_hdr *hdr = NULL;
- u32 rate_n_flags = le32_to_cpu(tx_resp->rate_n_flags);
- int i, sh, idx;
- u16 seq;
- if (agg->wait_for_ba)
- D_TX_REPLY("got tx response w/o block-ack\n");
-
- agg->frame_count = tx_resp->frame_count;
- agg->start_idx = start_idx;
- agg->rate_n_flags = rate_n_flags;
- agg->bitmap = 0;
-
- /* num frames attempted by Tx command */
- if (agg->frame_count == 1) {
- /* Only one frame was attempted; no block-ack will arrive */
- status = le16_to_cpu(frame_status[0].status);
- idx = start_idx;
-
- D_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
- agg->frame_count, agg->start_idx, idx);
-
- info = IEEE80211_SKB_CB(il->txq[txq_id].skbs[idx]);
- info->status.rates[0].count = tx_resp->failure_frame + 1;
- info->flags &= ~IEEE80211_TX_CTL_AMPDU;
- info->flags |= il4965_tx_status_to_mac80211(status);
- il4965_hwrate_to_tx_control(il, rate_n_flags, info);
-
- D_TX_REPLY("1 Frame 0x%x failure :%d\n", status & 0xff,
- tx_resp->failure_frame);
- D_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags);
-
- agg->wait_for_ba = 0;
- } else {
- /* Two or more frames were attempted; expect block-ack */
- u64 bitmap = 0;
- int start = agg->start_idx;
- struct sk_buff *skb;
-
- /* Construct bit-map of pending frames within Tx win */
- for (i = 0; i < agg->frame_count; i++) {
- u16 sc;
- status = le16_to_cpu(frame_status[i].status);
- seq = le16_to_cpu(frame_status[i].sequence);
- idx = SEQ_TO_IDX(seq);
- txq_id = SEQ_TO_QUEUE(seq);
-
- if (status &
- (AGG_TX_STATE_FEW_BYTES_MSK |
- AGG_TX_STATE_ABORT_MSK))
- continue;
-
- D_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n",
- agg->frame_count, txq_id, idx);
-
- skb = il->txq[txq_id].skbs[idx];
- if (WARN_ON_ONCE(skb == NULL))
- return -1;
- hdr = (struct ieee80211_hdr *) skb->data;
-
- sc = le16_to_cpu(hdr->seq_ctrl);
- if (idx != (SEQ_TO_SN(sc) & 0xff)) {
- IL_ERR("BUG_ON idx doesn't match seq control"
- " idx=%d, seq_idx=%d, seq=%d\n", idx,
- SEQ_TO_SN(sc), hdr->seq_ctrl);
- return -1;
- }
-
- D_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n", i, idx,
- SEQ_TO_SN(sc));
-
- sh = idx - start;
- if (sh > 64) {
- sh = (start - idx) + 0xff;
- bitmap = bitmap << sh;
- sh = 0;
- start = idx;
- } else if (sh < -64)
- sh = 0xff - (start - idx);
- else if (sh < 0) {
- sh = start - idx;
- start = idx;
- bitmap = bitmap << sh;
- sh = 0;
- }
- bitmap |= 1ULL << sh;
- D_TX_REPLY("start=%d bitmap=0x%llx\n", start,
- (unsigned long long)bitmap);
- }
-
- agg->bitmap = bitmap;
- agg->start_idx = start;
- D_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n",
- agg->frame_count, agg->start_idx,
- (unsigned long long)agg->bitmap);
-
- if (bitmap)
- agg->wait_for_ba = 1;
- }
- return 0;
-}
-
-static u8
-il4965_find_station(struct il_priv *il, const u8 * addr)
-{
- int i;
- int start = 0;
- int ret = IL_INVALID_STATION;
- unsigned long flags;
-
- if ((il->iw_mode == NL80211_IFTYPE_ADHOC))
- start = IL_STA_ID;
-
- if (is_broadcast_ether_addr(addr))
- return il->hw_params.bcast_id;
-
- spin_lock_irqsave(&il->sta_lock, flags);
- for (i = start; i < il->hw_params.max_stations; i++)
- if (il->stations[i].used &&
- (!compare_ether_addr(il->stations[i].sta.sta.addr, addr))) {
- ret = i;
- goto out;
- }
-
- D_ASSOC("can not find STA %pM total %d\n", addr, il->num_stations);
-
-out:
- /*
- * It may be possible that more commands interacting with stations
- * arrive before we completed processing the adding of
- * station
- */
- if (ret != IL_INVALID_STATION &&
- (!(il->stations[ret].used & IL_STA_UCODE_ACTIVE) ||
- ((il->stations[ret].used & IL_STA_UCODE_ACTIVE) &&
- (il->stations[ret].used & IL_STA_UCODE_INPROGRESS)))) {
- IL_ERR("Requested station info for sta %d before ready.\n",
- ret);
- ret = IL_INVALID_STATION;
- }
- spin_unlock_irqrestore(&il->sta_lock, flags);
- return ret;
-}
-
-static int
-il4965_get_ra_sta_id(struct il_priv *il, struct ieee80211_hdr *hdr)
-{
- if (il->iw_mode == NL80211_IFTYPE_STATION) {
- return IL_AP_ID;
- } else {
- u8 *da = ieee80211_get_DA(hdr);
- return il4965_find_station(il, da);
- }
-}
-
-/**
- * il4965_hdl_tx - Handle standard (non-aggregation) Tx response
- */
-static void
-il4965_hdl_tx(struct il_priv *il, struct il_rx_buf *rxb)
-{
- struct il_rx_pkt *pkt = rxb_addr(rxb);
- u16 sequence = le16_to_cpu(pkt->hdr.sequence);
- int txq_id = SEQ_TO_QUEUE(sequence);
- int idx = SEQ_TO_IDX(sequence);
- struct il_tx_queue *txq = &il->txq[txq_id];
- struct sk_buff *skb;
- struct ieee80211_hdr *hdr;
- struct ieee80211_tx_info *info;
- struct il4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
- u32 status = le32_to_cpu(tx_resp->u.status);
- int uninitialized_var(tid);
- int sta_id;
- int freed;
- u8 *qc = NULL;
- unsigned long flags;
-
- if (idx >= txq->q.n_bd || il_queue_used(&txq->q, idx) == 0) {
- IL_ERR("Read idx for DMA queue txq_id (%d) idx %d "
- "is out of range [0-%d] %d %d\n", txq_id, idx,
- txq->q.n_bd, txq->q.write_ptr, txq->q.read_ptr);
- return;
- }
-
- txq->time_stamp = jiffies;
-
- skb = txq->skbs[txq->q.read_ptr];
- info = IEEE80211_SKB_CB(skb);
- memset(&info->status, 0, sizeof(info->status));
-
- hdr = (struct ieee80211_hdr *) skb->data;
- if (ieee80211_is_data_qos(hdr->frame_control)) {
- qc = ieee80211_get_qos_ctl(hdr);
- tid = qc[0] & 0xf;
- }
-
- sta_id = il4965_get_ra_sta_id(il, hdr);
- if (txq->sched_retry && unlikely(sta_id == IL_INVALID_STATION)) {
- IL_ERR("Station not known\n");
- return;
- }
-
- spin_lock_irqsave(&il->sta_lock, flags);
- if (txq->sched_retry) {
- const u32 scd_ssn = il4965_get_scd_ssn(tx_resp);
- struct il_ht_agg *agg = NULL;
- WARN_ON(!qc);
-
- agg = &il->stations[sta_id].tid[tid].agg;
-
- il4965_tx_status_reply_tx(il, agg, tx_resp, txq_id, idx);
-
- /* check if BAR is needed */
- if ((tx_resp->frame_count == 1) &&
- !il4965_is_tx_success(status))
- info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
-
- if (txq->q.read_ptr != (scd_ssn & 0xff)) {
- idx = il_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd);
- D_TX_REPLY("Retry scheduler reclaim scd_ssn "
- "%d idx %d\n", scd_ssn, idx);
- freed = il4965_tx_queue_reclaim(il, txq_id, idx);
- if (qc)
- il4965_free_tfds_in_queue(il, sta_id, tid,
- freed);
-
- if (il->mac80211_registered &&
- il_queue_space(&txq->q) > txq->q.low_mark &&
- agg->state != IL_EMPTYING_HW_QUEUE_DELBA)
- il_wake_queue(il, txq);
- }
- } else {
- info->status.rates[0].count = tx_resp->failure_frame + 1;
- info->flags |= il4965_tx_status_to_mac80211(status);
- il4965_hwrate_to_tx_control(il,
- le32_to_cpu(tx_resp->rate_n_flags),
- info);
-
- D_TX_REPLY("TXQ %d status %s (0x%08x) "
- "rate_n_flags 0x%x retries %d\n", txq_id,
- il4965_get_tx_fail_reason(status), status,
- le32_to_cpu(tx_resp->rate_n_flags),
- tx_resp->failure_frame);
-
- freed = il4965_tx_queue_reclaim(il, txq_id, idx);
- if (qc && likely(sta_id != IL_INVALID_STATION))
- il4965_free_tfds_in_queue(il, sta_id, tid, freed);
- else if (sta_id == IL_INVALID_STATION)
- D_TX_REPLY("Station not known\n");
-
- if (il->mac80211_registered &&
- il_queue_space(&txq->q) > txq->q.low_mark)
- il_wake_queue(il, txq);
- }
- if (qc && likely(sta_id != IL_INVALID_STATION))
- il4965_txq_check_empty(il, sta_id, tid, txq_id);
-
- il4965_check_abort_status(il, tx_resp->frame_count, status);
-
- spin_unlock_irqrestore(&il->sta_lock, flags);
-}
-
-/* Set up 4965-specific Rx frame reply handlers */
-static void
-il4965_handler_setup(struct il_priv *il)
-{
- /* Legacy Rx frames */
- il->handlers[N_RX] = il4965_hdl_rx;
- /* Tx response */
- il->handlers[C_TX] = il4965_hdl_tx;
-}
-
static struct il_hcmd_ops il4965_hcmd = {
.rxon_assoc = il4965_send_rxon_assoc,
.commit_rxon = il4965_commit_rxon,
@@ -2205,7 +1894,6 @@ static struct il_lib_ops il4965_lib = {
.txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd,
.txq_free_tfd = il4965_hw_txq_free_tfd,
.txq_init = il4965_hw_tx_queue_init,
- .handler_setup = il4965_handler_setup,
.is_valid_rtc_data_addr = il4965_hw_valid_rtc_data_addr,
.init_alive_start = il4965_init_alive_start,
.load_ucode = il4965_load_bsm,
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index 83ab604..befa7e6 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -67,8 +67,6 @@ void il4965_rx_replenish_now(struct il_priv *il);
void il4965_rx_queue_free(struct il_priv *il, struct il_rx_queue *rxq);
int il4965_rxq_stop(struct il_priv *il);
int il4965_hwrate_to_mac80211_idx(u32 rate_n_flags, enum ieee80211_band band);
-void il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb);
-void il4965_hdl_rx_phy(struct il_priv *il, struct il_rx_buf *rxb);
void il4965_rx_handle(struct il_priv *il);
/* tx */
@@ -84,7 +82,6 @@ int il4965_tx_agg_start(struct il_priv *il, struct ieee80211_vif *vif,
int il4965_tx_agg_stop(struct il_priv *il, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, u16 tid);
int il4965_txq_check_empty(struct il_priv *il, int sta_id, u8 tid, int txq_id);
-void il4965_hdl_compressed_ba(struct il_priv *il, struct il_rx_buf *rxb);
int il4965_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx);
void il4965_hw_txq_ctx_free(struct il_priv *il);
int il4965_txq_ctx_alloc(struct il_priv *il);
@@ -106,12 +103,6 @@ void il4965_set_wr_ptrs(struct il_priv *il, int txq_id, u32 idx);
void il4965_tx_queue_set_status(struct il_priv *il, struct il_tx_queue *txq,
int tx_fifo_id, int scd_retry);
-/* rx */
-void il4965_hdl_missed_beacon(struct il_priv *il, struct il_rx_buf *rxb);
-bool il4965_good_plcp_health(struct il_priv *il, struct il_rx_pkt *pkt);
-void il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb);
-void il4965_hdl_c_stats(struct il_priv *il, struct il_rx_buf *rxb);
-
/* scan */
int il4965_request_scan(struct il_priv *il, struct ieee80211_vif *vif);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 37bc406..1c0d969 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1600,8 +1600,6 @@ struct il_lib_ops {
u16 len, u8 reset, u8 pad);
void (*txq_free_tfd) (struct il_priv *il, struct il_tx_queue *txq);
int (*txq_init) (struct il_priv *il, struct il_tx_queue *txq);
- /* setup Rx handler */
- void (*handler_setup) (struct il_priv *il);
/* alive notification after init uCode load */
void (*init_alive_start) (struct il_priv *il);
/* check validity of rtc data address */
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 07/24] iwlegacy: move debugfs_ops to il_priv
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (5 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 06/24] iwlegacy: gather all 4965 handlers in one place Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 08/24] iwlegacy: remove temp_ops Stanislaw Gruszka
` (16 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-debug.c | 6 ++++++
drivers/net/wireless/iwlegacy/3945-mac.c | 3 +++
drivers/net/wireless/iwlegacy/3945.c | 8 --------
drivers/net/wireless/iwlegacy/3945.h | 8 +-------
drivers/net/wireless/iwlegacy/4965-debug.c | 6 ++++++
drivers/net/wireless/iwlegacy/4965-mac.c | 3 +++
drivers/net/wireless/iwlegacy/4965.c | 7 -------
drivers/net/wireless/iwlegacy/4965.h | 8 +-------
drivers/net/wireless/iwlegacy/common.h | 10 ++++------
drivers/net/wireless/iwlegacy/debug.c | 9 ++++++---
10 files changed, 30 insertions(+), 38 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-debug.c b/drivers/net/wireless/iwlegacy/3945-debug.c
index 5e1a19f..f767dd1 100644
--- a/drivers/net/wireless/iwlegacy/3945-debug.c
+++ b/drivers/net/wireless/iwlegacy/3945-debug.c
@@ -503,3 +503,9 @@ il3945_ucode_general_stats_read(struct file *file, char __user *user_buf,
kfree(buf);
return ret;
}
+
+const struct il_debugfs_ops il3945_debugfs_ops = {
+ .rx_stats_read = il3945_ucode_rx_stats_read,
+ .tx_stats_read = il3945_ucode_tx_stats_read,
+ .general_stats_read = il3945_ucode_general_stats_read,
+};
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 63ec05b..b7d5ebc 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3619,6 +3619,9 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
D_INFO("*** LOAD DRIVER ***\n");
il->cfg = cfg;
il->ops = &il3945_ops;
+#ifdef CONFIG_IWLEGACY_DEBUGFS
+ il->debugfs_ops = &il3945_debugfs_ops;
+#endif
il->pci_dev = pdev;
il->inta_mask = CSR_INI_SET_MASK;
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 66a5dc0..4e63e7d 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -2651,14 +2651,6 @@ static struct il_lib_ops il3945_lib = {
},
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
-
-#ifdef CONFIG_IWLEGACY_DEBUGFS
- .debugfs_ops = {
- .rx_stats_read = il3945_ucode_rx_stats_read,
- .tx_stats_read = il3945_ucode_tx_stats_read,
- .general_stats_read = il3945_ucode_general_stats_read,
- },
-#endif
};
static const struct il_legacy_ops il3945_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/3945.h b/drivers/net/wireless/iwlegacy/3945.h
index c00a8d3..1d45075 100644
--- a/drivers/net/wireless/iwlegacy/3945.h
+++ b/drivers/net/wireless/iwlegacy/3945.h
@@ -595,13 +595,7 @@ struct il3945_tfd {
} __packed;
#ifdef CONFIG_IWLEGACY_DEBUGFS
-ssize_t il3945_ucode_rx_stats_read(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos);
-ssize_t il3945_ucode_tx_stats_read(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos);
-ssize_t il3945_ucode_general_stats_read(struct file *file,
- char __user *user_buf, size_t count,
- loff_t *ppos);
+extern const struct il_debugfs_ops il3945_debugfs_ops;
#endif
#endif
diff --git a/drivers/net/wireless/iwlegacy/4965-debug.c b/drivers/net/wireless/iwlegacy/4965-debug.c
index 98ec39f..c8153fc 100644
--- a/drivers/net/wireless/iwlegacy/4965-debug.c
+++ b/drivers/net/wireless/iwlegacy/4965-debug.c
@@ -744,3 +744,9 @@ il4965_ucode_general_stats_read(struct file *file, char __user *user_buf,
kfree(buf);
return ret;
}
+
+const struct il_debugfs_ops il4965_debugfs_ops = {
+ .rx_stats_read = il4965_ucode_rx_stats_read,
+ .tx_stats_read = il4965_ucode_tx_stats_read,
+ .general_stats_read = il4965_ucode_general_stats_read,
+};
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 4560021..36f85f2 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6483,6 +6483,9 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
D_INFO("*** LOAD DRIVER ***\n");
il->cfg = cfg;
il->ops = &il4965_ops;
+#ifdef CONFIG_IWLEGACY_DEBUGFS
+ il->debugfs_ops = &il4965_debugfs_ops;
+#endif
il->pci_dev = pdev;
il->inta_mask = CSR_INI_SET_MASK;
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index cf49a7a..34fa3db 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1913,13 +1913,6 @@ static struct il_lib_ops il4965_lib = {
.temp_ops = {
.temperature = il4965_temperature_calib,
},
-#ifdef CONFIG_IWLEGACY_DEBUGFS
- .debugfs_ops = {
- .rx_stats_read = il4965_ucode_rx_stats_read,
- .tx_stats_read = il4965_ucode_tx_stats_read,
- .general_stats_read = il4965_ucode_general_stats_read,
- },
-#endif
};
static const struct il_legacy_ops il4965_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index befa7e6..b3fcb8f 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -928,13 +928,7 @@ void il4965_calib_free_results(struct il_priv *il);
/* Debug */
#ifdef CONFIG_IWLEGACY_DEBUGFS
-ssize_t il4965_ucode_rx_stats_read(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos);
-ssize_t il4965_ucode_tx_stats_read(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos);
-ssize_t il4965_ucode_general_stats_read(struct file *file,
- char __user *user_buf, size_t count,
- loff_t *ppos);
+extern const struct il_debugfs_ops il4965_debugfs_ops;
#endif
/****************************/
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 1c0d969..cd8f27d 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1155,13 +1155,15 @@ struct il_power_mgr {
};
struct il_priv {
-
- /* ieee device used by generic ieee processing code */
struct ieee80211_hw *hw;
struct ieee80211_channel *ieee_channels;
struct ieee80211_rate *ieee_rates;
+
struct il_cfg *cfg;
const struct il_ops *ops;
+#ifdef CONFIG_IWLEGACY_DEBUGFS
+ const struct il_debugfs_ops *debugfs_ops;
+#endif
/* temporary frame storage list */
struct list_head free_frames;
@@ -1624,10 +1626,6 @@ struct il_lib_ops {
/* temperature */
struct il_temp_ops temp_ops;
-#ifdef CONFIG_IWLEGACY_DEBUGFS
- struct il_debugfs_ops debugfs_ops;
-#endif
-
};
struct il_led_ops {
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index bb7c956..5091db8 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -901,7 +901,8 @@ il_dbgfs_ucode_rx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *il = file->private_data;
- return il->ops->lib->debugfs_ops.rx_stats_read(file, user_buf, count, ppos);
+
+ return il->debugfs_ops->rx_stats_read(file, user_buf, count, ppos);
}
static ssize_t
@@ -909,7 +910,8 @@ il_dbgfs_ucode_tx_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *il = file->private_data;
- return il->ops->lib->debugfs_ops.tx_stats_read(file, user_buf, count, ppos);
+
+ return il->debugfs_ops->tx_stats_read(file, user_buf, count, ppos);
}
static ssize_t
@@ -917,7 +919,8 @@ il_dbgfs_ucode_general_stats_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
struct il_priv *il = file->private_data;
- return il->ops->lib->debugfs_ops.general_stats_read(file, user_buf, count, ppos);
+
+ return il->debugfs_ops->general_stats_read(file, user_buf, count, ppos);
}
static ssize_t
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 08/24] iwlegacy: remove temp_ops
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (6 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 07/24] iwlegacy: move debugfs_ops to il_priv Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 09/24] iwlegacy: merge eeprom_ops into lib_ops Stanislaw Gruszka
` (15 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Remove unneeded structure and cleanup temperature calibration routines
a bit.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 26 +++++++++++++-------------
drivers/net/wireless/iwlegacy/4965.c | 5 +----
drivers/net/wireless/iwlegacy/4965.h | 1 +
drivers/net/wireless/iwlegacy/common.h | 8 --------
4 files changed, 15 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 36f85f2..e113dc5 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1343,12 +1343,11 @@ il4965_accumulative_stats(struct il_priv *il, __le32 * stats)
}
#endif
-#define REG_RECALIB_PERIOD (60)
-
void
il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb)
{
- int change;
+ const int recalib_seconds = 60;
+ bool change;
struct il_rx_pkt *pkt = rxb_addr(rxb);
D_RX("Statistics notification received (%d vs %d).\n",
@@ -1369,20 +1368,21 @@ il4965_hdl_stats(struct il_priv *il, struct il_rx_buf *rxb)
set_bit(S_STATS, &il->status);
- /* Reschedule the stats timer to occur in
- * REG_RECALIB_PERIOD seconds to ensure we get a
- * thermal update even if the uCode doesn't give
- * us one */
+ /*
+ * Reschedule the stats timer to occur in recalib_seconds to ensure
+ * we get a thermal update even if the uCode doesn't give us one
+ */
mod_timer(&il->stats_periodic,
- jiffies + msecs_to_jiffies(REG_RECALIB_PERIOD * 1000));
+ jiffies + msecs_to_jiffies(recalib_seconds * 1000));
if (unlikely(!test_bit(S_SCANNING, &il->status)) &&
(pkt->hdr.cmd == N_STATS)) {
il4965_rx_calc_noise(il);
queue_work(il->workqueue, &il->run_time_calib_work);
}
- if (il->ops->lib->temp_ops.temperature && change)
- il->ops->lib->temp_ops.temperature(il);
+
+ if (change)
+ il4965_temperature_calib(il);
}
void
@@ -4028,9 +4028,9 @@ il4965_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb)
* This callback is provided in order to send a stats request.
*
* This timer function is continually reset to execute within
- * REG_RECALIB_PERIOD seconds since the last N_STATS
- * was received. We need to ensure we receive the stats in order
- * to update the temperature used for calibrating the TXPOWER.
+ * 60 seconds since the last N_STATS was received. We need to
+ * ensure we receive the stats in order to update the temperature
+ * used for calibrating the TXPOWER.
*/
static void
il4965_bg_stats_periodic(unsigned long data)
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 34fa3db..3a30aac 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1678,7 +1678,7 @@ il4965_is_temp_calib_needed(struct il_priv *il)
return 1;
}
-static void
+void
il4965_temperature_calib(struct il_priv *il)
{
s32 temp;
@@ -1910,9 +1910,6 @@ static struct il_lib_ops il4965_lib = {
},
.send_tx_power = il4965_send_tx_power,
.update_chain_flags = il4965_update_chain_flags,
- .temp_ops = {
- .temperature = il4965_temperature_calib,
- },
};
static const struct il_legacy_ops il4965_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index b3fcb8f..7c6b9b9 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -266,6 +266,7 @@ il4965_hw_valid_rtc_data_addr(u32 addr)
((t) < IL_TX_POWER_TEMPERATURE_MIN || \
(t) > IL_TX_POWER_TEMPERATURE_MAX)
+extern void il4965_temperature_calib(struct il_priv *il);
/********************* END TEMPERATURE ***************************************/
/********************* START TXPOWER *****************************************/
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index cd8f27d..6f42f56 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1588,10 +1588,6 @@ struct il_debugfs_ops {
};
#endif
-struct il_temp_ops {
- void (*temperature) (struct il_priv *il);
-};
-
struct il_lib_ops {
/* Handling TX */
void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
@@ -1622,10 +1618,6 @@ struct il_lib_ops {
/* eeprom operations */
struct il_eeprom_ops eeprom_ops;
-
- /* temperature */
- struct il_temp_ops temp_ops;
-
};
struct il_led_ops {
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 09/24] iwlegacy: merge eeprom_ops into lib_ops
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (7 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 08/24] iwlegacy: remove temp_ops Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 10/24] iwlegacy: remove il_apm_ops Stanislaw Gruszka
` (14 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945.c | 6 ++----
drivers/net/wireless/iwlegacy/4965.c | 6 ++----
drivers/net/wireless/iwlegacy/common.c | 4 ++--
drivers/net/wireless/iwlegacy/common.h | 8 ++------
4 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 4e63e7d..95d88b4 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -2645,12 +2645,10 @@ static struct il_lib_ops il3945_lib = {
.init = il3945_apm_init,
.config = il3945_nic_config,
},
- .eeprom_ops = {
- .acquire_semaphore = il3945_eeprom_acquire_semaphore,
- .release_semaphore = il3945_eeprom_release_semaphore,
- },
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
+ .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
+ .eeprom_release_semaphore = il3945_eeprom_release_semaphore,
};
static const struct il_legacy_ops il3945_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 3a30aac..3ddc31f 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1904,12 +1904,10 @@ static struct il_lib_ops il4965_lib = {
.init = il_apm_init,
.config = il4965_nic_config,
},
- .eeprom_ops = {
- .acquire_semaphore = il4965_eeprom_acquire_semaphore,
- .release_semaphore = il4965_eeprom_release_semaphore,
- },
.send_tx_power = il4965_send_tx_power,
.update_chain_flags = il4965_update_chain_flags,
+ .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
+ .eeprom_release_semaphore = il4965_eeprom_release_semaphore,
};
static const struct il_legacy_ops il4965_legacy_ops = {
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 5a7ad52..5de2340 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -740,7 +740,7 @@ il_eeprom_init(struct il_priv *il)
}
/* Make sure driver (instead of uCode) is allowed to read EEPROM */
- ret = il->ops->lib->eeprom_ops.acquire_semaphore(il);
+ ret = il->ops->lib->eeprom_acquire_semaphore(il);
if (ret < 0) {
IL_ERR("Failed to acquire EEPROM semaphore.\n");
ret = -ENOENT;
@@ -772,7 +772,7 @@ il_eeprom_init(struct il_priv *il)
ret = 0;
done:
- il->ops->lib->eeprom_ops.release_semaphore(il);
+ il->ops->lib->eeprom_release_semaphore(il);
err:
if (ret)
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 6f42f56..b588a5f 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -425,11 +425,6 @@ struct il_eeprom_calib_info {
#define EEPROM_REGULATORY_BAND_NO_HT40 (0)
-struct il_eeprom_ops {
- int (*acquire_semaphore) (struct il_priv *il);
- void (*release_semaphore) (struct il_priv *il);
-};
-
int il_eeprom_init(struct il_priv *il);
void il_eeprom_free(struct il_priv *il);
const u8 *il_eeprom_query_addr(const struct il_priv *il, size_t offset);
@@ -1617,7 +1612,8 @@ struct il_lib_ops {
void (*update_chain_flags) (struct il_priv *il);
/* eeprom operations */
- struct il_eeprom_ops eeprom_ops;
+ int (*eeprom_acquire_semaphore) (struct il_priv *il);
+ void (*eeprom_release_semaphore) (struct il_priv *il);
};
struct il_led_ops {
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 10/24] iwlegacy: remove il_apm_ops
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (8 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 09/24] iwlegacy: merge eeprom_ops into lib_ops Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 11/24] iwlegacy: merge il_lib_ops into il_ops Stanislaw Gruszka
` (13 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/iwlegacy/3945.c | 10 +++-------
drivers/net/wireless/iwlegacy/4965-mac.c | 8 ++------
drivers/net/wireless/iwlegacy/4965.c | 7 ++-----
drivers/net/wireless/iwlegacy/4965.h | 2 ++
drivers/net/wireless/iwlegacy/common.c | 2 +-
drivers/net/wireless/iwlegacy/common.h | 9 ++-------
7 files changed, 13 insertions(+), 27 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index b7d5ebc..ba01d2d 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3672,7 +3672,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* PCI Tx retries from interfering with C3 CPU state */
pci_write_config_byte(pdev, 0x41, 0x00);
- /* these spin locks will be used in apm_ops.init and EEPROM access
+ /* these spin locks will be used in apm_init and EEPROM access
* we should init now
*/
spin_lock_init(&il->reg_lock);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 95d88b4..a21ec25 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -958,12 +958,11 @@ il3945_hw_nic_init(struct il_priv *il)
struct il_rx_queue *rxq = &il->rxq;
spin_lock_irqsave(&il->lock, flags);
- il->ops->lib->apm_ops.init(il);
+ il3945_apm_init(il);
spin_unlock_irqrestore(&il->lock, flags);
il3945_set_pwr_vmain(il);
-
- il->ops->lib->apm_ops.config(il);
+ il3945_nic_config(il);
/* Allocate the RX queue, or reset if it is already allocated */
if (!rxq->bd) {
@@ -2641,10 +2640,7 @@ static struct il_lib_ops il3945_lib = {
.txq_init = il3945_hw_tx_queue_init,
.load_ucode = il3945_load_bsm,
.dump_nic_error_log = il3945_dump_nic_error_log,
- .apm_ops = {
- .init = il3945_apm_init,
- .config = il3945_nic_config,
- },
+ .apm_init = il3945_apm_init,
.send_tx_power = il3945_send_tx_power,
.is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
.eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index e113dc5..ebfcfc8 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -199,18 +199,14 @@ il4965_hw_nic_init(struct il_priv *il)
struct il_rx_queue *rxq = &il->rxq;
int ret;
- /* nic_init */
spin_lock_irqsave(&il->lock, flags);
- il->ops->lib->apm_ops.init(il);
-
+ il_apm_init(il);
/* Set interrupt coalescing calibration timer to default (512 usecs) */
il_write8(il, CSR_INT_COALESCING, IL_HOST_INT_CALIB_TIMEOUT_DEF);
-
spin_unlock_irqrestore(&il->lock, flags);
il4965_set_pwr_vmain(il);
-
- il->ops->lib->apm_ops.config(il);
+ il4965_nic_config(il);
/* Allocate the RX queue, or reset if it is already allocated */
if (!rxq->bd) {
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 3ddc31f..e5e5ab2 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -508,7 +508,7 @@ iw4965_is_ht40_channel(__le32 rxon_flags)
chan_mod == CHANNEL_MODE_MIXED);
}
-static void
+void
il4965_nic_config(struct il_priv *il)
{
unsigned long flags;
@@ -1900,10 +1900,7 @@ static struct il_lib_ops il4965_lib = {
.dump_nic_error_log = il4965_dump_nic_error_log,
.dump_fh = il4965_dump_fh,
.set_channel_switch = il4965_hw_channel_switch,
- .apm_ops = {
- .init = il_apm_init,
- .config = il4965_nic_config,
- },
+ .apm_init = il_apm_init,
.send_tx_power = il4965_send_tx_power,
.update_chain_flags = il4965_update_chain_flags,
.eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index 7c6b9b9..208a456 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -60,6 +60,8 @@ int il4965_rx_init(struct il_priv *il, struct il_rx_queue *rxq);
int il4965_hw_nic_init(struct il_priv *il);
int il4965_dump_fh(struct il_priv *il, char **buf, bool display);
+void il4965_nic_config(struct il_priv *il);
+
/* rx */
void il4965_rx_queue_restock(struct il_priv *il);
void il4965_rx_replenish(struct il_priv *il);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 5de2340..6e63d9f 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -730,7 +730,7 @@ il_eeprom_init(struct il_priv *il)
}
e = (__le16 *) il->eeprom;
- il->ops->lib->apm_ops.init(il);
+ il->ops->lib->apm_init(il);
ret = il_eeprom_verify_signature(il);
if (ret < 0) {
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index b588a5f..ca68b58 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1566,11 +1566,6 @@ struct il_hcmd_utils_ops {
void (*post_scan) (struct il_priv *il);
};
-struct il_apm_ops {
- int (*init) (struct il_priv *il);
- void (*config) (struct il_priv *il);
-};
-
#ifdef CONFIG_IWLEGACY_DEBUGFS
struct il_debugfs_ops {
ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf,
@@ -1605,9 +1600,9 @@ struct il_lib_ops {
int (*set_channel_switch) (struct il_priv *il,
struct ieee80211_channel_switch *ch_switch);
/* power management */
- struct il_apm_ops apm_ops;
+ int (*apm_init) (struct il_priv *il);
- /* power */
+ /* tx power */
int (*send_tx_power) (struct il_priv *il);
void (*update_chain_flags) (struct il_priv *il);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 11/24] iwlegacy: merge il_lib_ops into il_ops
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (9 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 10/24] iwlegacy: remove il_apm_ops Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 12/24] iwlegacy: merge all ops structures into one Stanislaw Gruszka
` (12 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 8 +++---
drivers/net/wireless/iwlegacy/3945.c | 29 ++++++++++-------------
drivers/net/wireless/iwlegacy/4965-calib.c | 4 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 23 +++++++++----------
drivers/net/wireless/iwlegacy/4965.c | 19 ++++++---------
drivers/net/wireless/iwlegacy/common.c | 34 ++++++++++++++--------------
drivers/net/wireless/iwlegacy/common.h | 31 +++++++++++--------------
drivers/net/wireless/iwlegacy/debug.c | 4 +-
8 files changed, 71 insertions(+), 81 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index ba01d2d..19a4d56 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -616,7 +616,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* Add buffer containing Tx command and MAC(!) header to TFD's
* first entry */
- il->ops->lib->txq_attach_buf_to_tfd(il, txq, txcmd_phys, len, 1, 0);
+ il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, len, 1, 0);
/* Set up TFD's 2nd entry to point directly to remainder of skb,
* if any (802.11 null frames have no payload). */
@@ -625,8 +625,8 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
phys_addr =
pci_map_single(il->pci_dev, skb->data + hdr_len, len,
PCI_DMA_TODEVICE);
- il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr, len, 0,
- U32_PAD(len));
+ il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, len, 0,
+ U32_PAD(len));
}
/* Tell device the write idx *just past* this latest filled TFD */
@@ -2413,7 +2413,7 @@ __il3945_up(struct il_priv *il)
/* load bootstrap state machine,
* load bootstrap program into processor's memory,
* prepare to load the "initialize" uCode */
- rc = il->ops->lib->load_ucode(il);
+ rc = il->ops->load_ucode(il);
if (rc) {
IL_ERR("Unable to set up bootstrap uCode: %d\n", rc);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index a21ec25..f5833d0 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -303,7 +303,7 @@ il3945_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx)
skb = txq->skbs[txq->q.read_ptr];
ieee80211_tx_status_irqsafe(il->hw, skb);
txq->skbs[txq->q.read_ptr] = NULL;
- il->ops->lib->txq_free_tfd(il, txq);
+ il->ops->txq_free_tfd(il, txq);
}
if (il_queue_space(q) > q->low_mark && txq_id >= 0 &&
@@ -1612,7 +1612,7 @@ il3945_hw_reg_comp_txpower_temp(struct il_priv *il)
}
/* send Txpower command for current channel to ucode */
- return il->ops->lib->send_tx_power(il);
+ return il->ops->send_tx_power(il);
}
int
@@ -2634,19 +2634,6 @@ static struct il_hcmd_ops il3945_hcmd = {
.commit_rxon = il3945_commit_rxon,
};
-static struct il_lib_ops il3945_lib = {
- .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
- .txq_free_tfd = il3945_hw_txq_free_tfd,
- .txq_init = il3945_hw_tx_queue_init,
- .load_ucode = il3945_load_bsm,
- .dump_nic_error_log = il3945_dump_nic_error_log,
- .apm_init = il3945_apm_init,
- .send_tx_power = il3945_send_tx_power,
- .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
- .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
- .eeprom_release_semaphore = il3945_eeprom_release_semaphore,
-};
-
static const struct il_legacy_ops il3945_legacy_ops = {
.post_associate = il3945_post_associate,
.config_ap = il3945_config_ap,
@@ -2661,7 +2648,17 @@ static struct il_hcmd_utils_ops il3945_hcmd_utils = {
};
const struct il_ops il3945_ops = {
- .lib = &il3945_lib,
+ .txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
+ .txq_free_tfd = il3945_hw_txq_free_tfd,
+ .txq_init = il3945_hw_tx_queue_init,
+ .load_ucode = il3945_load_bsm,
+ .dump_nic_error_log = il3945_dump_nic_error_log,
+ .apm_init = il3945_apm_init,
+ .send_tx_power = il3945_send_tx_power,
+ .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
+ .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
+ .eeprom_release_semaphore = il3945_eeprom_release_semaphore,
+
.hcmd = &il3945_hcmd,
.utils = &il3945_hcmd_utils,
.led = &il3945_led_ops,
diff --git a/drivers/net/wireless/iwlegacy/4965-calib.c b/drivers/net/wireless/iwlegacy/4965-calib.c
index fe91715..47c20e3 100644
--- a/drivers/net/wireless/iwlegacy/4965-calib.c
+++ b/drivers/net/wireless/iwlegacy/4965-calib.c
@@ -923,8 +923,8 @@ il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
/* Some power changes may have been made during the calibration.
* Update and commit the RXON
*/
- if (il->ops->lib->update_chain_flags)
- il->ops->lib->update_chain_flags(il);
+ if (il->ops->update_chain_flags)
+ il->ops->update_chain_flags(il);
data->state = IL_CHAIN_NOISE_DONE;
il_power_update_mode(il, false);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index ebfcfc8..cc2963b 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1811,7 +1811,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
dma_unmap_len_set(out_meta, len, firstlen);
/* Add buffer containing Tx command and MAC(!) header to TFD's
* first entry */
- il->ops->lib->txq_attach_buf_to_tfd(il, txq, txcmd_phys, firstlen, 1, 0);
+ il->ops->txq_attach_buf_to_tfd(il, txq, txcmd_phys, firstlen, 1, 0);
if (!ieee80211_has_morefrags(hdr->frame_control)) {
txq->need_update = 1;
@@ -1827,8 +1827,8 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
phys_addr =
pci_map_single(il->pci_dev, skb->data + hdr_len, secondlen,
PCI_DMA_TODEVICE);
- il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr,
- secondlen, 0, 0);
+ il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, secondlen,
+ 0, 0);
}
scratch_phys =
@@ -1848,8 +1848,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* Set up entry for this TFD in Tx byte-count array */
if (info->flags & IEEE80211_TX_CTL_AMPDU)
- il->ops->lib->txq_update_byte_cnt_tbl(il, txq,
- le16_to_cpu(tx_cmd->len));
+ il->ops->txq_update_byte_cnt_tbl(il, txq, le16_to_cpu(tx_cmd->len));
pci_dma_sync_single_for_device(il->pci_dev, txcmd_phys, firstlen,
PCI_DMA_BIDIRECTIONAL);
@@ -2470,7 +2469,7 @@ il4965_tx_queue_reclaim(struct il_priv *il, int txq_id, int idx)
il4965_tx_status(il, skb, txq_id >= IL4965_FIRST_AMPDU_QUEUE);
txq->skbs[txq->q.read_ptr] = NULL;
- il->ops->lib->txq_free_tfd(il, txq);
+ il->ops->txq_free_tfd(il, txq);
}
return nfreed;
}
@@ -5072,7 +5071,7 @@ il4965_dump_nic_error_log(struct il_priv *il)
else
base = le32_to_cpu(il->card_alive.error_event_table_ptr);
- if (!il->ops->lib->is_valid_rtc_data_addr(base)) {
+ if (!il->ops->is_valid_rtc_data_addr(base)) {
IL_ERR("Not valid error log pointer 0x%08X for %s uCode\n",
base, (il->ucode_type == UCODE_INIT) ? "Init" : "RT");
return;
@@ -5574,7 +5573,7 @@ __il4965_up(struct il_priv *il)
/* load bootstrap state machine,
* load bootstrap program into processor's memory,
* prepare to load the "initialize" uCode */
- ret = il->ops->lib->load_ucode(il);
+ ret = il->ops->load_ucode(il);
if (ret) {
IL_ERR("Unable to set up bootstrap uCode: %d\n", ret);
@@ -5615,7 +5614,7 @@ il4965_bg_init_alive_start(struct work_struct *data)
if (test_bit(S_EXIT_PENDING, &il->status))
goto out;
- il->ops->lib->init_alive_start(il);
+ il->ops->init_alive_start(il);
out:
mutex_unlock(&il->mutex);
}
@@ -6047,7 +6046,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
if (!il_is_associated(il))
goto out;
- if (!il->ops->lib->set_channel_switch)
+ if (!il->ops->set_channel_switch)
goto out;
ch = channel->hw_value;
@@ -6099,7 +6098,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
*/
set_bit(S_CHANNEL_SWITCH_PENDING, &il->status);
il->switch_channel = cpu_to_le16(ch);
- if (il->ops->lib->set_channel_switch(il, ch_switch)) {
+ if (il->ops->set_channel_switch(il, ch_switch)) {
clear_bit(S_CHANNEL_SWITCH_PENDING, &il->status);
il->switch_channel = 0;
ieee80211_chswitch_done(il->vif, false);
@@ -6182,7 +6181,7 @@ il4965_bg_txpower_work(struct work_struct *work)
/* Regardless of if we are associated, we must reconfigure the
* TX power since frames can be sent on non-radar channels while
* not associated */
- il->ops->lib->send_tx_power(il);
+ il->ops->send_tx_power(il);
/* Update last_temperature to keep is_calib_needed from running
* when it isn't needed... */
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index e5e5ab2..805a4ea 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -1889,7 +1889,14 @@ static struct il_hcmd_utils_ops il4965_hcmd_utils = {
.post_scan = il4965_post_scan,
};
-static struct il_lib_ops il4965_lib = {
+static const struct il_legacy_ops il4965_legacy_ops = {
+ .post_associate = il4965_post_associate,
+ .config_ap = il4965_config_ap,
+ .manage_ibss_station = il4965_manage_ibss_station,
+ .update_bcast_stations = il4965_update_bcast_stations,
+};
+
+const struct il_ops il4965_ops = {
.txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl,
.txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd,
.txq_free_tfd = il4965_hw_txq_free_tfd,
@@ -1905,17 +1912,7 @@ static struct il_lib_ops il4965_lib = {
.update_chain_flags = il4965_update_chain_flags,
.eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
.eeprom_release_semaphore = il4965_eeprom_release_semaphore,
-};
-static const struct il_legacy_ops il4965_legacy_ops = {
- .post_associate = il4965_post_associate,
- .config_ap = il4965_config_ap,
- .manage_ibss_station = il4965_manage_ibss_station,
- .update_bcast_stations = il4965_update_bcast_stations,
-};
-
-const struct il_ops il4965_ops = {
- .lib = &il4965_lib,
.hcmd = &il4965_hcmd,
.utils = &il4965_hcmd_utils,
.led = &il4965_led_ops,
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 6e63d9f..d522a43 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -730,7 +730,7 @@ il_eeprom_init(struct il_priv *il)
}
e = (__le16 *) il->eeprom;
- il->ops->lib->apm_init(il);
+ il->ops->apm_init(il);
ret = il_eeprom_verify_signature(il);
if (ret < 0) {
@@ -740,7 +740,7 @@ il_eeprom_init(struct il_priv *il)
}
/* Make sure driver (instead of uCode) is allowed to read EEPROM */
- ret = il->ops->lib->eeprom_acquire_semaphore(il);
+ ret = il->ops->eeprom_acquire_semaphore(il);
if (ret < 0) {
IL_ERR("Failed to acquire EEPROM semaphore.\n");
ret = -ENOENT;
@@ -772,7 +772,7 @@ il_eeprom_init(struct il_priv *il)
ret = 0;
done:
- il->ops->lib->eeprom_release_semaphore(il);
+ il->ops->eeprom_release_semaphore(il);
err:
if (ret)
@@ -1155,9 +1155,9 @@ il_power_set_mode(struct il_priv *il, struct il_powertable_cmd *cmd, bool force)
if (!(cmd->flags & IL_POWER_DRIVER_ALLOW_SLEEP_MSK))
clear_bit(S_POWER_PMI, &il->status);
- if (il->ops->lib->update_chain_flags && update_chains)
- il->ops->lib->update_chain_flags(il);
- else if (il->ops->lib->update_chain_flags)
+ if (il->ops->update_chain_flags && update_chains)
+ il->ops->update_chain_flags(il);
+ else if (il->ops->update_chain_flags)
D_POWER("Cannot update the power, chain noise "
"calibration running: %d\n",
il->chain_noise_data.state);
@@ -2719,7 +2719,7 @@ il_tx_queue_unmap(struct il_priv *il, int txq_id)
return;
while (q->write_ptr != q->read_ptr) {
- il->ops->lib->txq_free_tfd(il, txq);
+ il->ops->txq_free_tfd(il, txq);
q->read_ptr = il_queue_inc_wrap(q->read_ptr, q->n_bd);
}
}
@@ -3019,7 +3019,7 @@ il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
/* Tell device where to find queue */
- il->ops->lib->txq_init(il, txq);
+ il->ops->txq_init(il, txq);
return 0;
err:
@@ -3050,7 +3050,7 @@ il_tx_queue_reset(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
/* Tell device where to find queue */
- il->ops->lib->txq_init(il, txq);
+ il->ops->txq_init(il, txq);
}
EXPORT_SYMBOL(il_tx_queue_reset);
@@ -3157,9 +3157,9 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
#endif
txq->need_update = 1;
- if (il->ops->lib->txq_update_byte_cnt_tbl)
+ if (il->ops->txq_update_byte_cnt_tbl)
/* Set up entry in queue's byte count circular buffer */
- il->ops->lib->txq_update_byte_cnt_tbl(il, txq, 0);
+ il->ops->txq_update_byte_cnt_tbl(il, txq, 0);
phys_addr =
pci_map_single(il->pci_dev, &out_cmd->hdr, fix_size,
@@ -3167,7 +3167,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
dma_unmap_addr_set(out_meta, mapping, phys_addr);
dma_unmap_len_set(out_meta, len, fix_size);
- il->ops->lib->txq_attach_buf_to_tfd(il, txq, phys_addr, fix_size, 1,
+ il->ops->txq_attach_buf_to_tfd(il, txq, phys_addr, fix_size, 1,
U32_PAD(cmd->len));
/* Increment and update queue's write idx */
@@ -4101,9 +4101,9 @@ il_irq_handle_error(struct il_priv *il)
IL_ERR("Loaded firmware version: %s\n", il->hw->wiphy->fw_version);
- il->ops->lib->dump_nic_error_log(il);
- if (il->ops->lib->dump_fh)
- il->ops->lib->dump_fh(il, NULL, false);
+ il->ops->dump_nic_error_log(il);
+ if (il->ops->dump_fh)
+ il->ops->dump_fh(il, NULL, false);
#ifdef CONFIG_IWLEGACY_DEBUG
if (il_get_debug_level(il) & IL_DL_FW_ERRORS)
il_print_rx_config_cmd(il);
@@ -4290,7 +4290,7 @@ il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
if (il->tx_power_user_lmt == tx_power && !force)
return 0;
- if (!il->ops->lib->send_tx_power)
+ if (!il->ops->send_tx_power)
return -EOPNOTSUPP;
/* 0 dBm mean 1 milliwatt */
@@ -4323,7 +4323,7 @@ il_set_tx_power(struct il_priv *il, s8 tx_power, bool force)
prev_tx_power = il->tx_power_user_lmt;
il->tx_power_user_lmt = tx_power;
- ret = il->ops->lib->send_tx_power(il);
+ ret = il->ops->send_tx_power(il);
/* if fail to set tx_power, restore the orig. tx power */
if (ret) {
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index ca68b58..91624ee 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1578,7 +1578,20 @@ struct il_debugfs_ops {
};
#endif
-struct il_lib_ops {
+struct il_led_ops {
+ int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
+};
+
+struct il_legacy_ops {
+ void (*post_associate) (struct il_priv *il);
+ void (*config_ap) (struct il_priv *il);
+ /* station management */
+ int (*update_bcast_stations) (struct il_priv *il);
+ int (*manage_ibss_station) (struct il_priv *il,
+ struct ieee80211_vif *vif, bool add);
+};
+
+struct il_ops {
/* Handling TX */
void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
struct il_tx_queue *txq,
@@ -1609,23 +1622,7 @@ struct il_lib_ops {
/* eeprom operations */
int (*eeprom_acquire_semaphore) (struct il_priv *il);
void (*eeprom_release_semaphore) (struct il_priv *il);
-};
-struct il_led_ops {
- int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
-};
-
-struct il_legacy_ops {
- void (*post_associate) (struct il_priv *il);
- void (*config_ap) (struct il_priv *il);
- /* station management */
- int (*update_bcast_stations) (struct il_priv *il);
- int (*manage_ibss_station) (struct il_priv *il,
- struct ieee80211_vif *vif, bool add);
-};
-
-struct il_ops {
- const struct il_lib_ops *lib;
const struct il_hcmd_ops *hcmd;
const struct il_hcmd_utils_ops *utils;
const struct il_led_ops *led;
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index 5091db8..be6005d 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -1178,8 +1178,8 @@ il_dbgfs_fh_reg_read(struct file *file, char __user *user_buf, size_t count,
int pos = 0;
ssize_t ret = -EFAULT;
- if (il->ops->lib->dump_fh) {
- ret = pos = il->ops->lib->dump_fh(il, &buf, true);
+ if (il->ops->dump_fh) {
+ ret = pos = il->ops->dump_fh(il, &buf, true);
if (buf) {
ret =
simple_read_from_buffer(user_buf, count, ppos, buf,
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 12/24] iwlegacy: merge all ops structures into one
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (10 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 11/24] iwlegacy: merge il_lib_ops into il_ops Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 13/24] iwlegacy: get rid of tx/rx traffic log Stanislaw Gruszka
` (11 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945.c | 39 +++++++---------------
drivers/net/wireless/iwlegacy/4965-mac.c | 17 ++++-----
drivers/net/wireless/iwlegacy/4965.c | 51 +++++++++++------------------
drivers/net/wireless/iwlegacy/common.c | 50 +++++++++++------------------
drivers/net/wireless/iwlegacy/common.h | 52 +++++++++++-------------------
5 files changed, 78 insertions(+), 131 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index f5833d0..fde6979 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -57,10 +57,6 @@ il3945_send_led_cmd(struct il_priv *il, struct il_led_cmd *led_cmd)
return il_send_cmd(il, &cmd);
}
-const struct il_led_ops il3945_led_ops = {
- .cmd = il3945_send_led_cmd,
-};
-
#define IL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
[RATE_##r##M_IDX] = { RATE_##r##M_PLCP, \
RATE_##r##M_IEEE, \
@@ -2629,24 +2625,6 @@ il3945_load_bsm(struct il_priv *il)
return 0;
}
-static struct il_hcmd_ops il3945_hcmd = {
- .rxon_assoc = il3945_send_rxon_assoc,
- .commit_rxon = il3945_commit_rxon,
-};
-
-static const struct il_legacy_ops il3945_legacy_ops = {
- .post_associate = il3945_post_associate,
- .config_ap = il3945_config_ap,
- .manage_ibss_station = il3945_manage_ibss_station,
-};
-
-static struct il_hcmd_utils_ops il3945_hcmd_utils = {
- .get_hcmd_size = il3945_get_hcmd_size,
- .build_addsta_hcmd = il3945_build_addsta_hcmd,
- .request_scan = il3945_request_scan,
- .post_scan = il3945_post_scan,
-};
-
const struct il_ops il3945_ops = {
.txq_attach_buf_to_tfd = il3945_hw_txq_attach_buf_to_tfd,
.txq_free_tfd = il3945_hw_txq_free_tfd,
@@ -2659,10 +2637,19 @@ const struct il_ops il3945_ops = {
.eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
.eeprom_release_semaphore = il3945_eeprom_release_semaphore,
- .hcmd = &il3945_hcmd,
- .utils = &il3945_hcmd_utils,
- .led = &il3945_led_ops,
- .legacy = &il3945_legacy_ops,
+ .rxon_assoc = il3945_send_rxon_assoc,
+ .commit_rxon = il3945_commit_rxon,
+
+ .get_hcmd_size = il3945_get_hcmd_size,
+ .build_addsta_hcmd = il3945_build_addsta_hcmd,
+ .request_scan = il3945_request_scan,
+ .post_scan = il3945_post_scan,
+
+ .post_associate = il3945_post_associate,
+ .config_ap = il3945_config_ap,
+ .manage_ibss_station = il3945_manage_ibss_station,
+
+ .send_led_cmd = il3945_send_led_cmd,
};
static struct il_cfg il3945_bg_cfg = {
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index cc2963b..89275bf 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -3649,8 +3649,8 @@ il4965_sta_modify_sleep_tx_count(struct il_priv *il, int sta_id, int cnt)
void
il4965_update_chain_flags(struct il_priv *il)
{
- if (il->ops->hcmd->set_rxon_chain) {
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain) {
+ il->ops->set_rxon_chain(il);
if (il->active.rx_chain != il->staging.rx_chain)
il_commit_rxon(il);
}
@@ -4399,9 +4399,8 @@ il4965_irq_tasklet(struct il_priv *il)
/* HW RF KILL switch toggled */
if (inta & CSR_INT_BIT_RF_KILL) {
int hw_rf_kill = 0;
- if (!
- (_il_rd(il, CSR_GP_CNTRL) &
- CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
+
+ if (!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW))
hw_rf_kill = 1;
IL_WARN("RF_KILL bit toggled to %s.\n",
@@ -5300,8 +5299,8 @@ il4965_alive_start(struct il_priv *il)
/* Initialize our rx_config data */
il_connection_init_rx_config(il);
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
}
/* Configure bluetooth coexistence if enabled */
@@ -6333,8 +6332,8 @@ il4965_init_drv(struct il_priv *il)
il->force_reset.reset_duration = IL_DELAY_NEXT_FORCE_FW_RELOAD;
/* Choose which receivers/antennas to use */
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
il_init_scan_params(il);
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 805a4ea..5db1171 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -264,10 +264,6 @@ il4965_led_enable(struct il_priv *il)
_il_wr(il, CSR_LED_REG, CSR_LED_REG_TRUN_ON);
}
-const struct il_led_ops il4965_led_ops = {
- .cmd = il4965_send_led_cmd,
-};
-
static int il4965_send_tx_power(struct il_priv *il);
static int il4965_hw_get_temperature(struct il_priv *il);
@@ -1737,12 +1733,6 @@ il4965_build_addsta_hcmd(const struct il_addsta_cmd *cmd, u8 * data)
return (u16) sizeof(struct il4965_addsta_cmd);
}
-static struct il_hcmd_ops il4965_hcmd = {
- .rxon_assoc = il4965_send_rxon_assoc,
- .commit_rxon = il4965_commit_rxon,
- .set_rxon_chain = il4965_set_rxon_chain,
-};
-
static void
il4965_post_scan(struct il_priv *il)
{
@@ -1782,8 +1772,8 @@ il4965_post_associate(struct il_priv *il)
il_set_rxon_ht(il, &il->current_ht_config);
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
il->staging.assoc_id = cpu_to_le16(vif->bss_conf.aid);
@@ -1857,8 +1847,8 @@ il4965_config_ap(struct il_priv *il)
/* AP has all antennas */
il->chain_noise_data.active_chains = il->hw_params.valid_rx_ant;
il_set_rxon_ht(il, &il->current_ht_config);
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
il->staging.assoc_id = 0;
@@ -1882,20 +1872,6 @@ il4965_config_ap(struct il_priv *il)
il4965_send_beacon_cmd(il);
}
-static struct il_hcmd_utils_ops il4965_hcmd_utils = {
- .get_hcmd_size = il4965_get_hcmd_size,
- .build_addsta_hcmd = il4965_build_addsta_hcmd,
- .request_scan = il4965_request_scan,
- .post_scan = il4965_post_scan,
-};
-
-static const struct il_legacy_ops il4965_legacy_ops = {
- .post_associate = il4965_post_associate,
- .config_ap = il4965_config_ap,
- .manage_ibss_station = il4965_manage_ibss_station,
- .update_bcast_stations = il4965_update_bcast_stations,
-};
-
const struct il_ops il4965_ops = {
.txq_update_byte_cnt_tbl = il4965_txq_update_byte_cnt_tbl,
.txq_attach_buf_to_tfd = il4965_hw_txq_attach_buf_to_tfd,
@@ -1913,10 +1889,21 @@ const struct il_ops il4965_ops = {
.eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
.eeprom_release_semaphore = il4965_eeprom_release_semaphore,
- .hcmd = &il4965_hcmd,
- .utils = &il4965_hcmd_utils,
- .led = &il4965_led_ops,
- .legacy = &il4965_legacy_ops,
+ .rxon_assoc = il4965_send_rxon_assoc,
+ .commit_rxon = il4965_commit_rxon,
+ .set_rxon_chain = il4965_set_rxon_chain,
+
+ .get_hcmd_size = il4965_get_hcmd_size,
+ .build_addsta_hcmd = il4965_build_addsta_hcmd,
+ .request_scan = il4965_request_scan,
+ .post_scan = il4965_post_scan,
+
+ .post_associate = il4965_post_associate,
+ .config_ap = il4965_config_ap,
+ .manage_ibss_station = il4965_manage_ibss_station,
+ .update_bcast_stations = il4965_update_bcast_stations,
+
+ .send_led_cmd = il4965_send_led_cmd,
};
struct il_cfg il4965_cfg = {
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index d522a43..1bf8616 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -519,7 +519,7 @@ il_led_cmd(struct il_priv *il, unsigned long on, unsigned long off)
il_blink_compensation(il, off,
il->cfg->led_compensation);
- ret = il->ops->led->cmd(il, &led_cmd);
+ ret = il->ops->send_led_cmd(il, &led_cmd);
if (!ret) {
il->blink_on = on;
il->blink_off = off;
@@ -1482,9 +1482,6 @@ il_scan_initiate(struct il_priv *il, struct ieee80211_vif *vif)
lockdep_assert_held(&il->mutex);
- if (WARN_ON(!il->ops->utils->request_scan))
- return -EOPNOTSUPP;
-
cancel_delayed_work(&il->scan_check);
if (!il_is_ready_rf(il)) {
@@ -1507,7 +1504,7 @@ il_scan_initiate(struct il_priv *il, struct ieee80211_vif *vif)
set_bit(S_SCANNING, &il->status);
il->scan_start = jiffies;
- ret = il->ops->utils->request_scan(il, vif);
+ ret = il->ops->request_scan(il, vif);
if (ret) {
clear_bit(S_SCANNING, &il->status);
return ret;
@@ -1669,7 +1666,7 @@ out_settings:
il_power_set_mode(il, &il->power_data.sleep_cmd_next, false);
il_set_tx_power(il, il->tx_power_next, false);
- il->ops->utils->post_scan(il);
+ il->ops->post_scan(il);
out:
mutex_unlock(&il->mutex);
@@ -1811,7 +1808,7 @@ il_send_add_sta(struct il_priv *il, struct il_addsta_cmd *sta, u8 flags)
might_sleep();
}
- cmd.len = il->ops->utils->build_addsta_hcmd(sta, data);
+ cmd.len = il->ops->build_addsta_hcmd(sta, data);
ret = il_send_cmd(il, &cmd);
if (ret || (flags & CMD_ASYNC))
@@ -3078,7 +3075,7 @@ il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd)
u32 idx;
u16 fix_size;
- cmd->len = il->ops->utils->get_hcmd_size(cmd->id, cmd->len);
+ cmd->len = il->ops->get_hcmd_size(cmd->id, cmd->len);
fix_size = (u16) (cmd->len + sizeof(out_cmd->hdr));
/* If any of the command structures end up being larger than
@@ -3842,8 +3839,8 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf)
rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY;
}
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
D_ASSOC("rxon flags 0x%X operation mode :0x%X "
"extension channel offset 0x%x\n", le32_to_cpu(rxon->flags),
@@ -4472,8 +4469,8 @@ il_set_mode(struct il_priv *il)
{
il_connection_init_rx_config(il);
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
return il_commit_rxon(il);
}
@@ -5171,9 +5168,6 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
int scan_active = 0;
bool ht_changed = false;
- if (WARN_ON(!il->ops->legacy))
- return -EOPNOTSUPP;
-
mutex_lock(&il->mutex);
D_MAC80211("enter to channel %d changed 0x%X\n", channel->hw_value,
@@ -5196,8 +5190,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
* set up the SM PS mode to OFF if an HT channel is
* configured.
*/
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
}
/* during scanning mac80211 will delay channel setting until
@@ -5266,8 +5260,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
spin_unlock_irqrestore(&il->lock, flags);
- if (il->ops->legacy->update_bcast_stations)
- ret = il->ops->legacy->update_bcast_stations(il);
+ if (il->ops->update_bcast_stations)
+ ret = il->ops->update_bcast_stations(il);
set_ch_out:
/* The list of supported rates and rate mask can be different
@@ -5317,9 +5311,6 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct il_priv *il = hw->priv;
unsigned long flags;
- if (WARN_ON(!il->ops->legacy))
- return;
-
mutex_lock(&il->mutex);
D_MAC80211("enter\n");
@@ -5472,7 +5463,7 @@ il_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
return;
}
- il->ops->legacy->post_associate(il);
+ il->ops->post_associate(il);
}
void
@@ -5482,9 +5473,6 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct il_priv *il = hw->priv;
int ret;
- if (WARN_ON(!il->ops->legacy))
- return;
-
D_MAC80211("changes = 0x%X\n", changes);
mutex_lock(&il->mutex);
@@ -5587,8 +5575,8 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (changes & BSS_CHANGED_HT) {
il_ht_conf(il, vif);
- if (il->ops->hcmd->set_rxon_chain)
- il->ops->hcmd->set_rxon_chain(il);
+ if (il->ops->set_rxon_chain)
+ il->ops->set_rxon_chain(il);
}
if (changes & BSS_CHANGED_ASSOC) {
@@ -5597,7 +5585,7 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
il->timestamp = bss_conf->timestamp;
if (!il_is_rfkill(il))
- il->ops->legacy->post_associate(il);
+ il->ops->post_associate(il);
} else
il_set_no_assoc(il, vif);
}
@@ -5617,14 +5605,14 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
memcpy(il->staging.bssid_addr, bss_conf->bssid,
ETH_ALEN);
memcpy(il->bssid, bss_conf->bssid, ETH_ALEN);
- il->ops->legacy->config_ap(il);
+ il->ops->config_ap(il);
} else
il_set_no_assoc(il, vif);
}
if (changes & BSS_CHANGED_IBSS) {
ret =
- il->ops->legacy->manage_ibss_station(il, vif,
+ il->ops->manage_ibss_station(il, vif,
bss_conf->ibss_joined);
if (ret)
IL_ERR("failed to %s IBSS station %pM\n",
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 91624ee..873182e 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1553,19 +1553,6 @@ il_free_pages(struct il_priv *il, unsigned long page)
#define IL_RX_BUF_SIZE_4K (4 * 1024)
#define IL_RX_BUF_SIZE_8K (8 * 1024)
-struct il_hcmd_ops {
- int (*rxon_assoc) (struct il_priv *il);
- int (*commit_rxon) (struct il_priv *il);
- void (*set_rxon_chain) (struct il_priv *il);
-};
-
-struct il_hcmd_utils_ops {
- u16(*get_hcmd_size) (u8 cmd_id, u16 len);
- u16(*build_addsta_hcmd) (const struct il_addsta_cmd *cmd, u8 *data);
- int (*request_scan) (struct il_priv *il, struct ieee80211_vif *vif);
- void (*post_scan) (struct il_priv *il);
-};
-
#ifdef CONFIG_IWLEGACY_DEBUGFS
struct il_debugfs_ops {
ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf,
@@ -1578,19 +1565,6 @@ struct il_debugfs_ops {
};
#endif
-struct il_led_ops {
- int (*cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
-};
-
-struct il_legacy_ops {
- void (*post_associate) (struct il_priv *il);
- void (*config_ap) (struct il_priv *il);
- /* station management */
- int (*update_bcast_stations) (struct il_priv *il);
- int (*manage_ibss_station) (struct il_priv *il,
- struct ieee80211_vif *vif, bool add);
-};
-
struct il_ops {
/* Handling TX */
void (*txq_update_byte_cnt_tbl) (struct il_priv *il,
@@ -1623,11 +1597,23 @@ struct il_ops {
int (*eeprom_acquire_semaphore) (struct il_priv *il);
void (*eeprom_release_semaphore) (struct il_priv *il);
- const struct il_hcmd_ops *hcmd;
- const struct il_hcmd_utils_ops *utils;
- const struct il_led_ops *led;
- const struct il_nic_ops *nic;
- const struct il_legacy_ops *legacy;
+ int (*rxon_assoc) (struct il_priv *il);
+ int (*commit_rxon) (struct il_priv *il);
+ void (*set_rxon_chain) (struct il_priv *il);
+
+ u16(*get_hcmd_size) (u8 cmd_id, u16 len);
+ u16(*build_addsta_hcmd) (const struct il_addsta_cmd *cmd, u8 *data);
+
+ int (*request_scan) (struct il_priv *il, struct ieee80211_vif *vif);
+ void (*post_scan) (struct il_priv *il);
+ void (*post_associate) (struct il_priv *il);
+ void (*config_ap) (struct il_priv *il);
+ /* station management */
+ int (*update_bcast_stations) (struct il_priv *il);
+ int (*manage_ibss_station) (struct il_priv *il,
+ struct ieee80211_vif *vif, bool add);
+
+ int (*send_led_cmd) (struct il_priv *il, struct il_led_cmd *led_cmd);
};
struct il_mod_params {
@@ -2053,13 +2039,13 @@ int il_send_rxon_timing(struct il_priv *il);
static inline int
il_send_rxon_assoc(struct il_priv *il)
{
- return il->ops->hcmd->rxon_assoc(il);
+ return il->ops->rxon_assoc(il);
}
static inline int
il_commit_rxon(struct il_priv *il)
{
- return il->ops->hcmd->commit_rxon(il);
+ return il->ops->commit_rxon(il);
}
static inline const struct ieee80211_supported_band *
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 13/24] iwlegacy: get rid of tx/rx traffic log
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (11 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 12/24] iwlegacy: merge all ops structures into one Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 14/24] iwlegacy: improve mac operation debuggability a bit Stanislaw Gruszka
` (10 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
The same data can be gathered using monitor mode.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 12 +--
drivers/net/wireless/iwlegacy/3945.c | 2 -
drivers/net/wireless/iwlegacy/4965-mac.c | 13 +--
drivers/net/wireless/iwlegacy/common.c | 247 ------------------------------
drivers/net/wireless/iwlegacy/common.h | 51 +------
drivers/net/wireless/iwlegacy/debug.c | 243 ++++++++++++++++-------------
6 files changed, 145 insertions(+), 423 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 19a4d56..1743acc 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -573,7 +573,6 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
len = (u16) skb->len;
tx_cmd->len = cpu_to_le16(len);
- il_dbg_log_tx_data_frame(il, len, hdr);
il_update_stats(il, true, fc, len);
tx_cmd->tx_flags &= ~TX_CMD_FLG_ANT_A_MSK;
tx_cmd->tx_flags &= ~TX_CMD_FLG_ANT_B_MSK;
@@ -3098,11 +3097,9 @@ il3945_store_debug_level(struct device *d, struct device_attribute *attr,
ret = strict_strtoul(buf, 0, &val);
if (ret)
IL_INFO("%s is not in hex or decimal form.\n", buf);
- else {
+ else
il->debug_level = val;
- if (il_alloc_traffic_mem(il))
- IL_ERR("Not enough memory to generate traffic log\n");
- }
+
return strnlen(buf, count);
}
@@ -3625,9 +3622,6 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
il->pci_dev = pdev;
il->inta_mask = CSR_INI_SET_MASK;
- if (il_alloc_traffic_mem(il))
- IL_ERR("Not enough memory to generate traffic log\n");
-
/***************************
* 2. Initializing PCI bus
* *************************/
@@ -3790,7 +3784,6 @@ out_pci_disable_device:
pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev);
out_ieee80211_free_hw:
- il_free_traffic_mem(il);
ieee80211_free_hw(il->hw);
out:
return err;
@@ -3858,7 +3851,6 @@ il3945_pci_remove(struct pci_dev *pdev)
* until now... */
destroy_workqueue(il->workqueue);
il->workqueue = NULL;
- il_free_traffic_mem(il);
free_irq(pdev->irq, il);
pci_disable_msi(pdev);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index fde6979..95ebd43 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -573,8 +573,6 @@ il3945_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)
network_packet ? '*' : ' ', le16_to_cpu(rx_hdr->channel),
rx_status.signal, rx_status.signal, rx_status.rate_idx);
- il_dbg_log_rx_data_frame(il, le16_to_cpu(rx_hdr->len), header);
-
if (network_packet) {
il->_3945.last_beacon_time =
le32_to_cpu(rx_end->beacon_timestamp);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 89275bf..b251d34 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -688,7 +688,6 @@ il4965_hdl_rx(struct il_priv *il, struct il_rx_buf *rxb)
/* Find max signal strength (dBm) among 3 antenna/receiver chains */
rx_status.signal = il4965_calc_rssi(il, phy_res);
- il_dbg_log_rx_data_frame(il, len, header);
D_STATS("Rssi %d, TSF %llu\n", rx_status.signal,
(unsigned long long)rx_status.mactime);
@@ -1781,7 +1780,6 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
/* TODO need this for burst mode later on */
il4965_tx_cmd_build_basic(il, skb, tx_cmd, info, hdr, sta_id);
- il_dbg_log_tx_data_frame(il, len, hdr);
il4965_tx_cmd_build_rate(il, tx_cmd, info, fc);
@@ -4541,11 +4539,9 @@ il4965_store_debug_level(struct device *d, struct device_attribute *attr,
ret = strict_strtoul(buf, 0, &val);
if (ret)
IL_ERR("%s is not in hex or decimal form.\n", buf);
- else {
+ else
il->debug_level = val;
- if (il_alloc_traffic_mem(il))
- IL_ERR("Not enough memory to generate traffic log\n");
- }
+
return strnlen(buf, count);
}
@@ -6483,9 +6479,6 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
il->pci_dev = pdev;
il->inta_mask = CSR_INI_SET_MASK;
- if (il_alloc_traffic_mem(il))
- IL_ERR("Not enough memory to generate traffic log\n");
-
/**************************
* 2. Initializing PCI bus
**************************/
@@ -6663,7 +6656,6 @@ out_pci_release_regions:
out_pci_disable_device:
pci_disable_device(pdev);
out_ieee80211_free_hw:
- il_free_traffic_mem(il);
ieee80211_free_hw(il->hw);
out:
return err;
@@ -6734,7 +6726,6 @@ il4965_pci_remove(struct pci_dev *pdev)
* until now... */
destroy_workqueue(il->workqueue);
il->workqueue = NULL;
- il_free_traffic_mem(il);
free_irq(il->pci_dev->irq, il);
pci_disable_msi(il->pci_dev);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 1bf8616..21b355a 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4574,253 +4574,6 @@ il_txq_mem(struct il_priv *il)
}
EXPORT_SYMBOL(il_txq_mem);
-#ifdef CONFIG_IWLEGACY_DEBUGFS
-
-#define IL_TRAFFIC_DUMP_SIZE (IL_TRAFFIC_ENTRY_SIZE * IL_TRAFFIC_ENTRIES)
-
-void
-il_reset_traffic_log(struct il_priv *il)
-{
- il->tx_traffic_idx = 0;
- il->rx_traffic_idx = 0;
- if (il->tx_traffic)
- memset(il->tx_traffic, 0, IL_TRAFFIC_DUMP_SIZE);
- if (il->rx_traffic)
- memset(il->rx_traffic, 0, IL_TRAFFIC_DUMP_SIZE);
-}
-
-int
-il_alloc_traffic_mem(struct il_priv *il)
-{
- u32 traffic_size = IL_TRAFFIC_DUMP_SIZE;
-
- if (il_debug_level & IL_DL_TX) {
- if (!il->tx_traffic) {
- il->tx_traffic = kzalloc(traffic_size, GFP_KERNEL);
- if (!il->tx_traffic)
- return -ENOMEM;
- }
- }
- if (il_debug_level & IL_DL_RX) {
- if (!il->rx_traffic) {
- il->rx_traffic = kzalloc(traffic_size, GFP_KERNEL);
- if (!il->rx_traffic)
- return -ENOMEM;
- }
- }
- il_reset_traffic_log(il);
- return 0;
-}
-EXPORT_SYMBOL(il_alloc_traffic_mem);
-
-void
-il_free_traffic_mem(struct il_priv *il)
-{
- kfree(il->tx_traffic);
- il->tx_traffic = NULL;
-
- kfree(il->rx_traffic);
- il->rx_traffic = NULL;
-}
-EXPORT_SYMBOL(il_free_traffic_mem);
-
-void
-il_dbg_log_tx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header)
-{
- __le16 fc;
- u16 len;
-
- if (likely(!(il_debug_level & IL_DL_TX)))
- return;
-
- if (!il->tx_traffic)
- return;
-
- fc = header->frame_control;
- if (ieee80211_is_data(fc)) {
- len =
- (length >
- IL_TRAFFIC_ENTRY_SIZE) ? IL_TRAFFIC_ENTRY_SIZE : length;
- memcpy((il->tx_traffic +
- (il->tx_traffic_idx * IL_TRAFFIC_ENTRY_SIZE)), header,
- len);
- il->tx_traffic_idx =
- (il->tx_traffic_idx + 1) % IL_TRAFFIC_ENTRIES;
- }
-}
-EXPORT_SYMBOL(il_dbg_log_tx_data_frame);
-
-void
-il_dbg_log_rx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header)
-{
- __le16 fc;
- u16 len;
-
- if (likely(!(il_debug_level & IL_DL_RX)))
- return;
-
- if (!il->rx_traffic)
- return;
-
- fc = header->frame_control;
- if (ieee80211_is_data(fc)) {
- len =
- (length >
- IL_TRAFFIC_ENTRY_SIZE) ? IL_TRAFFIC_ENTRY_SIZE : length;
- memcpy((il->rx_traffic +
- (il->rx_traffic_idx * IL_TRAFFIC_ENTRY_SIZE)), header,
- len);
- il->rx_traffic_idx =
- (il->rx_traffic_idx + 1) % IL_TRAFFIC_ENTRIES;
- }
-}
-EXPORT_SYMBOL(il_dbg_log_rx_data_frame);
-
-const char *
-il_get_mgmt_string(int cmd)
-{
- switch (cmd) {
- IL_CMD(MANAGEMENT_ASSOC_REQ);
- IL_CMD(MANAGEMENT_ASSOC_RESP);
- IL_CMD(MANAGEMENT_REASSOC_REQ);
- IL_CMD(MANAGEMENT_REASSOC_RESP);
- IL_CMD(MANAGEMENT_PROBE_REQ);
- IL_CMD(MANAGEMENT_PROBE_RESP);
- IL_CMD(MANAGEMENT_BEACON);
- IL_CMD(MANAGEMENT_ATIM);
- IL_CMD(MANAGEMENT_DISASSOC);
- IL_CMD(MANAGEMENT_AUTH);
- IL_CMD(MANAGEMENT_DEAUTH);
- IL_CMD(MANAGEMENT_ACTION);
- default:
- return "UNKNOWN";
-
- }
-}
-
-const char *
-il_get_ctrl_string(int cmd)
-{
- switch (cmd) {
- IL_CMD(CONTROL_BACK_REQ);
- IL_CMD(CONTROL_BACK);
- IL_CMD(CONTROL_PSPOLL);
- IL_CMD(CONTROL_RTS);
- IL_CMD(CONTROL_CTS);
- IL_CMD(CONTROL_ACK);
- IL_CMD(CONTROL_CFEND);
- IL_CMD(CONTROL_CFENDACK);
- default:
- return "UNKNOWN";
-
- }
-}
-
-void
-il_clear_traffic_stats(struct il_priv *il)
-{
- memset(&il->tx_stats, 0, sizeof(struct traffic_stats));
- memset(&il->rx_stats, 0, sizeof(struct traffic_stats));
-}
-
-/*
- * if CONFIG_IWLEGACY_DEBUGFS defined,
- * il_update_stats function will
- * record all the MGMT, CTRL and DATA pkt for both TX and Rx pass
- * Use debugFs to display the rx/rx_stats
- * if CONFIG_IWLEGACY_DEBUGFS not being defined, then no MGMT and CTRL
- * information will be recorded, but DATA pkt still will be recorded
- * for the reason of il_led.c need to control the led blinking based on
- * number of tx and rx data.
- *
- */
-void
-il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len)
-{
- struct traffic_stats *stats;
-
- if (is_tx)
- stats = &il->tx_stats;
- else
- stats = &il->rx_stats;
-
- if (ieee80211_is_mgmt(fc)) {
- switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) {
- case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ):
- stats->mgmt[MANAGEMENT_ASSOC_REQ]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
- stats->mgmt[MANAGEMENT_ASSOC_RESP]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ):
- stats->mgmt[MANAGEMENT_REASSOC_REQ]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
- stats->mgmt[MANAGEMENT_REASSOC_RESP]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_PROBE_REQ):
- stats->mgmt[MANAGEMENT_PROBE_REQ]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
- stats->mgmt[MANAGEMENT_PROBE_RESP]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_BEACON):
- stats->mgmt[MANAGEMENT_BEACON]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_ATIM):
- stats->mgmt[MANAGEMENT_ATIM]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
- stats->mgmt[MANAGEMENT_DISASSOC]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_AUTH):
- stats->mgmt[MANAGEMENT_AUTH]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
- stats->mgmt[MANAGEMENT_DEAUTH]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_ACTION):
- stats->mgmt[MANAGEMENT_ACTION]++;
- break;
- }
- } else if (ieee80211_is_ctl(fc)) {
- switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) {
- case cpu_to_le16(IEEE80211_STYPE_BACK_REQ):
- stats->ctrl[CONTROL_BACK_REQ]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_BACK):
- stats->ctrl[CONTROL_BACK]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_PSPOLL):
- stats->ctrl[CONTROL_PSPOLL]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_RTS):
- stats->ctrl[CONTROL_RTS]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_CTS):
- stats->ctrl[CONTROL_CTS]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_ACK):
- stats->ctrl[CONTROL_ACK]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_CFEND):
- stats->ctrl[CONTROL_CFEND]++;
- break;
- case cpu_to_le16(IEEE80211_STYPE_CFENDACK):
- stats->ctrl[CONTROL_CFENDACK]++;
- break;
- }
- } else {
- /* data */
- stats->data_cnt++;
- stats->data_bytes += len;
- }
-}
-EXPORT_SYMBOL(il_update_stats);
-#endif
-
int
il_force_reset(struct il_priv *il, bool external)
{
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 873182e..b2a6e52 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1766,57 +1766,21 @@ int il_alloc_txq_mem(struct il_priv *il);
void il_txq_mem(struct il_priv *il);
#ifdef CONFIG_IWLEGACY_DEBUGFS
-int il_alloc_traffic_mem(struct il_priv *il);
-void il_free_traffic_mem(struct il_priv *il);
-void il_reset_traffic_log(struct il_priv *il);
-void il_dbg_log_tx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header);
-void il_dbg_log_rx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header);
-const char *il_get_mgmt_string(int cmd);
-const char *il_get_ctrl_string(int cmd);
-void il_clear_traffic_stats(struct il_priv *il);
-void il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len);
+extern void il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len);
#else
-static inline int
-il_alloc_traffic_mem(struct il_priv *il)
-{
- return 0;
-}
-
-static inline void
-il_free_traffic_mem(struct il_priv *il)
-{
-}
-
-static inline void
-il_reset_traffic_log(struct il_priv *il)
-{
-}
-
-static inline void
-il_dbg_log_tx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header)
-{
-}
-
-static inline void
-il_dbg_log_rx_data_frame(struct il_priv *il, u16 length,
- struct ieee80211_hdr *header)
-{
-}
-
static inline void
il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len)
{
}
#endif
+
/*****************************************************
- * RX handlers.
- * **************************************************/
+ * Handlers
+ ***************************************************/
void il_hdl_pm_sleep(struct il_priv *il, struct il_rx_buf *rxb);
void il_hdl_pm_debug_stats(struct il_priv *il, struct il_rx_buf *rxb);
void il_hdl_error(struct il_priv *il, struct il_rx_buf *rxb);
+void il_hdl_csa(struct il_priv *il, struct il_rx_buf *rxb);
/*****************************************************
* RX
@@ -1827,13 +1791,10 @@ int il_rx_queue_alloc(struct il_priv *il);
void il_rx_queue_update_write_ptr(struct il_priv *il, struct il_rx_queue *q);
int il_rx_queue_space(const struct il_rx_queue *q);
void il_tx_cmd_complete(struct il_priv *il, struct il_rx_buf *rxb);
-/* Handlers */
+
void il_hdl_spectrum_measurement(struct il_priv *il, struct il_rx_buf *rxb);
void il_recover_from_stats(struct il_priv *il, struct il_rx_pkt *pkt);
void il_chswitch_done(struct il_priv *il, bool is_success);
-void il_hdl_csa(struct il_priv *il, struct il_rx_buf *rxb);
-
-/* TX helpers */
/*****************************************************
* TX
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index be6005d..236dc90 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -31,6 +31,101 @@
#include "common.h"
+void
+il_clear_traffic_stats(struct il_priv *il)
+{
+ memset(&il->tx_stats, 0, sizeof(struct traffic_stats));
+ memset(&il->rx_stats, 0, sizeof(struct traffic_stats));
+}
+
+/*
+ * il_update_stats function record all the MGMT, CTRL and DATA pkt for
+ * both TX and Rx . Use debugfs to display the rx/rx_stats
+ */
+void
+il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len)
+{
+ struct traffic_stats *stats;
+
+ if (is_tx)
+ stats = &il->tx_stats;
+ else
+ stats = &il->rx_stats;
+
+ if (ieee80211_is_mgmt(fc)) {
+ switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) {
+ case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ):
+ stats->mgmt[MANAGEMENT_ASSOC_REQ]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_ASSOC_RESP):
+ stats->mgmt[MANAGEMENT_ASSOC_RESP]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ):
+ stats->mgmt[MANAGEMENT_REASSOC_REQ]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
+ stats->mgmt[MANAGEMENT_REASSOC_RESP]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_PROBE_REQ):
+ stats->mgmt[MANAGEMENT_PROBE_REQ]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_PROBE_RESP):
+ stats->mgmt[MANAGEMENT_PROBE_RESP]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_BEACON):
+ stats->mgmt[MANAGEMENT_BEACON]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_ATIM):
+ stats->mgmt[MANAGEMENT_ATIM]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
+ stats->mgmt[MANAGEMENT_DISASSOC]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_AUTH):
+ stats->mgmt[MANAGEMENT_AUTH]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
+ stats->mgmt[MANAGEMENT_DEAUTH]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_ACTION):
+ stats->mgmt[MANAGEMENT_ACTION]++;
+ break;
+ }
+ } else if (ieee80211_is_ctl(fc)) {
+ switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) {
+ case cpu_to_le16(IEEE80211_STYPE_BACK_REQ):
+ stats->ctrl[CONTROL_BACK_REQ]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_BACK):
+ stats->ctrl[CONTROL_BACK]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_PSPOLL):
+ stats->ctrl[CONTROL_PSPOLL]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_RTS):
+ stats->ctrl[CONTROL_RTS]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_CTS):
+ stats->ctrl[CONTROL_CTS]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_ACK):
+ stats->ctrl[CONTROL_ACK]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_CFEND):
+ stats->ctrl[CONTROL_CFEND]++;
+ break;
+ case cpu_to_le16(IEEE80211_STYPE_CFENDACK):
+ stats->ctrl[CONTROL_CFENDACK]++;
+ break;
+ }
+ } else {
+ /* data */
+ stats->data_cnt++;
+ stats->data_bytes += len;
+ }
+}
+EXPORT_SYMBOL(il_update_stats);
+
/* create and remove of files */
#define DEBUGFS_ADD_FILE(name, parent, mode) do { \
if (!debugfs_create_file(#name, mode, parent, il, \
@@ -98,6 +193,46 @@ static const struct file_operations il_dbgfs_##name##_ops = { \
.llseek = generic_file_llseek, \
};
+static const char *
+il_get_mgmt_string(int cmd)
+{
+ switch (cmd) {
+ IL_CMD(MANAGEMENT_ASSOC_REQ);
+ IL_CMD(MANAGEMENT_ASSOC_RESP);
+ IL_CMD(MANAGEMENT_REASSOC_REQ);
+ IL_CMD(MANAGEMENT_REASSOC_RESP);
+ IL_CMD(MANAGEMENT_PROBE_REQ);
+ IL_CMD(MANAGEMENT_PROBE_RESP);
+ IL_CMD(MANAGEMENT_BEACON);
+ IL_CMD(MANAGEMENT_ATIM);
+ IL_CMD(MANAGEMENT_DISASSOC);
+ IL_CMD(MANAGEMENT_AUTH);
+ IL_CMD(MANAGEMENT_DEAUTH);
+ IL_CMD(MANAGEMENT_ACTION);
+ default:
+ return "UNKNOWN";
+
+ }
+}
+
+static const char *
+il_get_ctrl_string(int cmd)
+{
+ switch (cmd) {
+ IL_CMD(CONTROL_BACK_REQ);
+ IL_CMD(CONTROL_BACK);
+ IL_CMD(CONTROL_PSPOLL);
+ IL_CMD(CONTROL_RTS);
+ IL_CMD(CONTROL_CTS);
+ IL_CMD(CONTROL_ACK);
+ IL_CMD(CONTROL_CFEND);
+ IL_CMD(CONTROL_CFENDACK);
+ default:
+ return "UNKNOWN";
+
+ }
+}
+
static ssize_t
il_dbgfs_tx_stats_read(struct file *file, char __user *user_buf, size_t count,
loff_t *ppos)
@@ -715,112 +850,6 @@ DEBUGFS_READ_FILE_OPS(qos);
DEBUGFS_READ_WRITE_FILE_OPS(disable_ht40);
static ssize_t
-il_dbgfs_traffic_log_read(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos)
-{
- struct il_priv *il = file->private_data;
- int pos = 0, ofs = 0;
- int cnt = 0, entry;
- struct il_tx_queue *txq;
- struct il_queue *q;
- struct il_rx_queue *rxq = &il->rxq;
- char *buf;
- int bufsz =
- ((IL_TRAFFIC_ENTRIES * IL_TRAFFIC_ENTRY_SIZE * 64) * 2) +
- (il->cfg->num_of_queues * 32 * 8) + 400;
- const u8 *ptr;
- ssize_t ret;
-
- if (!il->txq) {
- IL_ERR("txq not ready\n");
- return -EAGAIN;
- }
- buf = kzalloc(bufsz, GFP_KERNEL);
- if (!buf) {
- IL_ERR("Can not allocate buffer\n");
- return -ENOMEM;
- }
- pos += scnprintf(buf + pos, bufsz - pos, "Tx Queue\n");
- for (cnt = 0; cnt < il->hw_params.max_txq_num; cnt++) {
- txq = &il->txq[cnt];
- q = &txq->q;
- pos +=
- scnprintf(buf + pos, bufsz - pos,
- "q[%d]: read_ptr: %u, write_ptr: %u\n", cnt,
- q->read_ptr, q->write_ptr);
- }
- if (il->tx_traffic && (il_debug_level & IL_DL_TX)) {
- ptr = il->tx_traffic;
- pos +=
- scnprintf(buf + pos, bufsz - pos, "Tx Traffic idx: %u\n",
- il->tx_traffic_idx);
- for (cnt = 0, ofs = 0; cnt < IL_TRAFFIC_ENTRIES; cnt++) {
- for (entry = 0; entry < IL_TRAFFIC_ENTRY_SIZE / 16;
- entry++, ofs += 16) {
- pos +=
- scnprintf(buf + pos, bufsz - pos, "0x%.4x ",
- ofs);
- hex_dump_to_buffer(ptr + ofs, 16, 16, 2,
- buf + pos, bufsz - pos, 0);
- pos += strlen(buf + pos);
- if (bufsz - pos > 0)
- buf[pos++] = '\n';
- }
- }
- }
-
- pos += scnprintf(buf + pos, bufsz - pos, "Rx Queue\n");
- pos +=
- scnprintf(buf + pos, bufsz - pos, "read: %u, write: %u\n",
- rxq->read, rxq->write);
-
- if (il->rx_traffic && (il_debug_level & IL_DL_RX)) {
- ptr = il->rx_traffic;
- pos +=
- scnprintf(buf + pos, bufsz - pos, "Rx Traffic idx: %u\n",
- il->rx_traffic_idx);
- for (cnt = 0, ofs = 0; cnt < IL_TRAFFIC_ENTRIES; cnt++) {
- for (entry = 0; entry < IL_TRAFFIC_ENTRY_SIZE / 16;
- entry++, ofs += 16) {
- pos +=
- scnprintf(buf + pos, bufsz - pos, "0x%.4x ",
- ofs);
- hex_dump_to_buffer(ptr + ofs, 16, 16, 2,
- buf + pos, bufsz - pos, 0);
- pos += strlen(buf + pos);
- if (bufsz - pos > 0)
- buf[pos++] = '\n';
- }
- }
- }
-
- ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
- kfree(buf);
- return ret;
-}
-
-static ssize_t
-il_dbgfs_traffic_log_write(struct file *file, const char __user *user_buf,
- size_t count, loff_t *ppos)
-{
- struct il_priv *il = file->private_data;
- char buf[8];
- int buf_size;
- int traffic_log;
-
- memset(buf, 0, sizeof(buf));
- buf_size = min(count, sizeof(buf) - 1);
- if (copy_from_user(buf, user_buf, buf_size))
- return -EFAULT;
- if (sscanf(buf, "%d", &traffic_log) != 1)
- return -EFAULT;
- if (traffic_log == 0)
- il_reset_traffic_log(il);
-
- return count;
-}
-
-static ssize_t
il_dbgfs_tx_queue_read(struct file *file, char __user *user_buf, size_t count,
loff_t *ppos)
{
@@ -1303,7 +1332,6 @@ il_dbgfs_wd_timeout_write(struct file *file, const char __user *user_buf,
DEBUGFS_READ_FILE_OPS(rx_stats);
DEBUGFS_READ_FILE_OPS(tx_stats);
-DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
DEBUGFS_READ_FILE_OPS(rx_queue);
DEBUGFS_READ_FILE_OPS(tx_queue);
DEBUGFS_READ_FILE_OPS(ucode_rx_stats);
@@ -1357,7 +1385,6 @@ il_dbgfs_register(struct il_priv *il, const char *name)
DEBUGFS_ADD_FILE(disable_ht40, dir_data, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(rx_stats, dir_debug, S_IRUSR);
DEBUGFS_ADD_FILE(tx_stats, dir_debug, S_IRUSR);
- DEBUGFS_ADD_FILE(traffic_log, dir_debug, S_IWUSR | S_IRUSR);
DEBUGFS_ADD_FILE(rx_queue, dir_debug, S_IRUSR);
DEBUGFS_ADD_FILE(tx_queue, dir_debug, S_IRUSR);
DEBUGFS_ADD_FILE(power_save_status, dir_debug, S_IRUSR);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 14/24] iwlegacy: improve mac operation debuggability a bit
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (12 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 13/24] iwlegacy: get rid of tx/rx traffic log Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 15/24] iwleagcy: remove old comments Stanislaw Gruszka
` (9 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 16 +++--
drivers/net/wireless/iwlegacy/common.c | 89 +++++++++++++++---------------
2 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 1743acc..99d7c72 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2781,10 +2781,9 @@ il3945_mac_start(struct ieee80211_hw *hw)
struct il_priv *il = hw->priv;
int ret;
- D_MAC80211("enter\n");
-
/* we should be verifying the device is ready to be opened */
mutex_lock(&il->mutex);
+ D_MAC80211("enter\n");
/* fetch ucode file from disk, alloc and copy to bus-master buffers ...
* ucode filename and max sizes are card-specific. */
@@ -2940,15 +2939,19 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
* hardware will then not attempt to decrypt the frames.
*/
if (vif->type == NL80211_IFTYPE_ADHOC &&
- !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
+ !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
+ D_MAC80211("leave - IBSS RSN\n");
return -EOPNOTSUPP;
+ }
static_key = !il_is_associated(il);
if (!static_key) {
sta_id = il_sta_id_or_broadcast(il, sta);
- if (sta_id == IL_INVALID_STATION)
+ if (sta_id == IL_INVALID_STATION) {
+ D_MAC80211("leave - station not found\n");
return -EINVAL;
+ }
}
mutex_lock(&il->mutex);
@@ -2973,8 +2976,8 @@ il3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
ret = -EINVAL;
}
+ D_MAC80211("leave ret %d\n", ret);
mutex_unlock(&il->mutex);
- D_MAC80211("leave\n");
return ret;
}
@@ -2989,9 +2992,8 @@ il3945_mac_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
bool is_ap = vif->type == NL80211_IFTYPE_STATION;
u8 sta_id;
- D_INFO("received request to add station %pM\n", sta->addr);
mutex_lock(&il->mutex);
- D_INFO("proceeding to add station %pM\n", sta->addr);
+ D_INFO("station %pM\n", sta->addr);
sta_priv->common.sta_id = IL_INVALID_STATION;
ret = il_add_station_common(il, sta->addr, is_ap, sta, &sta_id);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 21b355a..0d1a643 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1523,12 +1523,13 @@ il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct il_priv *il = hw->priv;
int ret;
- D_MAC80211("enter\n");
-
- if (req->n_channels == 0)
+ if (req->n_channels == 0) {
+ IL_ERR("Can not scan on no channels.\n");
return -EINVAL;
+ }
mutex_lock(&il->mutex);
+ D_MAC80211("enter\n");
if (test_bit(S_SCANNING, &il->status)) {
D_SCAN("Scan already in progress.\n");
@@ -1543,9 +1544,8 @@ il_mac_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
ret = il_scan_initiate(il, vif);
- D_MAC80211("leave\n");
-
out_unlock:
+ D_MAC80211("leave ret %d\n", ret);
mutex_unlock(&il->mutex);
return ret;
@@ -2413,13 +2413,16 @@ il_mac_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct il_station_priv_common *sta_common = (void *)sta->drv_priv;
int ret;
- D_INFO("received request to remove station %pM\n", sta->addr);
mutex_lock(&il->mutex);
- D_INFO("proceeding to remove station %pM\n", sta->addr);
+ D_MAC80211("enter station %pM\n", sta->addr);
+
ret = il_remove_station(il, sta_common->sta_id, sta->addr);
if (ret)
IL_ERR("Error removing station %pM\n", sta->addr);
+
+ D_MAC80211("leave ret %d\n", ret);
mutex_unlock(&il->mutex);
+
return ret;
}
EXPORT_SYMBOL(il_mac_sta_remove);
@@ -4459,8 +4462,14 @@ int
il_mac_tx_last_beacon(struct ieee80211_hw *hw)
{
struct il_priv *il = hw->priv;
+ int ret;
- return il->ibss_manager == IL_IBSS_MANAGER;
+ D_MAC80211("enter\n");
+
+ ret = (il->ibss_manager == IL_IBSS_MANAGER);
+
+ D_MAC80211("leave ret %d\n", ret);
+ return ret;
}
EXPORT_SYMBOL_GPL(il_mac_tx_last_beacon);
@@ -4481,9 +4490,8 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct il_priv *il = hw->priv;
int err;
- D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
-
mutex_lock(&il->mutex);
+ D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
if (!il_is_ready_rf(il)) {
IL_WARN("Try to add interface when device not ready\n");
@@ -4506,9 +4514,9 @@ il_mac_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
}
out:
+ D_MAC80211("leave err %d\n", err);
mutex_unlock(&il->mutex);
- D_MAC80211("leave\n");
return err;
}
EXPORT_SYMBOL(il_mac_add_interface);
@@ -4534,20 +4542,17 @@ il_mac_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{
struct il_priv *il = hw->priv;
- D_MAC80211("enter\n");
-
mutex_lock(&il->mutex);
+ D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
WARN_ON(il->vif != vif);
il->vif = NULL;
il_teardown_interface(il, vif, false);
-
memset(il->bssid, 0, ETH_ALEN);
- mutex_unlock(&il->mutex);
D_MAC80211("leave\n");
-
+ mutex_unlock(&il->mutex);
}
EXPORT_SYMBOL(il_mac_remove_interface);
@@ -4633,10 +4638,14 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct il_priv *il = hw->priv;
int err;
- if (newp2p)
- return -EOPNOTSUPP;
-
mutex_lock(&il->mutex);
+ D_MAC80211("enter: type %d, addr %pM newtype %d newp2p %d\n",
+ vif->type, vif->addr, newtype, newp2p);
+
+ if (newp2p) {
+ err = -EOPNOTSUPP;
+ goto out;
+ }
if (!il->vif || !il_is_ready_rf(il)) {
/*
@@ -4663,7 +4672,9 @@ il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
err = 0;
out:
+ D_MAC80211("leave err %d\n", err);
mutex_unlock(&il->mutex);
+
return err;
}
EXPORT_SYMBOL(il_mac_change_interface);
@@ -4922,8 +4933,7 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
bool ht_changed = false;
mutex_lock(&il->mutex);
-
- D_MAC80211("enter to channel %d changed 0x%X\n", channel->hw_value,
+ D_MAC80211("enter: channel %d changed 0x%X\n", channel->hw_value,
changed);
if (unlikely(test_bit(S_SCANNING, &il->status))) {
@@ -5052,8 +5062,9 @@ set_ch_out:
il_update_qos(il);
out:
- D_MAC80211("leave\n");
+ D_MAC80211("leave ret %d\n", ret);
mutex_unlock(&il->mutex);
+
return ret;
}
EXPORT_SYMBOL(il_mac_config);
@@ -5065,20 +5076,16 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
unsigned long flags;
mutex_lock(&il->mutex);
- D_MAC80211("enter\n");
+ D_MAC80211("enter: type %d, addr %pM\n", vif->type, vif->addr);
spin_lock_irqsave(&il->lock, flags);
- memset(&il->current_ht_config, 0, sizeof(struct il_ht_config));
- spin_unlock_irqrestore(&il->lock, flags);
- spin_lock_irqsave(&il->lock, flags);
+ memset(&il->current_ht_config, 0, sizeof(struct il_ht_config));
/* new association get rid of ibss beacon skb */
if (il->beacon_skb)
dev_kfree_skb(il->beacon_skb);
-
il->beacon_skb = NULL;
-
il->timestamp = 0;
spin_unlock_irqrestore(&il->lock, flags);
@@ -5090,17 +5097,14 @@ il_mac_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
return;
}
- /* we are restarting association process
- * clear RXON_FILTER_ASSOC_MSK bit
- */
+ /* we are restarting association process */
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
il_commit_rxon(il);
il_set_rate(il);
- mutex_unlock(&il->mutex);
-
D_MAC80211("leave\n");
+ mutex_unlock(&il->mutex);
}
EXPORT_SYMBOL(il_mac_reset_tsf);
@@ -5226,11 +5230,11 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct il_priv *il = hw->priv;
int ret;
- D_MAC80211("changes = 0x%X\n", changes);
-
mutex_lock(&il->mutex);
+ D_MAC80211("enter: changes 0x%x\n", changes);
if (!il_is_alive(il)) {
+ D_MAC80211("leave - not alive\n");
mutex_unlock(&il->mutex);
return;
}
@@ -5261,8 +5265,7 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
* below/in post_associate will fail.
*/
if (il_scan_cancel_timeout(il, 100)) {
- IL_WARN("Aborted scan still in progress after 100ms\n");
- D_MAC80211("leaving - scan abort failed.\n");
+ D_MAC80211("leave - scan abort failed\n");
mutex_unlock(&il->mutex);
return;
}
@@ -5274,10 +5277,8 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
/* currently needed in a few places */
memcpy(il->bssid, bss_conf->bssid, ETH_ALEN);
- } else {
+ } else
il->staging.filter_flags &= ~RXON_FILTER_ASSOC_MSK;
- }
-
}
/*
@@ -5364,18 +5365,16 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
if (changes & BSS_CHANGED_IBSS) {
- ret =
- il->ops->manage_ibss_station(il, vif,
- bss_conf->ibss_joined);
+ ret = il->ops->manage_ibss_station(il, vif,
+ bss_conf->ibss_joined);
if (ret)
IL_ERR("failed to %s IBSS station %pM\n",
bss_conf->ibss_joined ? "add" : "remove",
bss_conf->bssid);
}
- mutex_unlock(&il->mutex);
-
D_MAC80211("leave\n");
+ mutex_unlock(&il->mutex);
}
EXPORT_SYMBOL(il_mac_bss_info_changed);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 15/24] iwleagcy: remove old comments
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (13 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 14/24] iwlegacy: improve mac operation debuggability a bit Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 16/24] iwleagcy: fix ident code damage Stanislaw Gruszka
` (8 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/common.h | 16 ----------------
1 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index b2a6e52..a779445 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1626,22 +1626,6 @@ struct il_mod_params {
int restart_fw; /* def: 1 = restart firmware */
};
-/*
- * @led_compensation: compensate on the led on/off time per HW according
- * to the deviation to achieve the desired led frequency.
- * The detail algorithm is described in common.c
- * @chain_noise_num_beacons: number of beacons used to compute chain noise
- * @wd_timeout: TX queues watchdog timeout
- * @temperature_kelvin: temperature report by uCode in kelvin
- * @ucode_tracing: support ucode continuous tracing
- * @sensitivity_calib_by_driver: driver has the capability to perform
- * sensitivity calibration operation
- * @chain_noise_calib_by_driver: driver has the capability to perform
- * chain noise calibration operation
- */
-struct il_base_params {
-};
-
#define IL_LED_SOLID 11
#define IL_DEF_LED_INTRVL cpu_to_le32(1000)
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 16/24] iwleagcy: fix ident code damage
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (14 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 15/24] iwleagcy: remove old comments Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 17/24] iwlegacy: do not grab nic access if rfkill Stanislaw Gruszka
` (7 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Using ident is not always good.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 18 +++++-------------
drivers/net/wireless/iwlegacy/4965-mac.c | 18 +++++-------------
2 files changed, 10 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 99d7c72..002cf4f 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2272,12 +2272,8 @@ __il3945_down(struct il_priv *il)
* clear all bits but the RF Kill bits and return */
if (!il_is_init(il)) {
il->status =
- test_bit(S_RF_KILL_HW,
- &il->
- status) << S_RF_KILL_HW |
- test_bit(S_GEO_CONFIGURED,
- &il->
- status) << S_GEO_CONFIGURED |
+ test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
goto exit;
}
@@ -2285,13 +2281,9 @@ __il3945_down(struct il_priv *il)
/* ...otherwise clear out all the status bits but the RF Kill
* bit and continue taking the NIC down. */
il->status &=
- test_bit(S_RF_KILL_HW,
- &il->status) << S_RF_KILL_HW | test_bit(S_GEO_CONFIGURED,
- &il->
- status) <<
- S_GEO_CONFIGURED | test_bit(S_FW_ERROR,
- &il->
- status) << S_FW_ERROR |
+ test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
+ test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
il3945_hw_txq_ctx_stop(il);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index b251d34..8930e7a 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5384,12 +5384,8 @@ __il4965_down(struct il_priv *il)
* clear all bits but the RF Kill bit and return */
if (!il_is_init(il)) {
il->status =
- test_bit(S_RF_KILL_HW,
- &il->
- status) << S_RF_KILL_HW |
- test_bit(S_GEO_CONFIGURED,
- &il->
- status) << S_GEO_CONFIGURED |
+ test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
goto exit;
}
@@ -5397,13 +5393,9 @@ __il4965_down(struct il_priv *il)
/* ...otherwise clear out all the status bits but the RF Kill
* bit and continue taking the NIC down. */
il->status &=
- test_bit(S_RF_KILL_HW,
- &il->status) << S_RF_KILL_HW | test_bit(S_GEO_CONFIGURED,
- &il->
- status) <<
- S_GEO_CONFIGURED | test_bit(S_FW_ERROR,
- &il->
- status) << S_FW_ERROR |
+ test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
+ test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
il4965_txq_ctx_stop(il);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 17/24] iwlegacy: do not grab nic access if rfkill
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (15 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 16/24] iwleagcy: fix ident code damage Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 18/24] iwlegacy: check correct il_poll_bit error value Stanislaw Gruszka
` (6 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
If rfkill is on il_grab_nic_access() fail and we can not write to the
various registers during stop procedure. Write to those registers
unconditionally instead.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 17 +++++--
drivers/net/wireless/iwlegacy/3945.c | 29 ++++++-----
drivers/net/wireless/iwlegacy/4965-mac.c | 81 ++++++++++++++++++------------
drivers/net/wireless/iwlegacy/common.c | 25 +++++++--
drivers/net/wireless/iwlegacy/common.h | 4 +-
5 files changed, 98 insertions(+), 58 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index 002cf4f..ee91ab2 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -2286,16 +2286,25 @@ __il3945_down(struct il_priv *il)
test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
+ /*
+ * We disabled and synchronized interrupt, and priv->mutex is taken, so
+ * here is the only thread which will program device registers, but
+ * still have lockdep assertions, so we are taking reg_lock.
+ */
+ spin_lock_irq(&il->reg_lock);
+ /* FIXME: il_grab_nic_access if rfkill is off ? */
+
il3945_hw_txq_ctx_stop(il);
il3945_hw_rxq_stop(il);
-
/* Power-down device's busmaster DMA clocks */
- il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
+ _il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
udelay(5);
-
/* Stop the device, and put it in low power state */
- il_apm_stop(il);
+ _il_apm_stop(il);
+ spin_unlock_irq(&il->reg_lock);
+
+ il3945_hw_txq_ctx_free(il);
exit:
memset(&il->card_alive, 0, sizeof(struct il_alive_resp));
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 95ebd43..103251d 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -1016,18 +1016,17 @@ il3945_hw_txq_ctx_stop(struct il_priv *il)
int txq_id;
/* stop SCD */
- il_wr_prph(il, ALM_SCD_MODE_REG, 0);
- il_wr_prph(il, ALM_SCD_TXFACT_REG, 0);
+ _il_wr_prph(il, ALM_SCD_MODE_REG, 0);
+ _il_wr_prph(il, ALM_SCD_TXFACT_REG, 0);
/* reset TFD queues */
for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
- il_wr(il, FH39_TCSR_CONFIG(txq_id), 0x0);
- il_poll_bit(il, FH39_TSSR_TX_STATUS,
- FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id),
- 1000);
+ _il_wr(il, FH39_TCSR_CONFIG(txq_id), 0x0);
+ _il_poll_bit(il, FH39_TSSR_TX_STATUS,
+ FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id),
+ FH39_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(txq_id),
+ 1000);
}
-
- il3945_hw_txq_ctx_free(il);
}
/**
@@ -2176,12 +2175,14 @@ il3945_txpower_set_from_eeprom(struct il_priv *il)
int
il3945_hw_rxq_stop(struct il_priv *il)
{
- int rc;
+ int ret;
- il_wr(il, FH39_RCSR_CONFIG(0), 0);
- rc = il_poll_bit(il, FH39_RSSR_STATUS,
- FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
- if (rc < 0)
+ _il_wr(il, FH39_RCSR_CONFIG(0), 0);
+ ret = _il_poll_bit(il, FH39_RSSR_STATUS,
+ FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE,
+ FH39_RSSR_CHNL0_RX_STATUS_CHNL_IDLE,
+ 1000);
+ if (ret < 0)
IL_ERR("Can't stop Rx DMA.\n");
return 0;
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 8930e7a..5ebf761 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -441,11 +441,15 @@ il4965_rx_queue_free(struct il_priv *il, struct il_rx_queue *rxq)
int
il4965_rxq_stop(struct il_priv *il)
{
+ int ret;
- /* stop Rx DMA */
- il_wr(il, FH49_MEM_RCSR_CHNL0_CONFIG_REG, 0);
- il_poll_bit(il, FH49_MEM_RSSR_RX_STATUS_REG,
- FH49_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, 1000);
+ _il_wr(il, FH49_MEM_RCSR_CHNL0_CONFIG_REG, 0);
+ ret = _il_poll_bit(il, FH49_MEM_RSSR_RX_STATUS_REG,
+ FH49_RSSR_CHNL0_RX_STATUS_CHNL_IDLE,
+ FH49_RSSR_CHNL0_RX_STATUS_CHNL_IDLE,
+ 1000);
+ if (ret < 0)
+ IL_ERR("Can't stop Rx DMA.\n");
return 0;
}
@@ -2031,31 +2035,10 @@ il4965_txq_ctx_reset(struct il_priv *il)
}
}
-/**
- * il4965_txq_ctx_stop - Stop all Tx DMA channels
- */
void
-il4965_txq_ctx_stop(struct il_priv *il)
+il4965_txq_ctx_unmap(struct il_priv *il)
{
- int ch, txq_id;
- unsigned long flags;
-
- /* Turn off all Tx DMA fifos */
- spin_lock_irqsave(&il->lock, flags);
-
- il4965_txq_set_sched(il, 0);
-
- /* Stop each Tx DMA channel, and wait for it to be idle */
- for (ch = 0; ch < il->hw_params.dma_chnl_num; ch++) {
- il_wr(il, FH49_TCSR_CHNL_TX_CONFIG_REG(ch), 0x0);
- if (il_poll_bit
- (il, FH49_TSSR_TX_STATUS_REG,
- FH49_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch), 1000))
- IL_ERR("Failing on timeout while stopping"
- " DMA channel %d [0x%08x]", ch,
- il_rd(il, FH49_TSSR_TX_STATUS_REG));
- }
- spin_unlock_irqrestore(&il->lock, flags);
+ int txq_id;
if (!il->txq)
return;
@@ -2068,6 +2051,30 @@ il4965_txq_ctx_stop(struct il_priv *il)
il_tx_queue_unmap(il, txq_id);
}
+/**
+ * il4965_txq_ctx_stop - Stop all Tx DMA channels
+ */
+void
+il4965_txq_ctx_stop(struct il_priv *il)
+{
+ int ch, ret;
+
+ _il_wr_prph(il, IL49_SCD_TXFACT, 0);
+
+ /* Stop each Tx DMA channel, and wait for it to be idle */
+ for (ch = 0; ch < il->hw_params.dma_chnl_num; ch++) {
+ _il_wr(il, FH49_TCSR_CHNL_TX_CONFIG_REG(ch), 0x0);
+ ret =
+ _il_poll_bit(il, FH49_TSSR_TX_STATUS_REG,
+ FH49_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch),
+ FH49_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(ch),
+ 1000);
+ if (ret < 0)
+ IL_ERR("Timeout stopping DMA channel %d [0x%08x]",
+ ch, _il_rd(il, FH49_TSSR_TX_STATUS_REG));
+ }
+}
+
/*
* Find first available (lowest unused) Tx Queue, mark it "active".
* Called only when finding queue for aggregation.
@@ -5398,19 +5405,27 @@ __il4965_down(struct il_priv *il)
test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
+ /*
+ * We disabled and synchronized interrupt, and priv->mutex is taken, so
+ * here is the only thread which will program device registers, but
+ * still have lockdep assertions, so we are taking reg_lock.
+ */
+ spin_lock_irq(&il->reg_lock);
+ /* FIXME: il_grab_nic_access if rfkill is off ? */
+
il4965_txq_ctx_stop(il);
il4965_rxq_stop(il);
-
/* Power-down device's busmaster DMA clocks */
- il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
+ _il_wr_prph(il, APMG_CLK_DIS_REG, APMG_CLK_VAL_DMA_CLK_RQT);
udelay(5);
-
/* Make sure (redundant) we've released our request to stay awake */
- il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
-
+ _il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
/* Stop the device, and put it in low power state */
- il_apm_stop(il);
+ _il_apm_stop(il);
+
+ spin_unlock_irq(&il->reg_lock);
+ il4965_txq_ctx_unmap(il);
exit:
memset(&il->card_alive, 0, sizeof(struct il_alive_resp));
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 0d1a643..f343f27 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4126,12 +4126,12 @@ il_irq_handle_error(struct il_priv *il)
EXPORT_SYMBOL(il_irq_handle_error);
static int
-il_apm_stop_master(struct il_priv *il)
+_il_apm_stop_master(struct il_priv *il)
{
int ret = 0;
/* stop device's busmaster DMA activity */
- il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
+ _il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
ret =
_il_poll_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_MASTER_DISABLED,
@@ -4145,15 +4145,17 @@ il_apm_stop_master(struct il_priv *il)
}
void
-il_apm_stop(struct il_priv *il)
+_il_apm_stop(struct il_priv *il)
{
+ lockdep_assert_held(&il->reg_lock);
+
D_INFO("Stop card, put in low power state\n");
/* Stop device's DMA activity */
- il_apm_stop_master(il);
+ _il_apm_stop_master(il);
/* Reset the entire device */
- il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
+ _il_set_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
udelay(10);
@@ -4161,7 +4163,18 @@ il_apm_stop(struct il_priv *il)
* Clear "initialization complete" bit to move adapter from
* D0A* (powered-up Active) --> D0U* (Uninitialized) state.
*/
- il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
+ _il_clear_bit(il, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
+}
+EXPORT_SYMBOL(_il_apm_stop);
+
+void
+il_apm_stop(struct il_priv *il)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&il->reg_lock, flags);
+ _il_apm_stop(il);
+ spin_unlock_irqrestore(&il->reg_lock, flags);
}
EXPORT_SYMBOL(il_apm_stop);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index a779445..13bfd43 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1976,7 +1976,9 @@ il_is_ready_rf(struct il_priv *il)
extern void il_send_bt_config(struct il_priv *il);
extern int il_send_stats_request(struct il_priv *il, u8 flags, bool clear);
-void il_apm_stop(struct il_priv *il);
+extern void il_apm_stop(struct il_priv *il);
+extern void _il_apm_stop(struct il_priv *il);
+
int il_apm_init(struct il_priv *il);
int il_send_rxon_timing(struct il_priv *il);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 18/24] iwlegacy: check correct il_poll_bit error value
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (16 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 17/24] iwlegacy: do not grab nic access if rfkill Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 19/24] iwlegacy: small il4965_set_hw_ready cleanup Stanislaw Gruszka
` (5 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/common.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index f343f27..d0d408e 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4136,7 +4136,7 @@ _il_apm_stop_master(struct il_priv *il)
ret =
_il_poll_bit(il, CSR_RESET, CSR_RESET_REG_FLAG_MASTER_DISABLED,
CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
- if (ret)
+ if (ret < 0)
IL_WARN("Master Disable Timed Out, 100 usec\n");
D_INFO("stop master\n");
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 19/24] iwlegacy: small il4965_set_hw_ready cleanup
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (17 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 18/24] iwlegacy: check correct il_poll_bit error value Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP Stanislaw Gruszka
` (4 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 35 ++++++++++++------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 5ebf761..24a3bbc 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5446,40 +5446,36 @@ il4965_down(struct il_priv *il)
il4965_cancel_deferred_work(il);
}
-#define HW_READY_TIMEOUT (50)
-static int
+static void
il4965_set_hw_ready(struct il_priv *il)
{
- int ret = 0;
+ int ret;
il_set_bit(il, CSR_HW_IF_CONFIG_REG,
CSR_HW_IF_CONFIG_REG_BIT_NIC_READY);
/* See if we got it */
- ret =
- _il_poll_bit(il, CSR_HW_IF_CONFIG_REG,
- CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
- CSR_HW_IF_CONFIG_REG_BIT_NIC_READY, HW_READY_TIMEOUT);
- if (ret != -ETIMEDOUT)
+ ret = _il_poll_bit(il, CSR_HW_IF_CONFIG_REG,
+ CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
+ CSR_HW_IF_CONFIG_REG_BIT_NIC_READY,
+ 100);
+ if (ret >= 0)
il->hw_ready = true;
- else
- il->hw_ready = false;
- D_INFO("hardware %s\n", (il->hw_ready == 1) ? "ready" : "not ready");
- return ret;
+ D_INFO("hardware %s ready\n", (il->hw_ready) ? "" : "not");
}
-static int
+static void
il4965_prepare_card_hw(struct il_priv *il)
{
- int ret = 0;
+ int ret;
- D_INFO("il4965_prepare_card_hw enter\n");
+ il->hw_ready = false;
- ret = il4965_set_hw_ready(il);
+ il4965_set_hw_ready(il);
if (il->hw_ready)
- return ret;
+ return;
/* If HW is not ready, prepare the conditions to check again */
il_set_bit(il, CSR_HW_IF_CONFIG_REG, CSR_HW_IF_CONFIG_REG_PREPARE);
@@ -5492,8 +5488,6 @@ il4965_prepare_card_hw(struct il_priv *il)
/* HW should be ready by now, check again. */
if (ret != -ETIMEDOUT)
il4965_set_hw_ready(il);
-
- return ret;
}
#define MAX_HW_RESTARTS 5
@@ -5521,9 +5515,8 @@ __il4965_up(struct il_priv *il)
}
il4965_prepare_card_hw(il);
-
if (!il->hw_ready) {
- IL_WARN("Exit HW not ready\n");
+ IL_ERR("HW not ready\n");
return -EIO;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (18 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 19/24] iwlegacy: small il4965_set_hw_ready cleanup Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 16:19 ` Dan Williams
2012-02-14 7:50 ` [PATCH 20/24 v2] iwlegacy: enable only rfkill interrupt when rfkill switch is on during IFF_UP Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 21/24] iwlegacy: small queue initializations cleanup Stanislaw Gruszka
` (3 subsequent siblings)
23 siblings, 2 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/4965-mac.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 24a3bbc..cf14861 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5523,13 +5523,11 @@ __il4965_up(struct il_priv *il)
/* If platform's RF_KILL switch is NOT set to KILL */
if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
clear_bit(S_RF_KILL_HW, &il->status);
- else
+ else {
set_bit(S_RF_KILL_HW, &il->status);
-
- if (il_is_rfkill(il)) {
wiphy_rfkill_set_hw_state(il->hw->wiphy, true);
- il_enable_interrupts(il);
+ il_enable_rfkill_int(il);
IL_WARN("Radio disabled by HW RF Kill switch\n");
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* Re: [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP
2012-02-13 10:23 ` [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP Stanislaw Gruszka
@ 2012-02-13 16:19 ` Dan Williams
2012-02-13 16:43 ` Stanislaw Gruszka
2012-02-14 7:50 ` [PATCH 20/24 v2] iwlegacy: enable only rfkill interrupt when rfkill switch is on during IFF_UP Stanislaw Gruszka
1 sibling, 1 reply; 28+ messages in thread
From: Dan Williams @ 2012-02-13 16:19 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: John W. Linville, linux-wireless
On Mon, 2012-02-13 at 11:23 +0100, Stanislaw Gruszka wrote:
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> drivers/net/wireless/iwlegacy/4965-mac.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
By UP here I'll assume IFF_UP; did the previous code enable the
interrupt while the interface was down too? The problem we have here is
that if there's no platform rfkill switch, but only the iwlwifi one,
then we don't get notifications of rfkill changes, which breaks showing
in the UI when you can and cannot use the card.
There are various complexities with rfkill here; for example I think for
3945 it used to be that you couldn't UP the interface when it was
rfkilled, so when it was killed (and thus down) you couldn't get
notifications of rfkill change at all, and thus you wouldn't know if you
could start using it again, except to poll (which sucks).
Dan
> diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
> index 24a3bbc..cf14861 100644
> --- a/drivers/net/wireless/iwlegacy/4965-mac.c
> +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
> @@ -5523,13 +5523,11 @@ __il4965_up(struct il_priv *il)
> /* If platform's RF_KILL switch is NOT set to KILL */
> if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
> clear_bit(S_RF_KILL_HW, &il->status);
> - else
> + else {
> set_bit(S_RF_KILL_HW, &il->status);
> -
> - if (il_is_rfkill(il)) {
> wiphy_rfkill_set_hw_state(il->hw->wiphy, true);
>
> - il_enable_interrupts(il);
> + il_enable_rfkill_int(il);
> IL_WARN("Radio disabled by HW RF Kill switch\n");
> return 0;
> }
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP
2012-02-13 16:19 ` Dan Williams
@ 2012-02-13 16:43 ` Stanislaw Gruszka
0 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 16:43 UTC (permalink / raw)
To: Dan Williams; +Cc: John W. Linville, linux-wireless
On Mon, Feb 13, 2012 at 10:19:18AM -0600, Dan Williams wrote:
> On Mon, 2012-02-13 at 11:23 +0100, Stanislaw Gruszka wrote:
> > Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> > ---
> > drivers/net/wireless/iwlegacy/4965-mac.c | 6 ++----
> > 1 files changed, 2 insertions(+), 4 deletions(-)
>
> By UP here I'll assume IFF_UP; did the previous code enable the
> interrupt while the interface was down too?
Yes, we do the same thing during IFF_DOWN and IFF_UP, we enable rfkill
interrupt and mask all other interrupts, when rfkill switch is on.
> The problem we have here is
> that if there's no platform rfkill switch, but only the iwlwifi one,
> then we don't get notifications of rfkill changes, which breaks showing
> in the UI when you can and cannot use the card.
This change will not broke that.
I just realize that description is wrong, and probably that make the
confusion here. It should be "enable only rfkill interrupt when
rfkill switch is on during IFF_UP".
Deja vu
http://comments.gmane.org/gmane.linux.kernel.wireless.general/61915
Some people will never learn some things ...
> There are various complexities with rfkill here; for example I think for
> 3945 it used to be that you couldn't UP the interface when it was
> rfkilled, so when it was killed (and thus down) you couldn't get
> notifications of rfkill change at all, and thus you wouldn't know if you
> could start using it again, except to poll (which sucks).
Anyway I tested this patches on two laptops with 3945 and 4965,
rfkill worked there as expected.
I'll repost patch with correct topic
Stanislaw
>
> Dan
>
> > diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
> > index 24a3bbc..cf14861 100644
> > --- a/drivers/net/wireless/iwlegacy/4965-mac.c
> > +++ b/drivers/net/wireless/iwlegacy/4965-mac.c
> > @@ -5523,13 +5523,11 @@ __il4965_up(struct il_priv *il)
> > /* If platform's RF_KILL switch is NOT set to KILL */
> > if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
> > clear_bit(S_RF_KILL_HW, &il->status);
> > - else
> > + else {
> > set_bit(S_RF_KILL_HW, &il->status);
> > -
> > - if (il_is_rfkill(il)) {
> > wiphy_rfkill_set_hw_state(il->hw->wiphy, true);
> >
> > - il_enable_interrupts(il);
> > + il_enable_rfkill_int(il);
> > IL_WARN("Radio disabled by HW RF Kill switch\n");
> > return 0;
> > }
>
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 20/24 v2] iwlegacy: enable only rfkill interrupt when rfkill switch is on during IFF_UP
2012-02-13 10:23 ` [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP Stanislaw Gruszka
2012-02-13 16:19 ` Dan Williams
@ 2012-02-14 7:50 ` Stanislaw Gruszka
1 sibling, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-14 7:50 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
v1 -> v2: make description less confusing
drivers/net/wireless/iwlegacy/4965-mac.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 24a3bbc..cf14861 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5523,13 +5523,11 @@ __il4965_up(struct il_priv *il)
/* If platform's RF_KILL switch is NOT set to KILL */
if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
clear_bit(S_RF_KILL_HW, &il->status);
- else
+ else {
set_bit(S_RF_KILL_HW, &il->status);
-
- if (il_is_rfkill(il)) {
wiphy_rfkill_set_hw_state(il->hw->wiphy, true);
- il_enable_interrupts(il);
+ il_enable_rfkill_int(il);
IL_WARN("Radio disabled by HW RF Kill switch\n");
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 21/24] iwlegacy: small queue initializations cleanup
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (19 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 20/24] iwlegacy: only enable rfkill interrupt during UP Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 22/24] iwlegacy: s/S_RF_KILL_HW/S_RFKILL/g Stanislaw Gruszka
` (2 subsequent siblings)
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945.c | 9 +---
drivers/net/wireless/iwlegacy/4965-mac.c | 18 ++------
drivers/net/wireless/iwlegacy/common.c | 66 ++++++++++++++++-------------
drivers/net/wireless/iwlegacy/common.h | 20 ++++-----
4 files changed, 52 insertions(+), 61 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 103251d..8900e3c 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -790,7 +790,6 @@ il3945_rx_init(struct il_priv *il, struct il_rx_queue *rxq)
static int
il3945_tx_reset(struct il_priv *il)
{
-
/* bypass mode */
il_wr_prph(il, ALM_SCD_MODE_REG, 0x2);
@@ -827,8 +826,7 @@ il3945_tx_reset(struct il_priv *il)
static int
il3945_txq_ctx_reset(struct il_priv *il)
{
- int rc;
- int txq_id, slots_num;
+ int rc, txq_id;
il3945_hw_txq_ctx_free(il);
@@ -844,10 +842,7 @@ il3945_txq_ctx_reset(struct il_priv *il)
/* Tx queue(s) */
for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
- slots_num =
- (txq_id ==
- IL39_CMD_QUEUE_NUM) ? TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
- rc = il_tx_queue_init(il, &il->txq[txq_id], slots_num, txq_id);
+ rc = il_tx_queue_init(il, txq_id);
if (rc) {
IL_ERR("Tx %d queue init failed\n", txq_id);
goto error;
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index cf14861..a0158e3 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1952,8 +1952,7 @@ il4965_hw_txq_ctx_free(struct il_priv *il)
int
il4965_txq_ctx_alloc(struct il_priv *il)
{
- int ret;
- int txq_id, slots_num;
+ int ret, txq_id;
unsigned long flags;
/* Free all tx/cmd queues and keep-warm buffer */
@@ -1990,10 +1989,7 @@ il4965_txq_ctx_alloc(struct il_priv *il)
/* Alloc and init all Tx queues, including the command queue (#4/#9) */
for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
- slots_num =
- (txq_id ==
- il->cmd_queue) ? TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
- ret = il_tx_queue_init(il, &il->txq[txq_id], slots_num, txq_id);
+ ret = il_tx_queue_init(il, txq_id);
if (ret) {
IL_ERR("Tx %d queue init failed\n", txq_id);
goto error;
@@ -2014,25 +2010,21 @@ error_bc_tbls:
void
il4965_txq_ctx_reset(struct il_priv *il)
{
- int txq_id, slots_num;
+ int txq_id;
unsigned long flags;
spin_lock_irqsave(&il->lock, flags);
/* Turn off all Tx DMA fifos */
il4965_txq_set_sched(il, 0);
-
/* Tell NIC where to find the "keep warm" buffer */
il_wr(il, FH49_KW_MEM_ADDR_REG, il->kw.dma >> 4);
spin_unlock_irqrestore(&il->lock, flags);
/* Alloc and init all Tx queues, including the command queue (#4) */
- for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++) {
- slots_num =
- txq_id == il->cmd_queue ? TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
- il_tx_queue_reset(il, &il->txq[txq_id], slots_num, txq_id);
- }
+ for (txq_id = 0; txq_id < il->hw_params.max_txq_num; txq_id++)
+ il_tx_queue_reset(il, txq_id);
}
void
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index d0d408e..872302a 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -2887,20 +2887,22 @@ EXPORT_SYMBOL(il_queue_space);
* il_queue_init - Initialize queue's high/low-water and read/write idxes
*/
static int
-il_queue_init(struct il_priv *il, struct il_queue *q, int count, int slots_num,
- u32 id)
+il_queue_init(struct il_priv *il, struct il_queue *q, int slots, u32 id)
{
- q->n_bd = count;
- q->n_win = slots_num;
- q->id = id;
+ /*
+ * TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
+ * il_queue_inc_wrap and il_queue_dec_wrap are broken.
+ */
+ BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
+ /* FIXME: remove q->n_bd */
+ q->n_bd = TFD_QUEUE_SIZE_MAX;
- /* count must be power-of-two size, otherwise il_queue_inc_wrap
- * and il_queue_dec_wrap are broken. */
- BUG_ON(!is_power_of_2(count));
+ q->n_win = slots;
+ q->id = id;
- /* slots_num must be power-of-two size, otherwise
+ /* slots_must be power-of-two size, otherwise
* il_get_cmd_idx is broken. */
- BUG_ON(!is_power_of_2(slots_num));
+ BUG_ON(!is_power_of_2(slots));
q->low_mark = q->n_win / 4;
if (q->low_mark < 4)
@@ -2959,12 +2961,11 @@ error:
* il_tx_queue_init - Allocate and initialize one tx/cmd queue
*/
int
-il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
- u32 txq_id)
+il_tx_queue_init(struct il_priv *il, u32 txq_id)
{
- int i, len;
- int ret;
- int actual_slots = slots_num;
+ int i, len, ret;
+ int slots, actual_slots;
+ struct il_tx_queue *txq = &il->txq[txq_id];
/*
* Alloc buffer array for commands (Tx or other types of commands).
@@ -2974,8 +2975,13 @@ il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
* For normal Tx queues (all other queues), no super-size command
* space is needed.
*/
- if (txq_id == il->cmd_queue)
- actual_slots++;
+ if (txq_id == il->cmd_queue) {
+ slots = TFD_CMD_SLOTS;
+ actual_slots = slots + 1;
+ } else {
+ slots = TFD_TX_CMD_SLOTS;
+ actual_slots = slots;
+ }
txq->meta =
kzalloc(sizeof(struct il_cmd_meta) * actual_slots, GFP_KERNEL);
@@ -2988,7 +2994,7 @@ il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
len = sizeof(struct il_device_cmd);
for (i = 0; i < actual_slots; i++) {
/* only happens for cmd queue */
- if (i == slots_num)
+ if (i == slots)
len = IL_MAX_CMD_SIZE;
txq->cmd[i] = kmalloc(len, GFP_KERNEL);
@@ -3011,12 +3017,8 @@ il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
if (txq_id < 4)
il_set_swq_id(txq, txq_id, txq_id);
- /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise
- * il_queue_inc_wrap and il_queue_dec_wrap are broken. */
- BUILD_BUG_ON(TFD_QUEUE_SIZE_MAX & (TFD_QUEUE_SIZE_MAX - 1));
-
/* Initialize queue's high/low-water marks, and head/tail idxes */
- il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
+ il_queue_init(il, &txq->q, slots, txq_id);
/* Tell device where to find queue */
il->ops->txq_init(il, txq);
@@ -3034,20 +3036,24 @@ out_free_arrays:
EXPORT_SYMBOL(il_tx_queue_init);
void
-il_tx_queue_reset(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
- u32 txq_id)
+il_tx_queue_reset(struct il_priv *il, u32 txq_id)
{
- int actual_slots = slots_num;
+ int slots, actual_slots;
+ struct il_tx_queue *txq = &il->txq[txq_id];
- if (txq_id == il->cmd_queue)
- actual_slots++;
+ if (txq_id == il->cmd_queue) {
+ slots = TFD_CMD_SLOTS;
+ actual_slots = TFD_CMD_SLOTS + 1;
+ } else {
+ slots = TFD_TX_CMD_SLOTS;
+ actual_slots = TFD_TX_CMD_SLOTS;
+ }
memset(txq->meta, 0, sizeof(struct il_cmd_meta) * actual_slots);
-
txq->need_update = 0;
/* Initialize queue's high/low-water marks, and head/tail idxes */
- il_queue_init(il, &txq->q, TFD_QUEUE_SIZE_MAX, slots_num, txq_id);
+ il_queue_init(il, &txq->q, slots, txq_id);
/* Tell device where to find queue */
il->ops->txq_init(il, txq);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 13bfd43..e2f55dc 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1783,14 +1783,12 @@ void il_chswitch_done(struct il_priv *il, bool is_success);
/*****************************************************
* TX
******************************************************/
-void il_txq_update_write_ptr(struct il_priv *il, struct il_tx_queue *txq);
-int il_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq, int slots_num,
- u32 txq_id);
-void il_tx_queue_reset(struct il_priv *il, struct il_tx_queue *txq,
- int slots_num, u32 txq_id);
-void il_tx_queue_unmap(struct il_priv *il, int txq_id);
-void il_tx_queue_free(struct il_priv *il, int txq_id);
-void il_setup_watchdog(struct il_priv *il);
+extern void il_txq_update_write_ptr(struct il_priv *il, struct il_tx_queue *txq);
+extern int il_tx_queue_init(struct il_priv *il, u32 txq_id);
+extern void il_tx_queue_reset(struct il_priv *il, u32 txq_id);
+extern void il_tx_queue_unmap(struct il_priv *il, int txq_id);
+extern void il_tx_queue_free(struct il_priv *il, int txq_id);
+extern void il_setup_watchdog(struct il_priv *il);
/*****************************************************
* TX power
****************************************************/
@@ -2405,10 +2403,10 @@ struct il_rb_status {
__le32 __unused; /* 3945 only */
} __packed;
-#define TFD_QUEUE_SIZE_MAX (256)
-#define TFD_QUEUE_SIZE_BC_DUP (64)
+#define TFD_QUEUE_SIZE_MAX 256
+#define TFD_QUEUE_SIZE_BC_DUP 64
#define TFD_QUEUE_BC_SIZE (TFD_QUEUE_SIZE_MAX + TFD_QUEUE_SIZE_BC_DUP)
-#define IL_TX_DMA_MASK DMA_BIT_MASK(36)
+#define IL_TX_DMA_MASK DMA_BIT_MASK(36)
#define IL_NUM_OF_TBS 20
static inline u8
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 22/24] iwlegacy: s/S_RF_KILL_HW/S_RFKILL/g
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (20 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 21/24] iwlegacy: small queue initializations cleanup Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 23/24] iwlegacy: s/il_txq_mem/il_free_txq_mem/g Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 24/24] iwlegacy: remove il_is_rfkill_hw Stanislaw Gruszka
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 30 +++++++++++++++---------------
drivers/net/wireless/iwlegacy/4965-mac.c | 28 ++++++++++++++--------------
drivers/net/wireless/iwlegacy/common.c | 6 +++---
drivers/net/wireless/iwlegacy/common.h | 4 ++--
drivers/net/wireless/iwlegacy/debug.c | 4 ++--
5 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index ee91ab2..0ccc934 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -809,16 +809,16 @@ il3945_hdl_card_state(struct il_priv *il, struct il_rx_buf *rxb)
_il_wr(il, CSR_UCODE_DRV_GP1_SET, CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED);
if (flags & HW_CARD_DISABLED)
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
else
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
il_scan_cancel(il);
- if ((test_bit(S_RF_KILL_HW, &status) !=
- test_bit(S_RF_KILL_HW, &il->status)))
+ if ((test_bit(S_RFKILL, &status) !=
+ test_bit(S_RFKILL, &il->status)))
wiphy_rfkill_set_hw_state(il->hw->wiphy,
- test_bit(S_RF_KILL_HW, &il->status));
+ test_bit(S_RFKILL, &il->status));
else
wake_up(&il->wait_command_queue);
}
@@ -2166,7 +2166,7 @@ il3945_alive_start(struct il_priv *il)
D_INFO("RFKILL status: 0x%x\n", rfkill);
if (rfkill & 0x1) {
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
/* if RFKILL is not on, then wait for thermal
* sensor in adapter to kick in */
while (il3945_hw_get_temperature(il) == 0) {
@@ -2178,7 +2178,7 @@ il3945_alive_start(struct il_priv *il)
D_INFO("Thermal calibration took %dus\n",
thermal_spin * 10);
} else
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
/* After the ALIVE response, we can send commands to 3945 uCode */
set_bit(S_ALIVE, &il->status);
@@ -2272,7 +2272,7 @@ __il3945_down(struct il_priv *il)
* clear all bits but the RF Kill bits and return */
if (!il_is_init(il)) {
il->status =
- test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_RFKILL, &il->status) << S_RFKILL |
test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
goto exit;
@@ -2281,7 +2281,7 @@ __il3945_down(struct il_priv *il)
/* ...otherwise clear out all the status bits but the RF Kill
* bit and continue taking the NIC down. */
il->status &=
- test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_RFKILL, &il->status) << S_RFKILL |
test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
@@ -2371,9 +2371,9 @@ __il3945_up(struct il_priv *il)
/* If platform's RF_KILL switch is NOT set to KILL */
if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
else {
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
IL_WARN("Radio disabled by HW RF Kill switch\n");
return -ENODEV;
}
@@ -2405,7 +2405,7 @@ __il3945_up(struct il_priv *il)
il->ucode_data.len);
/* We return success when we resume from suspend and rf_kill is on. */
- if (test_bit(S_RF_KILL_HW, &il->status))
+ if (test_bit(S_RFKILL, &il->status))
return 0;
for (i = 0; i < MAX_HW_RESTARTS; i++) {
@@ -2485,15 +2485,15 @@ il3945_rfkill_poll(struct work_struct *data)
{
struct il_priv *il =
container_of(data, struct il_priv, _3945.rfkill_poll.work);
- bool old_rfkill = test_bit(S_RF_KILL_HW, &il->status);
+ bool old_rfkill = test_bit(S_RFKILL, &il->status);
bool new_rfkill =
!(_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW);
if (new_rfkill != old_rfkill) {
if (new_rfkill)
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
else
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy, new_rfkill);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index a0158e3..3aa0ee5 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4110,17 +4110,17 @@ il4965_hdl_card_state(struct il_priv *il, struct il_rx_buf *rxb)
il4965_perform_ct_kill_task(il);
if (flags & HW_CARD_DISABLED)
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
else
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
if (!(flags & RXON_CARD_DISABLED))
il_scan_cancel(il);
- if ((test_bit(S_RF_KILL_HW, &status) !=
- test_bit(S_RF_KILL_HW, &il->status)))
+ if ((test_bit(S_RFKILL, &status) !=
+ test_bit(S_RFKILL, &il->status)))
wiphy_rfkill_set_hw_state(il->hw->wiphy,
- test_bit(S_RF_KILL_HW, &il->status));
+ test_bit(S_RFKILL, &il->status));
else
wake_up(&il->wait_command_queue);
}
@@ -4412,9 +4412,9 @@ il4965_irq_tasklet(struct il_priv *il)
*/
if (!test_bit(S_ALIVE, &il->status)) {
if (hw_rf_kill)
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
else
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
}
@@ -5383,7 +5383,7 @@ __il4965_down(struct il_priv *il)
* clear all bits but the RF Kill bit and return */
if (!il_is_init(il)) {
il->status =
- test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_RFKILL, &il->status) << S_RFKILL |
test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
goto exit;
@@ -5392,7 +5392,7 @@ __il4965_down(struct il_priv *il)
/* ...otherwise clear out all the status bits but the RF Kill
* bit and continue taking the NIC down. */
il->status &=
- test_bit(S_RF_KILL_HW, &il->status) << S_RF_KILL_HW |
+ test_bit(S_RFKILL, &il->status) << S_RFKILL |
test_bit(S_GEO_CONFIGURED, &il->status) << S_GEO_CONFIGURED |
test_bit(S_FW_ERROR, &il->status) << S_FW_ERROR |
test_bit(S_EXIT_PENDING, &il->status) << S_EXIT_PENDING;
@@ -5514,9 +5514,9 @@ __il4965_up(struct il_priv *il)
/* If platform's RF_KILL switch is NOT set to KILL */
if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
else {
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy, true);
il_enable_rfkill_int(il);
@@ -6612,12 +6612,12 @@ il4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* If platform's RF_KILL switch is NOT set to KILL */
if (_il_rd(il, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
else
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy,
- test_bit(S_RF_KILL_HW, &il->status));
+ test_bit(S_RFKILL, &il->status));
il_power_initialize(il);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 872302a..defe8d9 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -350,7 +350,7 @@ il_send_cmd_sync(struct il_priv *il, struct il_host_cmd *cmd)
}
}
- if (test_bit(S_RF_KILL_HW, &il->status)) {
+ if (test_bit(S_RFKILL, &il->status)) {
IL_ERR("Command %s aborted: RF KILL Switch\n",
il_get_cmd_string(cmd->id));
ret = -ECANCELED;
@@ -4890,9 +4890,9 @@ il_pci_resume(struct device *device)
hw_rfkill = true;
if (hw_rfkill)
- set_bit(S_RF_KILL_HW, &il->status);
+ set_bit(S_RFKILL, &il->status);
else
- clear_bit(S_RF_KILL_HW, &il->status);
+ clear_bit(S_RFKILL, &il->status);
wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rfkill);
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index e2f55dc..4282018 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1906,7 +1906,7 @@ void il_free_geos(struct il_priv *il);
#define S_HCMD_ACTIVE 0 /* host command in progress */
/* 1 is unused (used to be S_HCMD_SYNC_ACTIVE) */
#define S_INT_ENABLED 2
-#define S_RF_KILL_HW 3
+#define S_RFKILL 3
#define S_CT_KILL 4
#define S_INIT 5
#define S_ALIVE 6
@@ -1947,7 +1947,7 @@ il_is_init(struct il_priv *il)
static inline int
il_is_rfkill_hw(struct il_priv *il)
{
- return test_bit(S_RF_KILL_HW, &il->status);
+ return test_bit(S_RFKILL, &il->status);
}
static inline int
diff --git a/drivers/net/wireless/iwlegacy/debug.c b/drivers/net/wireless/iwlegacy/debug.c
index 236dc90..2298491 100644
--- a/drivers/net/wireless/iwlegacy/debug.c
+++ b/drivers/net/wireless/iwlegacy/debug.c
@@ -630,8 +630,8 @@ il_dbgfs_status_read(struct file *file, char __user *user_buf, size_t count,
scnprintf(buf + pos, bufsz - pos, "S_INT_ENABLED:\t %d\n",
test_bit(S_INT_ENABLED, &il->status));
pos +=
- scnprintf(buf + pos, bufsz - pos, "S_RF_KILL_HW:\t %d\n",
- test_bit(S_RF_KILL_HW, &il->status));
+ scnprintf(buf + pos, bufsz - pos, "S_RFKILL:\t %d\n",
+ test_bit(S_RFKILL, &il->status));
pos +=
scnprintf(buf + pos, bufsz - pos, "S_CT_KILL:\t\t %d\n",
test_bit(S_CT_KILL, &il->status));
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 23/24] iwlegacy: s/il_txq_mem/il_free_txq_mem/g
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (21 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 22/24] iwlegacy: s/S_RF_KILL_HW/S_RFKILL/g Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
2012-02-13 10:23 ` [PATCH 24/24] iwlegacy: remove il_is_rfkill_hw Stanislaw Gruszka
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Previous name was confusing.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/3945.c | 2 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/iwlegacy/common.c | 4 ++--
drivers/net/wireless/iwlegacy/common.h | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 8900e3c..456f32d 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -1002,7 +1002,7 @@ il3945_hw_txq_ctx_free(struct il_priv *il)
il_tx_queue_free(il, txq_id);
/* free tx queue structure */
- il_txq_mem(il);
+ il_free_txq_mem(il);
}
void
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 3aa0ee5..2d01db0 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1939,7 +1939,7 @@ il4965_hw_txq_ctx_free(struct il_priv *il)
il4965_free_dma_ptr(il, &il->scd_bc_tbls);
/* free tx queue structure */
- il_txq_mem(il);
+ il_free_txq_mem(il);
}
/**
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index defe8d9..b42052b 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4591,12 +4591,12 @@ il_alloc_txq_mem(struct il_priv *il)
EXPORT_SYMBOL(il_alloc_txq_mem);
void
-il_txq_mem(struct il_priv *il)
+il_free_txq_mem(struct il_priv *il)
{
kfree(il->txq);
il->txq = NULL;
}
-EXPORT_SYMBOL(il_txq_mem);
+EXPORT_SYMBOL(il_free_txq_mem);
int
il_force_reset(struct il_priv *il, bool external)
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 4282018..cee72f1 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1747,7 +1747,7 @@ void il_mac_remove_interface(struct ieee80211_hw *hw,
int il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum nl80211_iftype newtype, bool newp2p);
int il_alloc_txq_mem(struct il_priv *il);
-void il_txq_mem(struct il_priv *il);
+void il_free_txq_mem(struct il_priv *il);
#ifdef CONFIG_IWLEGACY_DEBUGFS
extern void il_update_stats(struct il_priv *il, bool is_tx, __le16 fc, u16 len);
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread
* [PATCH 24/24] iwlegacy: remove il_is_rfkill_hw
2012-02-13 10:23 [PATCH 00/24] iwlegacy update 2012-02-13 Stanislaw Gruszka
` (22 preceding siblings ...)
2012-02-13 10:23 ` [PATCH 23/24] iwlegacy: s/il_txq_mem/il_free_txq_mem/g Stanislaw Gruszka
@ 2012-02-13 10:23 ` Stanislaw Gruszka
23 siblings, 0 replies; 28+ messages in thread
From: Stanislaw Gruszka @ 2012-02-13 10:23 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Stanislaw Gruszka
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlegacy/common.h | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index cee72f1..6ed9871 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1945,15 +1945,9 @@ il_is_init(struct il_priv *il)
}
static inline int
-il_is_rfkill_hw(struct il_priv *il)
-{
- return test_bit(S_RFKILL, &il->status);
-}
-
-static inline int
il_is_rfkill(struct il_priv *il)
{
- return il_is_rfkill_hw(il);
+ return test_bit(S_RFKILL, &il->status);
}
static inline int
--
1.7.1
^ permalink raw reply related [flat|nested] 28+ messages in thread