]> git.karo-electronics.de Git - mv-sheeva.git/log
mv-sheeva.git
12 years agoiwlwifi: reintroduce iwl_enable_rfkill_int
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:28 +0000 (09:52 -0800)]
iwlwifi: reintroduce iwl_enable_rfkill_int

If device is disabled by rfkill switch, do not enable all interrupts,
but only CSR_INT_BIT_RF_KILL to receive rfkill state change. Unblocking
other interrupts might cause problems, since driver can not be prepared
for receive them.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: print DMA stop timeout error only if it happened
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:27 +0000 (09:52 -0800)]
iwlwifi: print DMA stop timeout error only if it happened

iwl_poll_direct_bit() return negative error value on timeout,
positive values do not indicate an error.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: use writeb,writel,readl directly
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:26 +0000 (09:52 -0800)]
iwlwifi: use writeb,writel,readl directly

That change will save us some CPU cycles at run time. Having port-based
I/O seems to be not possible for PCIe devices.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: cleanup/fix memory barriers
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:25 +0000 (09:52 -0800)]
iwlwifi: 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 iwlwifi 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: 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>
12 years agoiwlwifi: always check if got h/w access before write
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:24 +0000 (09:52 -0800)]
iwlwifi: always check if got h/w access before write

Before we write to the device registers always check if
iwl_grap_nic_access() was successful.

On the way change return type of grab_nic_access() to bool, and add
likely()/unlikely() statement.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: dump stack when fail to gain access to the device
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:23 +0000 (09:52 -0800)]
iwlwifi: 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: 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>
12 years agoiwlwifi: return error if loading uCode failed
Johannes Berg [Wed, 7 Mar 2012 17:52:22 +0000 (09:52 -0800)]
iwlwifi: return error if loading uCode failed

In "iwlwifi: consolidate the start_device flow"
the code flow changed and the firmware is now
loaded by the transport layer, but the change
unfortunately lost error checking -- restore.

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>
12 years agoiwlwifi: remove unused max_nrg_cck from sensitivity and constify
Johannes Berg [Wed, 7 Mar 2012 17:52:21 +0000 (09:52 -0800)]
iwlwifi: remove unused max_nrg_cck from sensitivity and constify

The sensitivity parameters are never modified, so they
should be const. Also remove the unused max_nrg_cck
value to save some space.

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>
12 years agoiwlwifi: make EEPROM enhanced TX power a bool
Johannes Berg [Wed, 7 Mar 2012 17:52:20 +0000 (09:52 -0800)]
iwlwifi: make EEPROM enhanced TX power a bool

There's no need to carry around the function
pointer when a boolean indicating that the
EEPROM stores enhanced TX power information
is sufficient.

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>
12 years agoiwlwifi: move BT/HT params to shared
Johannes Berg [Wed, 7 Mar 2012 17:52:19 +0000 (09:52 -0800)]
iwlwifi: move BT/HT params to shared

Hardware parameters will be shared, so
move the definitions into the shared
header file.

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>
12 years agoiwlwifi: remove BT handlers from lib_ops
Johannes Berg [Wed, 7 Mar 2012 17:52:18 +0000 (09:52 -0800)]
iwlwifi: remove BT handlers from lib_ops

There's no need to have operations for
these as they simply depend on whether
the device has built-in bluetooth, so
just duplicate the information already
there (whether bt_params is present or
not).

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>
12 years agoiwlwifi: transport's tx_agg_disable must be atomic
Johannes Berg [Wed, 7 Mar 2012 17:52:17 +0000 (09:52 -0800)]
iwlwifi: transport's tx_agg_disable must be atomic

At least as long as it is called from the reclaim
flow (iwlagn_check_ratid_empty) it must be atomic.

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>
12 years agoiwlwifi: redesign PASSIVE_NO_RX workaround
Johannes Berg [Wed, 7 Mar 2012 17:52:16 +0000 (09:52 -0800)]
iwlwifi: redesign PASSIVE_NO_RX workaround

The PASSIVE_NO_RX workaround currently crosses
through the op_mode and transport layers, which
is a bit odd. This also isn't necessary, if the
transport simply reports when queues are full
(or no longer full) the op_mode can keep track
of this state, and report to mac80211 only what
*it* thinks is appropriate. What is appropriate
can then be based on whether queues should be
stopped to wait for RX or not.

This significantly simplifies the transport API,
it no longer needs to expose anything to stop a
queue, nor to wake "any" queue, this can all be
handled in the upper layer completely.

Also simplify the handling to not be dependent
on the context, that makes little sense as the
queues are shared and both contexts have to be
on the same channel anyway.

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>
12 years agoiwlwifi: remove unused argument from iwlagn_suspend
Johannes Berg [Wed, 7 Mar 2012 17:52:15 +0000 (09:52 -0800)]
iwlwifi: remove unused argument from iwlagn_suspend

There's not much point in passing priv and
hw pointers since they can be derived from
each other, and the function doesn't use
the hw pointer anyway. 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>
12 years agoiwlwifi: remove two unused arguments in testmode
Johannes Berg [Wed, 7 Mar 2012 17:52:14 +0000 (09:52 -0800)]
iwlwifi: remove two unused arguments in testmode

The dump functions never access the incoming
attributes, so don't pass 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>
12 years agoiwlwifi: remove unused argument from iwl_init_hw_rates
Johannes Berg [Wed, 7 Mar 2012 17:52:13 +0000 (09:52 -0800)]
iwlwifi: remove unused argument from iwl_init_hw_rates

The function never uses the priv argument as it
only fills in the passed data, so remove the
argument.

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>
12 years agoiwlwifi: move iwl_sta_id_or_broadcast to user
Johannes Berg [Wed, 7 Mar 2012 17:52:12 +0000 (09:52 -0800)]
iwlwifi: move iwl_sta_id_or_broadcast to user

There's only one user, so the function
can be moved into the correct file. It
also loses an argument along the way.

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>
12 years agoiwlwifi: remove unused argument from rs_initialize_lq
Johannes Berg [Wed, 7 Mar 2012 17:52:11 +0000 (09:52 -0800)]
iwlwifi: remove unused argument from rs_initialize_lq

The function never uses its conf argument,
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>
12 years agoiwlwifi: remove unused arguments from iwlagn_gain_computation
Johannes Berg [Wed, 7 Mar 2012 17:52:10 +0000 (09:52 -0800)]
iwlwifi: remove unused arguments from iwlagn_gain_computation

The function has two arguments it never uses,
remove 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>
12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux...
Olof Johansson [Thu, 8 Mar 2012 18:56:12 +0000 (10:56 -0800)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix module build errors with CONFIG_OMAP4_ERRATA_I688
  ARM: OMAP: id: Add missing break statement in omap3xxx_check_revision
  ARM: OMAP2+: Remove apply_uV constraints for fixed regulator
  ARM: OMAP: irqs: Fix NR_IRQS value to handle PRCM interrupts

12 years agoARM: S3C2440: Fixed build error for s3c244x
Kukjin Kim [Thu, 8 Mar 2012 09:48:36 +0000 (01:48 -0800)]
ARM: S3C2440: Fixed build error for s3c244x

Fixed following:
arch/arm/mach-s3c2440/s3c244x.c: In function 's3c244x_restart':
arch/arm/mach-s3c2440/s3c244x.c:209: error: expected declaration or statement at end of input
make[1]: *** [arch/arm/mach-s3c24xx/s3c244x.o] Error 1
make: *** [arch/arm/mach-s3c24xx] Error 2

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
12 years agoALSA: hdspm - Provide ioctl_compat
Adrian Knoth [Thu, 8 Mar 2012 14:38:04 +0000 (15:38 +0100)]
ALSA: hdspm - Provide ioctl_compat

snd_hdspm uses its own ioctls to acquire config- and status information.
Expose the corresponding ioctl handler via ioctl_compat, so that 32bit
applications can use it on 64bit kernels.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
12 years agoMerge branch 'wl12xx-next' into for-linville
Luciano Coelho [Thu, 8 Mar 2012 12:40:40 +0000 (14:40 +0200)]
Merge branch 'wl12xx-next' into for-linville

12 years agowl12xx: implement SW Tx watchdog
Arik Nemtsov [Sat, 3 Mar 2012 20:18:00 +0000 (22:18 +0200)]
wl12xx: implement SW Tx watchdog

Track freed FW blocks during Tx. If no blocks were freed during a
predefined timeout, initiate a HW recovery. This helps in situations
when the FW watchdog fails.

Don't trigger recovery during activities that can temporarily stop
Tx. This includes:
- scanning
- buffering packets for sleeping stations (AP role)
- ROC on any role

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agox86/amd: iommu_set_device_table() must not be __init
Jan Beulich [Thu, 8 Mar 2012 08:58:13 +0000 (08:58 +0000)]
x86/amd: iommu_set_device_table() must not be __init

This function is called from enable_iommus(), which in turn is used
from amd_iommu_resume().

Cc: stable@vger.kernel.org
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
12 years agodrm/radeon/kms: fix hdmi duallink checks
Alex Deucher [Thu, 8 Mar 2012 00:05:01 +0000 (19:05 -0500)]
drm/radeon/kms: fix hdmi duallink checks

All pre-SI chips are limited to 165 Mhz for single link.
Code in question will be re-enabled when SI support is added.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=44755
https://bugzilla.kernel.org/show_bug.cgi?id=42887

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: set SX_MISC in the r6xx blit code (v2)
Marek Olšák [Wed, 7 Mar 2012 22:33:00 +0000 (23:33 +0100)]
drm/radeon/kms: set SX_MISC in the r6xx blit code (v2)

Mesa may set it to 1, causing all primitives to be killed.

v2: also update the r7xx code

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agonet/usbnet: avoid recursive locking in usbnet_stop()
Sebastian Siewior [Wed, 7 Mar 2012 10:19:28 +0000 (10:19 +0000)]
net/usbnet: avoid recursive locking in usbnet_stop()

|kernel BUG at kernel/rtmutex.c:724!
|[<c029599c>] (rt_spin_lock_slowlock+0x108/0x2bc) from [<c01c2330>] (defer_bh+0x1c/0xb4)
|[<c01c2330>] (defer_bh+0x1c/0xb4) from [<c01c3afc>] (rx_complete+0x14c/0x194)
|[<c01c3afc>] (rx_complete+0x14c/0x194) from [<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0)
|[<c01cac88>] (usb_hcd_giveback_urb+0xa0/0xf0) from [<c01e1ff4>] (musb_giveback+0x34/0x40)
|[<c01e1ff4>] (musb_giveback+0x34/0x40) from [<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0)
|[<c01e2b1c>] (musb_advance_schedule+0xb4/0x1c0) from [<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c)
|[<c01e2ca8>] (musb_cleanup_urb.isra.9+0x80/0x8c) from [<c01e2ed0>] (musb_urb_dequeue+0xec/0x108)
|[<c01e2ed0>] (musb_urb_dequeue+0xec/0x108) from [<c01cbb90>] (unlink1+0xbc/0xcc)
|[<c01cbb90>] (unlink1+0xbc/0xcc) from [<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8)
|[<c01cc2ec>] (usb_hcd_unlink_urb+0x54/0xa8) from [<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58)
|[<c01c2a84>] (unlink_urbs.isra.17+0x2c/0x58) from [<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c)
|[<c01c2b44>] (usbnet_terminate_urbs+0x94/0x10c) from [<c01c2d68>] (usbnet_stop+0x100/0x15c)
|[<c01c2d68>] (usbnet_stop+0x100/0x15c) from [<c020f718>] (__dev_close_many+0x94/0xc8)

defer_bh() takes the lock which is hold during unlink_urbs(). The safe
walk suggest that the skb will be removed from the list and this is done
by defer_bh() so it seems to be okay to drop the lock here.

Cc: stable@kernel.org
Reported-by: Aníbal Almeida Pinto <anibal.pinto@efacec.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoroute: Remove redirect_genid
Steffen Klassert [Tue, 6 Mar 2012 21:21:10 +0000 (21:21 +0000)]
route: Remove redirect_genid

As we invalidate the inetpeer tree along with the routing cache now,
we don't need a genid to reset the redirect handling when the routing
cache is flushed.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinetpeer: Invalidate the inetpeer tree along with the routing cache
Steffen Klassert [Tue, 6 Mar 2012 21:20:26 +0000 (21:20 +0000)]
inetpeer: Invalidate the inetpeer tree along with the routing cache

We initialize the routing metrics with the values cached on the
inetpeer in rt_init_metrics(). So if we have the metrics cached on the
inetpeer, we ignore the user configured fib_metrics.

To fix this issue, we replace the old tree with a fresh initialized
inet_peer_base. The old tree is removed later with a delayed work queue.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoenic: Fix addr valid check in enic_set_vf_mac
Roopa Prabhu [Wed, 7 Mar 2012 03:50:44 +0000 (03:50 +0000)]
enic: Fix addr valid check in enic_set_vf_mac

zero mac address is a valid address for VIC dynamic vnic and sriov Vf's.
Fix the check in enic_set_vf_mac appropriately

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomlx4_core: fix bug in modify_cq wrapper for resize flow.
Jack Morgenstein [Wed, 7 Mar 2012 05:56:35 +0000 (05:56 +0000)]
mlx4_core: fix bug in modify_cq wrapper for resize flow.

The actual FW command is called in procedure "handle_resize".
Code incorrectly invoked the FW command again (in good flow), in
the modify_cq wrapper function.

Fix by skipping second FW invocation unconditionally for resize.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoatl1c: set ATL1C_WORK_EVENT_RESET bit correctly
Dan Carpenter [Wed, 7 Mar 2012 00:02:04 +0000 (00:02 +0000)]
atl1c: set ATL1C_WORK_EVENT_RESET bit correctly

ATL1C_WORK_EVENT_RESET is zero so the original code here is a nop.  The
intent was to set the zero bit.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: fix state reporting when port is disabled
Paulius Zaleckas [Tue, 6 Mar 2012 22:25:22 +0000 (22:25 +0000)]
bridge: fix state reporting when port is disabled

Now we have:
eth0: link *down*
br0: port 1(eth0) entered *forwarding* state

br_log_state(p) should be called *after* p->state is set
to BR_STATE_DISABLED.

Reported-by: Zilvinas Valinskas <zilvinas@wilibox.com>
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobridge: br_log_state() s/entering/entered/
Paulius Zaleckas [Tue, 6 Mar 2012 22:25:14 +0000 (22:25 +0000)]
bridge: br_log_state() s/entering/entered/

When br_log_state() is reporting state it should say "entered"
istead of "entering" since state at this point is already
changed.

Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoehea: restore multicast and rx_errors fields
Eric Dumazet [Tue, 6 Mar 2012 19:46:41 +0000 (19:46 +0000)]
ehea: restore multicast and rx_errors fields

Commit 239c562c94d (ehea: Add 64bit statistics) added a regression,
since we no longer report multicast & rx_errors fields, taken from
port->stats structure. These fields are updated in ehea_update_stats()
every second.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
David S. Miller [Thu, 8 Mar 2012 06:53:48 +0000 (22:53 -0800)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next

12 years agolcs: Return zero from ccwgroup devs set_offline function
Klaus-Dieter Wacker [Wed, 7 Mar 2012 02:06:29 +0000 (02:06 +0000)]
lcs: Return zero from ccwgroup devs set_offline function

A return code of non-zero of the devs ccwgroup set_offline function
leaves the dev in online state. Having done a partly offlining
may leave the dev in unusable state. To make sure the dev is set to
offline, zero is returned. A setup trace entry is written in case
the offlining steps encountered some trouble.

Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoqeth: meaningful return code for set_mac_address
Ursula Braun [Wed, 7 Mar 2012 02:06:28 +0000 (02:06 +0000)]
qeth: meaningful return code for set_mac_address

Setting an invalid mac-address for a qeth layer2 device returns
with a strange error code:
# ip link set hsi1 address 00:00:00:00:00:01
   RTNETLINK answers: Unknown error 18446744073709486085
Problem is caused by wrong usage of the return_code field within
structure qeth_ipa_cmd.
With this patch the ip command above returns
   SIOCSIFHWADDR: Invalid argument

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoctcm: use correct idal word list for ctcmpc
Belinda Thompson [Wed, 7 Mar 2012 02:06:27 +0000 (02:06 +0000)]
ctcm: use correct idal word list for ctcmpc

Communication Server Linux uses the ctcmpc code of the ctcm driver.
Sending problems have shown up caused by a wrong idal word list for
the first ccw. Function ctcmpc_chx_txdone() invokes the function
to prepare the idal word list without setting an appropriate length
for the first ccw, which may lead to an incomplete idal word list.
This patch sets the maximum buffer size as data length of the first
ccw. Thus correct idal word lists are guaranteed in all cases.

Signed-off-by: Belinda Thompson <belindat@us.ibm.com>
Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoctcm: make ctcmpc debugging compilable
Ursula Braun [Wed, 7 Mar 2012 02:06:26 +0000 (02:06 +0000)]
ctcm: make ctcmpc debugging compilable

ctcmpc debugging can be activated defining constant DEBUGCCW.
The debugging part contains wrong checks for 64 bit addresses.
Thus the debugging version does not compile.
This patch corrects the 64-bit address checks to make it
compilable.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Reviewed-by: Belinda Thompson <belindat@us.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoqeth: synchronize discipline module loading
Frank Blaschka [Wed, 7 Mar 2012 02:06:25 +0000 (02:06 +0000)]
qeth: synchronize discipline module loading

During system startup udev may try to configure devices in
parallel so we have to synchronize discipline module
loading.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoaf_iucv: add shutdown for HS transport
Ursula Braun [Wed, 7 Mar 2012 02:06:24 +0000 (02:06 +0000)]
af_iucv: add shutdown for HS transport

AF_IUCV sockets offer a shutdown function. This patch makes sure
shutdown works for HS transport as well.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoaf_iucv: handle netdev events
Ursula Braun [Wed, 7 Mar 2012 02:06:23 +0000 (02:06 +0000)]
af_iucv: handle netdev events

In case of transport through HiperSockets the underlying network
interface may switch to DOWN state or the underlying network device
may recover. In both cases the socket must change to IUCV_DISCONN
state. If the interface goes down, af_iucv has a chance to notify
its connection peer in addition.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch
David S. Miller [Thu, 8 Mar 2012 06:49:01 +0000 (22:49 -0800)]
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jesse/openvswitch

12 years agoMerge branch 'master' of git://1984.lsi.us.es/net-next
David S. Miller [Thu, 8 Mar 2012 06:27:56 +0000 (22:27 -0800)]
Merge branch 'master' of git://1984.lsi.us.es/net-next

12 years agoBluetooth: Set security level on incoming pairing request
Ido Yariv [Mon, 5 Mar 2012 18:09:38 +0000 (20:09 +0200)]
Bluetooth: Set security level on incoming pairing request

If a master would like to raise the security level, it will send a
pairing request. While the pending security level is set on an incoming
security request (from a slave), it is not set on a pairing request. As
a result, the security level would not be raised on the slave in such
case.

Fix this by setting the pending security when receiving pairing
requests according to the requested authorization.

Signed-off-by: Ido Yariv <ido@wizery.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Fix access to the STK generation methods matrix
Ido Yariv [Mon, 5 Mar 2012 18:07:08 +0000 (20:07 +0200)]
Bluetooth: Fix access to the STK generation methods matrix

The major index of the table is actually the remote I/O capabilities, not
the local ones. As a result, devices with different I/O capabilities
could have used wrong or even unsupported generation methods.

Signed-off-by: Ido Yariv <ido@wizery.com>
CC: Brian Gix <bgix@codeaurora.org>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Fix using uninitialized variable
Luiz Augusto von Dentz [Wed, 7 Mar 2012 18:20:14 +0000 (20:20 +0200)]
Bluetooth: Fix using uninitialized variable

+ src/net/bluetooth/rfcomm/tty.c: warning: 'p' is used uninitialized in this
       function:  => 218
+ src/net/bluetooth/rfcomm/tty.c: warning: 'p' may be used uninitialized in
       this function:  => 218

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: Adding USB device 13d3:3375 as an Atheros AR3012.
Eran [Mon, 5 Dec 2011 22:15:29 +0000 (22:15 +0000)]
Bluetooth: Adding USB device 13d3:3375 as an Atheros AR3012.

The bluetooth module in the Asus UX31/UX21 is based on Atheros AR3012
and requires a firmware to be uploaded before it's usable.

output of usb-devices for this module:
T:  Bus=01 Lev=02 Prnt=02 Port=07 Cnt=03 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=13d3 ProdID=3375 Rev=00.02
S:  Manufacturer=Atheros Communications
S:  Product=Bluetooth USB Host Controller
S:  SerialNumber=Alaska Day 2006
C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

Signed-off-by: Eran <eran@over-here.org>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoBluetooth: fix conding style issues all over the tree
Gustavo F. Padovan [Thu, 8 Mar 2012 04:25:00 +0000 (01:25 -0300)]
Bluetooth: fix conding style issues all over the tree

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
12 years agoopenvswitch: Fix checksum update for actions on UDP packets.
Jesse Gross [Tue, 6 Mar 2012 23:05:46 +0000 (15:05 -0800)]
openvswitch: Fix checksum update for actions on UDP packets.

When modifying IP addresses or ports on a UDP packet we don't
correctly follow the rules for unchecksummed packets.  This meant
that packets without a checksum can be given a incorrect new checksum
and packets with a checksum can become marked as being unchecksummed.
This fixes it to handle those requirements.

Signed-off-by: Jesse Gross <jesse@nicira.com>
12 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Wed, 7 Mar 2012 20:34:42 +0000 (15:34 -0500)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

12 years agotcp: md5: correct a RCU lockdep splat
Eric Dumazet [Wed, 7 Mar 2012 04:45:43 +0000 (04:45 +0000)]
tcp: md5: correct a RCU lockdep splat

commit a8afca0329 (tcp: md5: protects md5sig_info with RCU) added a
lockdep splat in tcp_md5_do_lookup() in case a timer fires a tcp
retransmit.

At this point, socket lock is owned by the sofirq handler, not the user,
so we should adjust a bit the lockdep condition, as we dont hold
rcu_read_lock().

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reported-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoregulator: tps65910: Configure correct value for VDDCTRL vout reg
Laxman Dewangan [Wed, 7 Mar 2012 11:09:05 +0000 (16:39 +0530)]
regulator: tps65910: Configure correct value for VDDCTRL vout reg

As per datasheet, the voltage output is defined as
from SEL[6:0] = 3 to 64 (dec)
Vout= (SEL[6:0] × 12.5 mV + 562.5 mV)

The list_voltage returns the vout as
    600mV +  selector * 12.5mV

and so equivalent VSEL is selector + 3.
Adding 3 on selector when configuring VSEL register for
VDDCTRL output.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
12 years agodm raid: fix flush support
Jonathan E Brassow [Wed, 7 Mar 2012 19:09:48 +0000 (19:09 +0000)]
dm raid: fix flush support

Fix dm-raid flush support.

Both md and dm have support for flush, but the dm-raid target
forgot to set the flag to indicate that flushes should be
passed on.  (Important for data integrity e.g. with writeback cache
enabled.)

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid: set MD_CHANGE_DEVS when rebuilding
Jonathan E Brassow [Wed, 7 Mar 2012 19:09:47 +0000 (19:09 +0000)]
dm raid: set MD_CHANGE_DEVS when rebuilding

The 'rebuild' parameter is used to rebuild individual devices in an
array (e.g. resynchronize a RAID1 device or recalculate a parity device
in higher RAID).  The MD_CHANGE_DEVS flag must be set when this
parameter is given in order to write out the superblocks and make the
change take immediate effect.  The code that handles new devices in
super_load already sets MD_CHANGE_DEVS and 'FirstUse'.  (The 'FirstUse'
flag was being set as a special case for rebuilds in
super_init_validation.)

Add a condition for rebuilds in super_load to take care of both flags
without the special case in 'super_init_validation'.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm thin metadata: decrement counter after removing mapped block
Joe Thornber [Wed, 7 Mar 2012 19:09:44 +0000 (19:09 +0000)]
dm thin metadata: decrement counter after removing mapped block

Correct the number of mapped sectors shown on a thin device's
status line by decrementing td->mapped_blocks in __remove() each time
a block is removed.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm thin metadata: unlock superblock in init_pmd error path
Joe Thornber [Wed, 7 Mar 2012 19:09:43 +0000 (19:09 +0000)]
dm thin metadata: unlock superblock in init_pmd error path

If dm_sm_disk_create() fails the superblock must be unlocked.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm thin metadata: remove incorrect close_device on creation error paths
Mike Snitzer [Wed, 7 Mar 2012 19:09:41 +0000 (19:09 +0000)]
dm thin metadata: remove incorrect close_device on creation error paths

The __open_device() error paths in __create_thin() and __create_snap()
incorrectly call __close_device() even if td was not initialized by
__open_device().  Remove this.

Also document __open_device() return values, remove a redundant
td->changed = 1 in __create_thin(), and insert an additional
safeguard against creating an already-existing device.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm flakey: fix crash on read when corrupt_bio_byte not set
Mike Snitzer [Wed, 7 Mar 2012 19:09:39 +0000 (19:09 +0000)]
dm flakey: fix crash on read when corrupt_bio_byte not set

The following BUG is hit on the first read that is submitted to a dm
flakey test device while the device is "down" if the corrupt_bio_byte
feature wasn't requested when the device's table was loaded.

Example DM table that will hit this BUG:
2097152 flakey 8:0 2048 0 30

This bug was introduced by commit a3998799fb4df0b0af8271a7d50c4269032397aa
(dm flakey: add corrupt_bio_byte feature) in v3.1-rc1.

BUG: unable to handle kernel paging request at ffff8801cfce3fff
IP: [<ffffffffa008c233>] corrupt_bio_data+0x6e/0xae [dm_flakey]
PGD 1606063 PUD 0
Oops: 0002 [#1] SMP
...
Call Trace:
 <IRQ>
 [<ffffffffa008c2b5>] flakey_end_io+0x42/0x48 [dm_flakey]
 [<ffffffffa00dca98>] clone_endio+0x54/0xb6 [dm_mod]
 [<ffffffff81130587>] bio_endio+0x2d/0x2f
 [<ffffffff811c819a>] req_bio_endio+0x96/0x9f
 [<ffffffff811c94b9>] blk_update_request+0x1dc/0x3a9
 [<ffffffff812f5ee2>] ? rcu_read_unlock+0x21/0x23
 [<ffffffff811c96a6>] blk_update_bidi_request+0x20/0x6e
 [<ffffffff811c9713>] blk_end_bidi_request+0x1f/0x5d
 [<ffffffff811c978d>] blk_end_request+0x10/0x12
 [<ffffffff8128f450>] scsi_io_completion+0x1e5/0x4b1
 [<ffffffff812882a9>] scsi_finish_command+0xec/0xf5
 [<ffffffff8128f830>] scsi_softirq_done+0xff/0x108
 [<ffffffff811ce284>] blk_done_softirq+0x84/0x98
 [<ffffffff81048d19>] __do_softirq+0xe3/0x1d5
 [<ffffffff8138f83f>] ? _raw_spin_lock+0x62/0x69
 [<ffffffff810997cf>] ? handle_irq_event+0x4c/0x61
 [<ffffffff8139833c>] call_softirq+0x1c/0x30
 [<ffffffff81003b37>] do_softirq+0x4b/0xa3
 [<ffffffff81048a39>] irq_exit+0x53/0xca
 [<ffffffff81398acd>] do_IRQ+0x9d/0xb4
 [<ffffffff81390333>] common_interrupt+0x73/0x73
...

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # 3.1+
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm io: fix discard support
Milan Broz [Wed, 7 Mar 2012 19:09:37 +0000 (19:09 +0000)]
dm io: fix discard support

This patch fixes a crash by recognising discards in dm_io.

Currently dm_mirror can send REQ_DISCARD bios if running over a
discard-enabled device and without support in dm_io the system
crashes badly.

BUG: unable to handle kernel paging request at 00800000
IP:  __bio_add_page.part.17+0xf5/0x1e0
...
 bio_add_page+0x56/0x70
 dispatch_io+0x1cf/0x240 [dm_mod]
 ? km_get_page+0x50/0x50 [dm_mod]
 ? vm_next_page+0x20/0x20 [dm_mod]
 ? mirror_flush+0x130/0x130 [dm_mirror]
 dm_io+0xdc/0x2b0 [dm_mod]
...

Introduced in 2.6.38-rc1 by commit 5fc2ffeabb9ee0fc0e71ff16b49f34f0ed3d05b4
(dm raid1: support discard).

Signed-off-by: Milan Broz <mbroz@redhat.com>
Cc: stable@kernel.org
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm ioctl: do not leak argv if target message only contains whitespace
Jesper Juhl [Wed, 7 Mar 2012 19:09:34 +0000 (19:09 +0000)]
dm ioctl: do not leak argv if target message only contains whitespace

If 'argc' is zero we jump to the 'out:' label, but this leaks the
(unused) memory that 'dm_split_args()' allocated for 'argv' if the
string being split consisted entirely of whitespace.  Jump to the
'out_argv:' label instead to free up that memory.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agortl8187: Add AD-HOC support
Attila Fazekas [Thu, 23 Feb 2012 18:50:35 +0000 (19:50 +0100)]
rtl8187: Add AD-HOC support

Add AD-HOC support to the rtl8187 based on the rtl8180 source

Signed-off-by: Attila Fazekas <turul64@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: silence PMU warning for BCM4331
Rafał Miłecki [Wed, 7 Mar 2012 08:11:22 +0000 (09:11 +0100)]
bcma: silence PMU warning for BCM4331

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix smatch lock errors in mesh
Thomas Pedersen [Wed, 7 Mar 2012 00:42:09 +0000 (16:42 -0800)]
mac80211: fix smatch lock errors in mesh

smatch was complaining:

CHECK   net/mac80211/mesh_pathtbl.c
net/mac80211/mesh_pathtbl.c:562 mesh_path_add() error: double lock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:580 mesh_path_add() error: double unlock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:589 mesh_path_add() error: double unlock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:691 mpp_path_add() error: double lock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:707 mpp_path_add() error: double unlock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:716 mpp_path_add() error: double unlock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:814 mesh_path_flush_by_nexthop() error:
double lock 'bottom_half:'
net/mac80211/mesh_pathtbl.c:819 mesh_path_flush_by_nexthop() error:
double unlock 'bottom_half:'
net/mac80211/mesh_pathtbl.c:887 mesh_path_del() error: double lock
'bottom_half:'
net/mac80211/mesh_pathtbl.c:901 mesh_path_del() error: double unlock
'bottom_half:'

So don't lock / unlock with _bh() while bottom halves are already
disabled.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make iwl_fill_probe_req static
Johannes Berg [Tue, 6 Mar 2012 21:31:08 +0000 (13:31 -0800)]
iwlwifi: make iwl_fill_probe_req static

This function is only used in iwl-scan.c, so
if we move it up a little in the file it can
be made static.

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>
12 years agoiwlwifi: clean up iwl-commands.h
Johannes Berg [Tue, 6 Mar 2012 21:31:07 +0000 (13:31 -0800)]
iwlwifi: clean up iwl-commands.h

Do some cleanups here:
 * remove an unused prototype
 * remove some unused constants
 * clean up includes

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: don't include iwl-prph.h everywhere
Johannes Berg [Tue, 6 Mar 2012 21:31:06 +0000 (13:31 -0800)]
iwlwifi: don't include iwl-prph.h everywhere

It's only needed in a few places.

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>
12 years agoiwlwifi: remove PA type configuration
Johannes Berg [Tue, 6 Mar 2012 21:31:05 +0000 (13:31 -0800)]
iwlwifi: remove PA type configuration

No need to have a special config variable
for the PA type, we can just use the
additional NIC config function to config
the hardware correctly.

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>
12 years agoiwlwifi: remove priv from shared
Johannes Berg [Tue, 6 Mar 2012 21:31:04 +0000 (13:31 -0800)]
iwlwifi: remove priv from shared

Finally nothing needs to access priv
from shared any more, 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>
12 years agoiwlwifi: virtualize nic_config
Johannes Berg [Tue, 6 Mar 2012 21:31:03 +0000 (13:31 -0800)]
iwlwifi: virtualize nic_config

The nic_config sets uCode dependent register
bits, so it must be virtual in the op_mode.

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>
12 years agoiwlwifi: move packet to transport
Johannes Berg [Tue, 6 Mar 2012 21:31:02 +0000 (13:31 -0800)]
iwlwifi: move packet to transport

The base packet structure will (hopefully) be
the same for all transports, but what is in it
differs. Remove the union of all the possible
contents and move the packet itself into the
transport header file. This requires changing
all users of the union to just use pkt->data.

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>
12 years agoiwlwifi: move irq to PCIe
Johannes Berg [Tue, 6 Mar 2012 21:31:01 +0000 (13:31 -0800)]
iwlwifi: move irq to PCIe

Even if the variable might also be used by other
transports, there's no need for anything outside
of the transport itself to access it, so move it
into the private area.

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>
12 years agoiwlwifi: move all uCode load variables
Johannes Berg [Tue, 6 Mar 2012 21:31:00 +0000 (13:31 -0800)]
iwlwifi: move all uCode load variables

All variables related to uCode loading (the
waitqueue and done indication) should be in
the PCI-E transport's private data as this
is transport specific. Move them there.

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>
12 years agoiwlwifi: move ucode_owner to priv
Johannes Berg [Tue, 6 Mar 2012 21:30:59 +0000 (13:30 -0800)]
iwlwifi: move ucode_owner to priv

The transport doesn't really need to know as
we can enforce it in the command wrapper.
Move the ucode_owner variable into priv and
do all enforcing there.

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>
12 years agoiwlwifi: abstract out notification wait support
Johannes Berg [Tue, 6 Mar 2012 21:30:58 +0000 (13:30 -0800)]
iwlwifi: abstract out notification wait support

This will be sharable, but needs to live in the
op_mode as it is dependent on command processing.
Make a library out of the notification wait code.

Since I wrote all of the code originally and only
Intel employees changed it, we can also relicense
it to dual BSD/GPL.

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>
12 years agoiwlwifi: fix notification wait bug
Johannes Berg [Tue, 6 Mar 2012 21:30:57 +0000 (13:30 -0800)]
iwlwifi: fix notification wait bug

In "iwlwifi: consolidate the start_device flow"
Emmanuel added the return if the fw isn't there
but forgot to take into account that the struct
for notification wait needs to be added only
after the check -- fix that.

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>
12 years agoiwlwifi: constify remaining config data
Johannes Berg [Tue, 6 Mar 2012 21:30:56 +0000 (13:30 -0800)]
iwlwifi: constify remaining config data

The HW configuration settings base_params, ht_params
and bt_params all should be const, make it so.

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>
12 years agoiwlwifi: put use_rts_for_aggregation into hw_params
Johannes Berg [Tue, 6 Mar 2012 21:30:55 +0000 (13:30 -0800)]
iwlwifi: put use_rts_for_aggregation into hw_params

The hardware config ht_params shouldn't be modified,
so copy the use_rts_for_aggregation parameter into
hw_params and use/modify it there.

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>
12 years agoiwlwifi: use watchdog timeout from hw_params
Johannes Berg [Tue, 6 Mar 2012 21:30:54 +0000 (13:30 -0800)]
iwlwifi: use watchdog timeout from hw_params

This is the version that can be modified, the
config params should be read-only.

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>
12 years agoiwlwifi: keep plcp_delta_threshold in priv
Johannes Berg [Tue, 6 Mar 2012 21:30:53 +0000 (13:30 -0800)]
iwlwifi: keep plcp_delta_threshold in priv

The base_params shouldn't be writable, so keep
a copy of this in priv that can be modified.

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>
12 years agoiwlwifi: remove max_txq_num from hw_params
Johannes Berg [Tue, 6 Mar 2012 21:30:52 +0000 (13:30 -0800)]
iwlwifi: remove max_txq_num from hw_params

This can be used directly from the config 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>
12 years agoiwlwifi: remove num_of_queues module parameter
Johannes Berg [Tue, 6 Mar 2012 21:30:51 +0000 (13:30 -0800)]
iwlwifi: remove num_of_queues module parameter

This is a hardware parameter, so it shouldn't
be configurable by the user. Users can disable
aggregation (which is the only thing affected)
with 11n_disable.

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>
12 years agoiwlwifi: clean up iwl-core.h inclusions
Johannes Berg [Tue, 6 Mar 2012 21:30:50 +0000 (13:30 -0800)]
iwlwifi: clean up iwl-core.h inclusions

The transport doesn't need to include iwl-core.h any more.

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>
12 years agoiwlwifi: virtualize command queue full behaviour
Johannes Berg [Tue, 6 Mar 2012 21:30:49 +0000 (13:30 -0800)]
iwlwifi: virtualize command queue full behaviour

When the command queue is full, the transport
will return -ENOSPC, but the reaction to that
depends on the op_mode. Virtualize that, the
DVM op_mode checks for CT-kill and restarts
the hardware otherwise.

We may be able to get rid of this callback by
putting the behaviour check into the wrapper
but that needs more careful evaluation.

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>
12 years agoiwlwifi: make tracing use device as identifier
Johannes Berg [Tue, 6 Mar 2012 21:30:48 +0000 (13:30 -0800)]
iwlwifi: make tracing use device as identifier

Tracing used the priv pointer as an identifier,
which has the problem that we don't have it in
all code, and also some people say no pointers
should be "leaked" to userspace.

Use the device name instead, it is more useful
anyway.

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>
12 years agoiwlwifi: move status check functions out of shared
Johannes Berg [Tue, 6 Mar 2012 21:30:47 +0000 (13:30 -0800)]
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>
12 years agoiwlwifi: remove shadow_reg_enable from hw_params
Johannes Berg [Tue, 6 Mar 2012 21:30:46 +0000 (13:30 -0800)]
iwlwifi: remove shadow_reg_enable from hw_params

There's no need to copy shadow_reg_enable into
hw_params since it is a pure hardware parameter
that will never change, we can access it from
the config directly.

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>
12 years agoiwlwifi: remove AMT check from transport
Johannes Berg [Tue, 6 Mar 2012 21:30:45 +0000 (13:30 -0800)]
iwlwifi: remove AMT check from transport

As iwl_prepare_card_hw() is idempotent (and
many cards support AMT anyway) there's no
point in calling iwl_prepare_card_hw() only
for AMT capable devices -- call it always
and simplify the code that way.

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>
12 years agoiwlwifi: rename ucode.h to fw-file.h
Johannes Berg [Tue, 6 Mar 2012 21:30:44 +0000 (13:30 -0800)]
iwlwifi: rename ucode.h to fw-file.h

That name better reflects the contents
of the file and the fact that it isn't
related to iwl-ucode.c.

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>
12 years agoiwlwifi: move rfkill status handling out of transport
Johannes Berg [Tue, 6 Mar 2012 21:30:43 +0000 (13:30 -0800)]
iwlwifi: move rfkill status handling out of transport

The transport layer should only check the
hardware RF kill status, not impose any
policy or reaction based on it, so move
that out of it into the op_mode.

For now keep the restriction on loading
firmware, that will have to be removed
later.

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>
12 years agoiwlwifi: move mutex out of shared
Johannes Berg [Tue, 6 Mar 2012 21:30:42 +0000 (13:30 -0800)]
iwlwifi: move mutex out of shared

Now the mutex no longer needs to be
shared, so move it into iwl_priv.

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>
12 years agoiwlwifi: move lockdep assertion into DVM
Johannes Berg [Tue, 6 Mar 2012 21:30:41 +0000 (13:30 -0800)]
iwlwifi: move lockdep assertion into DVM

The fact that the mutex must be held is an
implementation detail of DVM, but something
has to ensure that no two synchronous cmds
are submitted concurrently. Move the lockdep
assertion into the DVM-specific code, but
also make the transport abort if there are
two concurrently commands.

The assertion is much more useful though as
the transport check can only catch it when
it actually happens, while the assertion
makes sure it can't possibly happen.

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>
12 years agoiwlwifi: move RF/CT kill check to command wrapper
Johannes Berg [Tue, 6 Mar 2012 21:30:40 +0000 (13:30 -0800)]
iwlwifi: move RF/CT kill check to command wrapper

Currently, we cannot send any commands when the
uCode is in RF or CT kill, but that will not be
true for all new uCode versions, so we need to
move the check into the uCode specific code.

Also remove the duplicate rfkill check.

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>
12 years agoiwlwifi: add wrappers for command sending
Johannes Berg [Tue, 6 Mar 2012 21:30:39 +0000 (13:30 -0800)]
iwlwifi: add wrappers for command sending

Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.

Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.

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>
12 years agoiwlwifi: remove iwl-wifi.h
Johannes Berg [Tue, 6 Mar 2012 21:30:38 +0000 (13:30 -0800)]
iwlwifi: remove iwl-wifi.h

This file was recently introduced, but then
directly abused -- it contained private data
that shouldn't have been used by anything
but the implementation of firmware requests
and some very core code. Now that it is no
longer accessed by any code but the code in
iwl-drv.c, we can dissolve it.

Also rename the iwl_nic struct to iwl_drv to
better reflect where and how it is used.

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>
12 years agoiwlwifi: split out firmware store
Johannes Berg [Tue, 6 Mar 2012 21:30:37 +0000 (13:30 -0800)]
iwlwifi: split out firmware store

Through the driver, struct iwl_fw will
store the firmware. Split this out into
a separate file, iwl-fw.h, and make all
other code use it. To do this, also move
the log pointers into it, and remove the
knowledge of "nic" from everything.

Now the op_mode has a fw pointer, and
(unfortunately) for now the shared data
also needs to keep one for the transport
to access dump the error log -- I think
that will move later.

Since I wanted to constify the firmware
pointers, some more changes were needed.

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>
12 years agoiwlwifi: move ucode loading to op_mode
Johannes Berg [Tue, 6 Mar 2012 21:30:36 +0000 (13:30 -0800)]
iwlwifi: move ucode loading to op_mode

uCode loading belongs to the op_mode, as it
is dependent on various things there and the
commands sent during it are specific to it.
Move the prototypes to iwl-agn.h to indicate
this. To make this possible, also move all
the calibration handling (which is op_mode
dependent after all).

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>
12 years agomac80211: Fix potential null pointer dereferencing
Ashok Nagarajan [Tue, 6 Mar 2012 20:48:30 +0000 (12:48 -0800)]
mac80211: Fix potential null pointer dereferencing

The patch "{nl,cfg,mac}80211: Implement RSSI threshold for mesh peering"
has a potential null pointer dereferencing problem. Thanks to Dan Carpenter
for pointing out. This patch will fix the issue.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>