Lines Matching refs:ah

61 	struct ath5k_hw *ah = hw->priv;  in ath5k_tx()  local
64 if (WARN_ON(qnum >= ah->ah_capabilities.cap_queues.q_tx_num)) { in ath5k_tx()
69 ath5k_tx_queue(hw, skb, &ah->txqs[qnum], control); in ath5k_tx()
76 struct ath5k_hw *ah = hw->priv; in ath5k_add_interface() local
80 mutex_lock(&ah->lock); in ath5k_add_interface()
84 && (ah->num_ap_vifs + ah->num_adhoc_vifs) >= ATH_BCBUF) { in ath5k_add_interface()
94 if (ah->num_adhoc_vifs || in ath5k_add_interface()
95 (ah->nvifs && vif->type == NL80211_IFTYPE_ADHOC)) { in ath5k_add_interface()
96 ATH5K_ERR(ah, "Only one single ad-hoc interface is allowed.\n"); in ath5k_add_interface()
113 ah->nvifs++; in ath5k_add_interface()
114 ATH5K_DBG(ah, ATH5K_DEBUG_MODE, "add interface mode %d\n", avf->opmode); in ath5k_add_interface()
122 WARN_ON(list_empty(&ah->bcbuf)); in ath5k_add_interface()
123 avf->bbuf = list_first_entry(&ah->bcbuf, struct ath5k_buf, in ath5k_add_interface()
129 if (!ah->bslot[slot]) { in ath5k_add_interface()
134 BUG_ON(ah->bslot[avf->bslot] != NULL); in ath5k_add_interface()
135 ah->bslot[avf->bslot] = vif; in ath5k_add_interface()
137 ah->num_ap_vifs++; in ath5k_add_interface()
139 ah->num_adhoc_vifs++; in ath5k_add_interface()
141 ah->num_mesh_vifs++; in ath5k_add_interface()
147 ath5k_hw_set_lladdr(ah, vif->addr); in ath5k_add_interface()
149 ath5k_update_bssid_mask_and_opmode(ah, vif); in ath5k_add_interface()
152 mutex_unlock(&ah->lock); in ath5k_add_interface()
161 struct ath5k_hw *ah = hw->priv; in ath5k_remove_interface() local
165 mutex_lock(&ah->lock); in ath5k_remove_interface()
166 ah->nvifs--; in ath5k_remove_interface()
169 ath5k_txbuf_free_skb(ah, avf->bbuf); in ath5k_remove_interface()
170 list_add_tail(&avf->bbuf->list, &ah->bcbuf); in ath5k_remove_interface()
172 if (ah->bslot[i] == vif) { in ath5k_remove_interface()
173 ah->bslot[i] = NULL; in ath5k_remove_interface()
180 ah->num_ap_vifs--; in ath5k_remove_interface()
182 ah->num_adhoc_vifs--; in ath5k_remove_interface()
184 ah->num_mesh_vifs--; in ath5k_remove_interface()
186 ath5k_update_bssid_mask_and_opmode(ah, NULL); in ath5k_remove_interface()
187 mutex_unlock(&ah->lock); in ath5k_remove_interface()
197 struct ath5k_hw *ah = hw->priv; in ath5k_config() local
202 mutex_lock(&ah->lock); in ath5k_config()
205 ret = ath5k_chan_set(ah, &conf->chandef); in ath5k_config()
211 (ah->ah_txpower.txp_requested != conf->power_level)) { in ath5k_config()
212 ah->ah_txpower.txp_requested = conf->power_level; in ath5k_config()
215 ath5k_hw_set_txpower_limit(ah, (conf->power_level * 2)); in ath5k_config()
219 ah->ah_retry_long = conf->long_frame_max_tx_count; in ath5k_config()
220 ah->ah_retry_short = conf->short_frame_max_tx_count; in ath5k_config()
222 for (i = 0; i < ah->ah_capabilities.cap_queues.q_tx_num; i++) in ath5k_config()
223 ath5k_hw_set_tx_retry_limits(ah, i); in ath5k_config()
243 ath5k_hw_set_antenna_mode(ah, ah->ah_ant_mode); in ath5k_config()
246 mutex_unlock(&ah->lock); in ath5k_config()
256 struct ath5k_hw *ah = hw->priv; in ath5k_bss_info_changed() local
257 struct ath_common *common = ath5k_hw_common(ah); in ath5k_bss_info_changed()
259 mutex_lock(&ah->lock); in ath5k_bss_info_changed()
265 ath5k_hw_set_bssid(ah); in ath5k_bss_info_changed()
269 ah->bintval = bss_conf->beacon_int; in ath5k_bss_info_changed()
274 ah->ah_short_slot = bss_conf->use_short_slot; in ath5k_bss_info_changed()
275 slot_time = ath5k_hw_get_default_slottime(ah) + in ath5k_bss_info_changed()
276 3 * ah->ah_coverage_class; in ath5k_bss_info_changed()
277 ath5k_hw_set_ifs_intervals(ah, slot_time); in ath5k_bss_info_changed()
283 ah->assoc = bss_conf->assoc; in ath5k_bss_info_changed()
285 ah->assoc = ath5k_any_vif_assoc(ah); in ath5k_bss_info_changed()
287 if (ah->opmode == NL80211_IFTYPE_STATION) in ath5k_bss_info_changed()
288 ath5k_set_beacon_filter(hw, ah->assoc); in ath5k_bss_info_changed()
289 ath5k_hw_set_ledstate(ah, ah->assoc ? in ath5k_bss_info_changed()
292 ATH5K_DBG(ah, ATH5K_DEBUG_ANY, in ath5k_bss_info_changed()
296 ath5k_hw_set_bssid(ah); in ath5k_bss_info_changed()
302 spin_lock_bh(&ah->block); in ath5k_bss_info_changed()
304 spin_unlock_bh(&ah->block); in ath5k_bss_info_changed()
308 ah->enable_beacon = bss_conf->enable_beacon; in ath5k_bss_info_changed()
312 ath5k_beacon_config(ah); in ath5k_bss_info_changed()
314 mutex_unlock(&ah->lock); in ath5k_bss_info_changed()
375 struct ath5k_hw *ah = hw->priv; in ath5k_configure_filter() local
379 mutex_lock(&ah->lock); in ath5k_configure_filter()
391 rfilt = (ath5k_hw_get_rx_filter(ah) & (AR5K_RX_FILTER_PHYERR)) | in ath5k_configure_filter()
407 if ((*new_flags & FIF_BCN_PRBRESP_PROMISC) || (ah->nvifs > 1)) in ath5k_configure_filter()
421 switch (ah->opmode) { in ath5k_configure_filter()
434 if (ah->assoc) in ath5k_configure_filter()
445 ah->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in ath5k_configure_filter()
458 ath5k_hw_set_rx_filter(ah, rfilt); in ath5k_configure_filter()
461 ath5k_hw_set_mcast_filter(ah, mfilt[0], mfilt[1]); in ath5k_configure_filter()
464 ah->filter_flags = rfilt; in ath5k_configure_filter()
466 ah->fif_filter_flags = *new_flags; in ath5k_configure_filter()
468 mutex_unlock(&ah->lock); in ath5k_configure_filter()
477 struct ath5k_hw *ah = hw->priv; in ath5k_set_key() local
478 struct ath_common *common = ath5k_hw_common(ah); in ath5k_set_key()
508 mutex_lock(&ah->lock); in ath5k_set_key()
531 mutex_unlock(&ah->lock); in ath5k_set_key()
541 struct ath5k_hw *ah = hw->priv; in ath5k_sw_scan_start() local
542 if (!ah->assoc) in ath5k_sw_scan_start()
543 ath5k_hw_set_ledstate(ah, AR5K_LED_SCAN); in ath5k_sw_scan_start()
550 struct ath5k_hw *ah = hw->priv; in ath5k_sw_scan_complete() local
551 ath5k_hw_set_ledstate(ah, ah->assoc ? in ath5k_sw_scan_complete()
560 struct ath5k_hw *ah = hw->priv; in ath5k_get_stats() local
563 ath5k_hw_update_mib_counters(ah); in ath5k_get_stats()
565 stats->dot11ACKFailureCount = ah->stats.ack_fail; in ath5k_get_stats()
566 stats->dot11RTSFailureCount = ah->stats.rts_fail; in ath5k_get_stats()
567 stats->dot11RTSSuccessCount = ah->stats.rts_ok; in ath5k_get_stats()
568 stats->dot11FCSErrorCount = ah->stats.fcs_error; in ath5k_get_stats()
578 struct ath5k_hw *ah = hw->priv; in ath5k_conf_tx() local
582 if (queue >= ah->ah_capabilities.cap_queues.q_tx_num) in ath5k_conf_tx()
585 mutex_lock(&ah->lock); in ath5k_conf_tx()
587 ath5k_hw_get_tx_queueprops(ah, queue, &qi); in ath5k_conf_tx()
594 ATH5K_DBG(ah, ATH5K_DEBUG_ANY, in ath5k_conf_tx()
600 if (ath5k_hw_set_tx_queueprops(ah, queue, &qi)) { in ath5k_conf_tx()
601 ATH5K_ERR(ah, in ath5k_conf_tx()
605 ath5k_hw_reset_tx_queue(ah, queue); in ath5k_conf_tx()
607 mutex_unlock(&ah->lock); in ath5k_conf_tx()
616 struct ath5k_hw *ah = hw->priv; in ath5k_get_tsf() local
618 return ath5k_hw_get_tsf64(ah); in ath5k_get_tsf()
625 struct ath5k_hw *ah = hw->priv; in ath5k_set_tsf() local
627 ath5k_hw_set_tsf64(ah, tsf); in ath5k_set_tsf()
634 struct ath5k_hw *ah = hw->priv; in ath5k_reset_tsf() local
640 if (ah->opmode == NL80211_IFTYPE_ADHOC) in ath5k_reset_tsf()
641 ath5k_beacon_update_timers(ah, 0); in ath5k_reset_tsf()
643 ath5k_hw_reset_tsf(ah); in ath5k_reset_tsf()
650 struct ath5k_hw *ah = hw->priv; in ath5k_get_survey() local
652 struct ath_common *common = ath5k_hw_common(ah); in ath5k_get_survey()
662 ah->survey.time += cc->cycles / div; in ath5k_get_survey()
663 ah->survey.time_busy += cc->rx_busy / div; in ath5k_get_survey()
664 ah->survey.time_rx += cc->rx_frame / div; in ath5k_get_survey()
665 ah->survey.time_tx += cc->tx_frame / div; in ath5k_get_survey()
670 memcpy(survey, &ah->survey, sizeof(*survey)); in ath5k_get_survey()
673 survey->noise = ah->ah_noise_floor; in ath5k_get_survey()
698 struct ath5k_hw *ah = hw->priv; in ath5k_set_coverage_class() local
700 mutex_lock(&ah->lock); in ath5k_set_coverage_class()
701 ath5k_hw_set_coverage_class(ah, coverage_class); in ath5k_set_coverage_class()
702 mutex_unlock(&ah->lock); in ath5k_set_coverage_class()
709 struct ath5k_hw *ah = hw->priv; in ath5k_set_antenna() local
712 ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_A); in ath5k_set_antenna()
714 ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_FIXED_B); in ath5k_set_antenna()
716 ath5k_hw_set_antenna_mode(ah, AR5K_ANTMODE_DEFAULT); in ath5k_set_antenna()
726 struct ath5k_hw *ah = hw->priv; in ath5k_get_antenna() local
728 switch (ah->ah_ant_mode) { in ath5k_get_antenna()
743 struct ath5k_hw *ah = hw->priv; in ath5k_get_ringparam() local
745 *tx = ah->txqs[AR5K_TX_QUEUE_ID_DATA_MIN].txq_max; in ath5k_get_ringparam()
754 struct ath5k_hw *ah = hw->priv; in ath5k_set_ringparam() local
765 for (qnum = 0; qnum < ARRAY_SIZE(ah->txqs); qnum++) { in ath5k_set_ringparam()
766 if (!ah->txqs[qnum].setup) in ath5k_set_ringparam()
768 if (ah->txqs[qnum].qnum < AR5K_TX_QUEUE_ID_DATA_MIN || in ath5k_set_ringparam()
769 ah->txqs[qnum].qnum > AR5K_TX_QUEUE_ID_DATA_MAX) in ath5k_set_ringparam()
772 ah->txqs[qnum].txq_max = tx; in ath5k_set_ringparam()
773 if (ah->txqs[qnum].txq_len >= ah->txqs[qnum].txq_max) in ath5k_set_ringparam()
774 ieee80211_stop_queue(hw, ah->txqs[qnum].qnum); in ath5k_set_ringparam()