aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-05-18 05:56:04 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-04 15:32:18 -0400
commitabd984e6117e72e17073fd0a81a477e43b4580f5 (patch)
tree4e68e724b48e4ef7ab1b6c20262d7a92359f3b0c
parent9d1ac34ec3a67713308ae0883c3359c557f14d17 (diff)
ath9k_htc: Use proper station add/remove callbacks
sta_add/sta_remove are the callbacks that can sleep. Use them instead of sta_notify. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index e776dee6f07..569b9c0fee3 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1516,32 +1516,38 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
1516 mutex_unlock(&priv->mutex); 1516 mutex_unlock(&priv->mutex);
1517} 1517}
1518 1518
1519static void ath9k_htc_sta_notify(struct ieee80211_hw *hw, 1519static int ath9k_htc_sta_add(struct ieee80211_hw *hw,
1520 struct ieee80211_vif *vif, 1520 struct ieee80211_vif *vif,
1521 enum sta_notify_cmd cmd, 1521 struct ieee80211_sta *sta)
1522 struct ieee80211_sta *sta)
1523{ 1522{
1524 struct ath9k_htc_priv *priv = hw->priv; 1523 struct ath9k_htc_priv *priv = hw->priv;
1525 int ret; 1524 int ret;
1526 1525
1527 mutex_lock(&priv->mutex); 1526 mutex_lock(&priv->mutex);
1528 ath9k_htc_ps_wakeup(priv); 1527 ath9k_htc_ps_wakeup(priv);
1528 ret = ath9k_htc_add_station(priv, vif, sta);
1529 if (!ret)
1530 ath9k_htc_init_rate(priv, sta);
1531 ath9k_htc_ps_restore(priv);
1532 mutex_unlock(&priv->mutex);
1529 1533
1530 switch (cmd) { 1534 return ret;
1531 case STA_NOTIFY_ADD: 1535}
1532 ret = ath9k_htc_add_station(priv, vif, sta); 1536
1533 if (!ret) 1537static int ath9k_htc_sta_remove(struct ieee80211_hw *hw,
1534 ath9k_htc_init_rate(priv, sta); 1538 struct ieee80211_vif *vif,
1535 break; 1539 struct ieee80211_sta *sta)
1536 case STA_NOTIFY_REMOVE: 1540{
1537 ath9k_htc_remove_station(priv, vif, sta); 1541 struct ath9k_htc_priv *priv = hw->priv;
1538 break; 1542 int ret;
1539 default:
1540 break;
1541 }
1542 1543
1544 mutex_lock(&priv->mutex);
1545 ath9k_htc_ps_wakeup(priv);
1546 ret = ath9k_htc_remove_station(priv, vif, sta);
1543 ath9k_htc_ps_restore(priv); 1547 ath9k_htc_ps_restore(priv);
1544 mutex_unlock(&priv->mutex); 1548 mutex_unlock(&priv->mutex);
1549
1550 return ret;
1545} 1551}
1546 1552
1547static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue, 1553static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
@@ -1849,7 +1855,8 @@ struct ieee80211_ops ath9k_htc_ops = {
1849 .remove_interface = ath9k_htc_remove_interface, 1855 .remove_interface = ath9k_htc_remove_interface,
1850 .config = ath9k_htc_config, 1856 .config = ath9k_htc_config,
1851 .configure_filter = ath9k_htc_configure_filter, 1857 .configure_filter = ath9k_htc_configure_filter,
1852 .sta_notify = ath9k_htc_sta_notify, 1858 .sta_add = ath9k_htc_sta_add,
1859 .sta_remove = ath9k_htc_sta_remove,
1853 .conf_tx = ath9k_htc_conf_tx, 1860 .conf_tx = ath9k_htc_conf_tx,
1854 .bss_info_changed = ath9k_htc_bss_info_changed, 1861 .bss_info_changed = ath9k_htc_bss_info_changed,
1855 .set_key = ath9k_htc_set_key, 1862 .set_key = ath9k_htc_set_key,