diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 8db75f6de53e..13d4e6756c99 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2008 Atheros Communications Inc. | 2 | * Copyright (c) 2008-2009 Atheros Communications Inc. |
3 | * | 3 | * |
4 | * Permission to use, copy, modify, and/or distribute this software for any | 4 | * Permission to use, copy, modify, and/or distribute this software for any |
5 | * purpose with or without fee is hereby granted, provided that the above | 5 | * purpose with or without fee is hereby granted, provided that the above |
@@ -940,18 +940,25 @@ static void ath_led_blink_work(struct work_struct *work) | |||
940 | 940 | ||
941 | if (!(sc->sc_flags & SC_OP_LED_ASSOCIATED)) | 941 | if (!(sc->sc_flags & SC_OP_LED_ASSOCIATED)) |
942 | return; | 942 | return; |
943 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, | 943 | |
944 | (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0); | 944 | if ((sc->led_on_duration == ATH_LED_ON_DURATION_IDLE) || |
945 | (sc->led_off_duration == ATH_LED_OFF_DURATION_IDLE)) | ||
946 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0); | ||
947 | else | ||
948 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, | ||
949 | (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0); | ||
945 | 950 | ||
946 | queue_delayed_work(sc->hw->workqueue, &sc->ath_led_blink_work, | 951 | queue_delayed_work(sc->hw->workqueue, &sc->ath_led_blink_work, |
947 | (sc->sc_flags & SC_OP_LED_ON) ? | 952 | (sc->sc_flags & SC_OP_LED_ON) ? |
948 | msecs_to_jiffies(sc->led_off_duration) : | 953 | msecs_to_jiffies(sc->led_off_duration) : |
949 | msecs_to_jiffies(sc->led_on_duration)); | 954 | msecs_to_jiffies(sc->led_on_duration)); |
950 | 955 | ||
951 | sc->led_on_duration = | 956 | sc->led_on_duration = sc->led_on_cnt ? |
952 | max((ATH_LED_ON_DURATION_IDLE - sc->led_on_cnt), 25); | 957 | max((ATH_LED_ON_DURATION_IDLE - sc->led_on_cnt), 25) : |
953 | sc->led_off_duration = | 958 | ATH_LED_ON_DURATION_IDLE; |
954 | max((ATH_LED_OFF_DURATION_IDLE - sc->led_off_cnt), 10); | 959 | sc->led_off_duration = sc->led_off_cnt ? |
960 | max((ATH_LED_OFF_DURATION_IDLE - sc->led_off_cnt), 10) : | ||
961 | ATH_LED_OFF_DURATION_IDLE; | ||
955 | sc->led_on_cnt = sc->led_off_cnt = 0; | 962 | sc->led_on_cnt = sc->led_off_cnt = 0; |
956 | if (sc->sc_flags & SC_OP_LED_ON) | 963 | if (sc->sc_flags & SC_OP_LED_ON) |
957 | sc->sc_flags &= ~SC_OP_LED_ON; | 964 | sc->sc_flags &= ~SC_OP_LED_ON; |
@@ -1592,7 +1599,8 @@ void ath_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
1592 | hw->wiphy->interface_modes = | 1599 | hw->wiphy->interface_modes = |
1593 | BIT(NL80211_IFTYPE_AP) | | 1600 | BIT(NL80211_IFTYPE_AP) | |
1594 | BIT(NL80211_IFTYPE_STATION) | | 1601 | BIT(NL80211_IFTYPE_STATION) | |
1595 | BIT(NL80211_IFTYPE_ADHOC); | 1602 | BIT(NL80211_IFTYPE_ADHOC) | |
1603 | BIT(NL80211_IFTYPE_MESH_POINT); | ||
1596 | 1604 | ||
1597 | hw->wiphy->reg_notifier = ath9k_reg_notifier; | 1605 | hw->wiphy->reg_notifier = ath9k_reg_notifier; |
1598 | hw->wiphy->strict_regulatory = true; | 1606 | hw->wiphy->strict_regulatory = true; |
@@ -2200,18 +2208,13 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2200 | ic_opmode = NL80211_IFTYPE_STATION; | 2208 | ic_opmode = NL80211_IFTYPE_STATION; |
2201 | break; | 2209 | break; |
2202 | case NL80211_IFTYPE_ADHOC: | 2210 | case NL80211_IFTYPE_ADHOC: |
2203 | if (sc->nbcnvifs >= ATH_BCBUF) { | ||
2204 | ret = -ENOBUFS; | ||
2205 | goto out; | ||
2206 | } | ||
2207 | ic_opmode = NL80211_IFTYPE_ADHOC; | ||
2208 | break; | ||
2209 | case NL80211_IFTYPE_AP: | 2211 | case NL80211_IFTYPE_AP: |
2212 | case NL80211_IFTYPE_MESH_POINT: | ||
2210 | if (sc->nbcnvifs >= ATH_BCBUF) { | 2213 | if (sc->nbcnvifs >= ATH_BCBUF) { |
2211 | ret = -ENOBUFS; | 2214 | ret = -ENOBUFS; |
2212 | goto out; | 2215 | goto out; |
2213 | } | 2216 | } |
2214 | ic_opmode = NL80211_IFTYPE_AP; | 2217 | ic_opmode = conf->type; |
2215 | break; | 2218 | break; |
2216 | default: | 2219 | default: |
2217 | DPRINTF(sc, ATH_DBG_FATAL, | 2220 | DPRINTF(sc, ATH_DBG_FATAL, |
@@ -2247,7 +2250,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw, | |||
2247 | * Note we only do this (at the moment) for station mode. | 2250 | * Note we only do this (at the moment) for station mode. |
2248 | */ | 2251 | */ |
2249 | if ((conf->type == NL80211_IFTYPE_STATION) || | 2252 | if ((conf->type == NL80211_IFTYPE_STATION) || |
2250 | (conf->type == NL80211_IFTYPE_ADHOC)) { | 2253 | (conf->type == NL80211_IFTYPE_ADHOC) || |
2254 | (conf->type == NL80211_IFTYPE_MESH_POINT)) { | ||
2251 | if (ath9k_hw_phycounters(sc->sc_ah)) | 2255 | if (ath9k_hw_phycounters(sc->sc_ah)) |
2252 | sc->imask |= ATH9K_INT_MIB; | 2256 | sc->imask |= ATH9K_INT_MIB; |
2253 | sc->imask |= ATH9K_INT_TSFOOR; | 2257 | sc->imask |= ATH9K_INT_TSFOOR; |
@@ -2294,8 +2298,9 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
2294 | del_timer_sync(&sc->ani.timer); | 2298 | del_timer_sync(&sc->ani.timer); |
2295 | 2299 | ||
2296 | /* Reclaim beacon resources */ | 2300 | /* Reclaim beacon resources */ |
2297 | if (sc->sc_ah->opmode == NL80211_IFTYPE_AP || | 2301 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || |
2298 | sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) { | 2302 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || |
2303 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { | ||
2299 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 2304 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
2300 | ath_beacon_return(sc, avp); | 2305 | ath_beacon_return(sc, avp); |
2301 | } | 2306 | } |
@@ -2428,6 +2433,7 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2428 | switch (vif->type) { | 2433 | switch (vif->type) { |
2429 | case NL80211_IFTYPE_STATION: | 2434 | case NL80211_IFTYPE_STATION: |
2430 | case NL80211_IFTYPE_ADHOC: | 2435 | case NL80211_IFTYPE_ADHOC: |
2436 | case NL80211_IFTYPE_MESH_POINT: | ||
2431 | /* Set BSSID */ | 2437 | /* Set BSSID */ |
2432 | memcpy(sc->curbssid, conf->bssid, ETH_ALEN); | 2438 | memcpy(sc->curbssid, conf->bssid, ETH_ALEN); |
2433 | memcpy(avp->bssid, conf->bssid, ETH_ALEN); | 2439 | memcpy(avp->bssid, conf->bssid, ETH_ALEN); |
@@ -2451,7 +2457,8 @@ static int ath9k_config_interface(struct ieee80211_hw *hw, | |||
2451 | } | 2457 | } |
2452 | 2458 | ||
2453 | if ((vif->type == NL80211_IFTYPE_ADHOC) || | 2459 | if ((vif->type == NL80211_IFTYPE_ADHOC) || |
2454 | (vif->type == NL80211_IFTYPE_AP)) { | 2460 | (vif->type == NL80211_IFTYPE_AP) || |
2461 | (vif->type == NL80211_IFTYPE_MESH_POINT)) { | ||
2455 | if ((conf->changed & IEEE80211_IFCC_BEACON) || | 2462 | if ((conf->changed & IEEE80211_IFCC_BEACON) || |
2456 | (conf->changed & IEEE80211_IFCC_BEACON_ENABLED && | 2463 | (conf->changed & IEEE80211_IFCC_BEACON_ENABLED && |
2457 | conf->enable_beacon)) { | 2464 | conf->enable_beacon)) { |
@@ -2723,7 +2730,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, | |||
2723 | 2730 | ||
2724 | ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid); | 2731 | ieee80211_stop_tx_ba_cb_irqsafe(hw, sta->addr, tid); |
2725 | break; | 2732 | break; |
2726 | case IEEE80211_AMPDU_TX_RESUME: | 2733 | case IEEE80211_AMPDU_TX_OPERATIONAL: |
2727 | ath_tx_aggr_resume(sc, sta, tid); | 2734 | ath_tx_aggr_resume(sc, sta, tid); |
2728 | break; | 2735 | break; |
2729 | default: | 2736 | default: |