[rt2x00-users] [RFC 1/9] rt2x00: use an irqmask to simplify irq toggling
Ivo Van Doorn
ivdoorn at gmail.com
Mon Jul 5 17:05:27 UTC 2010
On Mon, Jul 5, 2010 at 6:19 PM, Helmut Schaa
<helmut.schaa at googlemail.com> wrote:
> Use an irqmask to simplify irq toggling. Will be used in a subsequent patch.
>
> Signed-off-by: Helmut Schaa <helmut.schaa at googlemail.com>
> ---
> drivers/net/wireless/rt2x00/rt2400pci.c | 22 +++++++++---
> drivers/net/wireless/rt2x00/rt2500pci.c | 22 +++++++++---
> drivers/net/wireless/rt2x00/rt2800pci.c | 53 ++++++++++++++++++++-----------
> drivers/net/wireless/rt2x00/rt2x00.h | 5 +++
> drivers/net/wireless/rt2x00/rt61pci.c | 41 +++++++++++++++++-------
> 5 files changed, 100 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
> index 3bedf56..b627fdc 100644
> --- a/drivers/net/wireless/rt2x00/rt2400pci.c
> +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
> @@ -877,7 +877,6 @@ static void rt2400pci_toggle_rx(struct rt2x00_dev *rt2x00dev,
> static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
> enum dev_state state)
> {
> - int mask = (state == STATE_RADIO_IRQ_OFF);
> u32 reg;
>
> /*
> @@ -894,11 +893,10 @@ static void rt2400pci_toggle_irq(struct rt2x00_dev *rt2x00dev,
> * Non-checked interrupt bits are disabled by default.
> */
> rt2x00pci_register_read(rt2x00dev, CSR8, ®);
> - rt2x00_set_field32(®, CSR8_TBCN_EXPIRE, mask);
> - rt2x00_set_field32(®, CSR8_TXDONE_TXRING, mask);
> - rt2x00_set_field32(®, CSR8_TXDONE_ATIMRING, mask);
> - rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, mask);
> - rt2x00_set_field32(®, CSR8_RXDONE, mask);
> + if (state == STATE_RADIO_IRQ_OFF)
> + reg |= rt2x00dev->irqmask[0];
> + else
> + reg &= ~rt2x00dev->irqmask[0];
> rt2x00pci_register_write(rt2x00dev, CSR8, reg);
> }
This patch will not compile due to the missing
addition of irqmask to struct rt2x00_dev. But even then,
I do not believe this will simplify IRQ handling, instead
this seems to complicate matters.
But I will propose alternatives in your patch 2, where you
are using this irqmask more. :)
Ivo
More information about the users
mailing list