dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

58 Commits

Author SHA1 Message Date
Stanislaw Gruszka fa4cffcba9 iwlegacy: fix IBSS cleanup
We do not correctly change interface type when switching from
IBSS mode to STA mode, that results in microcode errors.

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=886946

Reported-by: Jaroslav Skarvada <jskarvad@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22 14:33:43 -05:00
Bjorn Helgaas f93eaffcac iwlegacy: Use standard #defines for PCIe Capability ASPM fields
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>
2012-12-07 11:19:52 -07:00
Bjorn Helgaas 94e1561344 iwlegacy: collapse wrapper for pcie_capability_read_word()
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>
2012-12-07 11:19:24 -07:00
Johannes Berg 742e7a9322 iwlegacy: use eth_broadcast_addr
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>
2012-09-24 15:02:08 -04:00
Johannes Berg 450e9038ee iwlegacy: clean up suspend/resume
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>
2012-08-10 15:26:59 -04:00
John W. Linville d07d152892 Merge branch 'for-john' of 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
2012-07-12 15:21:05 -04:00
Johannes Berg 8c358bcd09 mac80211: add time synchronisation with BSS for assoc
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>
2012-07-12 12:10:46 +02:00
John W. Linville 635d999fd3 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	net/mac80211/mlme.c
2012-07-09 16:34:34 -04:00
Stanislaw Gruszka c2ca7d92ed iwlegacy: always monitor for stuck queues
This is iwlegacy version of:

commit 342bbf3fee
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>
2012-07-09 15:01:02 -04:00
Paul Bolle 26b6da6b78 iwlegacy: print how long queue was actually stuck
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>
2012-06-28 14:37:44 -04:00
Joe Perches 2e42e4747e drivers/net: Convert compare_ether_addr to ether_addr_equal
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>
2012-05-10 23:33:01 -04:00
Stanislaw Gruszka e92109be7a iwlegacy: fix BSSID setting
Current commit 0775f9f90c
"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>
2012-03-26 15:07:24 -04:00
Stanislaw Gruszka 883a649b73 iwlegacy: do not nulify il->vif on reset
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>
2012-03-26 15:07:22 -04:00
Johannes Berg e9ac0745c7 mac80211: rename bss_conf timestamp to last_tsf
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>
2012-03-13 14:54:20 -04:00
Stanislaw Gruszka 6668e4eb50 iwlegacy: s/il_txq_mem/il_free_txq_mem/g
Previous name was confusing.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:17 -05:00
Stanislaw Gruszka bc269a8e27 iwlegacy: s/S_RF_KILL_HW/S_RFKILL/g
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:17 -05:00
Stanislaw Gruszka d87c771f47 iwlegacy: small queue initializations cleanup
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:17 -05:00
Stanislaw Gruszka 586e45e31e iwlegacy: check correct il_poll_bit error value
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:16 -05:00
Stanislaw Gruszka 775ed8abde iwlegacy: do not grab nic access if rfkill
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>
2012-02-22 14:51:16 -05:00
Stanislaw Gruszka 9ce7b73c76 iwlegacy: improve mac operation debuggability a bit
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:15 -05:00
Stanislaw Gruszka 288f995413 iwlegacy: get rid of tx/rx traffic log
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>
2012-02-22 14:51:15 -05:00
Stanislaw Gruszka c936355172 iwlegacy: merge all ops structures into one
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:15 -05:00
Stanislaw Gruszka 1600b87542 iwlegacy: merge il_lib_ops into il_ops
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:15 -05:00
Stanislaw Gruszka f03ee2a87e iwlegacy: remove il_apm_ops
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:14 -05:00
Stanislaw Gruszka a89268e8cd iwlegacy: merge eeprom_ops into lib_ops
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:13 -05:00
Stanislaw Gruszka 93a984a4ee iwlegacy: regulatory_bands is not an ops
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-22 14:51:12 -05:00
Stanislaw Gruszka 4e5ea2088b iwlegacy: cleanup/fix memory barriers
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>
2012-02-22 14:51:12 -05:00
Stanislaw Gruszka 1e0f32a43a iwlegacy: always check if got h/w access before write
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>
2012-02-22 14:51:12 -05:00
Stanislaw Gruszka b6603036ad iwlegacy: dump stack when fail to gain access to the device
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>
2012-02-22 14:51:11 -05:00
Stanislaw Gruszka 00ea99e1d8 iwlegacy: remove struct il_tx_info
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>
2012-02-06 14:56:13 -05:00
Stanislaw Gruszka 89ef1ed2d2 iwlegacy: merge il_base_params into il_cfg
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:12 -05:00
Stanislaw Gruszka c39ae9fd50 iwlegacy: move ops out of config
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:11 -05:00
Stanislaw Gruszka 8300719603 iwlegacy: get rid of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:11 -05:00
Stanislaw Gruszka 20c47eba70 iwlegacy: remove il_setup_interface()
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:10 -05:00
Stanislaw Gruszka dee9a09eb3 iwlegacy: get rid of ctx->is_active
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:09 -05:00
Stanislaw Gruszka 1c03c4620e iwlegacy: move ht out of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:07 -05:00
Stanislaw Gruszka 8d44f2bd75 iwlegacy: move qos_data out of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:06 -05:00
Stanislaw Gruszka 8c9c48d5a9 iwlegacy: remove ctx interface_modes
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:05 -05:00
Stanislaw Gruszka fd6415bcfb iwlegacy: get rid of ctx->station_flags
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:04 -05:00
Stanislaw Gruszka 6aa0c25435 iwlegacy: get rid of ctxid
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:02 -05:00
Stanislaw Gruszka 0f8b90f526 iwlegacy: get rid of *_devtype
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:01 -05:00
Stanislaw Gruszka b16db50a6d iwlegacy: move bcast_sta_id to hw_params
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:56:00 -05:00
Stanislaw Gruszka 8f9e564553 iwlegacy: get rid of ap_sta_id
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:55:59 -05:00
Stanislaw Gruszka b96ed60cd0 iwlegacy: get rid of qos_cmd
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:55:58 -05:00
Stanislaw Gruszka 63d0f0c551 iwlegacy: get rid of ctx->rxon_timing_cmd
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:55:56 -05:00
Stanislaw Gruszka c8b03958d4 iwlegacy: move rxon commands out of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-06 14:55:55 -05:00
Stanislaw Gruszka 17d4eca643 iwlegacy: move some i/o helpers out of inline
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>
2012-01-04 14:30:44 -05:00
Thomas Meyer 2b50b8f588 iwlegacy: Use kcalloc instead of kzalloc to allocate array
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>
2011-12-06 16:05:24 -05:00
Stanislaw Gruszka 1722f8e12a iwlegacy: checkpatch.pl fixes
Fix most checkpatch.pl ERRORs and some WARNINGs.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:51:01 +01:00
Stanislaw Gruszka e7392364fc iwlegacy: indentions and whitespaces
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>
2011-11-15 14:45:59 +01:00