summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath5k/pcu.c
AgeCommit message (Collapse)Author
2018-06-13ath5k: mark expected switch fall-throughGustavo A. R. Silva
In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-06-14ath5k: fix misplaced default label in sifs switchBob Copeland
In this switch statement, the default case does not always assign sifs. In practice, ah->ah_bwmode cannot take values besides the other labels, so this is not an actual problem, but it looks odd and smatch complains thus: ath5k_hw_get_default_sifs() warn: missing break? reassigning 'sifs' Silence the warning by moving default label up a line. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-01-23ath5k: document a fall-through case in ath5k_hw_set_opmodeJohn Linville
Coverity: CID 114932 Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2013-08-16ath5k: set 5/10 MHz supported channels and fix durationSimon Wunderlich
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-13mac80211: remove hw.conf.channel usage where possibleMichal Kazior
Removes hw.conf.channel usage from the following functions: * ieee80211_mandatory_rates * ieee80211_sta_get_rates * ieee80211_frame_duration * ieee80211_rts_duration * ieee80211_ctstoself_duration This is in preparation for multi-channel operation. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28ath5k: Cleanups v2 + add kerneldoc on all hw functionsNick Kossifidis
No functional changes Add kernel doc for all ath5k_hw_* functions and strcucts. Also do some cleanup, rename ath5k_hw_init_beacon to ath5k_hw_init_beacon_timers, remove an unused variable from ath5k_hw_pcu_init and a few obsolete macros, mostly related to XR. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-08ath5k: clean up base.h and its usePavel Roskin
Remove unnecessary includes from base.h. Add includes to other files as necessary. Don't include base.h unless needed. Move declarations for functions in base.c from ath5k.h to base.h. Use a better named define to protect base.h against double inclusion. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-08ath5k: eliminate CHANNEL_* macros, use AR5K_MODE_* in channel->hw_valuePavel Roskin
When checking for the band, use channel->band. Change ath5k_hw_nic_wakeup() and ath5k_channel_ok() to take ieee80211_channel. Change ath5k_hw_radio_revision() to take ieee80211_band. Signed-off-by: Pavel Roskin <proski@gnu.org> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-20ath5k: merge ath5k_hw and ath5k_softcPavel Roskin
Both ath5k_hw and ath5k_softc represent one instance of the hardware. This duplication is historical and is not needed anymore. Keep the name "ath5k_hw" for the merged structure and "ah" for the variable pointing to it. "ath5k_hw" is shorter than "ath5k_softc", more descriptive and more widely used. Put the combined structure to ath5k.h where the old ath5k_softc used to be. Move some code from base.h to ath5k.h as needed. Remove memory allocation for struct ath5k_hw and the corresponding error handling. Merge iobase and ah_iobase fields. Signed-off-by: Pavel Roskin <proski@gnu.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11ath5k: fix typos, bad comment formatting and GHz in place of MHzPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-08ath5k: fix formatting errors found by checkpatch.plPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-08ath5k: remove unneeded parentheses after returnPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-core.c drivers/net/wireless/rt2x00/rt2x00queue.c drivers/net/wireless/rt2x00/rt2x00queue.h
2011-04-12ath5k: fix slot time handlingFelix Fietkau
Set the slot time based on the mac80211 short slot vs long slot setting instead of just forcing long slot for all CCK-enabled channels. This slightly improves 802.11g mode performance in in my tests. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-12ath5k: fix short preamble rate duration valueFelix Fietkau
Subtract the difference in preamble duration (in usec) from the value returned by ieee80211_generic_frame_duration. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-01-27ath5k: correct endianness of frame durationBob Copeland
The ath5k version of ieee80211_generic_frame_duration() returns an __le16 for standard modes but a cpu-endian int for turbo/half/ quarter rates. Make it always return cpu-endian values. Signed-off-by: Bob Copeland <me@bobcopeland.com> Acked-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath5k: Always set IFS intervals on resetNick Kossifidis
* Make sure we always set IFS timings even if no coverage class is set. If we don't we'll miss the needed changes for different bwmodes. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath5k: Set all IFS intervals, not just slot timeNick Kossifidis
* Replace set_slot_time with set_ifs_intervals that also sets the various inter-frame space intervals based on current bwmode. * Clean up AR5210 mess from reset_tx_queue, AR5210 only has one data queue and we set IFS intervals for that queue on set_ifs_intervals so there is nothing left to do for 5210 on reset_tx_queue. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath5k: Extend rate_durationNick Kossifidis
* Extend ieee80211_generic_frame_duration to support the various bwmodes. * Better document what's going on with ack bitrates and update write_rate_duration to support the standard ack bitrates (when we don't set the high bit). * Get rid of set_ack_bitrate_high and introduce a flag on ath5k_hw for this (we only called the function on init anyway so there is no difference). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath5k: Extend get_default_sifs/slot_timeNick Kossifidis
* Extend get_default_sifs/slot_time to include timings for turbo half and quarter rate modes. * AR5210 code for now uses timings already on core clock units instead of usecs so rename them (we 'll clean it up later). Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath5k: Reset cleanup and generic cleanupNick Kossifidis
* No functional changes * Clean up reset: Introduce init functions for each unit and call them instead of having everything inside ath5k_hw_reset (it's just c/p for now so nothing changes except calling order -I tested it with various cards and it's ok-) * Further cleanups: ofdm_timings belongs to phy.c rate_duration belongs to pcu.c clock functions are general and belong to reset.c (more to follow) * Reorder functions for better organization: We start with helpers and other functions follow in categories, init functions are last Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-11ath5k: store the clock rate in common data on channel changesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-28ath5k: Disable interrupts in ath5k_hw_get_tsf64Bruno Randolf
The code in ath5k_hw_get_tsf64() is time critical and will return wrong results if we get interrupted, so disable local interrupts. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-28ath5k: Check and fix ATIM windowBruno Randolf
This patch adds sanity-checks for the beacon timers and especially the ATIM window to ath5k. It is basically the same what i did for madwifi two years ago and fixes a problem in IBSS mode which has been described as "ramping" pings. See the code comments for a more detailed description and these links: http://madwifi-project.org/ticket/1154 http://madwifi-project.org/changeset/3867 http://thread.gmane.org/gmane.linux.drivers.madwifi.devel/6066 Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-28ath5k: Remove unused variable for atim windowBruno Randolf
It's not used and it's unlikely we will ever implement ATIM. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-16ath5k: Remove old ath5k key handling functionsBruno Randolf
Remove the old ath5k key handling functions, since we now use the key management in ath common. 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-08-25ath5k: trivial spelling fixesBob Copeland
Fix some comments: s/transmition/transmission/ s/puting/putting/ Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-24ath5k: rename ath5k_hw_set_associd to _set_bssidNick Kossifidis
Although the named function also sets the aid, its main purpose is configuring the bssid and we use that everywhere else. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-16mac80211: use cipher suite selectorsJohannes Berg
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>
2010-06-02ath5k: remove ATH_TRACE macroBruno Randolf
Now that we have ftrace, it is not needed any more. Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-16ath5k/ath9k: Fix 64 bits TSF readsBenoit Papillault
According to tests, both TSF lower and upper registers kept counting, so the higher part could have been updated after the lower part has been read, as shown in the following log where the upper part is read first and the lower part next. tsf = {00000003-fffffffd} tsf = {00000003-00000001} tsf = {00000004-0000000b} This patch corrects this by checking that the upper part has not been changed while the lower part was read. It has been tested in an IBSS network where artifical IBSS merges have been done in order to trigger hundreds of rollover for the TSF lower part. It follows the logic mentionned by Derek, with only 2 register reads needed at each additional steps instead of 3 (the minimum number of register reads is still 3). Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-14ath5k: Use high bitrates for ACK/CTSBruno Randolf
There was a confusion in the usage of the bits AR5K_STA_ID1_ACKCTS_6MB and AR5K_STA_ID1_BASE_RATE_11B. If they are set (1), we will get lower bitrates for ACK and CTS. Therefore ath5k_hw_set_ack_bitrate_high(ah, false) actually resulted in high bitrates, which i think is what we want anyways. Cleared the confusion and added some documentation. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-04-07ath5k: Adaptive Noise Immunity (ANI) ImplementationBruno Randolf
This is an Adaptive Noise Imunity (ANI) implementation for ath5k. I have looked at both ath9k and HAL sources (they are nearly the same), and even though i have implemented some things differently, the basic algorithm is practically the same, for now. I hope that this can serve as a clean start to improve the algorithm later. This also adds a possibility to manually control ANI settings, right now only thru a debugfs file: * set lowest sensitivity (=highest noise immunity): echo sens-low > /sys/kernel/debug/ath5k/phy0/ani * set highest sensitivity (=lowest noise immunity): echo sens-high > /sys/kernel/debug/ath5k/phy0/ani * automatically control immunity (default): echo ani-on > /sys/kernel/debug/ath5k/phy0/ani * to see the parameters in use and watch them change: cat /sys/kernel/debug/ath5k/phy0/ani Manually setting sensitivity will turn the automatic control off. You can also control each of the five immunity parameters (noise immunity, spur immunity, firstep, ofdm weak signal detection, cck weak signal detection) manually thru the debugfs file. This is tested on AR5414 and nearly doubles the thruput in a noisy 2GHz band. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-03-31ath5k: simplify MIB countersBruno Randolf
Let's keep MIB counter statistics in our own statistics structure and only convert it to ieee80211_low_level_stats when needed by mac80211. Also we don't need to read profile count registers in the MIB interrupt (they don't trigger MIB interrupts). Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-03-15ath5k: remove unused beacon timer codeJohn W. Linville
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-03-15ath5k: remove some dead functionsJohn W. Linville
"ath5k: remove stale function declarations, make some functions static" commented-out some unused functions. This removes them. Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Bob Copeland <me@bobcopeland.com>
2010-03-10ath5k: remove double opmode definitionBruno Randolf
opmode (operating mode) was defined in struct ath5k_hw and struct ath5k_softc. remove it from ath5k_hw and use only from ath5k_softc (sc->opmode). (btw: what's the meaning of opmode when we have multiple interfaces?) Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-03-09ath5k: remove stale function declarations, make some functions staticPavel Roskin
Remove all unnecessary function declarations from ath5k.h. Comment out unused functions. Remove ath5k_hw_get_tsf32(), which is too trivial to be commented out. Make functions static if suggested by sparse. Make ath5k_pm_ops static. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-01-12ath5k: Implement mac80211 callback set_coverage_classLukáš Turek
The callback sets slot time as specified in IEEE 802.11-2007 section 17.3.8.6 (for 20MHz channels only for now) and raises ACK and CTS timeouts accordingly. The values are persistent, they are restored after device reset. Signed-off-by: Lukas Turek <8an@praha12.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-01-12ath5k: Reimplement clock rate to usec conversionLukáš Turek
The original code was correct in 802.11a mode only, 802.11b/g uses different clock rates. The new code uses values taken from FreeBSD HAL and should be correct for all modes including turbo modes. The former rate calculation was used by slope coefficient calculation function ath5k_hw_write_ofdm_timings. However, this function requires the 802.11a values even in 802.11g mode. Thus the use of ath5k_hw_htoclock was replaced by hardcoded values. Possibly the slope coefficient calculation is not related to clock rate at all. Signed-off-by: Lukas Turek <8an@praha12.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: fix regression which triggers an SME join upon assocLuis R. Rodriguez
This fixes a regression introduced by patch titled: "atheros: define shared bssidmask setting" The register for the BSSID was exchanged for the bssid mask register. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: remove temporary low_id and high_id vars on ath5k_hw_set_associd()Luis R. Rodriguez
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: simplify passed params to ath5k_hw_set_associd()Luis R. Rodriguez
We have access to common->curbssid and common->curaid so just use those. Note that common->curaid is always 0 so this keeps our current behaviour of always using 0 for now. Once we fix storing the association ID passed by mac80211 this will require no changes here. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: fix regression introduced upon the removal of AR5K_HIGH_ID()Luis R. Rodriguez
The trick was to add four bytes whenever this was used. There are two places where this was missed. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: use ath_hw_setbssidmask() for bssid mask setting upon assocLuis R. Rodriguez
This should avoid future typos. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: fix regression on setting bssid mask on associationLuis R. Rodriguez
There was a typo on the second bssid mask register. This was caused by the patch titled: "ath5k: use common curbssid, bssidmask and macaddr" Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07atheros: define shared bssidmask settingLuis R. Rodriguez
Also make ath5k and ath9k use it, and share register definitions. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07ath5k: use common curbssid, bssidmask and macaddrLuis R. Rodriguez
The ah_sta_id was really being used as the macaddr. ath5k still does not use the association ID now passed up by mac80211, that can be fixed later. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>