diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2010-07-11 06:28:23 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-12 16:05:35 -0400 |
commit | 9f926fb57a2eb14d58ea6d6699544f9ccd0df8c7 (patch) | |
tree | 968fd46eea2a5691e1be0d2cca4ec6697d53d825 /drivers/net/wireless/rt2x00/rt2800pci.c | |
parent | 07896fe2f4df3802a224a2ee1aad1c7345d2513c (diff) |
rt2x00: Use pretbtt irq for fetching beacons on rt2800pci
Updating the beacon on pre tbtt instead of beacondone allows much lower
latency in regard to TIM updates. Hence, use the pre tbtt interrupt for
updating the beacon in rt2800pci (older devices don't provide a pre tbtt
interrupt).
Also, add a new driver flag to indicate if a driver has pre tbtt support
or not and implement the according behavior in rt2x00lib.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800pci.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800pci.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index f21b77c61ad4..c0c38f9705ae 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -938,20 +938,32 @@ static irqreturn_t rt2800pci_interrupt_thread(int irq, void *dev_instance) | |||
938 | u32 reg = rt2x00dev->irqvalue[0]; | 938 | u32 reg = rt2x00dev->irqvalue[0]; |
939 | 939 | ||
940 | /* | 940 | /* |
941 | * 1 - Rx ring done interrupt. | 941 | * 1 - Pre TBTT interrupt. |
942 | */ | ||
943 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_PRE_TBTT)) | ||
944 | rt2x00lib_pretbtt(rt2x00dev); | ||
945 | |||
946 | /* | ||
947 | * 2 - Beacondone interrupt. | ||
948 | */ | ||
949 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TBTT)) | ||
950 | rt2x00lib_beacondone(rt2x00dev); | ||
951 | |||
952 | /* | ||
953 | * 3 - Rx ring done interrupt. | ||
942 | */ | 954 | */ |
943 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_RX_DONE)) | 955 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_RX_DONE)) |
944 | rt2x00pci_rxdone(rt2x00dev); | 956 | rt2x00pci_rxdone(rt2x00dev); |
945 | 957 | ||
958 | /* | ||
959 | * 4 - Tx done interrupt. | ||
960 | */ | ||
946 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) | 961 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TX_FIFO_STATUS)) |
947 | rt2800pci_txdone(rt2x00dev); | 962 | rt2800pci_txdone(rt2x00dev); |
948 | 963 | ||
949 | /* | 964 | /* |
950 | * Current beacon was sent out, fetch the next one | 965 | * 5 - Auto wakeup interrupt. |
951 | */ | 966 | */ |
952 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_TBTT)) | ||
953 | rt2x00lib_beacondone(rt2x00dev); | ||
954 | |||
955 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_AUTO_WAKEUP)) | 967 | if (rt2x00_get_field32(reg, INT_SOURCE_CSR_AUTO_WAKEUP)) |
956 | rt2800pci_wakeup(rt2x00dev); | 968 | rt2800pci_wakeup(rt2x00dev); |
957 | 969 | ||
@@ -1052,6 +1064,12 @@ static int rt2800pci_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1052 | __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); | 1064 | __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); |
1053 | 1065 | ||
1054 | /* | 1066 | /* |
1067 | * This device has a pre tbtt interrupt and thus fetches | ||
1068 | * a new beacon directly prior to transmission. | ||
1069 | */ | ||
1070 | __set_bit(DRIVER_SUPPORT_PRE_TBTT_INTERRUPT, &rt2x00dev->flags); | ||
1071 | |||
1072 | /* | ||
1055 | * This device requires firmware. | 1073 | * This device requires firmware. |
1056 | */ | 1074 | */ |
1057 | if (!rt2x00_is_soc(rt2x00dev)) | 1075 | if (!rt2x00_is_soc(rt2x00dev)) |