26 #include <linux/kernel.h>
27 #include <linux/module.h>
32 static int rt2x00mac_tx_rts_cts(
struct rt2x00_dev *rt2x00dev,
47 skb = dev_alloc_skb(data_length + rt2x00dev->
hw->extra_tx_headroom);
49 WARNING(rt2x00dev,
"Failed to create RTS/CTS frame.\n");
53 skb_reserve(skb, rt2x00dev->
hw->extra_tx_headroom);
65 memcpy(skb->cb, frag_skb->cb,
sizeof(skb->cb));
66 rts_info = IEEE80211_SKB_CB(skb);
86 frag_skb->
data, data_length, tx_info,
90 frag_skb->
data, data_length, tx_info,
96 WARNING(rt2x00dev,
"Failed to send RTS/CTS frame.\n");
127 queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
130 "Attempt to send packet over invalid queue %d.\n"
131 "Please file bug report to %s.\n", qid,
DRV_PROJECT);
144 if (!rt2x00dev->
ops->hw->set_rts_threshold &&
147 if (rt2x00queue_available(queue) <= 1)
150 if (rt2x00mac_tx_rts_cts(rt2x00dev, queue, skb))
163 if (rt2x00queue_threshold(queue))
223 for (i = 0; i < queue->
limit; i++) {
348 unsigned int changed_flags,
349 unsigned int *total_flags,
401 rt2x00dev->
ops->lib->config_filter(rt2x00dev, *total_flags);
405 static void rt2x00mac_set_tim_iter(
void *
data,
u8 *
mac,
428 rt2x00mac_set_tim_iter,
437 #ifdef CONFIG_RT2X00_LIB_CRYPTO
443 sizeof(crypto->
key));
466 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, };
486 memset(&crypto, 0,
sizeof(crypto));
497 sta_priv = sta_to_rt2x00_sta(sta);
503 memcpy_tkip(&crypto, &key->
key[0], key->
keylen);
526 set_key = rt2x00dev->
ops->lib->config_pairwise_key;
528 set_key = rt2x00dev->
ops->lib->config_shared_key;
533 return set_key(rt2x00dev, &crypto, key);
542 struct rt2x00_sta *sta_priv = sta_to_rt2x00_sta(sta);
548 if (rt2x00dev->
ops->lib->sta_add(rt2x00dev, vif, sta))
559 struct rt2x00_sta *sta_priv = sta_to_rt2x00_sta(sta);
564 if (sta_priv->
wcid < 0)
567 return rt2x00dev->
ops->lib->sta_remove(rt2x00dev, sta_priv->
wcid);
675 rt2x00dev->
link.count = 0;
713 queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx);
735 "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d, TXop: %d.\n",
745 bool active = !!rt2x00dev->
ops->lib->rfkill_poll(rt2x00dev);
770 if (!tx_ant || (tx_ant & ~3) || !rx_ant || (rx_ant & ~3))
815 *tx_ant = active->
tx;
820 *rx_ant = active->
rx;
834 *tx_max += queue->
limit;
837 *rx = rt2x00dev->
rx->length;
838 *rx_max = rt2x00dev->
rx->limit;
848 if (!rt2x00queue_empty(queue))