summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-led.c
AgeCommit message (Collapse)Author
2011-06-11iwlagn: move led_mode as part of iwlagn_mod_paramsWey-Yi Guy
Move led_mode module parameter into iwlagn_mod_params structure along with all the other iwlagn module parameters Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13iwlagn: prepare for multi-TB commandsJohannes Berg
In a subsequent patch, I want to make commands use multiple TBs in a TFD. This is a simple change to prepare the data structures for this, with as of now still just a single TB supported. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-10iwlagn: led stay solid on when no trafficWey-Yi Guy
commit 5ed540aecc2aae92d5c97b9a9306a5bf88ad5574 change the led behavior for iwlwifi driver; the side effect cause led blink all the time. Modify the led blink table to fix this problem Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-18iwlagn: use direct call for led functionsWey-Yi Guy
After driver split, no need to call led functions through callback Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08iwlagn: remove more reference to legacy devicesWey-Yi Guy
Remove the reference to both 3945 and 4965 in LED code Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-07iwlagn: change Copyright to 2011Wey-Yi Guy
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-21iwlwifi: split the drivers for agn and legacy devices 3945/4965Wey-Yi Guy
Intel WiFi devices 3945 and 4965 now have their own driver in the folder drivers/net/wireless/iwlegacy Add support to build these drivers independently of the driver for AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko, and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko contains code shared between both devices. The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3 ABGN device. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Acked-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21Revert "iwlwifi: split the drivers for agn and legacy devices 3945/4965"Wey-Yi Guy
This reverts commit aa833c4b1a928b8d3c4fcc2faaa0d6b81ea02b56.
2011-02-21iwlwifi: split the drivers for agn and legacy devices 3945/4965Wey-Yi Guy
Intel WiFi devices 3945 and 4965 now have their own driver in the folder drivers/net/wireless/iwlegacy Add support to build these drivers independently of the driver for AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko, and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko contains code shared between both devices. The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3 ABGN device. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Acked-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21iwlwifi: use mac80211 throughput triggerWey-Yi Guy
Instead of keeping track of LED blink speed in the driver, use the new mac80211 trigger and link it up with an LED classdev that we now register. This also allows users more flexibility in how they want to have the LED blink or not. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-26iwlwifi: remove extra stringWey-Yi Guy
For "led_mode" module parameters, string "led_mode" is duplicated twice, remove one. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16iwlwifi: change default led mode for different devicesWey-Yi Guy
Set the default led mode for different devices. For the newer devices such as 6000g2a, 6000g2b and newer, the default led mode is On/Off instead of blinking. The led_mode still can be control through module parameter 0: system default 1: On/Off 2: blinking Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-15iwlagn: new RXON processing for modern devicesJohannes Berg
In order to simplify the flow, and make new enhancements easier, separate out the RXON processing for modern AGN (5000 and newer) from RXON processing for the older 3945 and 4965 devices. Avoid changing these old ones to avoid regressions and move their code to a new file (iwl-legacy.c). 4965 gets the commit_rxon that used to be common for all AGN devices, but with removed PAN support. The new RXON processing is more central and does more work in committing, so that it is easier to follow. To make it more evident what is split out for legacy, split the necessary operations for that into a new struct iwl_legacy_ops. Those parts that still exist in the new AGN code don't need to be parametrized. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-06iwlagn: reduce redundant parameter definitionsWey-Yi Guy
move paramater definitions to a device paramater structure only leaving the device name, which antennas are used and what firmware file to use in the iwl_cfg structure. this will not completely remove the redundancies but greatly reduce them for devices that only vary by name or antennas. the parameters that are more likely to change within a given device family are left in iwl_cfg. also separate bt param structure added to help reduce more. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-03-25iwlwifi: remove "\n" from module parameter descriptionWey-Yi Guy
Remove the "\n" from following module parameter description: - enable wifi/bluetooth co-exist - led mode: 0=blinking, 1=On(RF On)/Off(RF Off), (default 0) to be consistence with the rest of iwlagn/iwlcore module parameters format. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
2010-01-19iwlwifi: update copyright year to 2010Reinette Chatre
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-11-23iwlwifi: remove reset led_tpt from iwl_leds_init()Wey-Yi Guy
Current blinking rate is calculated based on the difference between current tx/rx byte counts and priv->led_tpt. priv->led_tpt should not get reset in iwl_leds_init(), this function can be called by bring interface "up" or "down", or when uCode sysassert occurred. resetting the led_tpt parameter will introduce incorrect led blinking behavior. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07iwlwifi: LED cleanupJohannes Berg
The iwlwifi drivers have LED blinking requirements that mac80211 cannot fulfill due to the use of just a single LED instead of different ones for TX, RX, radio etc. Instead, the single LED blinks according to transfers and is solid on the rest of the time. As such, having LED class devices registered that mac80211 triggers are connected to is pointless as we don't use the triggers anyway. Remove all the useless code and add hooks into the driver itself. At the same time, make the LED code abstracted so the core code that determines blink rate etc. can be shared between 3945 and agn in iwlcore. At the same time, the fact that we removed the use of the mac80211 LED triggers means we can also remove the IWLWIFI_LEDS Kconfig symbol since the LED support is now self-contained. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07iwlwifi: add LED mode to support different LED behaviorWey-Yi Guy
Today's implementation allow LED to blink based on the traffic condition. We introduce an additional LED mode that reflects the RF state. The supported LED modes after this are: IWL_LED_BLINK (current/default) - blink rate based on current Tx/Rx traffic IWL_LED_RF_STATE (new) - LED OFF: No power/RF disabled, the LED is emitting no light LED ON: Powered/RF enabled, the LED is emitting light in a stable non-flashing state. In order to provide the flexibility to support different LED behavior per user/system preference we add "led_mode" iwlcore module parameter. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07iwlwifi: Adjust blink rate to compensate Clock differenceWey-Yi Guy
Adjust led blink rate to compensate on a MAC Clock difference on every HW. Led blink rate analysis showed an average deviation of 0% on 3945, 5% on 4965 HW and 20% on 5000 series and up. Need to compensate on the led on/off time per HW according to the deviation to achieve the desired led frequency The calculation is: (100-averageDeviation)/100 * blinkTime For code efficiency the calculation will be: compensation = (100 - averageDeviation) * 64 / 100 NewBlinkTime = (compensation * BlinkTime) / 64 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-07iwlwifi: modify LED blink index tableWey-Yi Guy
Modify LED blink index table to include 1Mbps. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-14iwlwifi: Traffic type and counter for debugFsWey-Yi Guy
Break down the traffic type and counter for both Tx and Rx. Enhance the tx_statistics and rx_statistics debugfs function and move to /sys/kernel/debug/ieee80211/phy0/iwlagn/debug directory to help better debugging both driver and uCode related problems. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-04iwlwifi: don't export symbols not needed in other modulesJohannes Berg
Even with the split into iwlcore/agn/3945 not all symbols that cross file boundaries are needed in other modules, a few are only used within iwlcore, for example. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-27iwlwifi: fix up command sendingJohannes Berg
The current command sending in iwlwifi is a bit of a mess: 1) there is a struct, iwl_cmd, that contains both driver and device data in a single packed structure -- this is very confusing 2) the on-stack data and the command metadata share a structure by embedding the latter in the former, which is also rather confusing because it leads to weird unions and similarly odd constructs 3) each txq always has enough space for 256 commands, even if only 32 end up being used This patch fixes these things: 1) rename iwl_cmd to iwl_device_cmd and keep track of command metadata and device command separately, in two arrays in each tx queue 2) remove the 'meta' member from iwl_host_cmd and only put in the required members 3) allocate the cmd/meta arrays separately instead of embedding them into the txq structure Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-24iwlwifi: Led blinking counting both tx and rxWey-Yi Guy
For controlling led blinking, counting both tx and rx data traffic; this will be able to handle traffic in either direction Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-24iwlwifi: make led functions genericWey-Yi Guy
Led functions are generic for all the devices except 3945, so remove the reference to 4965 Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-04iwl3945/iwlwifi: fix led bug when SW rfkillAbhijeet Kolekar
Patch fixes the bug at http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1903 when SW rfkill is invoked by 'iwconfig txpower off', the existing connection disassociates and led off command is sent to the device which returns error as rfkill is 'true'. Patch fixes this by just avoiding sending the led off/on command when disassociated. The main purpose of the led_disassociate callback is to start or stop the blinking. There are three states in led 1) Always on when radio is on 2) Always off when radio is off 3) blink when associated and if there is some traffic. In this callback 'allow_blinking' needs to be set false when associated, as LED will be always on. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-02-09iwlwifi: fix led namingDanny Kukawka
Fixed led device naming for the iwl driver. Due to the documentation of the led subsystem/class the naming should be "devicename:colour:function" while not applying sections should be left blank. This should lead to e.g. "iwl-phy0::RX" instead of "iwl-phy0:RX". Signed-off-by: Danny Kukawka <dkukawka@suse.de> Acked-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-02-09iwlwifi: don't use implicit priv in IWL_DEBUGTomas Winkler
Call IWL_DEBUG macro with explicit priv argument. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29iwlwifi: update copyright year to 2009Reinette Chatre
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29iwlwifi: replace IWL_ERROR with IWL_ERRWinkler, Tomas
IWL_ERR doesn't use hidden priv pointer. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19iwlwifi: add line feed to printkWu, Fengguang
This adds line feed to printk. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12iwlwifi: remove includes of iwl-helpers.h where not neededTomas Winkler
This patch removes includes of iwl-helpers.h where not needed Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12iwlwifi: change email contact informationWinkler, Tomas
This patch replaces personal emails with hopefully always valid Intel Linux Wireless, which will be routed to a current maintainer Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-10-31iwlwifi: run through spell checkerTomas Winkler
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-08-23removed unused #include <linux/version.h>'sAdrian Bunk
This patch lets the files using linux/version.h match the files that #include it. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-04iwlwifi: Don't use buffer allocated on the stack for led namesSven Wegener
Having the buffer on the stack and even re-using it for all led devices is bad. Not being able to resolve the name member of the led device structure to a meaningful value leads to confusion during ad-hoc debugging and potential breakage in the future, if we ever decide to access the name member outside of the registration function. Move the buffer to our private per led device structures so that it is accessible after registration. A quick grep didn't yield any occurence of using the led device name parameter outside of the led device registration function, so currently we should already be safe for normal operation. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Cc: Richard Purdie <rpurdie@rpsys.net> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-08-04iwlwifi: set led register in disassociationEsti Kummer
This patch sets the led register in disassociation flow according to rf-kill state : off - in case of rf_kill, on - otherwise. Signed-off-by: Esti Kummer <ester.kummer@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-07-29drivers/net/wireless/iwlwifi/iwl-led.c: printk fixAndrew Morton
ia64: drivers/net/wireless/iwlwifi/iwl-led.c: In function `iwl_get_blink_rate': drivers/net/wireless/iwlwifi/iwl-led.c:271: warning: long long int format, s64 arg (arg 6) drivers/net/wireless/iwlwifi/iwl-led.c:271: warning: long long int format, u64 arg (arg 7) We do not know what type the architecture uses to impement u64 and s64, hence we must cast the variables for printing. Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: John W. Linville <linville@tuxdriver.com> Cc: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-07-14iwlwifi: make index unsigned int for iwl_send_led_cmdAbhijeet Kolekar
This is a small fix to change the idx type from int to unsigned. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-07-14iwlwifi: LED use correctly blink tableTomas Winkler
This patch makes correct usage of the LED blink table. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-07-14iwlwifi: fix LED stallTomas Winkler
This patch fixes LED stall. last_blink_time was updated only if LED command was sent, causing wrong computation of the througput. Some code cleanup comes with this patch as well Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-05-07iwlwifi: rename iwl-4965.h to iwl-dev.hTomas Winkler
This patch renames iwl-4965.h to iwl-dev.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-08iwlwifi: move driver status inliners into iwl-core.hTomas Winkler
This patch moves inline functions into iwl-core.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-01iwlwifi: LED initialize before registeringTomas Winkler
This patch initialize all fields in led before registering it This fixes oops on initialization Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27iwlwifi: rename iwl-4965-io.h to iwl-io.hTomas Winkler
This patch renames iwl-4965-io.h back to iw-io.h it also remove 4965 from all functions it supplies Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-03-27iwlwifi: Add led supportMohamed Abbas
This patch add LEDS support to 3965 and 4965 drivers. It is based on led trigger and class. For our drivers we needed to avoid two things. 1- We receive led trigger on/off on each Rx\Tx frame. In our driver we can not call led command like that. In this driver once driver receive a start of traffic it call the led command to start blinking then we count all bytes of Tx and Rx frame, after two second we count the blink rate of last two second then id blink rate changed we call the led commands 2- Since we can call led command very often, we make sure we call the led command after we receive the statistics notification so we don't need to wake up the ucode id it is in sleep state. This patch was tested with 4965 and 3945. Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com> Signed-off-by: Ian Schram<ischram@telenet.be> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>