[go: nahoru, domu]

History log of /drivers/net/wireless/iwlwifi/iwl-debug.h
Revision Date Author Comments
a43ad46a450b1a4466f34b057522f56c125710fb 04-Aug-2014 Johannes Berg <johannes.berg@intel.com> iwlwifi: mvm: add some debugging to quota allocation

In order to follow more easily what's going on, add some
debug statements to the quota allocation algorithm.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
4b907fd4bed869d9c0a448dd8cae11a26a720ac9 07-May-2014 Johannes Berg <johannes.berg@intel.com> iwlwifi: cause build error on missing newline

If a (debug) message is missing a newline, cause build error
so we don't keep reintroducing this problem.

This also prevents using a non-constant argument as the format
string which is a good idea anyway (e.g. for security reasons.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
b3370d47f02eaeef52557259709589d81fdc573b 25-Nov-2013 Eliad Peller <eliad@wizery.com> iwlwifi: add enter/exit D0i3 ops

Add new enter_d0i3 and exit_d0i3 ops that
will be called by the transport on D0i3 enter/exit.

Each one of these ops will include the host commands
mentionned in the previous patch.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
51368bf792c79eb917694a4155d62f04359e3734 30-Dec-2013 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: Update Copyright to 2014

Happy new year!

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
f4f3c659846587aae9043d2df31f6434934965e1 06-Aug-2013 Matti Gottlieb <matti.gottlieb@intel.com> iwlwifi: introduce external debug level

This debug level will be used in the future for logging
interaction with external modules.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
51cd53ad120f33410c48fd0d696e6f6255c8e780 12-Jun-2013 Johannes Berg <johannes.berg@intel.com> iwlwifi: reduce debug ifdefs using the optimiser

Instead of using #ifdef CONFIG_IWLWIFI_DEBUG, remove the
iwlwifi_mod_params.debug_level variable completely and
make iwl_have_debug_level() always return false in the
non-debug case. This way, the optimiser will elide all
code for it automatically without having to add #ifdefs.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8ca151b568b67a7b72dcfc6ee6ea7c107ddd795c 24-Jan-2013 Johannes Berg <johannes.berg@intel.com> iwlwifi: add the MVM driver

Newer firmware revisions have a completely new
firmware API. This is the new driver for this
new API.

I've listed the people who directly contributed
code, but many others from various teams have
contributed in other ways.

Cc: Alexander Bondar <alexander.bondar@intel.com>
Cc: Amit Beka <amit.beka@intel.com>
Cc: Amnon Paz <amnonx.paz@intel.com>
Cc: Assaf Krauss <assaf.krauss@intel.com>
Cc: David Spinadel <david.spinadel@intel.com>
Cc: Dor Shaish <dor.shaish@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: Eytan Lifshitz <eytan.lifshitz@intel.com>
Cc: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
128e63ef077ef7ccd9c5779bbdce566641714666 21-Jan-2013 Johannes Berg <johannes.berg@intel.com> iwlwifi: update copyright

Update Copyright notices to 2013.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
26a7ca9a71a3f7e1826de96b1a1e907123e11b07 21-May-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: refactor EEPROM reading/parsing

The EEPROM reading/parsing code is all mixed in
the driver today, and the EEPROM is parsed only
when we access data from it. This is problematic
because the NVM needs to be parsed and that is
independent of reading it. Also, the NVM format
for new devices will be different and probably
require a new parser.

Therefore refactor the reading and parsing and
create two independent components. Reading the
EEPROM requires direct hardware accesses and
therefore access to the transport, but parsing
is independent and can be done on an NVM blob.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
142fb5b733d377dedd930ae53332b6a6ccb622f5 16-May-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: add __printf argument checking

Joe Perches suggested adding the __printf attribute
to the __iwl_dbg function to check arguments; add it
to all of the logging functions (err, warn, info, dbg
and crit.)

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
65de7e84fdc71a409f1d97aba8e44ece26628f51 17-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: clean up module parameters

For now at least, all module parameters should be
with the core functionality, so move them there,
while at it rename to iwlwifi_mod_params. Also
rename iwl-shared.h to iwl-modparams.h to reflect
the real contents.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
6238b00880b7d54a20357bfa90ad9b92afef25fa 02-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: clean up iwl-shared.h includes

That file is now holding just a few defines and
the module parameters, so it shouldn't include
anything. Make sure the right users include the
right files instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
26470b075a68c0bb31f114f6b9c4544b597e64eb 02-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move iwl_have_debug_level

This function belongs into the debugging framework.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
0e9f6aca344f457ac5c1b747e171d7db72e773fd 02-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move debugfs registration function declarations

They clearly belong into iwl-agn.h as they have no
relation to the (generic) debug logging framework.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
4b9844f5d887e31c18b9aad862b7ef5fde016d9b 22-Mar-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: don't use shared for the logger any more

Each modules will hold a pointer to struct device instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
84abd2cc066fc077c424d0faf7618be348a7efb2 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move status check functions out of shared

They are only used in the DVM op_mode.
Also move the rfkill debug macros that
depend on them.

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>
a8bceb392a739321ec20d03a91a86ebdde9c07bb 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove per-device debug level

There's no need for the per-device debug
level that we expose in debugfs since the
module parameter is writable in sysfs.

At the same time, simplify code by changing
iwl_get_debug_level(shrd) & IWL_DL_ISR)
to
iwl_have_debug_level(IWL_DL_ISR)

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>
36a79223c4b998efefda7a8c52c6923228f9c0ea 27-Feb-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: kill iwl_bus.h

No one needs it any more

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2655e314c4b204966008689eaf3e87ba1f38d55c 01-Feb-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: trace debug messages

Make iwlwifi record all debug messages into
tracing, even if debug_level is not enabled.
Due to the lack of APIs, the debug messages
are now recorded up to a max length of 100,
the only one above that is the RXON which is
not needed if you trace the commands as well
as it only dumps the command contents.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
ea4caade104490de0fadb64660f9e228c050fb3d 04-Jan-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: remove the pointer to dev from the bus layer

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
fb4961dbc27d40cdbed297aa9bd74fa4a0e2ba6c 06-Jan-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4e3182626a914443a5e0fbe014813f03e51a75df 27-Dec-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
112f11dc219ec8f9b0cf5cf9f55fef1096006908 02-Dec-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: make debug levels more readable

Using the actual shifted constants here allows
one to read and or them more easily.

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>
d28a21d8aaccadf930085cf581abc9b5e048026d 02-Dec-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove MACDUMP debug

This is only used for TX debugging where there
already is more debugging and tracing is more
useful anyway, so remove it.

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>
145274408049d21274e3c645066aa7980165c71e 02-Dec-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove HC_DUMP debug

This debug level is unused, remove it.

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>
d6846347a0e1bc111b67a1366380419231b97984 02-Dec-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove TX_REPLY_LIMIT debug

This macro is unused right now.

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>
9a0dd89547e419fce321f92ba80b8e22b623749d 25-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: make debug levels more readable

Using the actual shifted constants here allows
one to read and or them more easily.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
51057e5d4d89d13dd62dffb7708615479d20bdf6 25-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove MACDUMP debug

This is only used for TX debugging where there
already is more debugging and tracing is more
useful anyway, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
6e66bb4aeec93ea40a9c8efd7cf53b0b445b0b27 25-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove HC_DUMP debug

This debug level is unused, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
5c05dc8ad832c84a48d7897468f3f3e2559b0959 25-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove TX_REPLY_LIMIT debug

This macro is unused right now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
1e7aecc26b95efb9d9bdba1ff5c33c99ca34d4ad 18-Nov-2011 Joe Perches <joe@perches.com> iwl-debug: Shrink object by using dev_err and deduplicating formats

Using dev_err instead of dev_printk(KERN_ERR uses fewer
arguments and is a bit smaller.

Deduplicating formats used by IWL_DEBUG_QUIET_RFKILL also
makes the object a bit smaller.

Neatened the macros, used ##__VA_ARGS__.

$ size drivers/net/wireless/iwlwifi/built-in.o*
text data bss dec hex filename
462652 8646 92576 563874 89aa2 drivers/net/wireless/iwlwifi/built-in.o.new
467557 8646 92592 568795 8addb drivers/net/wireless/iwlwifi/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
81a3de1ce2929fef2b112c048c50bc52b686f94d 10-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: add debug information on queue stop / wake

Users complain that the traffic gets stalled sometimes. This will
allow easier debugging.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0dcf50ca4ebdef5468aa2475de2b87feec5a1e8f 10-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: remove the use of the QOS debug flag

This bit was used only once. Use IWL_DL_INFO instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b36b110c577a12157112faa1ec41b12924232af4 10-Nov-2011 Todd Previte <toddX.a.previte@intel.com> iwlwifi: Suppress noisy syslog messages when RF_KILL switch engaged

When a station is associated with an AP and the RF_KILL switch is engaged,
numerous error messages were sent to the system log. The error messages
were the result of the failure(s) of the various submodules to perform
their tasks after the radios were disabled.

To resolve this situation, the messages were modified to use a new macro,
IWL_DEBUG_QUIET_RFKILL. This macro allows for the RF_KILL error messages
to be sent to the log provided that IWL_DEBUG is true and IWL_DL_RADIO
is '1'. For all other cases, the error messages resulting from an RFKILL
event will not be sent to the system log. Messages logged because of an
RFKILL will be tagged with the prefix '(RFKILL)' to clarify the cause of
the error.

Signed-off-by: Todd Previte <toddX.a.previte@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
add6ff1aa35495f259056954202494f89f11cc98 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update comments on how to enable debug flag

Modify comments on how to enable and change debug_level

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a72b8b088c3465b28192c1a14ba97be8223a8cec 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add missing includes

a few h files weren't self contained. Fix that.
Move iwl_dma_ptr to transport layer since it is not used by the upper layer
any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9ca06f0a3fbf57c672c7f2cdfc85747a0bbfaf28 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add IWL_DEBUG_FW_ERRORS

instead of IWL_DEBUG(priv, IWL_DL_FW_ERRORS

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
44856c6596bf4b96eb17ee5e785b5fe5b8a12531 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: modify the debug macro to be usable by all the layers

Since all the layers need to print debug message, the debug macro cannot suppose
that they will be given iwl_priv as a parameter and then dereference it.
Use iwl_shared instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8f470ce31de1a9dfe6b53e0967eaa7e72b741714 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: debug_level moves to struct iwl_shared

This will allow all the modules to look at it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
48f20d354e729afcfb29ff41aca7583ebb94613d 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: introduce iwl-shared.h

It will hold declaration of functions and forward declaration of struct that
are used by several layers.
This will allow modules not to include iwl_priv. iwl_bus and iwl_trans are
still visible to all.

All the layers share the module parameters, move the struct to iwl-shared.h.
Also add all module parameters to iwl_mod_params instead of having them as
global static. This includes

* debug_level
* ant_coupling
* bt_ch_announce
* wanted_ucode_alternative

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0bfe9895d402faf03d5ccd30cc0e6bbad09e5bbc 14-Jul-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove forgotten debugfs function

It seems that due to merge issues between different
trees or so this function prototype wasn't removed
when it should have been, do it now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
d593411084a56124aa9d80aafa15db8463b2d8f7 11-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: simplify the bus architecture

Call iwl_probe with a ready iwl_bus struct. This means that the bus layer
assigns the irq, dev and iwl_bus_ops pointers to iwl_bus before giving it to
iwl_probe.

The device specific struct is allocated together with the common iwl_bus struct
by the bus specific layer. The pointer to the aggregate struct is passed to the
upper layer that holds a pointer to iwl_bus instead of an embedded iw_bus.
The private data given to the PCI subsystem is now iwl_bus and not iwl_priv.

Provide bus_* inliners on the way in order to simplify the syntax.

Rename iwl-pci.h -> iwl-bus.h since it is bus agnostic and represent the
external of the bus layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
3599d39a8525b01540e2c7ec8c5d0df0dd11d6cf 31-May-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add get_dev to iwl_bus_ops

Bus specific layer must know how to return the struct device* of the device.
Implement that as a callback of iwl_bus_ops and use that callback instead of
using the priv->pdev pointer which is meant to disappear soon.

Since the struct device * is needed in hot path, iwl_bus holds a pointer to it
instead of calling get_dev all the time.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
bf300252baa383065851e2ed6af41e5f9735fe9c 06-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove unused debug flag

Remove both IWL_DEBUG_TXPOWER and IWL_DEBUG_NOTIF, not used.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
ebbb491e8efac3c0a6f880f676374fc1605469f5 06-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: add coex debug flag

Replace IWL_DEBUG_AP with IWL_DEBUG_COEX for debug COEX related stuffs

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
02a7fa00a6d145037d549c779ad7692deb504acc 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: move IO functions out of line

This generates a massive reduction in module size:
with debug:
text data bss dec hex filename
670300 13136 420 683856 a6f50 iwlagn.ko (before)
388347 13136 408 401891 621e3 iwlagn.ko (after)

without debug:
text data bss dec hex filename
528575 13072 420 542067 84573 iwlagn.ko (before)
294192 13072 408 307672 4b1d8 iwlagn.ko (after)

This also removes all the IO debug functionality since
it can easily be replaced by tracing, and makes the
code unnecessarily complex.

I haven't done any CPU utilisation measurements, but
given that the hotpaths don't use much IO it is not
likely to have a negative impact; in fact, the size
reduction will reduce cache pressure which possibly
improves performance.

Finally, an unused function or two were removed.

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>
901069c71415a76d731857ccda814e18ded062f7 05-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change Copyright to 2011

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fb4c32bba1e0941db5972e2b612cbfdf10522a43 03-Dec-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add new EEPROM debug log type

Adding new debug type to log EEPROM related data

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
5fc97f7789e6ff3d1698a544f863b55dba9d9cd9 31-Jul-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: fix compile warning

When iwlwifi is compiled w/o debug, we get
this warning:
iwl-agn.c: In function ‘iwlagn_load_firmware’:
iwl-agn.c:2014: warning: passing argument 3 of ‘iwl_print_hex_dump’ discards qualifiers from pointer target type
iwl-debug.h:73: note: expected ‘void *’ but argument is of type ‘const u8 *’

because the const qualifier is missing in the
inline stub. Fix this.

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>
b8c76267cfb9a025afdd122bc2a8942dbf493dd1 09-Apr-2010 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add debugfs ops to iwlwifi

Seperate debugfs functions into iwlagn specific
debugfs file and Add debugfs ops to iwlwifi.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
4c84a8f1679f754d6080e49892f5cae2c88c91a8 22-Jan-2010 Johannes Berg <johannes@sipsolutions.net> iwlwifi: clean up debugfs code

The debugfs code can be made a whole lot more
efficient by using debugfs_remove_recursive(),
the large chunk of variables can completely go
away and by moving two variables we no longer
need to allocate an extra chunk of memory.

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>
3e4fb5faefb57824f2e42305b3d5907845af978c 22-Jan-2010 Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com> iwlwifi: Tune radio to prevent unexpected behavior

We have seen the throughput dropped due to external noisy environment
and the radio is out of tune. There are lot of plcp errors indicating
this condition. Eventually the station can get de-authenticated by the
Access Point. By resetting and tuning the radio, the plcp errors are
reduced or eliminated and the throughput starts to rise.

To prevent unexpected behavior such as drop in throughput or deauthentication,
- The change provides the driver feature to monitor and tune the radio base on
the statistics notification from the uCode.
- It also allows the setting of the plcp error rate threshold via
the plcp_delta under debugfs interface.

Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
afbdd69af0e6a0c40676d4d4b94a0a4414708eaa 22-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add function to reset/tune radio if needed

Adding "radio reset" function to help reset and stabilize the radio.

During normal operation, sometime for unknown reason, radio encounter
problem and can not recover by itself; the best way to
recover from it is to reset and re-tune the radio. Currently, there is
no RF reset command available, but since radio will get reset when
switching channel, use internal hw scan request to force radio
reset and get back to normal operation state.

The internal hw scan will only perform passive scan on the first
available channel (not the channel being used) in associated state. The
request should be ignored if already performing scan operation or STA is
not in associated state.

Also include an "internal_scan" debugfs file to help trigger the
internal scan from user mode.

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>
a13d276f1e49ae0bc4ad18ce8ea3c90656c9e8d4 22-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: configure missed beacon threshold

Add support to configure missed beacon threshold, by default, if receive
"missed beacon" notification from uCode and has more than 5 consecutive
beacon missed, then perform sensitivity calibration; with this change,
allow user to adjust the missed beacon threshold from debugfs in case
more sensitivity calibration required for better performance in noisy
environment

The default value (=5) should be good enough for the normal condition,
but for very noisy environment, more sensitivity calibration could help
improve the throughput, so by setting the missed beacon threshold to
lower number, user might experience better performance result.

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>
1f44780827c6bbbcd1f12d5c6b6ce84f49a96bc0 15-Jan-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2010

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1b3eb8236ad9369ae519216b61a3d22806370115 15-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: display flowhandler register when sw error or on-demand

Flowhandler handle the communication between driver and uCode, when any
uCode error happen, we also like to know what is the status of the
flowhandler; it can help to debug flowhandler related problem.

Also adding debugfs file to dump current value of flowhandler registers.

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>
a9e1cb6a78ea8a74c49bf76726a2942f636a833b 10-Dec-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add continuous uCode event log capability

In order to help uCode debugging, adding the capability to provide
continuous uCode event logging function.

uCode events is located in round-robin event queue and filled by uCode,
by enable continuous event logging, driver check the write pointer
and log the newly added events in iwl_bg_ucode_trace() timer function.

There is still possibility of missing events if event queue being
wrapped before next event dump; but with this capability, we can have
much better understanding of the uCode behavior during runtime; it can
help to debug the uCode related issues.

Methods to enable/disable the continuous event log:
step 1: enable ucode trace timer
"echo 1 >
/sys/kernel/debug/ieee80211/phyX/iwlagn/debug/ucode_tracing"
step 2: start ftrace
sudo ./trace-cmd record -e iwlwifi_ucode:* sleep 1d
step 3: stop ftrace
sudo ./trace-cmd report trace.dat
step 4: disable ucode trace timer
"echo 0 >
/sys/kernel/debug/ieee80211/phyX/iwlagn/debug/ucode_tracing"

use "ucode_tracing" debugfs file to display number of event
queue wrapped when driver attempt the continuous event logging. If event
queue being wrapped more than once when driver has opportunity to log
the event; it indicated there are events missing in the event log trace.

This continuous event log function only available for 4965 and newer
NICs.

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>
696bdee3ba216186e21997d20a839b76158346e6 10-Dec-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: dump "Control and Status Register" when detect uCode HW/SW error

When uCode HW/SW error detected, dumping important CSR (Control and Status
Registers) values.
Also add "csr" debugfs file to dump the current values of CSR defined in
CSR table to syslog.

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>
7163b8a4ec995dabda3e92c6fed7b8600060618c 20-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: reset led_tpt when clear tx/rx traffic byte counts

LED blink rate is based on the traffic load, when tx/rx traffic counts
got reset, we also need to reset the led_tpt to prevent incorrect
blink rate being calculated.

Merge both clear_tx_statistics() and clear_rx_statistics() into
single clear_traffic_statistics() function, when reset the traffic byte
counts, both tx and rx need to be reset at the same time, to make
sure calculated the correct led blink rate.

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>
ef8d5529b015d4c5db7fad1adfc91edfd5abad56 13-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update reply_statistics_cmd with 'clear' parameter

When issue REPLY_STATISTICS_CMD to uCode, two possible flag
can be set in the configuration flags

bit 0: Clear statistics
0: Do not clear Statistics counters
1: Clear to zero Statistics counters

Allow "clear" parameter to be set from the caller.

Add debugfs file to clear the statistics counters to help monitor and
debug the uCode 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>
c09430abed4159e5c56aaea257d040f7452daba6 16-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: show current power save status reported by uCode

Power save request is sent from driver to uCode, but there is no
indication from uCode about the current device power save state.

Reading GP_CNTRL register bit 25:24 to show the current power save
status

00: no power save
01: MAC power down
10: PHY power down
11: Error

The uCode could switch in and out of power save mode in the order of
once per 100-300 ms in many cases. The reading here should just be used for
reference on the current uCode power save status. Do not confuse this
reading with the PowerSave set by driver and mac80211.

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>
e932a609e9759cc75db0c234f465a5fd6e20d362 02-Oct-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: LED cleanup

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>
f204b2487e5503ca4a9f3e69dcd63f6af979aaac 21-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: show current tx power

debugFs file show current tx power for all the transmit chains

Adding "tx_power" file in /sys/kernal/debug/ieee80211/phy0/iwlagn/debug
to display current tx power for all the active chains in 1/2 dB step.

Show tx power information "Not available" if uCode can not provide the
information or interface is down.

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>
e312c24cf8229f9b6e76dbfd5d99eefe21f4ac0a 08-Aug-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: automatically adjust sleep level

Depending on required latency requested by pm_qos (via mac80211)
we can automatically adjust the sleep state. Also, mac80211 has
a user-visible dynamic sleep feature where we are supposed to
stay awake after sending/receiving frames to better receive
response frames to our packets, this can be integrated into the
sleep command.

Currently, and this patch doesn't change that yet, we default
to using sleep level 1 if PS is enabled. With a module parameter
to iwlcore, automatic adjustment to changing network latency
requirements can be enabled -- this isn't yet the default due
to requiring more testing.

The goal is to enable automatic adjustment and then go into the
deepest possible sleep state possible depending on the networking
latency requirements.

This patch does, however, enable IEEE80211_HW_SUPPORTS_DYNAMIC_PS
to avoid the double-timer (one in software and one in the device)
when transmitting -- the exact timeout may be ignored but that is
not of big concern.

Note also that we keep the hard-coded power indices around for
thermal throttling -- the specification of that calls for using
the specified power levels. Those can also be selected in debugfs
to allow easier testing of such parameters.

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>
5225935b53ce1eafb222c644230d03ad6011d357 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Display sensitivity and chain noise information

Display sensitivity and chain noise data to help understand the current
environment and RF condition.

The data is feeded by statistics notification and Beacon from uCode;
then used by sensitivity calibration and chain noise calibration to
determine how DSP should react to the environment changes

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>
e8fe59aecb9020b06305be4f8c67d73cbf49cbd2 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: uCode statistics notification counter

Display statistics notification information
The information break down into
uCode_tx_stats
uCode_rx_stats
uCode_general_stats
and can be found in /sys/kernel/debug/ieee80211/phy0/iwlagn/debug
directory

The statistic information display in debugFs is based on the last
statistics notification from uCode; it might not reflect the current
uCode activity. Using "watch" command to monitor the uCode
activity should give up-to-date statistics provided by uCode.

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>
141b03e07a54af68fc099459bf780a182b240b45 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: tx/rx queue pointer information

Adding debugfs function to show current TxFifo/RxFifo read/write
pointer, plus the current tx queue status (wake/stop) for both real and
virtual queue.
This is part of debug feature set to help debugging driver/uCode.

use tx_queue and rx_queue in
/sys/kernel/debug/ieee80211/phy0/iwlagn/debug directory to show the
current read/write pointer for both TxFifo and RxFifo queue

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
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>
22fdf3c9e19dce6d66bcfdbed547a5aa52b89933 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Traffic type and counter for debugFs

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>
20594eb0daa67f7a0cc19d74a1bafceb1bb09f4a 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: new debugging feature for dumping data traffic

The traffic buffer will only beallocated and used if either bit 23
(IWL_DX_TX) or bit 24 (IWL_DL_RX) of "debug" is set;
example: "debug=0x800000" - log tx data traffic
"debug=0x1000000" - log rx data traffic
"debug=0x1800000" - log both tx and rx traffic

The traffic log will store the beginning portion (64 bytes) of the
latest 256 of tx and rx packets in the round-robbin buffer for
debugging,
user can examine the log through debugfs file.

How to display the current logged tx/rx traffic and txfifo and rxfifo
read/write point:
"cat traffic_log" in /sys/kernel/debug/ieee80211/phy0/iwlagn/debug
directory

By echo "0" to traffic_log file will empty the traffic log buffer and
reset both tx and rx taffic log index to 0.

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>
3d816c77ecb05d3a3e974a205e53392e5353553e 08-Aug-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: re-introduce per device debugging

Commit "iwlwifi: make debug level more user friendly" cleaned up the
debug level handling. In doing so it created a single global debug
level for all devices. Some setups do consits of more that one iwlwifi
device and in these setups there is a requirement that debug levels
should be unique per device.

We now re-introduce the per device debugging while maintaining the
cleanup effort of the previous patch.

The maintain the global debug level and now introduce a per-device debug
level that will be used if it (the per-device debug level) is set. The
per-device debug level can be controlled via the debug_level sysfs file
while the global debug level is controlled by the debug module parameter.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1e4247d457c6a42e4a05cb7dfa4e6ea1fa65c112 27-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: debugFs to enable/disable HT40 support

Add debugfs file to enable/disable HT40(40MHz) channel support.
By default, 40MHz is supported if AP can support the function.

By echo "1" to "disable_ht40" file, iwlwifi driver will disable the
40MHz support and only allow 20MHz channel.

Because the information exchange happen during association time,
so enable/disable ht40 channel only can be performed when it is not
associated with AP.

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>
fbf3a2af3834e8e93e9c2876de62c5b49988e352 24-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Thermal Throttling debugfs function

Add debugfs function to display current thermal throttling status for
both Legacy and Advance Thermal Throttling Management

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>
a562a9dda7f47e7cac58d80bf1ffe441feca510e 17-Jul-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: make debug level more user friendly

* Deprecate the "debug50" module parameter used to obtain
5000 series and up debugging. Replace it with "debug" module
parameter to match with original driver and be consistent
between them. The "debug50" module parameter can still be used,
except that the module parameter is not writable in keeping
with its previous state. We currently just mark it as "deprecated"
and do not have it in the feature-removal-schedule. Some more
cleanup of module parameters needs to be done and can then be
entered together.

* Only make "debug" module parameters visible if the driver
is compiled with CONFIG_IWLWIFI_DEBUG. This will eliminate
a lot of confusion where users think they have set debug flags
but yet cannot see any debug output.

* Make module parameters writable. This eliminates the need for the
"debug_level" sysfs file, which can now also be deprecated and
added to feature-removal-schedule. This file is in significant
use though with many iwlwifi documents and text referring users
to it. We can thus not take its removal lightly and keep it around.

With iwlcore shared between iwlagn and iwl3945 we really do not need
debug module parameters for each but can instead have one debug
module parameter for the iwlcore module. The same issue is here as
with the sysfs file - a lot of iwlwifi documentation and text (like
bug reports) rely on iwlagn and iwl3945 having this module parameter,
so changing this to a module parameter of iwlcore will have significant
impact and we do not do this for that reason.

One consequence of this patch is that if a user is running a system
with both 3945 and later hardware then the setting of the one module
parameter will affect the value of the other. The likelihood of this
seems low - and even if this setup is present it does not seem like an
issue for both modules to run with the same debug level.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a283c0116b0cc5e82327e50ad4d05f6d4d42c603 17-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add led debugfs function

Adding debugfs file to show current led blinking rate
/sys/kernel/debug/ieee80211/phy0/iwlagn/data/led

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>
f5ad69fa47e7b204d0032d569812544cd9a351fb 09-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move show_qos to debugfs

This move the show_qos file from sysfs to debugfs because the "one
value per file" sysfs rule.

The file is located in
/sys/kernel/debug/ieee80211/phy0/iwlagn/data

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>
68021b966b3cb363596251bac0370c12e084e7da 26-Jun-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: add utility to print buffer when error occurs

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0848e297c2107dbc12a91a1709c879c73bd188d8 22-May-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: support NVM access (EEPROM/OTP)

Two type of NVM available for devices 1000, 6000 and after, adding
support to read OTP lower blocks if OTP is used instead of EEPROM.

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>
a83b9141b540f96dd59409c6487828e880113a29 08-Apr-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: adding interrupt counter in debugfs for debugging

This patch adds interrupt statistics report to debugfs, this can help to
understand number of interrupts happened which including HW/SW error for
easier and better debugging.

in /sys/kernel/debug/ieee80211/phyN/iwlagn/data directory
use "cat interrupt" to view the current interrupt counter
use "echo 0 > interrupt" to clear interrupt counter

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>
e1623446bb1de1834ff1c57b3e8ed341d5d4a927 27-Jan-2009 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: don't use implicit priv in IWL_DEBUG

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>
01f8162a854df7f9c259c839ad3c1168ac13b7b8 08-Jan-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2009

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15b1687cb4f45b87ddbe4dfc7759ff5bb69497d2 19-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: replace IWL_ERROR with IWL_ERR

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>
39aadf8c29ad959e823efca15381bea9d0770b1e 19-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: replace IWL_WARNING with IWL_WARN

IWL_WARN 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>
978785a3892b34448446e8c8a17f48454f1bdd6a 19-Dec-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: clean up printing

Use IWL_ macros where possible to unify debug output usage.
Define new unconditional printouts IWL_ERR, IWL_WARN, IWL_INFO,
and IWL_CRIT which don'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>
146846aed534aa0eb1fb0a8e6c0394190e5c1ad7 19-Dec-2008 Zhu Yi <yi.zhu@intel.com> iwlwifi: add more comments to IWL_DL_xx

This adds more comments to IWL_DL_xx macros.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d2bf55839ad77486a02ec32f8411f432621da110 19-Dec-2008 Wu Fengguang <fengguang.wu@intel.com> iwlwifi: beautify code

This patch beautifies macros in iwl-debug.h.

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>
a3139c5956702c9ff957ac9fe2d902de355b063e 19-Dec-2008 Samuel Ortiz <sameo@linux.intel.com> iwl3945: Remove DRV_NAME dependenies

As DRV_NAME is defined in 2 different header files, including both is not
possible.
This patch defines this constant from iwl3945-base.c and iwl-agn.c. It also
redefines the IWL_ERROR and IWL_WARNING macros to use dev_printk, as the
IWL_DEBUG_* macros do.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Acked-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>
40b8ec0bfa2d96c9feae2bc1596e9b427c77b8da 19-Dec-2008 Samuel Ortiz <sameo@linux.intel.com> iwl3945: Getting rid of iwl-3945-debug.h

At the cost of adding a debug_level field to iwl3945_priv, we are now able to
get rid of iwl-3945-debug.h, and use iwl-debug.h instead.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
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>
2ddfa129bbf3dca708ffb0eb29d08de32cacd547 22-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: move sysfs status entry to debugfs

This patch moves priv->status sysfs entry to debugfs. It is for
debugging only anyway.

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>
c3a739fa3507d1d5b3d2cb6cc491edeef8fa54c0 17-Dec-2008 Wu, Fengguang <fengguang.wu@intel.com> iwlwifi: update comments on the debug interface

Bring up-to-date some comments on the location of debug files.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-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>
759ef89fb096c4a6ef078d3cfd5682ac037bd789 09-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: change email contact information

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>
d366df5abb8d5ce7e2c36d3b678177787ccd9749 02-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: move channels sysfs to debugfs

This patch moves channels info display from sysfs to debugfs.
This shows channel information as stored in NIC EEPROM. This
is useful in debugging CRDA or iwl goes setting so it belongs
rather to debugfs then to sysfs.

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>
cb299bae8929705bf025fdbd6ce0ffcc62f5b3d0 07-Nov-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: move iwl_print_hex_dump to iwl-debug.h

This patch moves iwl_print_hex_dump to iwl-debug.h
where it belongs

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>
a96a27f97f2bbfc1fca54bc3c0b0d41484152740 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: run through spell checker

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>
3fd07a1e5aba89d4be3696c46cb7297f1873195a 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor TX response flow

This patch utilize 5000 new TX response command
which contains all necessary information and avoids
back referencing to the original TX frame.
It also change handling of software queue tracking
4965 flow is aligned with changes as much as possible.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ded2ae7c1fbff22516fd55ff0edcf6cd86f76186 04-Aug-2008 Esti Kummer <ester.kummer@intel.com> iwlwifi: add level for debugging host command

This patch adds another level for debugging host command. This adds an
option to suppress the debug prints for sensitivity and link quality
commands.

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>
f367422794315b7632f2a78c93e15b3c757d4be8 04-Aug-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: cleanup iwl_tx_skb

This patch cleans up iwl_tx_skb function.

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>
3ac7f14694dd38273d9d96f1c873233d71190c15 21-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix checkpatch.pl errors

This patch fixes errors reported by checkpatch in iwlwifi drivers

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c0b6a1c9be3acac0f600072ebc2bc6ad3d8c8f76 17-Jul-2008 Denis V. Lunev <den@openvz.org> iwlwifi: compilation error when CONFIG_IWLWIFI_DEBUG is not set

CC [M] drivers/net/wireless/iwlwifi/iwl-rfkill.o
drivers/net/wireless/iwlwifi/iwl-led.c: In function 'iwl_led_brightness_set':
drivers/net/wireless/iwlwifi/iwl-led.c:198: error: 'led_type_str' undeclared (first use in this function)
drivers/net/wireless/iwlwifi/iwl-led.c:198: error: (Each undeclared identifier is reported only once
drivers/net/wireless/iwlwifi/iwl-led.c:198: error: for each function it appears in.)

The problem is that led_type_str is defined under CONFIG_IWLWIFI_DEBUG
while IWL_DEBUG is a static inline function in this case. Replace it
with macro.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
203566f359b5702be72238a8b1d37655c986cc7c 12-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: add possibility to disable tx_power calibration

This patch adds the possibility to disable the tx_power calibration.
In 5000 HW, this calibration is implemented in uCode, hence, it is
disabled in driver by default.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@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>
16e727e866d739d7f02790c794410f6d9f1d720b 12-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: removes the RUN_TIME_CALIB ifdef

This patch removes the possibility not to compile the run time
calibrations. It also renames priv->sensitivity_work to
priv->run_time_calib_work, and moves bg_run_time_calib to iwl4965_base
since it is common to both: 4965 and 5000.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@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>
189a2b5942d62bd18e1e01772c4c784253f5dd16 15-May-2008 Ester Kummer <ester.kummer@intel.com> iwlwifi: trigger event log from debugfs

This patch adds a trigger for event log printing to debugfs.
It removes the triger from sysfs.

Signed-off-by: Ester Kummer <ester.kummer@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
445c2dff409ef9de5d2f964d20917ab238fd266f 15-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: add debugfs to disable/enable run time calibration

This patch adds functionality to debugfs to enable or disable chain
noise or sensitivity calibrations.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8cf769c6dcb7b83d380f20d2873ac20ec7a734b1 06-May-2008 Ester Kummer <ester.kummer@intel.com> iwlwifi: move debug_level to sysfs/bus/pci/devices

This patch ports the debug_level from sysfs/bus/pci/drivers/iwl4965
to /sys/class/net/wlanX/device/debug_level

Signed-off-by: Ester Kummer <ester.kummer@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bf403db8a2f5580a5eb355a109d29b9287ca51e1 05-May-2008 Ester Kummer <ester.kummer@intel.com> iwlwifi: move per driverdebug_level to per device

This patch ports the debug_level to iwl_priv and changes
the format of the debug prints.

Signed-off-by: Ester Kummer <ester.kummer@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8dd266ef4eb51d034fa1c5f9307a9ff07547d8e6 05-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: debugfs EEPROM dump

This patch adds EEPROM dump in debugfs.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
712b6cf57a53da608a682b5f782c5785bda76001 13-Mar-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: Add debugfs to iwl core

This patch adds debugfs support to iwl core
currently only iwl4965 is supported

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>
0a6857e70d577237bb1cd1c991e68e7d3b6f7c90 13-Mar-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: rename iwl-4965-debug.h back to iwl-debug.h

This patch removes iwl-4965-debug.h to iwl-debug.h
It will be used by more NICs

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>
5d08cd1dfdc57dc834c47eb9f023fcf861f3d6bf 25-Oct-2007 Christoph Hellwig <hch@lst.de> iwlwifi: keep 3945 and 4965 headers separate

The iwl3945 and iwl4965 devices share some common structure, but with a
lot of difference split all over. Currently the two drivers share a lot
of headers and use ugly preprocessor magic to manage the difference.

This patch keeps two entirely separate copies of the headers to get rid
of these hacks an ease future development.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
588263515fecd926ea82950e5b7752b8696b595c 27-Sep-2007 Zhu Yi <yi.zhu@intel.com> [PATCH] iwlwifi: limit printouts on hot path

This patch change printouts on TX path to the net_ratelimit version.

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>
b481de9ca074528fe8c429604e2777db8b89806a 26-Sep-2007 Zhu Yi <yi.zhu@intel.com> [IWLWIFI]: add iwlwifi wireless drivers

This patch adds the mac80211 based wireless drivers for the Intel
PRO/Wireless 3945ABG/BG Network Connection and Intel Wireless WiFi
Link AGN (4965) adapters.

[ Move driver into it's own directory -DaveM ]

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>