44 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
47 #include <asm/unaligned.h>
62 u16 qnum = skb_get_queue_mapping(skb);
78 struct ath5k_vif *avf = (
void *)vif->drv_priv;
96 ATH5K_ERR(ah,
"Only one single ad-hoc interface is allowed.\n");
128 for (slot = 0; slot <
ATH_BCBUF; slot++) {
129 if (!ah->
bslot[slot]) {
162 struct ath5k_vif *avf = (
void *)vif->drv_priv;
172 if (ah->
bslot[
i] == vif) {
255 struct ath5k_vif *avf = (
void *)vif->drv_priv;
292 if (bss_conf->
assoc) {
294 "Bss Info ASSOC %d, bssid: %pM\n",
303 spin_lock_bh(&ah->
block);
305 spin_unlock_bh(&ah->
block);
311 if (changes & (BSS_CHANGED_BEACON | BSS_CHANGED_BEACON_ENABLED |
312 BSS_CHANGED_BEACON_INT))
333 pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
335 pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
337 mfilt[pos / 32] |= (1 << (pos % 32));
345 return ((
u64)(mfilt[1]) << 32) | mfilt[0];
368 ath5k_configure_filter(
struct ieee80211_hw *hw,
unsigned int changed_flags,
369 unsigned int *new_flags,
u64 multicast)
371 #define SUPPORTED_FIF_FLAGS \
372 (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL | \
373 FIF_PLCPFAIL | FIF_CONTROL | FIF_OTHER_BSS | \
374 FIF_BCN_PRBRESP_PROMISC)
382 mfilt[0] = multicast;
383 mfilt[1] = multicast >> 32;
452 iter_data.hw_macaddr =
NULL;
453 iter_data.n_stas = 0;
454 iter_data.need_set_hw_addr =
false;
459 if (iter_data.n_stas > 1) {
597 qi.tqi_aifs = params->
aifs;
598 qi.tqi_cw_min = params->
cw_min;
599 qi.tqi_cw_max = params->
cw_max;
600 qi.tqi_burst_time = params->
txop * 32;
603 "Configure tx [queue %d], "
604 "aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n",
610 "Unable to update hardware queue %u!\n", queue);
660 struct ath_common *common = ath5k_hw_common(ah);
667 spin_lock_bh(&common->
cc_lock);
675 memset(cc, 0,
sizeof(*cc));
676 spin_unlock_bh(&common->
cc_lock);
718 if (tx_ant == 1 && rx_ant == 1)
720 else if (tx_ant == 2 && rx_ant == 2)
722 else if ((tx_ant & 3) == 3 && (rx_ant & 3) == 3)
737 *tx_ant = 1; *rx_ant = 1;
break;
739 *tx_ant = 2; *rx_ant = 2;
break;
741 *tx_ant = 3; *rx_ant = 3;
break;
747 static void ath5k_get_ringparam(
struct ieee80211_hw *hw,
773 if (!ah->
txqs[qnum].setup)
779 ah->
txqs[qnum].txq_max =
tx;
780 if (ah->
txqs[qnum].txq_len >= ah->
txqs[qnum].txq_max)
792 .add_interface = ath5k_add_interface,
794 .remove_interface = ath5k_remove_interface,
795 .config = ath5k_config,
796 .bss_info_changed = ath5k_bss_info_changed,
797 .prepare_multicast = ath5k_prepare_multicast,
798 .configure_filter = ath5k_configure_filter,
800 .set_key = ath5k_set_key,
803 .sw_scan_start = ath5k_sw_scan_start,
804 .sw_scan_complete = ath5k_sw_scan_complete,
805 .get_stats = ath5k_get_stats,
812 .conf_tx = ath5k_conf_tx,
813 .get_tsf = ath5k_get_tsf,
814 .set_tsf = ath5k_set_tsf,
815 .reset_tsf = ath5k_reset_tsf,
818 .get_survey = ath5k_get_survey,
819 .set_coverage_class = ath5k_set_coverage_class,
824 .set_antenna = ath5k_set_antenna,
825 .get_antenna = ath5k_get_antenna,
826 .set_ringparam = ath5k_set_ringparam,
827 .get_ringparam = ath5k_get_ringparam,