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

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

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

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



Changes:

* ath9k: enable Transmit Power Control (TPC) for ar9003 chips

* rtlwifi: cleanup and updates from the vendor driver

* rsi: fix memory leak related to firmware image

* ath: parameter fix for FCC DFS pattern

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3adc0bec 354f473e
Loading
Loading
Loading
Loading
+71 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,75 @@ static const struct file_operations fops_ackto = {
};
#endif

static ssize_t read_file_tpc(struct file *file, char __user *user_buf,
			     size_t count, loff_t *ppos)
{
	struct ath_softc *sc = file->private_data;
	struct ath_hw *ah = sc->sc_ah;
	unsigned int len = 0, size = 32;
	ssize_t retval;
	char *buf;

	buf = kzalloc(size, GFP_KERNEL);
	if (!buf)
		return -ENOMEM;

	len += scnprintf(buf + len, size - len, "%s\n",
			 ah->tpc_enabled ? "ENABLED" : "DISABLED");

	if (len > size)
		len = size;

	retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
	kfree(buf);

	return retval;
}

static ssize_t write_file_tpc(struct file *file, const char __user *user_buf,
			      size_t count, loff_t *ppos)
{
	struct ath_softc *sc = file->private_data;
	struct ath_hw *ah = sc->sc_ah;
	unsigned long val;
	char buf[32];
	ssize_t len;
	bool tpc_enabled;

	if (!AR_SREV_9300_20_OR_LATER(ah)) {
		/* ar9002 does not support TPC for the moment */
		return -EOPNOTSUPP;
	}

	len = min(count, sizeof(buf) - 1);
	if (copy_from_user(buf, user_buf, len))
		return -EFAULT;

	buf[len] = '\0';
	if (kstrtoul(buf, 0, &val))
		return -EINVAL;

	if (val < 0 || val > 1)
		return -EINVAL;

	tpc_enabled = !!val;

	if (tpc_enabled != ah->tpc_enabled) {
		ah->tpc_enabled = tpc_enabled;
		ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false);
	}

	return count;
}

static const struct file_operations fops_tpc = {
	.read = read_file_tpc,
	.write = write_file_tpc,
	.open = simple_open,
	.owner = THIS_MODULE,
	.llseek = default_llseek,
};

/* Ethtool support for get-stats */

#define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO"
@@ -1324,6 +1393,8 @@ int ath9k_init_debug(struct ath_hw *ah)
	debugfs_create_file("ack_to", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
			    sc, &fops_ackto);
#endif
	debugfs_create_file("tpc", S_IRUSR | S_IWUSR,
			    sc->debug.debugfs_phy, sc, &fops_tpc);

	return 0;
}
+3 −0
Original line number Diff line number Diff line
@@ -422,6 +422,9 @@ static void ath9k_hw_init_defaults(struct ath_hw *ah)
	ah->power_mode = ATH9K_PM_UNDEFINED;
	ah->htc_reset_init = true;

	/* ar9002 does not support TPC for the moment */
	ah->tpc_enabled = !!AR_SREV_9300_20_OR_LATER(ah);

	ah->ani_function = ATH9K_ANI_ALL;
	if (!AR_SREV_9300_20_OR_LATER(ah))
		ah->ani_function &= ~ATH9K_ANI_MRC_CCK;
+1 −1
Original line number Diff line number Diff line
@@ -1106,7 +1106,7 @@ static u8 ath_get_rate_txpower(struct ath_softc *sc, struct ath_buf *bf,
		return MAX_RATE_POWER;

	if (!AR_SREV_9300_20_OR_LATER(ah)) {
		/* ar9002 is not sipported for the moment */
		/* ar9002 does not support TPC for the moment */
		return MAX_RATE_POWER;
	}

+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ static const struct radar_detector_specs fcc_radar_ref_types[] = {
	FCC_PATTERN(1, 0, 5, 150, 230, 1, 23),
	FCC_PATTERN(2, 6, 10, 200, 500, 1, 16),
	FCC_PATTERN(3, 11, 20, 200, 500, 1, 12),
	FCC_PATTERN(4, 50, 100, 1000, 2000, 1, 20),
	FCC_PATTERN(4, 50, 100, 1000, 2000, 1, 1),
	FCC_PATTERN(5, 0, 1, 333, 333, 1, 9),
};

+1 −3
Original line number Diff line number Diff line
@@ -172,7 +172,6 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
		(struct rsi_91x_sdiodev *)adapter->rsi_dev;
	u32 len;
	u32 num_blocks;
	const u8 *fw;
	const struct firmware *fw_entry = NULL;
	u32 block_size = dev->tx_blk_size;
	int status = 0;
@@ -201,7 +200,6 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
		return status;
	}

	fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
	len = fw_entry->size;

	if (len % 4)
@@ -212,7 +210,7 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
	rsi_dbg(INIT_ZONE, "%s: Instruction size:%d\n", __func__, len);
	rsi_dbg(INIT_ZONE, "%s: num blocks: %d\n", __func__, num_blocks);

	status = rsi_copy_to_card(common, fw, len, num_blocks);
	status = rsi_copy_to_card(common, fw_entry->data, len, num_blocks);
	release_firmware(fw_entry);
	return status;
}
Loading