Commit a0d4a992 authored by David S. Miller's avatar David S. Miller

Merge tag 'wireless-drivers-for-davem-2016-08-29' of...

Merge tag 'wireless-drivers-for-davem-2016-08-29' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers

Kalle Valo says:

====================
wireless-drivers fixes for 4.8

ath9k

* fix regression in client mode beacon configuration
* fix a station pointer which resulted in spurious crashes

mwifiex

* fix large amsdu packets causing firmware hang

brcmfmac

* fix deadlock when removing interface
* fix use of mutex in atomic context
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents d2f394dc bb87f02b
...@@ -1154,6 +1154,7 @@ void ath9k_calculate_summary_state(struct ath_softc *sc, ...@@ -1154,6 +1154,7 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
bool changed = (iter_data.primary_sta != ctx->primary_sta); bool changed = (iter_data.primary_sta != ctx->primary_sta);
if (iter_data.primary_sta) { if (iter_data.primary_sta) {
iter_data.primary_beacon_vif = iter_data.primary_sta;
iter_data.beacons = true; iter_data.beacons = true;
ath9k_set_assoc_state(sc, iter_data.primary_sta, ath9k_set_assoc_state(sc, iter_data.primary_sta,
changed); changed);
...@@ -1563,13 +1564,13 @@ static int ath9k_sta_state(struct ieee80211_hw *hw, ...@@ -1563,13 +1564,13 @@ static int ath9k_sta_state(struct ieee80211_hw *hw,
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int ret = 0; int ret = 0;
if (old_state == IEEE80211_STA_AUTH && if (old_state == IEEE80211_STA_NOTEXIST &&
new_state == IEEE80211_STA_ASSOC) { new_state == IEEE80211_STA_NONE) {
ret = ath9k_sta_add(hw, vif, sta); ret = ath9k_sta_add(hw, vif, sta);
ath_dbg(common, CONFIG, ath_dbg(common, CONFIG,
"Add station: %pM\n", sta->addr); "Add station: %pM\n", sta->addr);
} else if (old_state == IEEE80211_STA_ASSOC && } else if (old_state == IEEE80211_STA_NONE &&
new_state == IEEE80211_STA_AUTH) { new_state == IEEE80211_STA_NOTEXIST) {
ret = ath9k_sta_remove(hw, vif, sta); ret = ath9k_sta_remove(hw, vif, sta);
ath_dbg(common, CONFIG, ath_dbg(common, CONFIG,
"Remove station: %pM\n", sta->addr); "Remove station: %pM\n", sta->addr);
......
...@@ -5635,7 +5635,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, ...@@ -5635,7 +5635,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
ifevent->action, ifevent->flags, ifevent->ifidx, ifevent->action, ifevent->flags, ifevent->ifidx,
ifevent->bsscfgidx); ifevent->bsscfgidx);
mutex_lock(&event->vif_event_lock); spin_lock(&event->vif_event_lock);
event->action = ifevent->action; event->action = ifevent->action;
vif = event->vif; vif = event->vif;
...@@ -5643,7 +5643,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, ...@@ -5643,7 +5643,7 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
case BRCMF_E_IF_ADD: case BRCMF_E_IF_ADD:
/* waiting process may have timed out */ /* waiting process may have timed out */
if (!cfg->vif_event.vif) { if (!cfg->vif_event.vif) {
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
return -EBADF; return -EBADF;
} }
...@@ -5654,24 +5654,24 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, ...@@ -5654,24 +5654,24 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp,
ifp->ndev->ieee80211_ptr = &vif->wdev; ifp->ndev->ieee80211_ptr = &vif->wdev;
SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy)); SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy));
} }
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
wake_up(&event->vif_wq); wake_up(&event->vif_wq);
return 0; return 0;
case BRCMF_E_IF_DEL: case BRCMF_E_IF_DEL:
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
/* event may not be upon user request */ /* event may not be upon user request */
if (brcmf_cfg80211_vif_event_armed(cfg)) if (brcmf_cfg80211_vif_event_armed(cfg))
wake_up(&event->vif_wq); wake_up(&event->vif_wq);
return 0; return 0;
case BRCMF_E_IF_CHANGE: case BRCMF_E_IF_CHANGE:
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
wake_up(&event->vif_wq); wake_up(&event->vif_wq);
return 0; return 0;
default: default:
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
break; break;
} }
return -EINVAL; return -EINVAL;
...@@ -5792,7 +5792,7 @@ static void wl_deinit_priv(struct brcmf_cfg80211_info *cfg) ...@@ -5792,7 +5792,7 @@ static void wl_deinit_priv(struct brcmf_cfg80211_info *cfg)
static void init_vif_event(struct brcmf_cfg80211_vif_event *event) static void init_vif_event(struct brcmf_cfg80211_vif_event *event)
{ {
init_waitqueue_head(&event->vif_wq); init_waitqueue_head(&event->vif_wq);
mutex_init(&event->vif_event_lock); spin_lock_init(&event->vif_event_lock);
} }
static s32 brcmf_dongle_roam(struct brcmf_if *ifp) static s32 brcmf_dongle_roam(struct brcmf_if *ifp)
...@@ -6691,9 +6691,9 @@ static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event, ...@@ -6691,9 +6691,9 @@ static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event,
{ {
u8 evt_action; u8 evt_action;
mutex_lock(&event->vif_event_lock); spin_lock(&event->vif_event_lock);
evt_action = event->action; evt_action = event->action;
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
return evt_action == action; return evt_action == action;
} }
...@@ -6702,10 +6702,10 @@ void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg, ...@@ -6702,10 +6702,10 @@ void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg,
{ {
struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
mutex_lock(&event->vif_event_lock); spin_lock(&event->vif_event_lock);
event->vif = vif; event->vif = vif;
event->action = 0; event->action = 0;
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
} }
bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg) bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
...@@ -6713,9 +6713,9 @@ bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg) ...@@ -6713,9 +6713,9 @@ bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg)
struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; struct brcmf_cfg80211_vif_event *event = &cfg->vif_event;
bool armed; bool armed;
mutex_lock(&event->vif_event_lock); spin_lock(&event->vif_event_lock);
armed = event->vif != NULL; armed = event->vif != NULL;
mutex_unlock(&event->vif_event_lock); spin_unlock(&event->vif_event_lock);
return armed; return armed;
} }
......
...@@ -227,7 +227,7 @@ struct escan_info { ...@@ -227,7 +227,7 @@ struct escan_info {
*/ */
struct brcmf_cfg80211_vif_event { struct brcmf_cfg80211_vif_event {
wait_queue_head_t vif_wq; wait_queue_head_t vif_wq;
struct mutex vif_event_lock; spinlock_t vif_event_lock;
u8 action; u8 action;
struct brcmf_cfg80211_vif *vif; struct brcmf_cfg80211_vif *vif;
}; };
......
...@@ -743,7 +743,7 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx, ...@@ -743,7 +743,7 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx,
* serious troublesome side effects. The p2p module will clean * serious troublesome side effects. The p2p module will clean
* up the ifp if needed. * up the ifp if needed.
*/ */
brcmf_p2p_ifp_removed(ifp); brcmf_p2p_ifp_removed(ifp, rtnl_locked);
kfree(ifp); kfree(ifp);
} }
} }
......
...@@ -2297,7 +2297,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev) ...@@ -2297,7 +2297,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
return err; return err;
} }
void brcmf_p2p_ifp_removed(struct brcmf_if *ifp) void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked)
{ {
struct brcmf_cfg80211_info *cfg; struct brcmf_cfg80211_info *cfg;
struct brcmf_cfg80211_vif *vif; struct brcmf_cfg80211_vif *vif;
...@@ -2306,8 +2306,10 @@ void brcmf_p2p_ifp_removed(struct brcmf_if *ifp) ...@@ -2306,8 +2306,10 @@ void brcmf_p2p_ifp_removed(struct brcmf_if *ifp)
vif = ifp->vif; vif = ifp->vif;
cfg = wdev_to_cfg(&vif->wdev); cfg = wdev_to_cfg(&vif->wdev);
cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
if (!rtnl_locked)
rtnl_lock(); rtnl_lock();
cfg80211_unregister_wdev(&vif->wdev); cfg80211_unregister_wdev(&vif->wdev);
if (!rtnl_locked)
rtnl_unlock(); rtnl_unlock();
brcmf_free_vif(vif); brcmf_free_vif(vif);
} }
......
...@@ -155,7 +155,7 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name, ...@@ -155,7 +155,7 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev); int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg, int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg,
enum brcmf_fil_p2p_if_types if_type); enum brcmf_fil_p2p_if_types if_type);
void brcmf_p2p_ifp_removed(struct brcmf_if *ifp); void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked);
int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev); int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev);
void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev); void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev);
int brcmf_p2p_scan_prep(struct wiphy *wiphy, int brcmf_p2p_scan_prep(struct wiphy *wiphy,
......
...@@ -205,7 +205,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, ...@@ -205,7 +205,8 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
do { do {
/* Check if AMSDU can accommodate this MSDU */ /* Check if AMSDU can accommodate this MSDU */
if (skb_tailroom(skb_aggr) < (skb_src->len + LLC_SNAP_LEN)) if ((skb_aggr->len + skb_src->len + LLC_SNAP_LEN) >
adapter->tx_buf_size)
break; break;
skb_src = skb_dequeue(&pra_list->skb_head); skb_src = skb_dequeue(&pra_list->skb_head);
......
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