Commit Graph

3656 Commits (970ec1a8213cd1a1ea29972ebbe4575a8b30bca1)

Author SHA1 Message Date
Reinette Chatre c4e061ace7 iwlwifi: save PCI state before suspend, restore after resume
This is the right thing to do and fixes the following warning:

[  115.012278] ------------[ cut here ]------------
[  115.012281] WARNING: at drivers/pci/pci-driver.c:370
pci_legacy_suspend+0x85/0xc2()
[  115.012285] Hardware name: Latitude D630
[  115.012301] PCI PM: Device state not saved by
iwl3945_pci_suspend+0x0/0x4c [iwl3945]
[  115.012304] Modules linked in: fuse nfsd lockd nfs_acl auth_rpcgss
exportfs sunrpc ipv6 acpi_cpufreq kvm_intel kvm snd_hda_codec_idt
snd_hda_intel snd_hda_codec snd_hwdep arc4 snd_seq_device snd_pcm_oss
snd_mixer_oss ecb snd_pcm cryptomgr aead snd_timer crypto_blkcipher
snd snd_page_alloc ohci1394 crypto_hash crypto_algapi ch341 ieee1394
usbserial thermal iwl3945 mac80211 led_class lib80211 tg3 processor
i2c_i801 i2c_core sg cfg80211 libphy usbhid battery ac button sr_mod
cdrom evdev dcdbas ata_generic ata_piix libata sd_mod scsi_mod ext3
jbd mbcache uhci_hcd ohci_hcd ehci_hcd usbcore [last unloaded:
microcode]
[  115.012374] Pid: 4163, comm: pm-suspend Not tainted
2.6.29-rc3-00227-gf1dd849-dirty #67
[  115.012377] Call Trace:
[  115.012382]  [<ffffffff8023d04d>] warn_slowpath+0xb1/0xed
[  115.012387]  [<ffffffff80450b5e>] ? _spin_unlock_irqrestore+0x5c/0x78
[  115.012390]  [<ffffffff80254f08>] ? up+0x34/0x39
[  115.012394]  [<ffffffff80362319>] ? acpi_ut_release_mutex+0x5d/0x61
[  115.012397]  [<ffffffff803584b2>] ? acpi_get_data+0x5e/0x70
[  115.012400]  [<ffffffff80363dd9>] ? acpi_bus_get_device+0x25/0x39
[  115.012403]  [<ffffffff80363e98>] ? acpi_bus_power_manageable+0x11/0x29
[  115.012406]  [<ffffffff803462f7>] ? acpi_pci_power_manageable+0x17/0x19
[  115.012410]  [<ffffffff8033ddfd>] ? pci_set_power_state+0xcc/0x101
[  115.012418]  [<ffffffffa01f28e9>] ? iwl3945_pci_suspend+0x0/0x4c [iwl3945]
[  115.012422]  [<ffffffff803401e6>] pci_legacy_suspend+0x85/0xc2
[  115.012425]  [<ffffffff80340316>] pci_pm_suspend+0x34/0x86
[  115.012429]  [<ffffffff8039d7ce>] pm_op+0x52/0xe5
[  115.012432]  [<ffffffff8039dd78>] device_suspend+0x32a/0x451
[  115.012436]  [<ffffffff80269ec2>] suspend_devices_and_enter+0x3e/0x13a
[  115.012439]  [<ffffffff8026a128>] enter_state+0x110/0x164
[  115.012442]  [<ffffffff8026a233>] state_store+0xb7/0xd7
[  115.012446]  [<ffffffff8032f95f>] kobj_attr_store+0x17/0x19
[  115.012449]  [<ffffffff80307d64>] sysfs_write_file+0xe4/0x119
[  115.012453]  [<ffffffff802baa7a>] vfs_write+0xae/0x137
[  115.012456]  [<ffffffff802babc7>] sys_write+0x47/0x70
[  115.012459]  [<ffffffff8020b73a>] system_call_fastpath+0x16/0x1b
[  115.012467] ---[ end trace 829828966f6f24dc ]---

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Ming Lei <tom.leiming@gmail.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-02-04 16:11:42 -05:00
Reinette Chatre 5e46882e2e iwlwifi: clean key table in iwl_clear_stations_table
Cleans uCode key table bit map iwl_clear_stations_table
since all stations are cleared also the key table must be.

Since the keys are not removed properly on suspend by mac80211
this may result in exhausting key table on resume leading
to memory corruption during removal

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>
2009-02-04 16:11:42 -05:00
Bob Copeland be0093705c ath5k: fix locking in ath5k_config
ath5k_config updates the software context without taking sc->lock.

Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 16:11:19 -05:00
Zhu, Yi 1f304e4e3b iwlwifi: fix kernel oops when ucode DMA memory allocation failure
The patch fixes memcpy to NULL address when the ucode DMA allocation failure.

This is a fix to bug
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1861

Signed-off-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>
2009-01-29 15:46:43 -05:00
Larry Finger eb83bbf574 rtl8187: Fix error in setting OFDM power settings for RTL8187L
After reports of poor performance, a review of the latest vendor driver
(rtl8187_linux_26.1025.0328.2007) for RTL8187L devices was undertaken.

A difference was found in the code used to index the OFDM power tables. When
the Linux driver was changed, my unit works at a much greater range than
before. I think this fixes Bugzilla #12380 and has been tested by at least
two other users.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Martín Ernesto Barreyro <barreyromartin@gmail.com>
Cc: Stable <stable@kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-29 15:46:42 -05:00
Larry Finger 2fcbab044a rtl8187: Add termination packet to prevent stall
The RTL8187 and RTL8187B devices can stall unless an explicit termination
packet is sent.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:36 -05:00
Abbas, Mohamed c338ba3ca5 iwlwifi: fix rs_get_rate WARN_ON()
In ieee80211_sta structure there is u64 supp_rates[IEEE80211_NUM_BANDS]
this is filled with all support rate from assoc_resp.  If we associate
with G-band AP only supp_rates of G-band will be set the other band
supp_rates will be set to 0. If the user type this command
this will cause mac80211 to set to new channel, mac80211
does not disassociate in setting new channel, so the active
band is now A-band. then in handling the new essid mac80211 will
kick in the assoc steps which involve sending disassociation frame.
in this mac80211 will WARN_ON sta->supp_rates[A_BAND] == 0.

This fixes:
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1822
http://www.kerneloops.org/searchweek.php?search=rs_get_rate

Signed-off-by: mohamed abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:36 -05:00
Christian Lamparter b4068a8049 p54usb: fix packet loss with first generation devices
Artur Skawina confirmed that the first generation devices needs the same
URB_ZERO_PACKET flag, in oder to finish the pending transfer properly.
The second generation has been successfully fixed by
"p54usb: fix random traffic stalls (LM87)" (43af18f06d5)

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-23 15:38:35 -05:00
Reinette Chatre 637f883739 iwlwifi: return NETDEV_TX_OK from _tx ops
be consistent with mac80211 drivers and return correct return code.
NETDEV_TX_OK is 0, but we need to be consistent wrt formatting amongst
implementations

re: http://marc.info/?l=linux-wireless&m=123119327419865&w=2

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:03 -05:00
Hin-Tak Leung de2624966f zd1211rw: adding Sitecom WL-603 (0df6:0036) to the USB id list
Giuseppe Cala <jiveaxe@gmail.com> (The second "a" in "Cala" should be
a grave, U+00E0) reported success on zd1211-devs@lists.sourceforge.net.
The chip info is:
zd1211b chip 0df6:0036 v4810 high 00-0c-f6 AL2230_RF pa0 g--N-

The Sitecom WL-603 is detected as a zd1211b with a AL2230 RF transceiver chip.

Signed-off-by: Giuseppe Cala <jiveaxe@gmail.com>
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:03 -05:00
Christian Lamparter e2fe154e91 p54usb: fix nasty use after free
In theory, the firmware acks the received a data frame, before signaling the driver to free it again.
However Artur Skawina <art.08.09@gmail.com> has shown that it can happen in reverse order as well.
This is very bad and could lead to memory corruptions, oopses and panics.

Thanks to Artur Skawina <art.08.09@gmail.com> for reporting and debugging this issue.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Tested-by: Artur Skawina <art.08.09@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Christian Lamparter 12da401e0d p54: more cryptographic accelerator fixes
If we let the firmware do the data encryption, we have to remove the ICV and
(M)MIC at the end of the frame before we can give it back to mac80211.
Or, these data frames have a few trailing bytes on cooked monitor interfaces.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Chr 40ab73cc6c p54: add missing break in eeprom parser
This patch fixes a obvious memory leak in the eeprom parser.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:02 -05:00
Pavel Roskin 11eaea4167 orinoco: use KERN_DEBUG for link status messages
KERN_INFO is too "loud" for messages that are generated by the ordinary
events, such as accociation.  Use of KERN_DEBUG is consistent with
mac80211.

Suggested by Michael Gilbert <michael.s.gilbert@gmail.com>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Ivo van Doorn 7490889c10 rt2x00: Fix TX rate short preamble detection
Mac80211 provides 2 structures to handle bitrates, namely
ieee80211_rate and ieee80211_tx_rate. To determine the short preamble
mode for an outgoing frame, the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE
must be checked on ieee80211_tx_rate and not ieee80211_rate (which rt2x00 did).

This fixes a regression which was triggered in 2.6.29-rcX as reported by Chris Clayton.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Tested-By: Chris Clayton <chris2553@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Andrey Borzenkov 7fe99c4e28 orinoco: move kmalloc(..., GFP_KERNEL) outside spinlock in orinoco_ioctl_set_genie
[   56.923623] BUG: sleeping function called from invalid context at /home/bor/src/linux-git/mm/slub.c:1599
[   56.923644] in_atomic(): 0, irqs_disabled(): 1, pid: 3031, name: wpa_supplicant
[   56.923656] 2 locks held by wpa_supplicant/3031:
[   56.923662]  #0:  (rtnl_mutex){--..}, at: [<c02abd1f>] rtnl_lock+0xf/0x20
[   56.923703]  #1:  (&priv->lock){++..}, at: [<dfc840c2>] orinoco_ioctl_set_genie+0x52/0x130 [orinoco]
[   56.923782] irq event stamp: 910
[   56.923788] hardirqs last  enabled at (909): [<c01957db>] __kmalloc+0x7b/0x140
[   56.923820] hardirqs last disabled at (910): [<c0309419>] _spin_lock_irqsave+0x19/0x80
[   56.923847] softirqs last  enabled at (880): [<c0124f54>] __do_softirq+0xc4/0x110
[   56.923865] softirqs last disabled at (871): [<c01049ae>] do_softirq+0x8e/0xe0
[   56.923895] Pid: 3031, comm: wpa_supplicant Not tainted 2.6.29-rc2-1avb #1
[   56.923905] Call Trace:
[   56.923919]  [<c01049ae>] ? do_softirq+0x8e/0xe0
[   56.923941]  [<c011ad12>] __might_sleep+0xd2/0x100
[   56.923952]  [<c0195837>] __kmalloc+0xd7/0x140
[   56.923963]  [<c030946a>] ? _spin_lock_irqsave+0x6a/0x80
[   56.923981]  [<dfc840e9>] ? orinoco_ioctl_set_genie+0x79/0x130 [orinoco]
[   56.923999]  [<dfc840c2>] ? orinoco_ioctl_set_genie+0x52/0x130 [orinoco]
[   56.924017]  [<dfc840e9>] orinoco_ioctl_set_genie+0x79/0x130 [orinoco]
[   56.924036]  [<c0209325>] ? copy_from_user+0x35/0x130
[   56.924061]  [<c02ffd96>] ioctl_standard_call+0x196/0x380
[   56.924085]  [<c029f945>] ? __dev_get_by_name+0x85/0xb0
[   56.924096]  [<c02ff88f>] wext_handle_ioctl+0x14f/0x230
[   56.924113]  [<dfc84070>] ? orinoco_ioctl_set_genie+0x0/0x130 [orinoco]
[   56.924132]  [<c02a3da5>] dev_ioctl+0x495/0x570
[   56.924155]  [<c0293e05>] ? sys_sendto+0xa5/0xd0
[   56.924171]  [<c0142fe8>] ? mark_held_locks+0x48/0x90
[   56.924183]  [<c0292880>] ? sock_ioctl+0x0/0x280
[   56.924193]  [<c029297d>] sock_ioctl+0xfd/0x280
[   56.924203]  [<c0292880>] ? sock_ioctl+0x0/0x280
[   56.924235]  [<c01a51d0>] vfs_ioctl+0x20/0x80
[   56.924246]  [<c01a53e2>] do_vfs_ioctl+0x72/0x570
[   56.924257]  [<c0293e62>] ? sys_send+0x32/0x40
[   56.924268]  [<c02947c0>] ? sys_socketcall+0x1d0/0x2a0
[   56.924280]  [<c010339f>] ? sysenter_exit+0xf/0x16
[   56.924292]  [<c01a5919>] sys_ioctl+0x39/0x70
[   56.924302]  [<c0103371>] sysenter_do_call+0x12/0x31

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-22 13:55:01 -05:00
Steve Glendinning 0b491eee46 usbnet: allow type check of devdbg arguments in non-debug build
Improve usbnet's devdbg to always type-check diagnostic arguments,
like dev_dbg (device.h).  This makes no change to the resulting size of
usbnet modules.

This patch also removes an #ifdef DEBUG directive from rndis_wlan so
it's devdbg statements are always type-checked at compile time.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 12:35:43 -08:00
Christian Lamparter 674743033c p54: fix p54_set_key's return code
p54 doesn't support AES-128-CMAC offload.

This patch will fix the noisy mac80211 warnings, when 802.11w is enabled:
mac80211-phy189: failed to set key (4, ff:ff:ff:ff:ff:ff) to hardware (-22)
mac80211-phy189: failed to set key (5, ff:ff:ff:ff:ff:ff) to hardware (-22)

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:25 -05:00
Artur Skawina 275719089b p54: set_tim must be atomic.
Fix for:

BUG: scheduling while atomic: named/2004/0x10000200
Pid: 2004, comm: named Not tainted 2.6.29-rc1-00271-ge9fa6b0 #45
Call Trace:
 [<c04d4ef7>] schedule+0x2a7/0x320
 [<c03aed74>] __alloc_skb+0x34/0x110
 [<c011f5b3>] __cond_resched+0x13/0x30
 [<c04d501d>] _cond_resched+0x2d/0x40
 [<c016d8c5>] kmem_cache_alloc+0x95/0xc0
 [<c016b8d4>] check_object+0xc4/0x230
 [<c03aed74>] __alloc_skb+0x34/0x110
 [<c02ede91>] p54_alloc_skb+0x71/0xf0
 [<c02ee36f>] p54_set_tim+0x3f/0xa0
 [<c04ae064>] sta_info_set_tim_bit+0x64/0x80
 [<c04c1017>] invoke_tx_handlers+0xd57/0xd80
 [<c016c397>] free_debug_processing+0x197/0x210
 [<c03ae215>] pskb_expand_head+0xf5/0x170
 [<c04bfd94>] __ieee80211_tx_prepare+0x164/0x2f0
 [<c04c1a8d>] ieee80211_skb_resize+0x6d/0xe0
 [<c04c250f>] ieee80211_master_start_xmit+0x23f/0x550
 [<c016d188>] __slab_alloc+0x2b8/0x4f0
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c03b5e7b>] dev_hard_start_xmit+0x1db/0x240
 [<c03c6a4b>] __qdisc_run+0x1ab/0x200
 [<c0136aa1>] __run_hrtimer+0x31/0xf0
 [<c03b6247>] dev_queue_xmit+0x247/0x500
 [<c04c1e56>] ieee80211_subif_start_xmit+0x356/0x7d0
 [<c0466ff7>] packet_rcv_spkt+0x37/0x150
 [<c0466ff7>] packet_rcv_spkt+0x37/0x150
 [<c03b5e7b>] dev_hard_start_xmit+0x1db/0x240
 [<c03c6a4b>] __qdisc_run+0x1ab/0x200
 [<c03b6247>] dev_queue_xmit+0x247/0x500
 [<c03bc1e2>] neigh_resolve_output+0xe2/0x200
 [<c0410080>] ip_finish_output+0x0/0x290
 [<c0410267>] ip_finish_output+0x1e7/0x290
 [<c040f355>] ip_local_out+0x15/0x20
 [<c040f5d2>] ip_push_pending_frames+0x272/0x380
 [<c042bbc6>] udp_push_pending_frames+0x146/0x3a0
 [<c042d52a>] udp_sendmsg+0x2fa/0x6b0
 [<c0433bc7>] inet_sendmsg+0x37/0x70
 [<c03a7b7e>] sock_sendmsg+0xbe/0x100
 [<c0133cd0>] autoremove_wake_function+0x0/0x50
 [<c011c043>] __wake_up_common+0x43/0x70
 [<c024a892>] copy_from_user+0x32/0x130
 [<c024a892>] copy_from_user+0x32/0x130
 [<c03b001e>] verify_iovec+0x2e/0xb0
 [<c03a7d3f>] sys_sendmsg+0x17f/0x290
 [<c017730a>] pipe_write+0x29a/0x570
 [<c013a172>] update_wall_time+0x492/0x8e0
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c011b05d>] sched_slice+0x3d/0x80
 [<c013a711>] getnstimeofday+0x51/0x120
 [<c0136657>] hrtimer_forward+0x147/0x1a0
 [<c01101b0>] lapic_next_event+0x10/0x20
 [<c013ccb3>] clockevents_program_event+0xa3/0x170
 [<c03a9054>] sys_socketcall+0xa4/0x290
 [<c0110920>] smp_apic_timer_interrupt+0x40/0x70
 [<c0103165>] sysenter_do_call+0x12/0x25

Signed-off-by: Artur Skawina <art.08.09@gmail.com>
Acked-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:24 -05:00
Rami Rosen e223b6dc05 rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free().
When running modprobe rt73usb, and then rmmod rt73usb, and then
iwconfig, the wlan0 device does not disappear. When repeating this
process again, we get a kernel Oops errors and "BUG: unable to handle
kernel paging request..." message in the kernel log.

The reason for this is that there is an error in rt2x00rfkill_free(),
which is called in the process of removing the device
(rt2x00lib_remove_dev() in rt2x00dev.c).
rt2x00rfkill_free() clears the RFKILL_STATE_ALLOCATED bit , which is
bit number 1 () in rt2x00dev->flags instead of in
rt2x00dev->rfkill_state. As a result, when checking the
DEVICE_STATE_REGISTERED_HW bit (bit number 1 in rt2x00dev->flags) in
rt2x00lib_remove_hw() it is **unset**, and we wrongly **don't** call
ieee80211_unregister_hw().

This patch corrects this: the parameter for __test_and_clear_bit() in
rt2x00rfkill_free() should be &rt2x00dev->rfkill_state and not
&rt2x00dev->flags.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:24 -05:00
Zhu Yi 73e1a65d3c iwlwifi: remove CMD_WANT_SKB flag if send_cmd_sync failure
In function iwl_send_cmd_sync(), if the flag CMD_WANT_SKB is set but
we are not provided with a valid SKB (cmd->meta.u.skb == NULL), we need
to remove the CMD_WANT_SKB flag from the TX cmd queue. Otherwise in case
the cmd comes in later, it will possibly set an invalid address. Thus
it causes an invalid memory access.

This fixed the bug http://bugzilla.kernel.org/show_bug.cgi?id=11326.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Jouni Malinen 9d97f2e55e ath9k: Fix an operator typo in REG_DOMAIN_2GHZ_MASK
Incorrect operator causes the REG_DOMAIN_2GHZ_MASK to be zero which
surely was not the goal of this definition. Mask out the 11a flags
correctly.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Jouni Malinen b657eade2f ath9k: Fix an operator typo in phy rate validation
This was not supposed to be a bitwise AND operation, but a check of
two separate conditions. Anyway, the old code happened to result in
the same behavior, so this is just changing the code to be easier to
understand and also to keep sparse from warning about dubious
operators.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Andrey Yurovsky d71038c059 libertas: Fix alignment issues in libertas core
Data structures that come over the wire from the WLAN firmware must be packed.
This fixes alignment problems on the blackfin architecture and, reportedly, on
the AVR32.

This is a replacement for the previous version of this patch which had also
explicitly used get_unaligned_ macros.  As Johannes Berg pointed out, these
macros were unnecessary.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: Colin McCabe <colin@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:23 -05:00
Christian Lamparter ef15aa490f p54: fix oops caused by bad eeproms
This patch fixes a bug that could occur, if it the eeprom is incomplete or partly corrupted.

BUG: unable to handle kernel NULL pointer dereference at 00000008
IP: p54_assign_address+0x108/0x15d [p54common]
Oops: 0002 [#1] SMP
Pid: 12988, comm: phy1 Tainted: P        W  2.6.28-rc6-wl #3
RIP: 0010: p54_assign_address+0x108/0x15d [p54common]
 [...]
Call Trace:
 p54_alloc_skb+0xa3/0xc0 [p54common]
 p54_scan+0x37/0x204 [p54common]
 [...]

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-16 17:08:22 -05:00
John W. Linville 26d1597c9a p54: fix "‘ret’ may be used uninitialized" warning
drivers/net/wireless/p54/p54common.c: In function ‘p54_config’:
drivers/net/wireless/p54/p54common.c:1853: warning: ‘ret’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:46 -05:00
John W. Linville 25a4cceaa4 iwl3945: fix "‘power_idx’ may be used uninitialized" warning
drivers/net/wireless/iwlwifi/iwl-3945.c: In function ‘iwl3945_txpower_set_from_eeprom’:
drivers/net/wireless/iwlwifi/iwl-3945.c:2222: warning: ‘power_idx’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
John W. Linville 08cb7e0167 b43legacy: fix "‘up_dev’ may be used uninitialized" warning
drivers/net/wireless/b43legacy/main.c: In function ‘b43legacy_op_dev_config’:
drivers/net/wireless/b43legacy/main.c:2468: warning: ‘up_dev’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
John W. Linville 922d8a0b6d b43: fix "‘gmode’ may be used uninitialized" warning
drivers/net/wireless/b43/main.c: In function ‘b43_op_config’:
drivers/net/wireless/b43/main.c:3264: warning: ‘gmode’ may be used uninitialized

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-13 10:25:45 -05:00
Andrey Yurovsky 51e99158d2 libertas_tf: return NETDEV_TX_OK in TX op
The TX op should return NETDEV_TX_OK or NETDEV_TX_BUSY.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Ivo van Doorn f1dd2b23ba rt2x00: Fix rt2500usb HW crypto: WEP 128 & AES
The TXD_W0_CIPHER field is a 1-bit field. It only acts as boolean value
to indicate if the frame must be encrypted or not.

The way rt2x00_set_field32() worked it would grab the least signifcant bit
from txdesc->cipher and use that as value. Because of that WEP 64 and TKIP
worked since they had odd-numbered values, while WEP 128 and AES were
even numbers and didn't work.

Correctly booleanize the txdecs->cipher value to allow the hardware to
encrypt the outgoing data. After this we can enable HW crypto by default again.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Bob Copeland 71ef99c8b7 ath5k: fix return values from ath5k_tx
Should return NETDEV_TX_{OK,BUSY} instead of 0,-1 (this doesn't change
any current functionality).

Changes-licensed-under: 3-Clause-BSD

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:57 -05:00
Johannes Berg d6e2be988d rtl8187: Fix module so that rmmod/insmod does not error
Due to misunderstanding of the returned values allowed for the tx callback
of mac80211, rtl8187 was using skb's that had been freed. This problem was
triggered when the module was sujected to a rmmod/insmod cycle.

After that was fixed, the modules would not work after the rmmod/insmod cycle
until the USB device was reset.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:56 -05:00
Christian Lamparter 124b68e755 p54: fix WARN_ON at line 2247 of net/mac80211/rx.c
This patch hopefully fixes a mac80211<->p54 interaction problem, which was
described by Larry Finger (ref: http://marc.info/?l=linux-wireless&m=123009889327707 )

I guess the warning was triggered by pending frames in the receive queue,
while we're doing a band change 5GHz.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:56 -05:00
Steve Brown 4fb7404e0e ath5k: Correct usage of AR5K_CFG_ADHOC
This corrects usage of AR5K_CFG_ADHOC introduced in
"ath5k: Update PCU code". Also,
the name of the indicator is changed to AR5K_CFG_IBSS to more
accurately reflect its function. This change restores
beaconing in AP and mesh modes.

Signed-off-by: Steve Brown <sbrown@cortland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:56 -05:00
Jouni Malinen 157ec87684 ath9k: Revert fix to TX status reporting for retries and MCS index
This patch reverts "ath9k: Fix TX status reporting for retries and MCS index"
because that change ended up breaking ath9k rate control. While the
MCS index reporting to mac80211 was indeed fixed by the patch, it did
not take into account that the ath9k rate control algorithm was
updating private tables based on this index and the index comes
through the rate control API call, i.e., based on mac80211 TX status
call. In addition, it looks like the "fix" to remove +1 from TX status
'count' field was not correct based on ieee80211_tx_status()
implementation that counts the total of count values, but starting
from -1, not 0.

The TX status reporting for frames using MCS needs to be fixed
somehow, but it does not look like there is any easy fix for the ath9k
rate control algorithm, so the best option now seems to be to revert the
change and bring it back once the rate control code is cleaned up to
handle this better.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:55 -05:00
Senthil Balasubramanian d3a1db1c67 ath9k: Fix incorrect sequence numbering for unaggregated QoS Frame.
This patch fixes an issue with the sequence numbers of unaggregated
QoS frames, because of which the frames are handled in a different order
at the AP and resulted in MLME REPLAYFAILURE.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:55 -05:00
Ivo van Doorn f3d340c1d5 Fix rt2500usb HW crypto: TKIP
rt2500usb doesn't strip the IV/ICV data from received frames,
so we don't need to set the RX_FLAG_IV_STRIPPED flag.
We do need to set the RX_FLAG_MMIC_STRIPPED flag for all
encryption types since the MMIC has been removed from the frame.

After this patch TKIP Hardware crypto works for rt2500usb.
WEP and AES are still failing.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:54 -05:00
Larry Finger b55eae3349 rtl8180: Fix to add STA mode
To be compatible with mac80211 following "mac80211: only create
default STA interface if supported", rtl8180 needs to set
NL80211_IFTYPE_STATION in interface_modes.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Reported-by: Fabio Rossi <rossi.f@inwind.it>
Tested-by: Piter PUNK <piterpunk@unitednerds.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:53 -05:00
Daniel Wu 1061787967 iwlwifi: Fix typo in iwl-commands.h for CCK rate bit range.
My first (minor) patch, hopefully this is correct.

Fix a typo in iwl-commands.h for CCK rates which needs 7 bits and not 4.

Signed-off-by: Daniel Wu <dyqith@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:53 -05:00
Ivo van Doorn d15cfc3ac7 rt2x00: Fix segementation fault
The queue_end() macro points to 1 position after the
queue, which means that if we want to know if queue
is at the end of the queue we should first increment
the position and then check if it is a valid entry.

This fixes a segmentation fault which only occurs when
the device has enough endpoints to provide a dedicated
endpoint for all TX queues (which likely won't happen
for rt2500usb and rt73usb, but will happen for rt2800usb).

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:53 -05:00
Christian Lamparter 00627f229c p54usb: fix random traffic stalls (LM87)
All LM87 firmwares need a explicit termination "packet",
in oder to finish the pending transfer properly.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:52 -05:00
Christian Lamparter c1d34c1dad p54: crypto offload fixes
This patch fixes two small flaws:
 - restore the original TKIP IV if we altered it.
 - reserve & initialize ICV with zeros.
   This is actually only necessary for some obsolete p54usb firmwares.
   But we don't know yet, if all devices are compatible with the new revisions.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:52 -05:00
Pavel Roskin 706ea9b669 orinoco_cs: add ID for ARtem Onair Comcard 11
Reported by Michael Jarosch <mitsch@riotmusic.de>

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:52 -05:00
Samuel Ortiz d732129b25 iwlwifi: Fix get_cmd_string() for REPLY_3945_RX
0x1b is a 3945 specific command, we should print it too when debugging.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:51 -05:00
Sujith 86060f0d69 ath9k: Fix chainmask handling bug
The chainmasks have to be updated before setting the channel,
since the HW reset routine uses them to set the appropriate registers.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:51 -05:00
David Kilroy 20953ad68e orinoco: take the driver lock in the rx tasklet
Fix the warning reproduced below.

We add to rx_list in interrupt context and remove elements in tasklet
context. While removing elements we need to prevent the interrupt
modifying the list.

Note that "orinoco: Process bulk of receive interrupt in a tasklet" did not
preserve locking semantics on what is now orinoco_rx.

This patch reinstates the locking semantics and ensures it covers
rx_list as well. This leads to additional cleanup required in
free_orinocodev.

[89479.105038] WARNING: at lib/list_debug.c:30 __list_add+0x8f/0xa0()
[89479.105058] list_add corruption. prev->next should be next (dddb3568), but was cbc28978. (prev=dddb3568).
[89479.106002] Pid: 15746, comm: X Not tainted 2.6.28-1avb #26
[89479.106020] Call Trace:
[89479.106062]  [<c011d3b0>] warn_slowpath+0x60/0x80
[89479.106104]  [<c01073d0>] ? native_sched_clock+0x20/0x70
[89479.106194]  [<c013d825>] ? lock_release_holdtime+0x35/0x200
[89479.106218]  [<c018d9f0>] ? __slab_alloc+0x550/0x560
[89479.106254]  [<c02f9c9d>] ? _spin_unlock+0x1d/0x20
[89479.106270]  [<c018d9f0>] ? __slab_alloc+0x550/0x560
[89479.106302]  [<c01ff2a7>] ? delay_tsc+0x17/0x24
[89479.106319]  [<c01ff221>] ? __const_udelay+0x21/0x30
[89479.106376]  [<dfa8b1e2>] ? hermes_bap_seek+0x112/0x1e0 [hermes]
[89479.106396]  [<c013d7eb>] ? trace_hardirqs_off+0xb/0x10
[89479.106418]  [<c018e307>] ? __kmalloc_track_caller+0xb7/0x110
[89479.106448]  [<c028eefc>] ? dev_alloc_skb+0x1c/0x30
[89479.106465]  [<c028eefc>] ? dev_alloc_skb+0x1c/0x30
[89479.106482]  [<c020e13f>] __list_add+0x8f/0xa0
[89479.106551]  [<dfd0fcae>] orinoco_interrupt+0xcae/0x16c0 [orinoco]
[89479.106574]  [<c013b0e3>] ? tick_dev_program_event+0x33/0xb0
[89479.106594]  [<c01073d0>] ? native_sched_clock+0x20/0x70
[89479.106613]  [<c013d825>] ? lock_release_holdtime+0x35/0x200
[89479.106662]  [<c013d7eb>] ? trace_hardirqs_off+0xb/0x10
[89479.106892]  [<dfe7faa7>] ? usb_hcd_irq+0x97/0xa0 [usbcore]
[89479.106926]  [<c015ba79>] handle_IRQ_event+0x29/0x60
[89479.106947]  [<c015cf89>] handle_level_irq+0x69/0xe0
[89479.106963]  [<c015cf20>] ? handle_level_irq+0x0/0xe0
[89479.106977]  <IRQ>  [<c02ca933>] ? tcp_v4_rcv+0x633/0x6e0
[89479.107025]  [<c0103f0c>] ? common_interrupt+0x28/0x30
[89479.107057]  [<c02a0000>] ? sk_run_filter+0x320/0x7a0
[89479.107078]  [<c020e041>] ? list_del+0x21/0x90
[89479.107106]  [<dfd0d24e>] ? orinoco_rx_isr_tasklet+0x2ce/0x480 [orinoco]
[89479.107131]  [<c01402e0>] ? __lock_acquire+0x160/0x1650
[89479.107151]  [<c01073d0>] ? native_sched_clock+0x20/0x70
[89479.107169]  [<c013d825>] ? lock_release_holdtime+0x35/0x200
[89479.107200]  [<c012249a>] ? irq_enter+0xa/0x60
[89479.107217]  [<c0104e52>] ? do_IRQ+0xd2/0x130
[89479.107518]  [<c010342c>] ? restore_nocheck_notrace+0x0/0xe
[89479.107542]  [<c0122830>] ? __do_softirq+0x0/0x110
[89479.107561]  [<c013f7b4>] ? trace_hardirqs_on_caller+0x74/0x140
[89479.107583]  [<c01ff678>] ? trace_hardirqs_on_thunk+0xc/0x10
[89479.107602]  [<c0122087>] ? tasklet_action+0x27/0x90
[89479.107620]  [<c013f7b4>] ? trace_hardirqs_on_caller+0x74/0x140
[89479.107638]  [<c01220a3>] ? tasklet_action+0x43/0x90
[89479.107655]  [<c012289f>] ? __do_softirq+0x6f/0x110
[89479.107674]  [<c0122830>] ? __do_softirq+0x0/0x110
[89479.107685]  <IRQ>  [<c015cf20>] ? handle_level_irq+0x0/0xe0
[89479.107715]  [<c012246d>] ? irq_exit+0x5d/0x80
[89479.107732]  [<c0104e52>] ? do_IRQ+0xd2/0x130
[89479.107747]  [<c0103337>] ? sysenter_exit+0xf/0x16
[89479.107765]  [<c013f83d>] ? trace_hardirqs_on_caller+0xfd/0x140
[89479.107782]  [<c0103f0c>] ? common_interrupt+0x28/0x30
[89479.107797] ---[ end trace a1fc0a52df4a729d ]---

Reported-by: Andrey Borzenkov <arvidjaar@mail.ru>
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:51 -05:00
Jouni Malinen 176ddc7dcf ath9k: Enforce module build if rfkill is a module
CONFIG_ATH9K=y results in build issues if CONFIG_RFKILL=m since ath9k
does not depend on rfkill in kconfig (i.e., CONFIG_RFKILL is used to
select whether to enable rfkill in ath9k), but uses its functions if
rfkill is enabled. Enforce ath9k to be build as a module if
CONFIG_RFKILL=m to avoid this invalid configuration.

Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:50 -05:00
Michiel 878e6a432f p54usb: Add USB ID for Thomson Speedtouch 121g
Add the USB ID for Thomson Speedtouch 121g to p54usb.

Signed-off-by: Michiel <michiel@ettema.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:50 -05:00
Ivo van Doorn 3ea9646315 rt2x00: Fix TX short preamble detection
The short preamble mode was not correctly detected during TX,
rt2x00 used the rate->hw_value_short field but mac80211 is not
using this field that way.
Instead the flag IEEE80211_TX_RC_USE_SHORT_PREAMBLE should be
used to determine if the frame should be send out using
short preamble or not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-01-12 14:24:50 -05:00