2 * Copyright (c) 2010 Atheros Communications Inc.
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
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #define ATH9K_HTC_INIT_TXQ(subtype) do { \
24 qi.tqi_subtype = subtype; \
25 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT; \
26 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT; \
27 qi.tqi_cwmax = ATH9K_TXQ_USEDEFAULT; \
28 qi.tqi_physCompBuf = 0; \
29 qi.tqi_qflags = TXQ_FLAG_TXEOLINT_ENABLE | \
30 TXQ_FLAG_TXDESCINT_ENABLE; \
33 int get_hw_qnum(u16 queue, int *hwq_map)
37 return hwq_map[ATH9K_WME_AC_VO];
39 return hwq_map[ATH9K_WME_AC_VI];
41 return hwq_map[ATH9K_WME_AC_BE];
43 return hwq_map[ATH9K_WME_AC_BK];
45 return hwq_map[ATH9K_WME_AC_BE];
49 int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
50 struct ath9k_tx_queue_info *qinfo)
52 struct ath_hw *ah = priv->ah;
54 struct ath9k_tx_queue_info qi;
56 ath9k_hw_get_txq_props(ah, qnum, &qi);
58 qi.tqi_aifs = qinfo->tqi_aifs;
59 qi.tqi_cwmin = qinfo->tqi_cwmin / 2; /* XXX */
60 qi.tqi_cwmax = qinfo->tqi_cwmax;
61 qi.tqi_burstTime = qinfo->tqi_burstTime;
62 qi.tqi_readyTime = qinfo->tqi_readyTime;
64 if (!ath9k_hw_set_txq_props(ah, qnum, &qi)) {
65 ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
66 "Unable to update hardware queue %u!\n", qnum);
69 ath9k_hw_resettxqueue(ah, qnum);
75 int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, struct sk_buff *skb)
77 struct ieee80211_hdr *hdr;
78 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
79 struct ieee80211_sta *sta = tx_info->control.sta;
80 struct ath9k_htc_sta *ista;
81 struct ath9k_htc_vif *avp;
82 struct ath9k_htc_tx_ctl tx_ctl;
83 enum htc_endpoint_id epid;
89 hdr = (struct ieee80211_hdr *) skb->data;
90 fc = hdr->frame_control;
92 avp = (struct ath9k_htc_vif *) tx_info->control.vif->drv_priv;
94 ista = (struct ath9k_htc_sta *) sta->drv_priv;
95 sta_idx = ista->index;
100 memset(&tx_ctl, 0, sizeof(struct ath9k_htc_tx_ctl));
102 if (ieee80211_is_data(fc)) {
103 struct tx_frame_hdr tx_hdr;
106 memset(&tx_hdr, 0, sizeof(struct tx_frame_hdr));
108 tx_hdr.node_idx = sta_idx;
109 tx_hdr.vif_idx = avp->index;
111 if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
112 tx_ctl.type = ATH9K_HTC_AMPDU;
113 tx_hdr.data_type = ATH9K_HTC_AMPDU;
115 tx_ctl.type = ATH9K_HTC_NORMAL;
116 tx_hdr.data_type = ATH9K_HTC_NORMAL;
119 if (ieee80211_is_data(fc)) {
120 qc = ieee80211_get_qos_ctl(hdr);
121 tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
124 /* Check for RTS protection */
125 if (priv->hw->wiphy->rts_threshold != (u32) -1)
126 if (skb->len > priv->hw->wiphy->rts_threshold)
127 tx_hdr.flags |= ATH9K_HTC_TX_RTSCTS;
130 if (!(tx_hdr.flags & ATH9K_HTC_TX_RTSCTS) &&
131 (priv->op_flags & OP_PROTECT_ENABLE))
132 tx_hdr.flags |= ATH9K_HTC_TX_CTSONLY;
134 tx_hdr.key_type = ath9k_cmn_get_hw_crypto_keytype(skb);
135 if (tx_hdr.key_type == ATH9K_KEY_TYPE_CLEAR)
136 tx_hdr.keyix = (u8) ATH9K_TXKEYIX_INVALID;
138 tx_hdr.keyix = tx_info->control.hw_key->hw_key_idx;
140 tx_fhdr = skb_push(skb, sizeof(tx_hdr));
141 memcpy(tx_fhdr, (u8 *) &tx_hdr, sizeof(tx_hdr));
143 qnum = skb_get_queue_mapping(skb);
147 TX_QSTAT_INC(WME_AC_VO);
148 epid = priv->data_vo_ep;
151 TX_QSTAT_INC(WME_AC_VI);
152 epid = priv->data_vi_ep;
155 TX_QSTAT_INC(WME_AC_BE);
156 epid = priv->data_be_ep;
160 TX_QSTAT_INC(WME_AC_BK);
161 epid = priv->data_bk_ep;
165 struct tx_mgmt_hdr mgmt_hdr;
167 memset(&mgmt_hdr, 0, sizeof(struct tx_mgmt_hdr));
169 tx_ctl.type = ATH9K_HTC_NORMAL;
171 mgmt_hdr.node_idx = sta_idx;
172 mgmt_hdr.vif_idx = avp->index;
176 mgmt_hdr.key_type = ath9k_cmn_get_hw_crypto_keytype(skb);
177 if (mgmt_hdr.key_type == ATH9K_KEY_TYPE_CLEAR)
178 mgmt_hdr.keyix = (u8) ATH9K_TXKEYIX_INVALID;
180 mgmt_hdr.keyix = tx_info->control.hw_key->hw_key_idx;
182 tx_fhdr = skb_push(skb, sizeof(mgmt_hdr));
183 memcpy(tx_fhdr, (u8 *) &mgmt_hdr, sizeof(mgmt_hdr));
184 epid = priv->mgmt_ep;
187 return htc_send(priv->htc, skb, epid, &tx_ctl);
190 void ath9k_tx_tasklet(unsigned long data)
192 struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
193 struct ieee80211_sta *sta;
194 struct ieee80211_hdr *hdr;
195 struct ieee80211_tx_info *tx_info;
196 struct sk_buff *skb = NULL;
199 while ((skb = skb_dequeue(&priv->tx_queue)) != NULL) {
201 hdr = (struct ieee80211_hdr *) skb->data;
202 fc = hdr->frame_control;
203 tx_info = IEEE80211_SKB_CB(skb);
205 memset(&tx_info->status, 0, sizeof(tx_info->status));
209 sta = ieee80211_find_sta(priv->vif, hdr->addr1);
212 ieee80211_tx_status(priv->hw, skb);
216 /* Check if we need to start aggregation */
218 if (sta && conf_is_ht(&priv->hw->conf) &&
219 (priv->op_flags & OP_TXAGGR)
220 && !(skb->protocol == cpu_to_be16(ETH_P_PAE))) {
221 if (ieee80211_is_data_qos(fc)) {
223 struct ath9k_htc_sta *ista;
225 qc = ieee80211_get_qos_ctl(hdr);
227 ista = (struct ath9k_htc_sta *)sta->drv_priv;
229 if ((tid < ATH9K_HTC_MAX_TID) &&
230 ista->tid_state[tid] == AGGR_STOP) {
231 ieee80211_start_tx_ba_session(sta, tid);
232 ista->tid_state[tid] = AGGR_PROGRESS;
239 /* Send status to mac80211 */
240 ieee80211_tx_status(priv->hw, skb);
243 /* Wake TX queues if needed */
244 spin_lock_bh(&priv->tx_lock);
245 if (priv->tx_queues_stop) {
246 priv->tx_queues_stop = false;
247 spin_unlock_bh(&priv->tx_lock);
248 ath_print(ath9k_hw_common(priv->ah), ATH_DBG_XMIT,
249 "Waking up TX queues\n");
250 ieee80211_wake_queues(priv->hw);
253 spin_unlock_bh(&priv->tx_lock);
256 void ath9k_htc_txep(void *drv_priv, struct sk_buff *skb,
257 enum htc_endpoint_id ep_id, bool txok)
259 struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) drv_priv;
260 struct ath_common *common = ath9k_hw_common(priv->ah);
261 struct ieee80211_tx_info *tx_info;
266 if (ep_id == priv->mgmt_ep) {
267 skb_pull(skb, sizeof(struct tx_mgmt_hdr));
268 } else if ((ep_id == priv->data_bk_ep) ||
269 (ep_id == priv->data_be_ep) ||
270 (ep_id == priv->data_vi_ep) ||
271 (ep_id == priv->data_vo_ep)) {
272 skb_pull(skb, sizeof(struct tx_frame_hdr));
274 ath_print(common, ATH_DBG_FATAL,
275 "Unsupported TX EPID: %d\n", ep_id);
276 dev_kfree_skb_any(skb);
280 tx_info = IEEE80211_SKB_CB(skb);
283 tx_info->flags |= IEEE80211_TX_STAT_ACK;
285 skb_queue_tail(&priv->tx_queue, skb);
286 tasklet_schedule(&priv->tx_tasklet);
289 int ath9k_tx_init(struct ath9k_htc_priv *priv)
291 skb_queue_head_init(&priv->tx_queue);
295 void ath9k_tx_cleanup(struct ath9k_htc_priv *priv)
300 bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv,
301 enum ath9k_tx_queue_subtype subtype)
303 struct ath_hw *ah = priv->ah;
304 struct ath_common *common = ath9k_hw_common(ah);
305 struct ath9k_tx_queue_info qi;
308 memset(&qi, 0, sizeof(qi));
309 ATH9K_HTC_INIT_TXQ(subtype);
311 qnum = ath9k_hw_setuptxqueue(priv->ah, ATH9K_TX_QUEUE_DATA, &qi);
315 if (qnum >= ARRAY_SIZE(priv->hwq_map)) {
316 ath_print(common, ATH_DBG_FATAL,
317 "qnum %u out of range, max %u!\n",
318 qnum, (unsigned int)ARRAY_SIZE(priv->hwq_map));
319 ath9k_hw_releasetxqueue(ah, qnum);
323 priv->hwq_map[subtype] = qnum;
327 int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv)
329 struct ath9k_tx_queue_info qi;
331 memset(&qi, 0, sizeof(qi));
332 ATH9K_HTC_INIT_TXQ(0);
334 return ath9k_hw_setuptxqueue(priv->ah, ATH9K_TX_QUEUE_CAB, &qi);
342 * Calculate the RX filter to be set in the HW.
344 u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
346 #define RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)
348 struct ath_hw *ah = priv->ah;
351 rfilt = (ath9k_hw_getrxfilter(ah) & RX_FILTER_PRESERVE)
352 | ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
353 | ATH9K_RX_FILTER_MCAST;
355 /* If not a STA, enable processing of Probe Requests */
356 if (ah->opmode != NL80211_IFTYPE_STATION)
357 rfilt |= ATH9K_RX_FILTER_PROBEREQ;
360 * Set promiscuous mode when FIF_PROMISC_IN_BSS is enabled for station
361 * mode interface or when in monitor mode. AP mode does not need this
362 * since it receives all in-BSS frames anyway.
364 if (((ah->opmode != NL80211_IFTYPE_AP) &&
365 (priv->rxfilter & FIF_PROMISC_IN_BSS)) ||
366 (ah->opmode == NL80211_IFTYPE_MONITOR))
367 rfilt |= ATH9K_RX_FILTER_PROM;
369 if (priv->rxfilter & FIF_CONTROL)
370 rfilt |= ATH9K_RX_FILTER_CONTROL;
372 if ((ah->opmode == NL80211_IFTYPE_STATION) &&
373 !(priv->rxfilter & FIF_BCN_PRBRESP_PROMISC))
374 rfilt |= ATH9K_RX_FILTER_MYBEACON;
376 rfilt |= ATH9K_RX_FILTER_BEACON;
378 if (conf_is_ht(&priv->hw->conf))
379 rfilt |= ATH9K_RX_FILTER_COMP_BAR;
383 #undef RX_FILTER_PRESERVE
387 * Recv initialization for opmode change.
389 static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
391 struct ath_hw *ah = priv->ah;
392 struct ath_common *common = ath9k_hw_common(ah);
396 /* configure rx filter */
397 rfilt = ath9k_htc_calcrxfilter(priv);
398 ath9k_hw_setrxfilter(ah, rfilt);
400 /* configure bssid mask */
401 if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
402 ath_hw_setbssidmask(common);
404 /* configure operational mode */
405 ath9k_hw_setopmode(ah);
407 /* Handle any link-level address change. */
408 ath9k_hw_setmac(ah, common->macaddr);
410 /* calculate and install multicast filter */
411 mfilt[0] = mfilt[1] = ~0;
412 ath9k_hw_setmcastfilter(ah, mfilt[0], mfilt[1]);
415 void ath9k_host_rx_init(struct ath9k_htc_priv *priv)
417 ath9k_hw_rxena(priv->ah);
418 ath9k_htc_opmode_init(priv);
419 ath9k_hw_startpcureceive(priv->ah);
420 priv->rx.last_rssi = ATH_RSSI_DUMMY_MARKER;
423 static void ath9k_process_rate(struct ieee80211_hw *hw,
424 struct ieee80211_rx_status *rxs,
425 u8 rx_rate, u8 rs_flags)
427 struct ieee80211_supported_band *sband;
428 enum ieee80211_band band;
431 if (rx_rate & 0x80) {
433 rxs->flag |= RX_FLAG_HT;
434 if (rs_flags & ATH9K_RX_2040)
435 rxs->flag |= RX_FLAG_40MHZ;
436 if (rs_flags & ATH9K_RX_GI)
437 rxs->flag |= RX_FLAG_SHORT_GI;
438 rxs->rate_idx = rx_rate & 0x7f;
442 band = hw->conf.channel->band;
443 sband = hw->wiphy->bands[band];
445 for (i = 0; i < sband->n_bitrates; i++) {
446 if (sband->bitrates[i].hw_value == rx_rate) {
450 if (sband->bitrates[i].hw_value_short == rx_rate) {
452 rxs->flag |= RX_FLAG_SHORTPRE;
459 static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
460 struct ath9k_htc_rxbuf *rxbuf,
461 struct ieee80211_rx_status *rx_status)
464 struct ieee80211_hdr *hdr;
465 struct ieee80211_hw *hw = priv->hw;
466 struct sk_buff *skb = rxbuf->skb;
467 struct ath_common *common = ath9k_hw_common(priv->ah);
468 struct ath_htc_rx_status *rxstatus;
469 int hdrlen, padpos, padsize;
470 int last_rssi = ATH_RSSI_DUMMY_MARKER;
473 if (skb->len <= HTC_RX_FRAME_HEADER_SIZE) {
474 ath_print(common, ATH_DBG_FATAL,
475 "Corrupted RX frame, dropping\n");
479 rxstatus = (struct ath_htc_rx_status *)skb->data;
481 if (be16_to_cpu(rxstatus->rs_datalen) -
482 (skb->len - HTC_RX_FRAME_HEADER_SIZE) != 0) {
483 ath_print(common, ATH_DBG_FATAL,
484 "Corrupted RX data len, dropping "
485 "(dlen: %d, skblen: %d)\n",
486 rxstatus->rs_datalen, skb->len);
490 /* Get the RX status information */
491 memcpy(&rxbuf->rxstatus, rxstatus, HTC_RX_FRAME_HEADER_SIZE);
492 skb_pull(skb, HTC_RX_FRAME_HEADER_SIZE);
494 hdr = (struct ieee80211_hdr *)skb->data;
495 fc = hdr->frame_control;
496 hdrlen = ieee80211_get_hdrlen_from_skb(skb);
498 padpos = ath9k_cmn_padpos(fc);
500 padsize = padpos & 3;
501 if (padsize && skb->len >= padpos+padsize+FCS_LEN) {
502 memmove(skb->data + padsize, skb->data, padpos);
503 skb_pull(skb, padsize);
506 memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
508 if (rxbuf->rxstatus.rs_status != 0) {
509 if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_CRC)
510 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
511 if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_PHY)
514 if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_DECRYPT) {
516 } else if (rxbuf->rxstatus.rs_status & ATH9K_RXERR_MIC) {
517 if (ieee80211_is_ctl(fc))
519 * Sometimes, we get invalid
520 * MIC failures on valid control frames.
521 * Remove these mic errors.
523 rxbuf->rxstatus.rs_status &= ~ATH9K_RXERR_MIC;
525 rx_status->flag |= RX_FLAG_MMIC_ERROR;
529 * Reject error frames with the exception of
530 * decryption and MIC failures. For monitor mode,
531 * we also ignore the CRC error.
533 if (priv->ah->opmode == NL80211_IFTYPE_MONITOR) {
534 if (rxbuf->rxstatus.rs_status &
535 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC |
539 if (rxbuf->rxstatus.rs_status &
540 ~(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_MIC)) {
546 if (!(rxbuf->rxstatus.rs_status & ATH9K_RXERR_DECRYPT)) {
548 keyix = rxbuf->rxstatus.rs_keyix;
549 if (keyix != ATH9K_RXKEYIX_INVALID) {
550 rx_status->flag |= RX_FLAG_DECRYPTED;
551 } else if (ieee80211_has_protected(fc) &&
552 skb->len >= hdrlen + 4) {
553 keyix = skb->data[hdrlen + 3] >> 6;
554 if (test_bit(keyix, common->keymap))
555 rx_status->flag |= RX_FLAG_DECRYPTED;
559 ath9k_process_rate(hw, rx_status, rxbuf->rxstatus.rs_rate,
560 rxbuf->rxstatus.rs_flags);
562 if (priv->op_flags & OP_ASSOCIATED) {
563 if (rxbuf->rxstatus.rs_rssi != ATH9K_RSSI_BAD &&
564 !rxbuf->rxstatus.rs_moreaggr)
565 ATH_RSSI_LPF(priv->rx.last_rssi,
566 rxbuf->rxstatus.rs_rssi);
568 last_rssi = priv->rx.last_rssi;
570 if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
571 rxbuf->rxstatus.rs_rssi = ATH_EP_RND(last_rssi,
572 ATH_RSSI_EP_MULTIPLIER);
574 if (rxbuf->rxstatus.rs_rssi < 0)
575 rxbuf->rxstatus.rs_rssi = 0;
577 if (ieee80211_is_beacon(fc))
578 priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
581 rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
582 rx_status->band = hw->conf.channel->band;
583 rx_status->freq = hw->conf.channel->center_freq;
584 rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR;
585 rx_status->antenna = rxbuf->rxstatus.rs_antenna;
586 rx_status->flag |= RX_FLAG_TSFT;
595 * FIXME: Handle FLUSH later on.
597 void ath9k_rx_tasklet(unsigned long data)
599 struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)data;
600 struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
601 struct ieee80211_rx_status rx_status;
604 struct ieee80211_hdr *hdr;
607 spin_lock_irqsave(&priv->rx.rxbuflock, flags);
608 list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
609 if (tmp_buf->in_process) {
616 spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
623 if (!ath9k_rx_prepare(priv, rxbuf, &rx_status)) {
624 dev_kfree_skb_any(rxbuf->skb);
628 memcpy(IEEE80211_SKB_RXCB(rxbuf->skb), &rx_status,
629 sizeof(struct ieee80211_rx_status));
631 hdr = (struct ieee80211_hdr *) skb->data;
633 if (ieee80211_is_beacon(hdr->frame_control) && priv->ps_enabled)
634 ieee80211_queue_work(priv->hw, &priv->ps_work);
636 spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
638 ieee80211_rx(priv->hw, skb);
640 spin_lock_irqsave(&priv->rx.rxbuflock, flags);
642 rxbuf->in_process = false;
644 list_move_tail(&rxbuf->list, &priv->rx.rxbuf);
646 spin_unlock_irqrestore(&priv->rx.rxbuflock, flags);
651 void ath9k_htc_rxep(void *drv_priv, struct sk_buff *skb,
652 enum htc_endpoint_id ep_id)
654 struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *)drv_priv;
655 struct ath_hw *ah = priv->ah;
656 struct ath_common *common = ath9k_hw_common(ah);
657 struct ath9k_htc_rxbuf *rxbuf = NULL, *tmp_buf = NULL;
659 spin_lock(&priv->rx.rxbuflock);
660 list_for_each_entry(tmp_buf, &priv->rx.rxbuf, list) {
661 if (!tmp_buf->in_process) {
666 spin_unlock(&priv->rx.rxbuflock);
669 ath_print(common, ATH_DBG_ANY,
670 "No free RX buffer\n");
674 spin_lock(&priv->rx.rxbuflock);
676 rxbuf->in_process = true;
677 spin_unlock(&priv->rx.rxbuflock);
679 tasklet_schedule(&priv->rx_tasklet);
682 dev_kfree_skb_any(skb);
685 /* FIXME: Locking for cleanup/init */
687 void ath9k_rx_cleanup(struct ath9k_htc_priv *priv)
689 struct ath9k_htc_rxbuf *rxbuf, *tbuf;
691 list_for_each_entry_safe(rxbuf, tbuf, &priv->rx.rxbuf, list) {
692 list_del(&rxbuf->list);
694 dev_kfree_skb_any(rxbuf->skb);
699 int ath9k_rx_init(struct ath9k_htc_priv *priv)
701 struct ath_hw *ah = priv->ah;
702 struct ath_common *common = ath9k_hw_common(ah);
703 struct ath9k_htc_rxbuf *rxbuf;
706 INIT_LIST_HEAD(&priv->rx.rxbuf);
707 spin_lock_init(&priv->rx.rxbuflock);
709 for (i = 0; i < ATH9K_HTC_RXBUF; i++) {
710 rxbuf = kzalloc(sizeof(struct ath9k_htc_rxbuf), GFP_KERNEL);
712 ath_print(common, ATH_DBG_FATAL,
713 "Unable to allocate RX buffers\n");
716 list_add_tail(&rxbuf->list, &priv->rx.rxbuf);
722 ath9k_rx_cleanup(priv);