From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
alan@lxorguk.ukuu.org.uk,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Johannes Berg <johannes.berg@intel.com>,
Ben Hutchings <ben@decadent.org.uk>
Subject: [ 56/56] iwlwifi: fix 6000 series channel switch command
Date: Fri, 30 Nov 2012 10:55:48 -0800 [thread overview]
Message-ID: <20121130185124.048181118@linuxfoundation.org> (raw)
In-Reply-To: <20121130185118.302752929@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <johannes.berg@intel.com>
commit 8f7b8db6e0557c8437adf9371e020cd89a7e85dc upstream.
The channel switch command for 6000 series devices
is larger than the maximum inline command size of
320 bytes. The command is therefore refused with a
warning. Fix this by allocating the command and
using the NOCOPY mechanism.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/iwlwifi/iwl-6000.c | 33 ++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -170,7 +170,7 @@ static int iwl6000_hw_channel_switch(str
* See iwlagn_mac_channel_switch.
*/
struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
- struct iwl6000_channel_switch_cmd cmd;
+ struct iwl6000_channel_switch_cmd *cmd;
const struct iwl_channel_info *ch_info;
u32 switch_time_in_usec, ucode_switch_time;
u16 ch;
@@ -180,18 +180,25 @@ static int iwl6000_hw_channel_switch(str
struct ieee80211_vif *vif = ctx->vif;
struct iwl_host_cmd hcmd = {
.id = REPLY_CHANNEL_SWITCH,
- .len = { sizeof(cmd), },
+ .len = { sizeof(*cmd), },
.flags = CMD_SYNC,
- .data = { &cmd, },
+ .dataflags[0] = IWL_HCMD_DFL_NOCOPY,
};
+ int err;
- cmd.band = priv->band == IEEE80211_BAND_2GHZ;
+ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+ if (!cmd)
+ return -ENOMEM;
+
+ hcmd.data[0] = cmd;
+
+ cmd->band = priv->band == IEEE80211_BAND_2GHZ;
ch = ch_switch->channel->hw_value;
IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
ctx->active.channel, ch);
- cmd.channel = cpu_to_le16(ch);
- cmd.rxon_flags = ctx->staging.flags;
- cmd.rxon_filter_flags = ctx->staging.filter_flags;
+ cmd->channel = cpu_to_le16(ch);
+ cmd->rxon_flags = ctx->staging.flags;
+ cmd->rxon_filter_flags = ctx->staging.filter_flags;
switch_count = ch_switch->count;
tsf_low = ch_switch->timestamp & 0x0ffffffff;
/*
@@ -207,30 +214,32 @@ static int iwl6000_hw_channel_switch(str
switch_count = 0;
}
if (switch_count <= 1)
- cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
+ cmd->switch_time = cpu_to_le32(priv->ucode_beacon_time);
else {
switch_time_in_usec =
vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
ucode_switch_time = iwl_usecs_to_beacons(priv,
switch_time_in_usec,
beacon_interval);
- cmd.switch_time = iwl_add_beacon_time(priv,
+ cmd->switch_time = iwl_add_beacon_time(priv,
priv->ucode_beacon_time,
ucode_switch_time,
beacon_interval);
}
IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
- cmd.switch_time);
+ cmd->switch_time);
ch_info = iwl_get_channel_info(priv, priv->band, ch);
if (ch_info)
- cmd.expect_beacon = is_channel_radar(ch_info);
+ cmd->expect_beacon = is_channel_radar(ch_info);
else {
IWL_ERR(priv, "invalid channel switch from %u to %u\n",
ctx->active.channel, ch);
return -EFAULT;
}
- return iwl_dvm_send_cmd(priv, &hcmd);
+ err = iwl_dvm_send_cmd(priv, &hcmd);
+ kfree(cmd);
+ return err;
}
static struct iwl_lib_ops iwl6000_lib = {
next prev parent reply other threads:[~2012-11-30 18:55 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 18:54 [ 00/56] 3.4.21-stable review Greg Kroah-Hartman
2012-11-30 18:54 ` [ 01/56] UBIFS: fix compilation warning Greg Kroah-Hartman
2012-11-30 18:54 ` [ 02/56] NVMe: Fix uninitialized iod compiler warning Greg Kroah-Hartman
2012-11-30 18:54 ` [ 03/56] Bluetooth: Fix using uninitialized option in RFCMode Greg Kroah-Hartman
2012-11-30 18:54 ` [ 04/56] ALSA: snd-usb-caiaq: initialize card pointer Greg Kroah-Hartman
2012-11-30 18:54 ` [ 05/56] drivers/leds/leds-lp5521.c: fix lp5521_read() error handling Greg Kroah-Hartman
2012-12-02 3:17 ` Ben Hutchings
2012-12-02 8:05 ` Dan Carpenter
2012-11-30 18:54 ` [ 06/56] [SCSI] mvsas: remove unused variable in mvs_task_exec() Greg Kroah-Hartman
2012-11-30 18:54 ` [ 07/56] scsi: aha152x: Fix sparse warning and make printing pointer address more portable Greg Kroah-Hartman
2012-11-30 18:55 ` [ 08/56] rtlwifi: rtl8192se: Fix gcc 4.7.x warning Greg Kroah-Hartman
2012-11-30 18:55 ` [ 09/56] x86-32: Fix invalid stack address while in softirq Greg Kroah-Hartman
2012-12-04 13:56 ` Herton Ronaldo Krzesinski
2012-12-06 18:42 ` Greg Kroah-Hartman
2012-11-30 18:55 ` [ 10/56] x86, efi: Fix processor-specific memcpy() build error Greg Kroah-Hartman
2012-11-30 18:55 ` [ 11/56] x86, microcode, AMD: Add support for family 16h processors Greg Kroah-Hartman
2012-11-30 18:55 ` [ 12/56] rtlwifi: rtl8192cu: Add new USB ID Greg Kroah-Hartman
2012-11-30 18:55 ` [ 13/56] mwifiex: report error to MMC core if we cannot suspend Greg Kroah-Hartman
2012-11-30 18:55 ` [ 14/56] mwifiex: fix system hang issue in cmd timeout error case Greg Kroah-Hartman
2012-11-30 18:55 ` [ 15/56] SCSI: isci: copy fis 0x34 response into proper buffer Greg Kroah-Hartman
2012-11-30 18:55 ` [ 16/56] drm/radeon: add new SI pci id Greg Kroah-Hartman
2012-11-30 18:55 ` [ 17/56] ALSA: ua101, usx2y: fix broken MIDI output Greg Kroah-Hartman
2012-11-30 18:55 ` [ 18/56] ALSA: hda - Cirrus: Correctly clear line_out_pins when moving to speaker Greg Kroah-Hartman
2012-11-30 18:55 ` [ 19/56] PARISC: fix virtual aliasing issue in get_shared_area() Greg Kroah-Hartman
2012-11-30 18:55 ` [ 20/56] PARISC: fix user-triggerable panic on parisc Greg Kroah-Hartman
2012-11-30 18:55 ` [ 21/56] mtd: slram: invalid checking of absolute end address Greg Kroah-Hartman
2012-11-30 18:55 ` [ 22/56] mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions() Greg Kroah-Hartman
2012-11-30 18:55 ` [ 23/56] jffs2: Fix lock acquisition order bug in jffs2_write_begin Greg Kroah-Hartman
2012-11-30 18:55 ` [ 24/56] md: Reassigned the parameters if read_seqretry returned true in func md_is_badblock Greg Kroah-Hartman
2012-11-30 18:55 ` [ 25/56] md: Avoid write invalid address if read_seqretry returned true Greg Kroah-Hartman
2012-11-30 18:55 ` [ 26/56] md/raid10: decrement correct pending counter when writing to replacement Greg Kroah-Hartman
2012-11-30 18:55 ` [ 27/56] dm: fix deadlock with request based dm and queue request_fn recursion Greg Kroah-Hartman
2012-11-30 18:55 ` [ 28/56] futex: avoid wake_futex() for a PI futex_q Greg Kroah-Hartman
2012-11-30 18:55 ` [ 29/56] mac80211: deinitialize ibss-internals after emptiness check Greg Kroah-Hartman
2012-11-30 18:55 ` [ 30/56] radeon: add AGPMode 1 quirk for RV250 Greg Kroah-Hartman
2012-11-30 18:55 ` [ 31/56] can: peak_usb: fix hwtstamp assignment Greg Kroah-Hartman
2012-11-30 18:55 ` [ 32/56] can: bcm: initialize ifindex for timeouts without previous frame reception Greg Kroah-Hartman
2012-11-30 18:55 ` [ 33/56] jbd: Fix lock ordering bug in journal_unmap_buffer() Greg Kroah-Hartman
2012-11-30 18:55 ` [ 34/56] sparc64: not any error from do_sigaltstack() should fail rt_sigreturn() Greg Kroah-Hartman
2012-11-30 18:55 ` [ 35/56] PM / QoS: fix wrong error-checking condition Greg Kroah-Hartman
2012-11-30 18:55 ` [ 36/56] ALSA: hda - Add new codec ALC283 ALC290 support Greg Kroah-Hartman
2012-11-30 18:55 ` [ 37/56] ALSA: hda - Fix missing beep on ASUS X43U notebook Greg Kroah-Hartman
2012-11-30 18:55 ` [ 38/56] ALSA: hda - Add support for Realtek ALC292 Greg Kroah-Hartman
2012-11-30 18:55 ` [ 39/56] bas_gigaset: fix pre_reset handling Greg Kroah-Hartman
2012-11-30 18:55 ` [ 40/56] scsi: Silence unnecessary warnings about ioctl to partition Greg Kroah-Hartman
2012-11-30 18:55 ` [ 41/56] KVM: x86: invalid opcode oops on SET_SREGS with OSXSAVE bit set (CVE-2012-4461) Greg Kroah-Hartman
2012-11-30 18:55 ` [ 42/56] ixgbe: add support for X540-AT1 Greg Kroah-Hartman
2012-11-30 18:55 ` [ 43/56] sata_svw: check DMA start bit before reset Greg Kroah-Hartman
2012-11-30 18:55 ` [ 44/56] get_dvb_firmware: fix download site for tda10046 firmware Greg Kroah-Hartman
2012-11-30 18:55 ` [ 45/56] NFC: pn533: Fix use after free Greg Kroah-Hartman
2012-11-30 18:55 ` [ 46/56] NFC: pn533: Fix mem leak in pn533_in_dep_link_up Greg Kroah-Hartman
2012-11-30 18:55 ` [ 47/56] NFC: Fix nfc_llcp_local chained list insertion Greg Kroah-Hartman
2012-11-30 18:55 ` [ 48/56] USB: mct_u232: fix broken close Greg Kroah-Hartman
2012-11-30 18:55 ` [ 49/56] watchdog: using u64 in get_sample_period() Greg Kroah-Hartman
2012-11-30 18:55 ` [ 50/56] MPI: Fix compilation on MIPS with GCC 4.4 and newer Greg Kroah-Hartman
2012-11-30 18:55 ` [ 51/56] powerpc/eeh: Lock module while handling EEH event Greg Kroah-Hartman
2012-11-30 18:55 ` [ 52/56] mmc: sdhci-s3c: fix the wrong number of max bus clocks Greg Kroah-Hartman
2012-11-30 18:55 ` [ 53/56] ARM: OMAP: counter: add locking to read_persistent_clock Greg Kroah-Hartman
2012-11-30 18:55 ` [ 54/56] timekeeping: Cast raw_interval to u64 to avoid shift overflow Greg Kroah-Hartman
2012-11-30 18:55 ` [ 55/56] net/wireless: ipw2200: Fix panic occurring in ipw_handle_promiscuous_tx() Greg Kroah-Hartman
2012-11-30 18:55 ` Greg Kroah-Hartman [this message]
2012-12-01 15:35 ` [ 00/56] 3.4.21-stable review Satoru Takeuchi
2012-12-02 2:08 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121130185124.048181118@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=ben@decadent.org.uk \
--cc=emmanuel.grumbach@intel.com \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).