Commit Graph

87183 Commits

Author SHA1 Message Date
Bruno Randolf 62412a8f0d ath5k: remove pointless rx error overlay struct
ath5k_hw_rx_error was only used once, where we could easily just use
ath5k_hw_rx_status as well, so remove it.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:04 -04:00
Bruno Randolf 2847109f73 ath5k: cosmetic changes in ath5k_hw_proc_5212_rx_status()
Just whitespace and indentation.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:04 -04:00
Bruno Randolf a666819354 ath5k: use direct function calls for descriptors when possible
Use direct function calls for ath5k_hw_setup_rx_desc() and
ath5k_hw_setup_mrr_tx_desc() instead of a function pointer which always pointed
to the same function in the case of ath5k_hw_setup_rx_desc() and which is
easily unified in the case of ath5k_hw_setup_mrr_tx_desc().

Also simplify the initialization function for the remaining function pointers.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:03 -04:00
Bruno Randolf 02a78b42f8 ath5k: move checks and stats into new function
Create a new function ath5k_receive_frame_ok() which checks for errors, updates
error statistics and tells us if we want to further "receive" this frame or
not. This way we can avoid a goto and have a cleaner separation between buffer
handling and other things.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:03 -04:00
Bruno Randolf 8a89f063e7 ath5k: split descriptor handling and frame receive
Move frame reception into it's own function to have a clearer separation
between buffer and descriptor handling and things that are done when we
actually receive a frame.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:02 -04:00
Bruno Randolf b16062facb ath5k: unify rx descriptor error handling
There is no reason for a special handling (return) here, just break like we do
with the checks before.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:02 -04:00
Bruno Randolf 39d63f2a3f ath5k: reset more pointers after we free skbs
After we free skbs for receive or transmit descriptors, make sure we have no
pointers to the now invalid memory address.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:01 -04:00
Bruno Randolf 0452d4a508 ath5k: print more errors when decriptor setup fails
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:00 -04:00
Bruno Randolf 265faadd6a ath5k: fix rx descriptor debugging
In the debug ouptut rx_status_0 was printed twice instead of rx_status_1. Also
make the debug message more clear.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:59:00 -04:00
Bruno Randolf beade6363c ath5k: fix some comment typos
Fix comment about dma sizes, brackets were missing. Replace 'insure' with
'ensure'.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:59 -04:00
Bruno Randolf 9e4e43f20f ath5k: rename ath5k_txbuf_free() to ath5k_txbuf_free_skb()
Rename ath5k_txbuf_free() to ath5k_txbuf_free_skb() since this is what it does:
it frees the skb and not the buf. Same for ath5k_rxbuf_free().

Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:58 -04:00
Bruno Randolf 8d67a0310f ath5k: more debug prints for resets
Add a debug print for every case of reset.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:58 -04:00
ubuntu@tjworld.net c086abae5b ipw2200: Enable LED by default
BugLink: http://bugs.launchpad.net/bugs/21367

Enable LED by default and update the MODULE_PARM_DESC.  The original
reason for defaulting to disabled was documented in 2005 and noted, "The
LED code has been reported to hang some systems when running ifconfig
and is therefore disabled by default."  This no longer appears
applicable and users have been requesting this be enabled for several
years.

Signed-off-by: TJ <ubuntu@tjworld.net>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:57 -04:00
Leann Ogasawara 7484bdc056 p54usb: Comment out duplicate Medion MD40900 device id
The Medion MD40900 device id [0x0cde, 0x0006] is defined twice.
Comment out the duplicate.

Originally-by: Ben Collins <ben.collins@ubuntu.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:57 -04:00
John W. Linville 3d3b33bd99 zd1211rw: change ZD_REGDOMAIN_JAPAN_* naming
ZD_REGDOMAIN_JAPAN_ADD and ZD_REGDOMAIN_JAPAN_GW_US54GXS seem a little
verbose to me...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:58:46 -04:00
Kouhei Sutou 71184ba482 zd1211rw: add 0x49 -> JP regulatory domain map
0x49 is used by PLANEX GW-US54GXS (2019:5303).

Signed-off-by: Kouhei Sutou <kou@clear-code.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-16 14:39:44 -04:00
Sujith d7ca21393d ath9k_htc: Fix ampdu_action callback
Now that ampdu_action() can sleep, remove all
the driver hacks and just issue WMI commands
to the target.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:22 -04:00
Luis R. Rodriguez 9a2af8892a ath9k_hw: avoid setting cwmin/cwmax to 0 for IBSS for AR9003
IBSS requires the cwmin and cwmax to be respected when
we reset the txqueues on AR9003 otherwise the distribution
of beacons will be balanced towards the AR9003 card first
preventing equal contention for air time for other peers
on the IBSS.

Without this IBSS will work but only the AR9003 card will be
be issuing beacons on the IBSS.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:22 -04:00
Ivo van Doorn e4a0ab3487 rt2x00: Synchronize WCID initialization with legacy driver
Legacy rt2870 driver handles WCID differently then we expected,
the BSSID and Cipher value are 3 bit values, while the 4th bit
should be set elsewhere in an extended field.

After this, rt2800usb reports frames have been decrypted
successfully, indicating that the Hardware decryption now is
working correctly.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:21 -04:00
Ivo van Doorn 04f1e34d3c rt2x00: Enable HW crypto by default
Hardware cryptography seems to be working
on a 11G network with WPA/WPA2 cryptography
enabled. WEP still needs to be tested...

Signed-of-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:20 -04:00
Ivo van Doorn e6474c3c6d rt2x00: Limit TX done looping to number of TX ring entries
Similar to rt2800pci, remove the check for duplicate
register reading, and instead limit the for-loop to
the maximum number of TX entries inside a queue.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:20 -04:00
Ivo van Doorn a5ea2f0255 rt2x00: Update author rt2800lib
rt2800lib has been under development of the rt2x00 project,
so add it to the author string for the module information.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:02:13 -04:00
Ivo van Doorn e1b4d7b735 rt2x00: Enable fallback rates for rt61pci and rt73usb
Explicitly enable the usage of fallback rates for
the transmission of frames with rt61pci and rt73usb hardware.

Note that for txdone reporting, only rt61pci is capable of
reporting the fallback rates, for USB it is not possible
to determine the number of retries. However the device will
use the fallback rates, so it might still help in the performance.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa 3d2bc1036a rt2x00: Fix tx status reporting when falling back to the lowest rate
In some corner cases the reported tx rates/retries didn't match the really
used ones.

The hardware lowers the tx rate on each consecutive retry by 1 (but won't
fall back from MCS to legacy rates) _until_ it reaches the lowest one.

In case the frame wasn't sent succesful the number of retries is 7 and if
a rate index <7 was used the previous code reported negative rate indexes
which were then ignored by the rate control algorithm and mac80211.

Instead, report the remaining number of retries to have happened with
the lowest rate (index 0). This should give the rate control algorithm
slightly more accurate information about the used tx rates/retries.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa 3f2bee2499 rt2x00: provide mac80211 a suitable max_rates value
Set up max_rates and max_rate_tries with suitable values even if we do not
support the whole functionality.

As rt2800 has a global fallback table we cannot specify more then one tx rate
per frame but since the hw will try several different rates (based on the
fallback table) we should still initialize max_rates to the maximum number of
rates we are going to try. Otherwise mac80211 will truncate our reported tx
rates and the rc algortihm will end up with incorrect data choosing unsuitable
rates for tx.

This improves throughput on rt2800 devices considerable.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa a3f84ca4b8 rt2x00: Fix typo in rt2800_config_txpower
Fix typo in rt2800_config_txpower.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa 3afa626a05 rt2x00: Fix TX_STA_FIFO handling
Currently rt2800pci will read TX_STA_FIFO until the previously read value
matches the current value. However, it is obvious that TX_STA_FIFO only
contains values that can easily be the same for multiple consecutive frames
(especially when communicating with only one other STA). Hence, we often
ended up with reading only the first entry and ignoring the rest.

One result was that when the TX_STA_FIFO contained multiple entires, only
the first one was read and properly handled while the others remained in the
tx queue.

Thus, drop this check but introduce a maximum number of reads. All legacy
drivers use the size of the tx ring as limit but state that the TX_STA_FIFO
has only 16 entries. So, let's just stick with the tx ring size for now.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa 52b58facff rt2x00: Add comment about BBP1_TX_POWER
Add a comment about the meaning of BBP1_TX_POWER stating all possible values.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:50 -04:00
Helmut Schaa 2606e4223e rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling
IEEE80211_TX_CTL_MORE_FRAMES indicates that more frames are queued for tx
but has nothing to do with fragmentation. Hence, don't set ENTRY_TXD_MORE_FRAG
but only ENTRY_TXD_BURST to not kick the tx queues immediately.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:49 -04:00
Helmut Schaa ecb7cab59a rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried
TXDONE_FALLBACK expresses that fallback rates were used for retries. Hence,
it only makes sense to set the flag if retries > 0.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:49 -04:00
Helmut Schaa fd6dcb883a rt2x00: don't use TXDONE_FALLBACK as success indicator
TXDONE_FALLBACK doesn't express if the frame was sent successful or not. It
only tells us that the hw used fallback rates for retries. Hence, don't use
TXDONE_FALLBACK as success indicator.

Before this patch we reported success to the rate control algorithm which
was wrong in a number of cases and might have lead to improper tx rate
selections.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:49 -04:00
Helmut Schaa 46678b197a rt2x00: clarify meaning of txdone flags
Update the documentation of the available txdone flags to better express
how they should be used.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-15 16:00:49 -04:00
Felix Fietkau 7b9a4b0019 ath9k_hw: remove ATH9K_CAP_DS
This capability check is no longer used, so it can be removed along with
the now-obsolete ath9k_hw_getcapability function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 3553727cfa ath9k/ath9k_htc: remove redundand checks for dual-stream tx support
mac80211 already masks the HT sta capabilities based on hardware support

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 16f2411fcb ath9k_hw: remove ATH9K_CAP_MCAST_KEYSRCH
The driver always sets this to enabled, but this can be simplified with
a small change to ah->sta_id1_defaults instead.
This change also removes the now-obsolete ath9k_hw_setcapability function.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau f32a488463 ath9k_hw: remove ATH9K_CAP_TKIP_SPLIT
This is only used as a workaround for an issue in one specific hw revision.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 71fca6e983 ath9k_hw: remove ATH9K_CAP_TKIP_MIC
TKIP MIC support is always enabled anyway.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 9cc3271faa ath9k_hw: remove ATH9K_CAP_TXPOW
replace calls that read this capability with accesses to ath9k_hw's
regulatory data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 716f7fc5b8 ath9k_hw: remove ATH9K_CAP_CIPHER
All of the ciphers that are tested for are always supported

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Luis R. Rodriguez 0efabd5123 ath9k: enable AR9003 PCI IDs
All AR9003 features are now complete so enable AR9003
support.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:33 -04:00
Felix Fietkau 9f42c2b667 ath9k: implement PA predistortion support
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:32 -04:00
Felix Fietkau 717f6bedcd ath9k_hw: add functions for controlling PA predistortion calibration
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:32 -04:00
Felix Fietkau 4935250ac1 ath9k_hw: add support for parsing PA predistortion related EEPROM fields
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:32 -04:00
Felix Fietkau ab33449895 ath9k_hw: add register definitions related to PA predistortion
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:32 -04:00
Felix Fietkau 96d159d03c ath9k_hw: remove a useless function for setting the mac address
ath9k_hw_setmac() only copies the mac address it is called with into
common->macaddr, yet in all call sites, the supplied mac address pointer
is already common->macaddr.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:31 -04:00
Felix Fietkau 41f3e54d72 ath9k: add a debugfs entry for ignoring CCA on the extension channel in HT40
Debugfs requires a u32 for bool knobs though so we turn the
ath9k_hw knob into a u32 as well.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:31 -04:00
Felix Fietkau 97923b14a5 ath9k: fix queue stopping threshold
ath9k tries to prevent WMM queue tx buffer starvation caused by
traffic on different queues by limiting the number of pending frames
in a tx queue (tracked in the ath_buf structure). This had a leak
issue, because the a skb can be reassigned to a different ath_buf
in the tx path, causing the pending frame counter to become inaccurate.

To fix this, track the number of frames in an array in the softc,
using the mac80211 queue mapping as index.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:31 -04:00
Felix Fietkau a6d2055b02 ath9k: fix extending the rx timestamp with the hardware TSF
AR5416 and all newer chipsets use a 32 bit rx timestamp, so there
is no need to keep the 15 bit timestamp extending logic around.

This patch removes ath9k_hw_extend_tsf (replaced by a call to
ath9k_hw_gettsf64), and reduces the frequency of TSF reads, which
can improve performance in some cases.

This change also has the side effect of making rx timestamps
more accurate.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:31 -04:00
Felix Fietkau ebe297c35d ath9k: make ath_get_hal_qnum static
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:30 -04:00
Felix Fietkau 9623009d2d ath9k: remove declarations of some nonexistant functions
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-06-14 15:39:30 -04:00