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

Commit 85eb018f authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'wireless-drivers-next-for-davem-2017-01-02' of...

Merge tag 'wireless-drivers-next-for-davem-2017-01-02' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next



Kalle Valo says:

====================
wireless-drivers-next patches for 4.11

The most notable change here is the inclusion of airtime fairness
scheduling to ath9k. It prevents slow clients from hogging all the
airtime and unfairly slowing down faster clients.

Otherwise smaller changes and cleanup.

Major changes:

ath9k

* cleanup eeprom endian handling
* add airtime fairness scheduling

ath10k

* fix issues for new QCA9377 firmware version
* support dev_coredump() for firmware crash dump
* enable channel 169 on 5 GHz band
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 31b95c9b e16e558e
Loading
Loading
Loading
Loading
+24 −3
Original line number Diff line number Diff line
@@ -413,6 +413,13 @@ static void adm8211_interrupt_rci(struct ieee80211_hw *dev)
						       skb_tail_pointer(newskb),
						       RX_PKT_SIZE,
						       PCI_DMA_FROMDEVICE);
				if (pci_dma_mapping_error(priv->pdev,
					   priv->rx_buffers[entry].mapping)) {
					priv->rx_buffers[entry].skb = NULL;
					dev_kfree_skb(newskb);
					skb = NULL;
					/* TODO: update rx dropped stats */
				}
			} else {
				skb = NULL;
				/* TODO: update rx dropped stats */
@@ -1450,6 +1457,12 @@ static int adm8211_init_rings(struct ieee80211_hw *dev)
						  skb_tail_pointer(rx_info->skb),
						  RX_PKT_SIZE,
						  PCI_DMA_FROMDEVICE);
		if (pci_dma_mapping_error(priv->pdev, rx_info->mapping)) {
			dev_kfree_skb(rx_info->skb);
			rx_info->skb = NULL;
			break;
		}

		desc->buffer1 = cpu_to_le32(rx_info->mapping);
		desc->status = cpu_to_le32(RDES0_STATUS_OWN | RDES0_STATUS_SQL);
	}
@@ -1613,7 +1626,7 @@ static void adm8211_calc_durations(int *dur, int *plcp, size_t payload_len, int
}

/* Transmit skb w/adm8211_tx_hdr (802.11 header created by hardware) */
static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
static int adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
			   u16 plcp_signal,
			   size_t hdrlen)
{
@@ -1625,6 +1638,8 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,

	mapping = pci_map_single(priv->pdev, skb->data, skb->len,
				 PCI_DMA_TODEVICE);
	if (pci_dma_mapping_error(priv->pdev, mapping))
		return -ENOMEM;

	spin_lock_irqsave(&priv->lock, flags);

@@ -1657,6 +1672,8 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,

	/* Trigger transmit poll */
	ADM8211_CSR_WRITE(TDR, 0);

	return 0;
}

/* Put adm8211_tx_hdr on skb and transmit */
@@ -1710,7 +1727,10 @@ static void adm8211_tx(struct ieee80211_hw *dev,

	txhdr->retry_limit = info->control.rates[0].count;

	adm8211_tx_raw(dev, skb, plcp_signal, hdrlen);
	if (adm8211_tx_raw(dev, skb, plcp_signal, hdrlen)) {
		/* Drop packet */
		ieee80211_free_txskb(dev, skb);
	}
}

static int adm8211_alloc_rings(struct ieee80211_hw *dev)
@@ -1843,7 +1863,8 @@ static int adm8211_probe(struct pci_dev *pdev,
	priv->rx_ring_size = rx_ring_size;
	priv->tx_ring_size = tx_ring_size;

	if (adm8211_alloc_rings(dev)) {
	err = adm8211_alloc_rings(dev);
	if (err) {
		printk(KERN_ERR "%s (adm8211): Cannot allocate TX/RX ring\n",
		       pci_name(pdev));
		goto err_iounmap;
+10 −1
Original line number Diff line number Diff line
@@ -694,8 +694,11 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar)
		   "boot get otp board id result 0x%08x board_id %d chip_id %d\n",
		   result, board_id, chip_id);

	if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0)
	if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 ||
	    (board_id == 0)) {
		ath10k_warn(ar, "board id is not exist in otp, ignore it\n");
		return -EOPNOTSUPP;
	}

	ar->id.bmi_ids_valid = true;
	ar->id.bmi_board_id = board_id;
@@ -1510,6 +1513,7 @@ static int ath10k_init_hw_params(struct ath10k *ar)
static void ath10k_core_restart(struct work_struct *work)
{
	struct ath10k *ar = container_of(work, struct ath10k, restart_work);
	int ret;

	set_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags);

@@ -1561,6 +1565,11 @@ static void ath10k_core_restart(struct work_struct *work)
	}

	mutex_unlock(&ar->conf_mutex);

	ret = ath10k_debug_fw_devcoredump(ar);
	if (ret)
		ath10k_warn(ar, "failed to send firmware crash dump via devcoredump: %d",
			    ret);
}

static void ath10k_core_set_coverage_class_work(struct work_struct *work)
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
#define WMI_READY_TIMEOUT (5 * HZ)
#define ATH10K_FLUSH_TIMEOUT_HZ (5 * HZ)
#define ATH10K_CONNECTION_LOSS_HZ (3 * HZ)
#define ATH10K_NUM_CHANS 39
#define ATH10K_NUM_CHANS 40

/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95
+40 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/utsname.h>
#include <linux/crc32.h>
#include <linux/firmware.h>
#include <linux/devcoredump.h>

#include "core.h"
#include "debug.h"
@@ -721,7 +722,8 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
}
EXPORT_SYMBOL(ath10k_debug_get_new_fw_crash_data);

static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar,
							    bool mark_read)
{
	struct ath10k_fw_crash_data *crash_data = ar->debug.fw_crash_data;
	struct ath10k_dump_file_data *dump_data;
@@ -790,19 +792,54 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
	       sizeof(crash_data->registers));
	sofar += sizeof(*dump_tlv) + sizeof(crash_data->registers);

	ar->debug.fw_crash_data->crashed_since_read = false;
	ar->debug.fw_crash_data->crashed_since_read = !mark_read;

	spin_unlock_bh(&ar->data_lock);

	return dump_data;
}

int ath10k_debug_fw_devcoredump(struct ath10k *ar)
{
	struct ath10k_dump_file_data *dump;
	void *dump_ptr;
	u32 dump_len;

	/* To keep the dump file available also for debugfs don't mark the
	 * file read, only debugfs should do that.
	 */
	dump = ath10k_build_dump_file(ar, false);
	if (!dump) {
		ath10k_warn(ar, "no crash dump data found for devcoredump");
		return -ENODATA;
	}

	/* Make a copy of the dump file for dev_coredumpv() as during the
	 * transition period we need to own the original file. Once
	 * fw_crash_dump debugfs file is removed no need to have a copy
	 * anymore.
	 */
	dump_len = le32_to_cpu(dump->len);
	dump_ptr = vzalloc(dump_len);

	if (!dump_ptr)
		return -ENOMEM;

	memcpy(dump_ptr, dump, dump_len);

	dev_coredumpv(ar->dev, dump_ptr, dump_len, GFP_KERNEL);

	return 0;
}

static int ath10k_fw_crash_dump_open(struct inode *inode, struct file *file)
{
	struct ath10k *ar = inode->i_private;
	struct ath10k_dump_file_data *dump;

	dump = ath10k_build_dump_file(ar);
	ath10k_warn(ar, "fw_crash_dump debugfs file is deprecated, please use /sys/class/devcoredump instead.");

	dump = ath10k_build_dump_file(ar, true);
	if (!dump)
		return -ENODATA;

+8 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ struct ath10k_fw_crash_data *
ath10k_debug_get_new_fw_crash_data(struct ath10k *ar);

void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer, int len);

int ath10k_debug_fw_devcoredump(struct ath10k *ar);

#define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)

void ath10k_debug_get_et_strings(struct ieee80211_hw *hw,
@@ -166,6 +169,11 @@ static inline u32 ath10k_debug_get_fw_dbglog_level(struct ath10k *ar)
	return 0;
}

static inline int ath10k_debug_fw_devcoredump(struct ath10k *ar)
{
	return 0;
}

#define ATH10K_DFS_STAT_INC(ar, c) do { } while (0)

#define ath10k_debug_get_et_strings NULL
Loading