Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53ee1033 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'wireless-drivers-for-davem-2015-05-05' of...

Merge tag 'wireless-drivers-for-davem-2015-05-05' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers



Kalle Valo says:

====================
iwlwifi:

* fix firmware API for -13.ucode
* fix RSSI handling that avoid bad roaming decision
* fix firmware debug
* fix MFUART operation
* fix ASSERT while restart the hardware (because of another ASSERT e.g)

ath9k:

* fix per-packet tx power configuration

rtlwifi:

* rtl8192cu: Fix kernel deadlock
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents c967a087 f6738218
Loading
Loading
Loading
Loading
+25 −27
Original line number Diff line number Diff line
@@ -1103,28 +1103,14 @@ static u8 ath_get_rate_txpower(struct ath_softc *sc, struct ath_buf *bf,
	struct sk_buff *skb;
	struct ath_frame_info *fi;
	struct ieee80211_tx_info *info;
	struct ieee80211_vif *vif;
	struct ath_hw *ah = sc->sc_ah;

	if (sc->tx99_state || !ah->tpc_enabled)
		return MAX_RATE_POWER;

	skb = bf->bf_mpdu;
	info = IEEE80211_SKB_CB(skb);
	vif = info->control.vif;

	if (!vif) {
		max_power = sc->cur_chan->cur_txpower;
		goto out;
	}

	if (vif->bss_conf.txpower_type != NL80211_TX_POWER_LIMITED) {
		max_power = min_t(u8, sc->cur_chan->cur_txpower,
				  2 * vif->bss_conf.txpower);
		goto out;
	}

	fi = get_frame_info(skb);
	info = IEEE80211_SKB_CB(skb);

	if (!AR_SREV_9300_20_OR_LATER(ah)) {
		int txpower = fi->tx_power;
@@ -1161,25 +1147,26 @@ static u8 ath_get_rate_txpower(struct ath_softc *sc, struct ath_buf *bf,
			txpower -= 2;

		txpower = max(txpower, 0);
		max_power = min_t(u8, ah->tx_power[rateidx],
				  2 * vif->bss_conf.txpower);
		max_power = min_t(u8, max_power, txpower);
		max_power = min_t(u8, ah->tx_power[rateidx], txpower);

		/* XXX: clamp minimum TX power at 1 for AR9160 since if
		 * max_power is set to 0, frames are transmitted at max
		 * TX power
		 */
		if (!max_power && !AR_SREV_9280_20_OR_LATER(ah))
			max_power = 1;
	} else if (!bf->bf_state.bfs_paprd) {
		if (rateidx < 8 && (info->flags & IEEE80211_TX_CTL_STBC))
			max_power = min_t(u8, ah->tx_power_stbc[rateidx],
					  2 * vif->bss_conf.txpower);
					  fi->tx_power);
		else
			max_power = min_t(u8, ah->tx_power[rateidx],
					  2 * vif->bss_conf.txpower);
		max_power = min(max_power, fi->tx_power);
					  fi->tx_power);
	} else {
		max_power = ah->paprd_training_power;
	}
out:
	/* XXX: clamp minimum TX power at 1 for AR9160 since if max_power
	 * is set to 0, frames are transmitted at max TX power
	 */
	return (!max_power && !AR_SREV_9280_20_OR_LATER(ah)) ? 1 : max_power;

	return max_power;
}

static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
@@ -2129,6 +2116,7 @@ static void setup_frame_info(struct ieee80211_hw *hw,
	struct ath_node *an = NULL;
	enum ath9k_key_type keytype;
	bool short_preamble = false;
	u8 txpower;

	/*
	 * We check if Short Preamble is needed for the CTS rate by
@@ -2145,6 +2133,16 @@ static void setup_frame_info(struct ieee80211_hw *hw,
	if (sta)
		an = (struct ath_node *) sta->drv_priv;

	if (tx_info->control.vif) {
		struct ieee80211_vif *vif = tx_info->control.vif;

		txpower = 2 * vif->bss_conf.txpower;
	} else {
		struct ath_softc *sc = hw->priv;

		txpower = sc->cur_chan->cur_txpower;
	}

	memset(fi, 0, sizeof(*fi));
	fi->txq = -1;
	if (hw_key)
@@ -2155,7 +2153,7 @@ static void setup_frame_info(struct ieee80211_hw *hw,
		fi->keyix = ATH9K_TXKEYIX_INVALID;
	fi->keytype = keytype;
	fi->framelen = framelen;
	fi->tx_power = MAX_RATE_POWER;
	fi->tx_power = txpower;

	if (!rate)
		return;
+2 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ enum iwl_ucode_tlv_flag {
 *	longer than the passive one, which is essential for fragmented scan.
 * @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source.
 * IWL_UCODE_TLV_API_HDC_PHASE_0: ucode supports finer configuration of LTR
 * @IWL_UCODE_TLV_API_TX_POWER_DEV: new API for tx power.
 * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command,
 *	regardless of the band or the number of the probes. FW will calculate
 *	the actual dwell time.
@@ -260,6 +261,7 @@ enum iwl_ucode_tlv_api {
	IWL_UCODE_TLV_API_FRAGMENTED_SCAN	= BIT(8),
	IWL_UCODE_TLV_API_WIFI_MCC_UPDATE	= BIT(9),
	IWL_UCODE_TLV_API_HDC_PHASE_0		= BIT(10),
	IWL_UCODE_TLV_API_TX_POWER_DEV		= BIT(11),
	IWL_UCODE_TLV_API_BASIC_DWELL		= BIT(13),
	IWL_UCODE_TLV_API_SCD_CFG		= BIT(15),
	IWL_UCODE_TLV_API_SINGLE_SCAN_EBS	= BIT(16),
+27 −14
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
 * GPL LICENSE SUMMARY
 *
 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
 * BSD LICENSE
 *
 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
@@ -421,8 +421,9 @@ struct iwl_trans_txq_scd_cfg {
 *
 * All the handlers MUST be implemented
 *
 * @start_hw: starts the HW- from that point on, the HW can send interrupts
 *	May sleep
 * @start_hw: starts the HW. If low_power is true, the NIC needs to be taken
 *	out of a low power state. From that point on, the HW can send
 *	interrupts. May sleep.
 * @op_mode_leave: Turn off the HW RF kill indication if on
 *	May sleep
 * @start_fw: allocates and inits all the resources for the transport
@@ -432,10 +433,11 @@ struct iwl_trans_txq_scd_cfg {
 *	the SCD base address in SRAM, then provide it here, or 0 otherwise.
 *	May sleep
 * @stop_device: stops the whole device (embedded CPU put to reset) and stops
 *	the HW. From that point on, the HW will be in low power but will still
 *	issue interrupt if the HW RF kill is triggered. This callback must do
 *	the right thing and not crash even if start_hw() was called but not
 *	start_fw(). May sleep
 *	the HW. If low_power is true, the NIC will be put in low power state.
 *	From that point on, the HW will be stopped but will still issue an
 *	interrupt if the HW RF kill switch is triggered.
 *	This callback must do the right thing and not crash even if %start_hw()
 *	was called but not &start_fw(). May sleep.
 * @d3_suspend: put the device into the correct mode for WoWLAN during
 *	suspend. This is optional, if not implemented WoWLAN will not be
 *	supported. This callback may sleep.
@@ -491,14 +493,14 @@ struct iwl_trans_txq_scd_cfg {
 */
struct iwl_trans_ops {

	int (*start_hw)(struct iwl_trans *iwl_trans);
	int (*start_hw)(struct iwl_trans *iwl_trans, bool low_power);
	void (*op_mode_leave)(struct iwl_trans *iwl_trans);
	int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw,
			bool run_in_rfkill);
	int (*update_sf)(struct iwl_trans *trans,
			 struct iwl_sf_region *st_fwrd_space);
	void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr);
	void (*stop_device)(struct iwl_trans *trans);
	void (*stop_device)(struct iwl_trans *trans, bool low_power);

	void (*d3_suspend)(struct iwl_trans *trans, bool test);
	int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status,
@@ -652,11 +654,16 @@ static inline void iwl_trans_configure(struct iwl_trans *trans,
	trans->ops->configure(trans, trans_cfg);
}

static inline int iwl_trans_start_hw(struct iwl_trans *trans)
static inline int _iwl_trans_start_hw(struct iwl_trans *trans, bool low_power)
{
	might_sleep();

	return trans->ops->start_hw(trans);
	return trans->ops->start_hw(trans, low_power);
}

static inline int iwl_trans_start_hw(struct iwl_trans *trans)
{
	return trans->ops->start_hw(trans, true);
}

static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans)
@@ -703,15 +710,21 @@ static inline int iwl_trans_update_sf(struct iwl_trans *trans,
	return 0;
}

static inline void iwl_trans_stop_device(struct iwl_trans *trans)
static inline void _iwl_trans_stop_device(struct iwl_trans *trans,
					  bool low_power)
{
	might_sleep();

	trans->ops->stop_device(trans);
	trans->ops->stop_device(trans, low_power);

	trans->state = IWL_TRANS_NO_FW;
}

static inline void iwl_trans_stop_device(struct iwl_trans *trans)
{
	_iwl_trans_stop_device(trans, true);
}

static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test)
{
	might_sleep();
+1 −1
Original line number Diff line number Diff line
@@ -1726,7 +1726,7 @@ iwl_mvm_netdetect_query_results(struct iwl_mvm *mvm,
	results->matched_profiles = le32_to_cpu(query->matched_profiles);
	memcpy(results->matches, query->matches, sizeof(results->matches));

#ifdef CPTCFG_IWLWIFI_DEBUGFS
#ifdef CONFIG_IWLWIFI_DEBUGFS
	mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done);
#endif

+34 −0
Original line number Diff line number Diff line
@@ -297,6 +297,40 @@ struct iwl_uapsd_misbehaving_ap_notif {
	u8 reserved[3];
} __packed;

/**
 * struct iwl_reduce_tx_power_cmd - TX power reduction command
 * REDUCE_TX_POWER_CMD = 0x9f
 * @flags: (reserved for future implementation)
 * @mac_context_id: id of the mac ctx for which we are reducing TX power.
 * @pwr_restriction: TX power restriction in dBms.
 */
struct iwl_reduce_tx_power_cmd {
	u8 flags;
	u8 mac_context_id;
	__le16 pwr_restriction;
} __packed; /* TX_REDUCED_POWER_API_S_VER_1 */

/**
 * struct iwl_dev_tx_power_cmd - TX power reduction command
 * REDUCE_TX_POWER_CMD = 0x9f
 * @set_mode: 0 - MAC tx power, 1 - device tx power
 * @mac_context_id: id of the mac ctx for which we are reducing TX power.
 * @pwr_restriction: TX power restriction in 1/8 dBms.
 * @dev_24: device TX power restriction in 1/8 dBms
 * @dev_52_low: device TX power restriction upper band - low
 * @dev_52_high: device TX power restriction upper band - high
 */
struct iwl_dev_tx_power_cmd {
	__le32 set_mode;
	__le32 mac_context_id;
	__le16 pwr_restriction;
	__le16 dev_24;
	__le16 dev_52_low;
	__le16 dev_52_high;
} __packed; /* TX_REDUCED_POWER_API_S_VER_2 */

#define IWL_DEV_MAX_TX_POWER 0x7FFF

/**
 * struct iwl_beacon_filter_cmd
 * REPLY_BEACON_FILTERING_CMD = 0xd2 (command)
Loading