Commit 4511a4a5 authored by David S. Miller's avatar David S. Miller

Merge tag 'master-2014-10-08' of...

Merge tag 'master-2014-10-08' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next

John W. Linville says:

====================
pull request: wireless-next 2014-10-09

Please pull this batch of fixes intended for the 3.18 stream!

Andrea Merello makes rtl818x_pci use a more reasonable transmission
rate for HW generated frames.

Fabian Frederick tweaks some kernel-doc bits to avoid warnings.

Larry Finger corrects a possible unaligned access in the rtlwifi code.

Marek Puzyniak avoids a kernel panic in ath9k_hw_reset.

Sujith Manoharan goes for the hat trick -- he fixes a smatch warning
in the shared ath code, he fixes a crash in ath9k, and he corrects
a sequence number assignment problem in ath9k too.

For ease of merging, I pulled the last bits of the wireless tree as well...

Please let me know if there are problems!
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3dab99e0 1fca350b
...@@ -294,7 +294,6 @@ struct ath_tx_control { ...@@ -294,7 +294,6 @@ struct ath_tx_control {
* (axq_qnum). * (axq_qnum).
*/ */
struct ath_tx { struct ath_tx {
u16 seq_no;
u32 txqsetup; u32 txqsetup;
spinlock_t txbuflock; spinlock_t txbuflock;
struct list_head txbuf; struct list_head txbuf;
...@@ -563,6 +562,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs); ...@@ -563,6 +562,7 @@ int ath_tx_init(struct ath_softc *sc, int nbufs);
int ath_txq_update(struct ath_softc *sc, int qnum, int ath_txq_update(struct ath_softc *sc, int qnum,
struct ath9k_tx_queue_info *q); struct ath9k_tx_queue_info *q);
void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop); void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop);
void ath_assign_seq(struct ath_common *common, struct sk_buff *skb);
int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ath_tx_control *txctl); struct ath_tx_control *txctl);
void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif, void ath_tx_cabq(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
...@@ -592,6 +592,8 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw, ...@@ -592,6 +592,8 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
struct ath_vif { struct ath_vif {
struct list_head list; struct list_head list;
u16 seq_no;
/* BSS info */ /* BSS info */
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
u16 aid; u16 aid;
......
...@@ -144,16 +144,8 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw, ...@@ -144,16 +144,8 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust; mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust;
info = IEEE80211_SKB_CB(skb); info = IEEE80211_SKB_CB(skb);
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
/* ath_assign_seq(common, skb);
* TODO: make sure the seq# gets assigned properly (vs. other
* TX frames)
*/
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
sc->tx.seq_no += 0x10;
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
}
if (vif->p2p) if (vif->p2p)
ath9k_beacon_add_noa(sc, avp, skb); ath9k_beacon_add_noa(sc, avp, skb);
......
...@@ -464,6 +464,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, ...@@ -464,6 +464,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
return -ENOMEM; return -ENOMEM;
ah->dev = priv->dev; ah->dev = priv->dev;
ah->hw = priv->hw;
ah->hw_version.devid = devid; ah->hw_version.devid = devid;
ah->hw_version.usbdev = drv_info; ah->hw_version.usbdev = drv_info;
ah->ah_flags |= AH_USE_EEPROM; ah->ah_flags |= AH_USE_EEPROM;
......
...@@ -2332,7 +2332,7 @@ static void ath9k_remove_chanctx(struct ieee80211_hw *hw, ...@@ -2332,7 +2332,7 @@ static void ath9k_remove_chanctx(struct ieee80211_hw *hw,
conf->def.chan->center_freq); conf->def.chan->center_freq);
ctx->assigned = false; ctx->assigned = false;
ctx->hw_queue_base = -1; ctx->hw_queue_base = 0;
ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_UNASSIGN); ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_UNASSIGN);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
......
...@@ -54,6 +54,12 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc) ...@@ -54,6 +54,12 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr;
struct ieee80211_tx_info *tx_info; struct ieee80211_tx_info *tx_info;
struct sk_buff *skb; struct sk_buff *skb;
struct ath_vif *avp;
if (!sc->tx99_vif)
return NULL;
avp = (struct ath_vif *)sc->tx99_vif->drv_priv;
skb = alloc_skb(len, GFP_KERNEL); skb = alloc_skb(len, GFP_KERNEL);
if (!skb) if (!skb)
...@@ -71,7 +77,7 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc) ...@@ -71,7 +77,7 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN); memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN); memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no); hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
tx_info = IEEE80211_SKB_CB(skb); tx_info = IEEE80211_SKB_CB(skb);
memset(tx_info, 0, sizeof(*tx_info)); memset(tx_info, 0, sizeof(*tx_info));
......
...@@ -2139,6 +2139,28 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, ...@@ -2139,6 +2139,28 @@ static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
return bf; return bf;
} }
void ath_assign_seq(struct ath_common *common, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_vif *vif = info->control.vif;
struct ath_vif *avp;
if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
return;
if (!vif)
return;
avp = (struct ath_vif *)vif->drv_priv;
if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
avp->seq_no += 0x10;
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
}
static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb, static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ath_tx_control *txctl) struct ath_tx_control *txctl)
{ {
...@@ -2162,17 +2184,7 @@ static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -2162,17 +2184,7 @@ static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
if (info->control.hw_key) if (info->control.hw_key)
frmlen += info->control.hw_key->icv_len; frmlen += info->control.hw_key->icv_len;
/* ath_assign_seq(ath9k_hw_common(sc->sc_ah), skb);
* As a temporary workaround, assign seq# here; this will likely need
* to be cleaned up to work better with Beacon transmission and virtual
* BSSes.
*/
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
sc->tx.seq_no += 0x10;
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
}
if ((vif && vif->type != NL80211_IFTYPE_AP && if ((vif && vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_AP_VLAN) || vif->type != NL80211_IFTYPE_AP_VLAN) ||
......
...@@ -79,13 +79,13 @@ void ath_printk(const char *level, const struct ath_common* common, ...@@ -79,13 +79,13 @@ void ath_printk(const char *level, const struct ath_common* common,
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
if (common && common->hw && common->hw->wiphy) if (common && common->hw && common->hw->wiphy) {
printk("%sath: %s: %pV", printk("%sath: %s: %pV",
level, wiphy_name(common->hw->wiphy), &vaf); level, wiphy_name(common->hw->wiphy), &vaf);
else
printk("%sath: %pV", level, &vaf);
trace_ath_log(common->hw->wiphy, &vaf); trace_ath_log(common->hw->wiphy, &vaf);
} else {
printk("%sath: %pV", level, &vaf);
}
va_end(args); va_end(args);
} }
......
...@@ -742,35 +742,49 @@ static void rtl8180_int_disable(struct ieee80211_hw *dev) ...@@ -742,35 +742,49 @@ static void rtl8180_int_disable(struct ieee80211_hw *dev)
} }
static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev, static void rtl8180_conf_basic_rates(struct ieee80211_hw *dev,
u32 rates_mask) u32 basic_mask)
{ {
struct rtl8180_priv *priv = dev->priv; struct rtl8180_priv *priv = dev->priv;
u8 max, min;
u16 reg; u16 reg;
u32 resp_mask;
max = fls(rates_mask) - 1; u8 basic_max;
min = ffs(rates_mask) - 1; u8 resp_max, resp_min;
resp_mask = basic_mask;
/* IEEE80211 says the response rate should be equal to the highest basic
* rate that is not faster than received frame. But it says also that if
* the basic rate set does not contains any rate for the current
* modulation class then mandatory rate set must be used for that
* modulation class. Eventually add OFDM mandatory rates..
*/
if ((resp_mask & 0xf) == resp_mask)
resp_mask |= 0x150; /* 6, 12, 24Mbps */
switch (priv->chip_family) { switch (priv->chip_family) {
case RTL818X_CHIP_FAMILY_RTL8180: case RTL818X_CHIP_FAMILY_RTL8180:
/* in 8180 this is NOT a BITMAP */ /* in 8180 this is NOT a BITMAP */
basic_max = fls(basic_mask) - 1;
reg = rtl818x_ioread16(priv, &priv->map->BRSR); reg = rtl818x_ioread16(priv, &priv->map->BRSR);
reg &= ~3; reg &= ~3;
reg |= max; reg |= basic_max;
rtl818x_iowrite16(priv, &priv->map->BRSR, reg); rtl818x_iowrite16(priv, &priv->map->BRSR, reg);
break; break;
case RTL818X_CHIP_FAMILY_RTL8185: case RTL818X_CHIP_FAMILY_RTL8185:
resp_max = fls(resp_mask) - 1;
resp_min = ffs(resp_mask) - 1;
/* in 8185 this is a BITMAP */ /* in 8185 this is a BITMAP */
rtl818x_iowrite16(priv, &priv->map->BRSR, rates_mask); rtl818x_iowrite16(priv, &priv->map->BRSR, basic_mask);
rtl818x_iowrite8(priv, &priv->map->RESP_RATE, (max << 4) | min); rtl818x_iowrite8(priv, &priv->map->RESP_RATE, (resp_max << 4) |
resp_min);
break; break;
case RTL818X_CHIP_FAMILY_RTL8187SE: case RTL818X_CHIP_FAMILY_RTL8187SE:
/* in 8187se this is a BITMAP */ /* in 8187se this is a BITMAP. BRSR reg actually sets
rtl818x_iowrite16(priv, &priv->map->BRSR_8187SE, rates_mask); * response rates.
*/
rtl818x_iowrite16(priv, &priv->map->BRSR_8187SE, resp_mask);
break; break;
} }
} }
......
...@@ -1370,7 +1370,7 @@ struct rtl_mac { ...@@ -1370,7 +1370,7 @@ struct rtl_mac {
bool rdg_en; bool rdg_en;
/*AP*/ /*AP*/
u8 bssid[6]; u8 bssid[ETH_ALEN] __aligned(2);
u32 vendor; u32 vendor;
u8 mcs[16]; /* 16 bytes mcs for HT rates. */ u8 mcs[16]; /* 16 bytes mcs for HT rates. */
u32 basic_rates; /* b/g rates */ u32 basic_rates; /* b/g rates */
......
...@@ -329,7 +329,7 @@ static atomic_t rfkill_input_disabled = ATOMIC_INIT(0); ...@@ -329,7 +329,7 @@ static atomic_t rfkill_input_disabled = ATOMIC_INIT(0);
/** /**
* __rfkill_switch_all - Toggle state of all switches of given type * __rfkill_switch_all - Toggle state of all switches of given type
* @type: type of interfaces to be affected * @type: type of interfaces to be affected
* @state: the new state * @blocked: the new state
* *
* This function sets the state of all switches of given type, * This function sets the state of all switches of given type,
* unless a specific switch is claimed by userspace (in which case, * unless a specific switch is claimed by userspace (in which case,
...@@ -353,7 +353,7 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked) ...@@ -353,7 +353,7 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
/** /**
* rfkill_switch_all - Toggle state of all switches of given type * rfkill_switch_all - Toggle state of all switches of given type
* @type: type of interfaces to be affected * @type: type of interfaces to be affected
* @state: the new state * @blocked: the new state
* *
* Acquires rfkill_global_mutex and calls __rfkill_switch_all(@type, @state). * Acquires rfkill_global_mutex and calls __rfkill_switch_all(@type, @state).
* Please refer to __rfkill_switch_all() for details. * Please refer to __rfkill_switch_all() for details.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment