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

Commit 124b68e7 authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville
Browse files

p54: fix WARN_ON at line 2247 of net/mac80211/rx.c

This patch hopefully fixes a mac80211<->p54 interaction problem, which was
described by Larry Finger (ref: http://marc.info/?l=linux-wireless&m=123009889327707

 )

I guess the warning was triggered by pending frames in the receive queue,
while we're doing a band change 5GHz.

Signed-off-by: default avatarChristian Lamparter <chunkeey@web.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent dcebf45c
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -586,6 +586,7 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb)
	u16 freq = le16_to_cpu(hdr->freq);
	u16 freq = le16_to_cpu(hdr->freq);
	size_t header_len = sizeof(*hdr);
	size_t header_len = sizeof(*hdr);
	u32 tsf32;
	u32 tsf32;
	u8 rate = hdr->rate & 0xf;


	/*
	/*
	 * If the device is in a unspecified state we have to
	 * If the device is in a unspecified state we have to
@@ -614,8 +615,11 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb)
	rx_status.qual = (100 * hdr->rssi) / 127;
	rx_status.qual = (100 * hdr->rssi) / 127;
	if (hdr->rate & 0x10)
	if (hdr->rate & 0x10)
		rx_status.flag |= RX_FLAG_SHORTPRE;
		rx_status.flag |= RX_FLAG_SHORTPRE;
	rx_status.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ?
	if (dev->conf.channel->band == IEEE80211_BAND_5GHZ)
			hdr->rate : (hdr->rate - 4)) & 0xf;
		rx_status.rate_idx = (rate < 4) ? 0 : rate - 4;
	else
		rx_status.rate_idx = rate;

	rx_status.freq = freq;
	rx_status.freq = freq;
	rx_status.band =  dev->conf.channel->band;
	rx_status.band =  dev->conf.channel->band;
	rx_status.antenna = hdr->antenna;
	rx_status.antenna = hdr->antenna;