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

Commit 777bf135 authored by John W. Linville's avatar John W. Linville Committed by David S. Miller
Browse files

Merge branch 'master' of...

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

 into for-davem

John W. Linville says:

====================
Please pull these fixes intended for 3.6.  There are more commits
here than I would like -- I got a bit behind while I was stalking
Steven Rostedt in San Diego last week...  I'll slow it down after this!

There are a couple of pulls here.  One is from Johannes:

"Please pull (according to the below information) to get a few fixes.

 * a fix to properly disconnect in the driver when authentication or
   association fails
 * a fix to prevent invalid information about mesh paths being reported
   to userspace
 * a memory leak fix in an nl80211 error path"

The other comes via Gustavo:

"A few updates for the 3.6 kernel. There are two btusb patches to add
more supported devices through the new USB_VENDOR_AND_INTEFACE_INFO()
macro and another one that add a new device id for a Sony Vaio laptop,
one fix for a user-after-free and, finally, two patches from Vinicius
to fix a issue in SMP pairing."

Along with those...

Arend van Spriel provides a fix for a use-after-free bug in brcmfmac.

Daniel Drake avoids a hang by not trying to touch the libertas hardware
duing suspend if it is already powered-down.

Felix Fietkau provides a batch of ath9k fixes that adress some
potential problems with power settings, as well as a fix to avoid a
potential interrupt storm.

Gertjan van Wingerde provides a register-width fix for rt2x00, and
a rt2x00 fix to prevent incorrectly detecting the rfkill status.
He also provides a device ID patch.

Hante Meuleman gives us three brcmfmac fixes, one that properly
initializes a command structure, one that fixes a race condition that
could lose usb requests, and one that removes some log spam.

Marc Kleine-Budde offers an rt2x00 fix for a voltage setting on some
specific devices.

Mohammed Shafi Shajakhan sent an ath9k fix to avoid a crash related to
using timers that aren't allocated when 2 wire bluetooth coexistence
hardware is in use.

Sergei Poselenov changes rt2800usb to do some validity checking for
received packets, avoiding crashes on an ARM Soc.

Stone Piao gives us an mwifiex fix for an incorrectly set skb length
value for a command buffer.

All of these are localized to their specific drivers, and relatively
small.  The power-related patches from Felix are bigger than I would
like, but I merged them in consideration of their isolation to ath9k
and the sensitive nature of power settings in wireless devices.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents b8dfc6a0 f1072384
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -86,6 +86,7 @@ static struct usb_device_id ath3k_table[] = {


	/* Atheros AR5BBU22 with sflash firmware */
	/* Atheros AR5BBU22 with sflash firmware */
	{ USB_DEVICE(0x0489, 0xE03C) },
	{ USB_DEVICE(0x0489, 0xE03C) },
	{ USB_DEVICE(0x0489, 0xE036) },


	{ }	/* Terminating entry */
	{ }	/* Terminating entry */
};
};
@@ -109,6 +110,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {


	/* Atheros AR5BBU22 with sflash firmware */
	/* Atheros AR5BBU22 with sflash firmware */
	{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
	{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
	{ USB_DEVICE(0x0489, 0xE036), .driver_info = BTUSB_ATH3012 },


	{ }	/* Terminating entry */
	{ }	/* Terminating entry */
};
};
+7 −5
Original line number Original line Diff line number Diff line
@@ -52,6 +52,9 @@ static struct usb_device_id btusb_table[] = {
	/* Generic Bluetooth USB device */
	/* Generic Bluetooth USB device */
	{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
	{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },


	/* Apple-specific (Broadcom) devices */
	{ USB_VENDOR_AND_INTERFACE_INFO(0x05ac, 0xff, 0x01, 0x01) },

	/* Broadcom SoftSailing reporting vendor specific */
	/* Broadcom SoftSailing reporting vendor specific */
	{ USB_DEVICE(0x0a5c, 0x21e1) },
	{ USB_DEVICE(0x0a5c, 0x21e1) },


@@ -94,16 +97,14 @@ static struct usb_device_id btusb_table[] = {


	/* Broadcom BCM20702A0 */
	/* Broadcom BCM20702A0 */
	{ USB_DEVICE(0x0489, 0xe042) },
	{ USB_DEVICE(0x0489, 0xe042) },
	{ USB_DEVICE(0x0a5c, 0x21e3) },
	{ USB_DEVICE(0x0a5c, 0x21e6) },
	{ USB_DEVICE(0x0a5c, 0x21e8) },
	{ USB_DEVICE(0x0a5c, 0x21f3) },
	{ USB_DEVICE(0x0a5c, 0x21f4) },
	{ USB_DEVICE(0x413c, 0x8197) },
	{ USB_DEVICE(0x413c, 0x8197) },


	/* Foxconn - Hon Hai */
	/* Foxconn - Hon Hai */
	{ USB_DEVICE(0x0489, 0xe033) },
	{ USB_DEVICE(0x0489, 0xe033) },


	/*Broadcom devices with vendor specific id */
	{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) },

	{ }	/* Terminating entry */
	{ }	/* Terminating entry */
};
};


@@ -141,6 +142,7 @@ static struct usb_device_id blacklist_table[] = {


	/* Atheros AR5BBU12 with sflash firmware */
	/* Atheros AR5BBU12 with sflash firmware */
	{ USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
	{ USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
	{ USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 },


	/* Broadcom BCM2035 */
	/* Broadcom BCM2035 */
	{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
	{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
+104 −1
Original line number Original line Diff line number Diff line
@@ -142,6 +142,7 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
	};
	};
	int training_power;
	int training_power;
	int i, val;
	int i, val;
	u32 am2pm_mask = ah->paprd_ratemask;


	if (IS_CHAN_2GHZ(ah->curchan))
	if (IS_CHAN_2GHZ(ah->curchan))
		training_power = ar9003_get_training_power_2g(ah);
		training_power = ar9003_get_training_power_2g(ah);
@@ -158,10 +159,13 @@ static int ar9003_paprd_setup_single_table(struct ath_hw *ah)
	}
	}
	ah->paprd_training_power = training_power;
	ah->paprd_training_power = training_power;


	if (AR_SREV_9330(ah))
		am2pm_mask = 0;

	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK,
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2AM, AR_PHY_PAPRD_AM2AM_MASK,
		      ah->paprd_ratemask);
		      ah->paprd_ratemask);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK,
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_AM2PM, AR_PHY_PAPRD_AM2PM_MASK,
		      ah->paprd_ratemask);
		      am2pm_mask);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK,
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_HT40, AR_PHY_PAPRD_HT40_MASK,
		      ah->paprd_ratemask_ht40);
		      ah->paprd_ratemask_ht40);


@@ -782,6 +786,102 @@ int ar9003_paprd_setup_gain_table(struct ath_hw *ah, int chain)
}
}
EXPORT_SYMBOL(ar9003_paprd_setup_gain_table);
EXPORT_SYMBOL(ar9003_paprd_setup_gain_table);


static bool ar9003_paprd_retrain_pa_in(struct ath_hw *ah,
				       struct ath9k_hw_cal_data *caldata,
				       int chain)
{
	u32 *pa_in = caldata->pa_table[chain];
	int capdiv_offset, quick_drop_offset;
	int capdiv2g, quick_drop;
	int count = 0;
	int i;

	if (!AR_SREV_9485(ah) && !AR_SREV_9330(ah))
		return false;

	capdiv2g = REG_READ_FIELD(ah, AR_PHY_65NM_CH0_TXRF3,
				  AR_PHY_65NM_CH0_TXRF3_CAPDIV2G);

	quick_drop = REG_READ_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
				    AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP);

	if (quick_drop)
		quick_drop -= 0x40;

	for (i = 0; i < NUM_BIN + 1; i++) {
		if (pa_in[i] == 1400)
			count++;
	}

	if (AR_SREV_9485(ah)) {
		if (pa_in[23] < 800) {
			capdiv_offset = (int)((1000 - pa_in[23] + 75) / 150);
			capdiv2g += capdiv_offset;
			if (capdiv2g > 7) {
				capdiv2g = 7;
				if (pa_in[23] < 600) {
					quick_drop++;
					if (quick_drop > 0)
						quick_drop = 0;
				}
			}
		} else if (pa_in[23] == 1400) {
			quick_drop_offset = min_t(int, count / 3, 2);
			quick_drop += quick_drop_offset;
			capdiv2g += quick_drop_offset / 2;

			if (capdiv2g > 7)
				capdiv2g = 7;

			if (quick_drop > 0) {
				quick_drop = 0;
				capdiv2g -= quick_drop_offset;
				if (capdiv2g < 0)
					capdiv2g = 0;
			}
		} else {
			return false;
		}
	} else if (AR_SREV_9330(ah)) {
		if (pa_in[23] < 1000) {
			capdiv_offset = (1000 - pa_in[23]) / 100;
			capdiv2g += capdiv_offset;
			if (capdiv_offset > 3) {
				capdiv_offset = 1;
				quick_drop--;
			}

			capdiv2g += capdiv_offset;
			if (capdiv2g > 6)
				capdiv2g = 6;
			if (quick_drop < -4)
				quick_drop = -4;
		} else if (pa_in[23] == 1400) {
			if (count > 3) {
				quick_drop++;
				capdiv2g -= count / 4;
				if (quick_drop > -2)
					quick_drop = -2;
			} else {
				capdiv2g--;
			}

			if (capdiv2g < 0)
				capdiv2g = 0;
		} else {
			return false;
		}
	}

	REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_TXRF3,
		      AR_PHY_65NM_CH0_TXRF3_CAPDIV2G, capdiv2g);
	REG_RMW_FIELD(ah, AR_PHY_PAPRD_TRAINER_CNTL3,
		      AR_PHY_PAPRD_TRAINER_CNTL3_CF_PAPRD_QUICK_DROP,
		      quick_drop);

	return true;
}

int ar9003_paprd_create_curve(struct ath_hw *ah,
int ar9003_paprd_create_curve(struct ath_hw *ah,
			      struct ath9k_hw_cal_data *caldata, int chain)
			      struct ath9k_hw_cal_data *caldata, int chain)
{
{
@@ -817,6 +917,9 @@ int ar9003_paprd_create_curve(struct ath_hw *ah,
	if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain))
	if (!create_pa_curve(data_L, data_U, pa_table, small_signal_gain))
		status = -2;
		status = -2;


	if (ar9003_paprd_retrain_pa_in(ah, caldata, chain))
		status = -EINPROGRESS;

	REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1,
	REG_CLR_BIT(ah, AR_PHY_PAPRD_TRAINER_STAT1,
		    AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);
		    AR_PHY_PAPRD_TRAINER_STAT1_PAPRD_TRAIN_DONE);


+4 −0
Original line number Original line Diff line number Diff line
@@ -625,6 +625,10 @@
#define AR_PHY_AIC_CTRL_4_B0	(AR_SM_BASE + 0x4c0)
#define AR_PHY_AIC_CTRL_4_B0	(AR_SM_BASE + 0x4c0)
#define AR_PHY_AIC_STAT_2_B0	(AR_SM_BASE + 0x4cc)
#define AR_PHY_AIC_STAT_2_B0	(AR_SM_BASE + 0x4cc)


#define AR_PHY_65NM_CH0_TXRF3       0x16048
#define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G		0x0000001e
#define AR_PHY_65NM_CH0_TXRF3_CAPDIV2G_S	1

#define AR_PHY_65NM_CH0_SYNTH4      0x1608c
#define AR_PHY_65NM_CH0_SYNTH4      0x1608c
#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT   (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002)
#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT   (AR_SREV_9462(ah) ? 0x00000001 : 0x00000002)
#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1)
#define AR_PHY_SYNTH4_LONG_SHIFT_SELECT_S (AR_SREV_9462(ah) ? 0 : 1)
+2 −1
Original line number Original line Diff line number Diff line
@@ -341,6 +341,7 @@ void ath9k_btcoex_stop_gen_timer(struct ath_softc *sc)
{
{
	struct ath_btcoex *btcoex = &sc->btcoex;
	struct ath_btcoex *btcoex = &sc->btcoex;


	if (btcoex->hw_timer_enabled)
		ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
		ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
}
}


Loading