summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/common.c
Commit message (Collapse)AuthorAgeFilesLines
* ath9k_common: remove ath9k_cmn_padposFelix Fietkau2013-04-101-14/+0
| | | | | | | It is equivalent to ieee80211_hdrlen Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan2013-03-251-2/+3
| | | | | | | | | | Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath9k_hw: clean up tx power handlingFelix Fietkau2011-10-111-2/+4
| | | | | | | | | | | | | | | The code for handling various restrictions concerning regulatory limits, antenna gain, etc. is very convoluted and duplicated across various EEPROM parsing implementations, making it hard to review. This patch partially cleans up the mess by unifying regulatory limit handling in one function and simplifying handling of antenna gain. It also removes unused transmit power scaling arrays from the EEPROM code, which belonged to an unimplemented API that isn't supposed to be in the driver anyway. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Move ath9k_init_crypto to commonRajkumar Manoharan2011-08-241-0/+26
| | | | | Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Drag the driver to the year 2011Sujith Manoharan2011-05-191-1/+1
| | | | | | | The Times They Are a-Changin'. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: Move bt_stomp to hw from common.Vivek Natarajan2011-04-281-31/+0
| | | | | | | Move bt_stomp to ath9k_hw and add its support for latest chipsets. Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: cleanup few redundant macrosMohammed Shafi Shajakhan2011-04-041-1/+1
| | | | | Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: move update tx power to commonRajkumar Manoharan2011-02-031-0/+11
| | | | | | | | move ath_update_txpow to common to remove code duplication in both ath9k & ath9k_htc. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath: Convert ath_print to ath_dbgJoe Perches2010-12-071-2/+2
| | | | | | | | | | | Remove ath/debug.h and the includes of these files. Coalesce long formats. Correct a few misspellings and missing "\n"s from these logging messages. Remove unnecessary trailing space before a newline. Remove ARRAY_SIZE casts, use printf type %zu Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: initialize per-channel tx power limits instead of hardcoding themFelix Fietkau2010-11-151-9/+6
| | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Use common ath key management functionsBruno Randolf2010-09-161-270/+0
| | | | | | | | Use key management functions which have been moved to ath/key.c and remove ath9k copies of these functions and other now unused definitions. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath/ath9k: Replace common->splitmic with a flagBruno Randolf2010-09-161-6/+6
| | | | | | | | | | | Replace common->splitmic with ATH_CRYPT_CAP_MIC_COMBINED flag. splitmic has to be used when the ATH_CRYPT_CAP_MIC_COMBINED capability flag is not set. Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix spurious MIC failure reportsFelix Fietkau2010-08-311-0/+11
| | | | | | | | | | | | | According to the hardware documentation, the MIC failure bit is only valid if the frame was decrypted using a valid TKIP key and is not a fragment. In some setups I've seen hardware-reported MIC failures on an AP that was configured for CCMP only, so it's clear that additional checks are necessary. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: Move bt_stomp to common for sharing with ath9k_htc.Vivek Natarajan2010-08-241-0/+31
| | | | | Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: use cipher suite selectorsJohannes Berg2010-08-161-15/+21
| | | | | | | | | | | | | Currently, mac80211 translates the cfg80211 cipher suite selectors into ALG_* values. That isn't all too useful, and some drivers benefit from the distinction between WEP40 and WEP104 as well. Therefore, convert it all to use the cipher suite selectors. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix crash with WEP in ad-hoc modeFelix Fietkau2010-07-021-0/+4
| | | | | | | | | | | | Commit eed8e22f0133e8278b1f8079fcb452f1f9692f9d added support for using multicast key lookup to support per-vif/sta keys for AP and ad-hoc. Unfortunately, it also introduced a crash in ad-hoc mode when the sta pointer is NULL, which happens when setting up an interface with WEP keys. This patch fixes it by falling back to the assigned key index. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: Move count_streams to common moduleSujith2010-06-041-0/+13
| | | | | | | This can be used by ath9k_htc. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: use allocated key cache entries for multi BSS crypto supportFelix Fietkau2010-06-031-10/+27
| | | | | | | | | | | | This patch replaces the buggy 'ath9k: Group Key fix for VAPs' change. For AP mode group keys, use the BSSID as lookup mac address, with the multicast keysearch bit set. For IBSS mode, use the peer's MAC address with multicast keysearch. For STA mode, keep using the group key slots. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Move ath9k specific RX code to driverSujith2010-06-021-264/+0
| | | | | | | | | This patch relocates RX processing code from the common module to ath9k. This reduces the size of the common module which is also used by ath9k_htc. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: drop incomming frames with an invalid hardware rateLuis R. Rodriguez2010-05-071-2/+1
| | | | | | | | | | | | ath9k_common (used by ath9k and ath9k_htc) trusts the frames blessed by hardware as OK are infact correct even if the rate seen by the driver is unrecognized. ath9k_common just treats these frames in mac80211 as frames as frames under 1 mbps rate. It seems this might not be the best thing to do as other parts of the frame might not be valid so just drop these frames for now. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: move the rate status setting into ath9k_process_rate()Luis R. Rodriguez2010-05-071-13/+27
| | | | | | | | | | | This has no real functional change, this just moves the setting the the mac80211 rate index into ath9k_process_rate(). This allows us to eventually make ath9k_process_rate() return a negative value in case we have detected a specific case rate situation which should have been ignored. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix another source of corrupt framesFelix Fietkau2010-05-071-2/+8
| | | | | | | | | | | Atheros hardware supports receiving frames that span multiple descriptors and buffers. In this case, the rx status of every descriptor except for the last one is invalid and may contain random data. Because the driver does not support this, it needs to drop such frames. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: remove usage of deprecated noise valueJohn W. Linville2010-04-281-1/+0
| | | | Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Do not indicate RX_FLAG_DECRYPTED for unprotected framesJouni Malinen2010-03-311-1/+2
| | | | | | | | | mac80211 skips drop_unencrypted checks if the driver/firmware has already taken care of this. In case of ath9k, we must not indicate that the frame was decrypted if no decryption was actually done. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: Move RX filter code to ath9k_htcSujith2010-03-311-82/+0
| | | | | | | | | | | | The calculation of RX filter is fairly different between ath9k and ath9k_htc, trying to make this common between the two drivers would result in code churn. While at it, remove the handling of PSPOLL filter, it can be added when(if) AP support is added to ath9k_htc. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_htc: Support for AR9271 chipset.Sujith2010-03-231-0/+421
| | | | | | | | | | | | | | | | | | | | | Features: * Station mode * IBSS mode * Monitor mode * Legacy support * HT support * TX/RX 11n Aggregation * HW encryption * LED * Suspend/Resume For more information: http://wireless.kernel.org/en/users/Drivers/ath9k_htc Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Proper padding/unpadding for the TX/RX path.Benoit Papillault2009-11-281-9/+15
| | | | | | | | | | | | Software padding is done on the TX path and software unpadding is done on the RX path. This patch corrects the position where the padding occurs. A specific function computes the pad position and this function is used in the TX and RX path. This patch has been tested by generating every possible 802.11 frames with every possible frame_control field and a varying length. This patch is useful for analyzing non standard 802.11 frames going over the air Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: remove warnings related to signed/unsigned type mismatchJohn W. Linville2009-11-251-2/+0
| | | | | | | | | CC [M] drivers/net/wireless/ath/ath9k/recv.o drivers/net/wireless/ath/ath9k/recv.c: In function `ath_rx_prepare': drivers/net/wireless/ath/ath9k/recv.c:208: warning: comparison is always true due to limited range of data type drivers/net/wireless/ath/ath9k/recv.c:220: warning: comparison is always false due to limited range of data type Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: This patch fix RX unpadding for any received frame.Benoit PAPILLAULT2009-11-231-5/+14
| | | | | | | | | | It has been tested with a 802.11 frame generator and by checking the FCS field of each received frame with the value reported by the Atheros hardware. This patch is useful if you are trying to analyze non standard 802.11 frame going over the air. Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fix massive rx packet loss issueFelix Fietkau2009-11-161-0/+1
| | | | | | | | | | This patch fixes a regression introduced in "ath9k: avoid the copy skb->cb on every RX'd skb" With that change, the rx status in skb->cb was left uninitialized Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: clarify and correct jumbogram processingLuis R. Rodriguez2009-11-111-10/+11
| | | | | | | | | | | | | | | | Jumbograms are frames put together linked together through more than one descriptor. For example ath9k_htc will use this to send from the target a large frame split up into 2 or more segments. The driver then would be in charge of putting the frame back together. When jumbograms are constructed the rx_stats->rs_more will bet set and rx_stats->rs_status will not have any valid content as the actual status will only be avialable at the end of the chained descriptors. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: remove ath9k_compute_qual()Luis R. Rodriguez2009-11-111-42/+0
| | | | | | | | | This is now deprecated and unused within mac80211, so time to remove it as otherwise we'd be doing some unecessary computations for nothing. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_common: add new module to share 802.11n driver helpersLuis R. Rodriguez2009-11-111-0/+326
ath9k and ath9k_htc share a lot of common hardware characteristics. They only differ in that ath9k_htc works with a target CPU and ath9k works directly with the hardware. ath9k_htc will do *some* things in the firmware, but a lot of others on the host. The common 802.11n hardware code is already shared through the ath9k_hw module. Common helpers amongst all Atheros drivers can use the ath module, this includes ath5k and ar9170 as users. But there is some common driver specific helpers which are not exactly hardware code which ath9k and ath9k_htc can share. We'll be using ath9k_common for this to avoid bloating the ath module and the common 802.11n hardware module ath9k_hw. We start by sharing skb pre and post processing in preparation for a hand off to mac80211. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>