summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/common.c
Commit message (Collapse)AuthorAgeFilesLines
* iwlegacy: Use standard #defines for PCIe Capability ASPM fieldsBjorn Helgaas2012-12-071-3/+2Star
| | | | | | | Use the standard #defines rather than creating local definitions for PCIe Capability ASPM fields. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
* iwlegacy: collapse wrapper for pcie_capability_read_word()Bjorn Helgaas2012-12-071-2/+3
| | | | | | | il_pcie_link_ctl() has only one call site and no longer provides any useful abstraction, so collapse it into the caller. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
* iwlegacy: use eth_broadcast_addrJohannes Berg2012-09-241-2/+2
| | | | | | | | Instead of copying from a constant array (which is still needed for other purposes) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: clean up suspend/resumeJohannes Berg2012-08-101-12/+3Star
| | | | | | | | | | | There's no need to export the il_pci_suspend and il_pci_resume functions since they're only referenced from il_pm_ops. The latter can also be defined using SIMPLE_DEV_PM_OPS instead of open-coding it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'for-john' of ↵John W. Linville2012-07-121-1/+1
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/iwmc3200wifi/cfg80211.c drivers/net/wireless/mwifiex/cfg80211.c
| * mac80211: add time synchronisation with BSS for assocJohannes Berg2012-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some drivers (iwlegacy, iwlwifi and rt2x00) today use the bss_conf.last_tsf value. By itself though that value is completely worthless since it may be ancient. What really is needed is synchronisation between some device time and the TSF. To clarify this, rename bss_conf.last_tsf to sync_tsf and add sync_device_ts which is obtained from rx_status which gets a new field device_timestamp for this purpose. This is intentionally not using the mactime field since that is used for other things and in IBSS is expected to sync with the IBSS's TSF which isn't necessarily true for the device timestamp. Also, since we have the information and it's useful even before the connection has been established, give all the timing details to the driver before authenticating. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'master' of ↵John W. Linville2012-07-091-8/+6Star
|\ \ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: net/mac80211/mlme.c
| * | iwlegacy: always monitor for stuck queuesStanislaw Gruszka2012-07-091-8/+6Star
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is iwlegacy version of: commit 342bbf3fee2fa9a18147e74b2e3c4229a4564912 Author: Johannes Berg <johannes.berg@intel.com> Date: Sun Mar 4 08:50:46 2012 -0800 iwlwifi: always monitor for stuck queues If we only monitor while associated, the following can happen: - we're associated, and the queue stuck check runs, setting the queue "touch" time to X - we disassociate, stopping the monitoring, which leaves the time set to X - almost 2s later, we associate, and enqueue a frame - before the frame is transmitted, we monitor for stuck queues, and find the time set to X, although it is now later than X + 2000ms, so we decide that the queue is stuck and erroneously restart the device Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* / iwlegacy: print how long queue was actually stuckPaul Bolle2012-06-281-3/+4
|/ | | | | | | | | | | | | | | Every now and then, after resuming from suspend, the iwlegacy driver prints iwl4965 0000:03:00.0: Queue 2 stuck for 2000 ms. iwl4965 0000:03:00.0: On demand firmware reload I have no idea what causes these errors. But the code currently uses wd_timeout in the first error. wd_timeout will generally be set at IL_DEF_WD_TIMEOUT (ie, 2000). Perhaps printing for how long the queue was actually stuck can clarify the cause of these errors. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* drivers/net: Convert compare_ether_addr to ether_addr_equalJoe Perches2012-05-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new bool function ether_addr_equal to add some clarity and reduce the likelihood for misuse of compare_ether_addr for sorting. Done via cocci script: $ cat compare_ether_addr.cocci @@ expression a,b; @@ - !compare_ether_addr(a, b) + ether_addr_equal(a, b) @@ expression a,b; @@ - compare_ether_addr(a, b) + !ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) == 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !ether_addr_equal(a, b) != 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) == 0 + !ether_addr_equal(a, b) @@ expression a,b; @@ - ether_addr_equal(a, b) != 0 + ether_addr_equal(a, b) @@ expression a,b; @@ - !!ether_addr_equal(a, b) + ether_addr_equal(a, b) Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* iwlegacy: fix BSSID settingStanislaw Gruszka2012-03-261-10/+6Star
| | | | | | | | | | | | | | | | | | | Current commit 0775f9f90cdaf40fbf69b3192b3dddb2b3436f45 "mac80211: remove spurious BSSID change flag" exposed bug on iwlegacy, that we do not set BSSID address correctly and then device was not able to receive frames after successful associate. On the way fix scan canceling comment. Apparently ->post_associate() do cancel scan itself, but scan cancel on BSS_CHANGED_BSSID is needed. I'm not sure why, but when I removed it, I had frequent auth failures: wlan4: send auth to 54:e6:fc:98:63:fe (try 1/3) wlan4: send auth to 54:e6:fc:98:63:fe (try 2/3) wlan4: send auth to 54:e6:fc:98:63:fe (try 3/3) wlan4: authentication with 54:e6:fc:98:63:fe timed out Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: do not nulify il->vif on resetStanislaw Gruszka2012-03-261-3/+12
| | | | | | | | | | | | | | This il->vif is dereferenced in different part of iwlegacy code, so do not nullify it. This should fix random crashes observed in companion with microcode errors i.e. crash in il3945_config_ap(). Additionally this should address also WARNING: at drivers/net/wireless/iwlegacy/common.c:4656 il_mac_remove_interface at least one of the possible reasons of that warning. Cc: stable@vger.kernel.org Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: rename bss_conf timestamp to last_tsfJohannes Berg2012-03-131-1/+1
| | | | | | | | | | | | | | | This value is not really very useful by itself, yet some drivers (including iwlwifi until I can figure out what it should do) use it. At least rename it to "last_tsf" to indicate the meaning and add a note that it may be really old. I suspect the value may become useful combined with the rx_status->mactime, but we don't (yet) store that value and pass it to the driver. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: s/il_txq_mem/il_free_txq_mem/gStanislaw Gruszka2012-02-221-2/+2
| | | | | | | Previous name was confusing. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: s/S_RF_KILL_HW/S_RFKILL/gStanislaw Gruszka2012-02-221-3/+3
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: small queue initializations cleanupStanislaw Gruszka2012-02-221-30/+36
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: check correct il_poll_bit error valueStanislaw Gruszka2012-02-221-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: do not grab nic access if rfkillStanislaw Gruszka2012-02-221-6/+19
| | | | | | | | | If rfkill is on il_grab_nic_access() fail and we can not write to the various registers during stop procedure. Write to those registers unconditionally instead. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: improve mac operation debuggability a bitStanislaw Gruszka2012-02-221-45/+44Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of tx/rx traffic logStanislaw Gruszka2012-02-221-247/+0Star
| | | | | | | The same data can be gathered using monitor mode. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: merge all ops structures into oneStanislaw Gruszka2012-02-221-31/+19Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: merge il_lib_ops into il_opsStanislaw Gruszka2012-02-221-17/+17
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: remove il_apm_opsStanislaw Gruszka2012-02-221-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: merge eeprom_ops into lib_opsStanislaw Gruszka2012-02-221-2/+2
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: regulatory_bands is not an opsStanislaw Gruszka2012-02-221-6/+4Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: cleanup/fix memory barriersStanislaw Gruszka2012-02-221-2/+0Star
| | | | | | | | | | | | | | | | wmb(), rmb() are not needed when writel(), readl() are used as accessors for MMIO. We use them indirectly via iowrite32(), ioread32(). What is needed mmiowb(), for synchronizing writes coming from different CPUs on PCIe bridge (see in patch comments). This fortunately is not needed on x86, where mmiowb() is just defined as compiler barrier. As iwlegacy devices are most likely not used on anything other than x86, this is not so important fix. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: always check if got h/w access before writeStanislaw Gruszka2012-02-221-5/+5
| | | | | | | | | | | Before we write to the device register always check if _il_grap_nic_access() was successful. Change type return type _il_grap_nic_access() to bool, and add likely()/unlikely() statements. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: dump stack when fail to gain access to the deviceStanislaw Gruszka2012-02-221-2/+3
| | | | | | | | | | | | Print dump stack when the device is not responding. This should give some more clue about the reason of failure. Also change the message we print, since "MAC in deep sleep" is kinda confusing. On the way add unlikely(), as fail to gain NIC access is hmm ... unlikely. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: remove struct il_tx_infoStanislaw Gruszka2012-02-061-13/+11Star
| | | | | | | It's just wrapper to sk_buff pointers ... Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: merge il_base_params into il_cfgStanislaw Gruszka2012-02-061-14/+14
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move ops out of configStanislaw Gruszka2012-02-061-70/+45Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ctx structureStanislaw Gruszka2012-02-061-120/+79Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: remove il_setup_interface()Stanislaw Gruszka2012-02-061-19/+3Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ctx->is_activeStanislaw Gruszka2012-02-061-18/+3Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move ht out of ctx structureStanislaw Gruszka2012-02-061-25/+24Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move qos_data out of ctx structureStanislaw Gruszka2012-02-061-12/+12
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: remove ctx interface_modesStanislaw Gruszka2012-02-061-25/+4Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ctx->station_flagsStanislaw Gruszka2012-02-061-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ctxidStanislaw Gruszka2012-02-061-6/+0Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of *_devtypeStanislaw Gruszka2012-02-061-3/+3
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move bcast_sta_id to hw_paramsStanislaw Gruszka2012-02-061-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ap_sta_idStanislaw Gruszka2012-02-061-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of qos_cmdStanislaw Gruszka2012-02-061-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: get rid of ctx->rxon_timing_cmdStanislaw Gruszka2012-02-061-1/+1
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move rxon commands out of ctx structureStanislaw Gruszka2012-02-061-80/+77Star
| | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: move some i/o helpers out of inlineStanislaw Gruszka2012-01-041-0/+161
| | | | | | | | | | | | | | | | | | | | This save us about 20k of text size, and should have no impact on performance as hot paths do not use much I/O. Before: text data bss dec hex filename 108512 1784 168 110464 1af80 drivers/net/wireless/iwlegacy/iwl3945.ko 165730 2164 156 168050 29072 drivers/net/wireless/iwlegacy/iwl4965.ko 91942 328 48 92318 1689e drivers/net/wireless/iwlegacy/iwlegacy.ko After: text data bss dec hex filename 95556 1784 168 97508 17ce4 drivers/net/wireless/iwlegacy/iwl3945.ko 154853 2164 156 157173 265f5 drivers/net/wireless/iwlegacy/iwl4965.ko 91634 328 48 92010 1676a drivers/net/wireless/iwlegacy/iwlegacy.ko Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: Use kcalloc instead of kzalloc to allocate arrayThomas Meyer2011-12-061-3/+2Star
| | | | | | | | | | | | The advantage of kcalloc is, that will prevent integer overflows which could result from the multiplication of number of elements and size and it is also a bit nicer to read. The semantic patch that makes this change is available in https://lkml.org/lkml/2011/11/25/107 Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* iwlegacy: checkpatch.pl fixesStanislaw Gruszka2011-11-151-126/+31Star
| | | | | | Fix most checkpatch.pl ERRORs and some WARNINGs. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
* iwlegacy: indentions and whitespacesStanislaw Gruszka2011-11-151-936/+991
| | | | | | | | | | | Process iwlegacy source files using: indent -npro -l500 -nhnl indent -npro -kr -i8 -ts8 -sob -l80 -nbbo -ss -ncs -cp1 -il0 -psl Plus manual compilation fixes. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
* iwlegacy: merge iwl-debug.h into common.hStanislaw Gruszka2011-11-151-1/+0Star
| | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>