1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
6 * Purpose: handle WMAC/802.3/802.11 rx & tx functions
13 * vnt_generate_tx_parameter - Generate tx dma required parameter.
14 * vnt_get_rsvtime- get frame reserved time
15 * vnt_fill_cts_head- fulfill CTS ctl header
21 #include <linux/etherdevice.h>
29 static const u16 vnt_time_stampoff[2][MAX_RATE] = {
31 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23},
34 {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},
40 static const u8 vnt_phy_signal[] = {
55 static struct vnt_usb_send_context
56 *vnt_get_free_context(struct vnt_private *priv)
58 struct vnt_usb_send_context *context = NULL;
61 for (ii = 0; ii < priv->num_tx_context; ii++) {
62 if (!priv->tx_context[ii])
65 context = priv->tx_context[ii];
66 if (!context->in_use) {
67 context->in_use = true;
72 if (ii == priv->num_tx_context) {
73 dev_dbg(&priv->usb->dev, "%s No Free Tx Context\n", __func__);
75 ieee80211_stop_queues(priv->hw);
81 /* Get Length, Service, and Signal fields of Phy for Tx */
82 static void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
83 u16 tx_rate, u8 pkt_type,
84 struct vnt_phy_field *phy)
92 u8 preamble_type = priv->preamble_type;
94 bit_count = frame_length * 8;
102 count = bit_count / 2;
105 count = DIV_ROUND_UP(bit_count * 10, 55);
108 count = bit_count / 11;
111 if (tmp != bit_count) {
114 if ((bit_count - tmp) <= 3)
121 if (tx_rate > RATE_11M) {
122 if (pkt_type == PK_TYPE_11A)
124 } else if (tx_rate > RATE_1M) {
125 if (preamble_type == PREAMBLE_SHORT)
129 i = tx_rate > RATE_54M ? RATE_54M : tx_rate;
130 phy->signal = vnt_phy_signal[i] | mask;
133 if (pkt_type == PK_TYPE_11B) {
135 phy->service |= 0x80;
136 phy->len = cpu_to_le16((u16)count);
138 phy->len = cpu_to_le16((u16)frame_length);
142 static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
144 return cpu_to_le16(vnt_time_stampoff[priv->preamble_type % 2]
148 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_usb_send_context *context)
150 struct vnt_private *priv = context->priv;
151 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
152 struct ieee80211_rate *rate = ieee80211_get_tx_rate(priv->hw, info);
154 return ieee80211_generic_frame_duration(priv->hw,
155 info->control.vif, info->band,
160 static __le16 vnt_get_rts_duration(struct vnt_usb_send_context *context)
162 struct vnt_private *priv = context->priv;
163 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
165 return ieee80211_rts_duration(priv->hw, priv->vif,
166 context->frame_len, info);
169 static __le16 vnt_get_cts_duration(struct vnt_usb_send_context *context)
171 struct vnt_private *priv = context->priv;
172 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
174 return ieee80211_ctstoself_duration(priv->hw, priv->vif,
175 context->frame_len, info);
178 static void vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
179 struct vnt_tx_datahead_g *buf)
181 struct vnt_private *priv = tx_context->priv;
182 struct ieee80211_hdr *hdr =
183 (struct ieee80211_hdr *)tx_context->skb->data;
184 u32 frame_len = tx_context->frame_len;
185 u16 rate = tx_context->tx_rate;
187 /* Get SignalField,ServiceField,Length */
188 vnt_get_phy_field(priv, frame_len, rate, tx_context->pkt_type, &buf->a);
189 vnt_get_phy_field(priv, frame_len, priv->top_cck_basic_rate,
190 PK_TYPE_11B, &buf->b);
192 /* Get Duration and TimeStamp */
193 buf->duration_a = hdr->duration_id;
194 buf->duration_b = hdr->duration_id;
195 buf->time_stamp_off_a = vnt_time_stamp_off(priv, rate);
196 buf->time_stamp_off_b = vnt_time_stamp_off(priv,
197 priv->top_cck_basic_rate);
200 static void vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
201 struct vnt_tx_datahead_ab *buf)
203 struct vnt_private *priv = tx_context->priv;
204 struct ieee80211_hdr *hdr =
205 (struct ieee80211_hdr *)tx_context->skb->data;
206 u32 frame_len = tx_context->frame_len;
207 u16 rate = tx_context->tx_rate;
209 /* Get SignalField,ServiceField,Length */
210 vnt_get_phy_field(priv, frame_len, rate,
211 tx_context->pkt_type, &buf->ab);
213 /* Get Duration and TimeStampOff */
214 buf->duration = hdr->duration_id;
215 buf->time_stamp_off = vnt_time_stamp_off(priv, rate);
218 static void vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
219 struct ieee80211_rts *rts, __le16 duration)
221 struct ieee80211_hdr *hdr =
222 (struct ieee80211_hdr *)tx_context->skb->data;
224 rts->duration = duration;
226 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
228 ether_addr_copy(rts->ra, hdr->addr1);
229 ether_addr_copy(rts->ta, hdr->addr2);
232 static void vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
233 struct vnt_rts_g *buf)
235 struct vnt_private *priv = tx_context->priv;
236 u16 rts_frame_len = 20;
238 vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
239 PK_TYPE_11B, &buf->b);
240 vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
241 tx_context->pkt_type, &buf->a);
243 buf->duration_bb = vnt_get_rts_duration(tx_context);
244 buf->duration_aa = buf->duration_bb;
245 buf->duration_ba = buf->duration_bb;
247 vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
249 vnt_rxtx_datahead_g(tx_context, &buf->data_head);
252 static void vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
253 struct vnt_rts_ab *buf)
255 struct vnt_private *priv = tx_context->priv;
256 u16 rts_frame_len = 20;
258 vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
259 tx_context->pkt_type, &buf->ab);
261 buf->duration = vnt_get_rts_duration(tx_context);
263 vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
265 vnt_rxtx_datahead_ab(tx_context, &buf->data_head);
268 static void vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
269 union vnt_tx_data_head *head)
271 struct vnt_private *priv = tx_context->priv;
272 struct vnt_cts *buf = &head->cts_g;
273 u32 cts_frame_len = 14;
275 /* Get SignalField,ServiceField,Length */
276 vnt_get_phy_field(priv, cts_frame_len, priv->top_cck_basic_rate,
277 PK_TYPE_11B, &buf->b);
278 /* Get CTSDuration_ba */
279 buf->duration_ba = vnt_get_cts_duration(tx_context);
280 /*Get CTS Frame body*/
281 buf->data.duration = buf->duration_ba;
282 buf->data.frame_control =
283 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
285 ether_addr_copy(buf->data.ra, priv->current_net_addr);
287 vnt_rxtx_datahead_g(tx_context, &buf->data_head);
290 /* returns true if mic_hdr is needed */
291 static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb)
293 struct vnt_tx_fifo_head *fifo = &tx_buffer->fifo_head;
294 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
295 struct ieee80211_key_conf *tx_key = info->control.hw_key;
296 struct vnt_mic_hdr *mic_hdr;
297 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
299 u16 payload_len = skb->len;
300 u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb));
302 /* strip header and icv len from payload */
303 payload_len -= ieee80211_get_hdrlen_from_skb(skb);
304 payload_len -= tx_key->icv_len;
306 switch (tx_key->cipher) {
307 case WLAN_CIPHER_SUITE_WEP40:
308 case WLAN_CIPHER_SUITE_WEP104:
309 memcpy(fifo->tx_key, iv, 3);
310 memcpy(fifo->tx_key + 3, tx_key->key, tx_key->keylen);
312 if (tx_key->keylen == WLAN_KEY_LEN_WEP40) {
313 memcpy(fifo->tx_key + 8, iv, 3);
314 memcpy(fifo->tx_key + 11,
315 tx_key->key, WLAN_KEY_LEN_WEP40);
318 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_LEGACY);
320 case WLAN_CIPHER_SUITE_TKIP:
321 ieee80211_get_tkip_p2k(tx_key, skb, fifo->tx_key);
323 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_TKIP);
325 case WLAN_CIPHER_SUITE_CCMP:
326 if (info->control.use_cts_prot) {
327 if (info->control.use_rts)
328 mic_hdr = &tx_buffer->tx_head.tx_rts.tx.mic.hdr;
330 mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr;
332 mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr;
336 mic_hdr->payload_len = cpu_to_be16(payload_len);
337 ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2);
339 pn64 = atomic64_read(&tx_key->tx_pn);
340 mic_hdr->ccmp_pn[5] = pn64;
341 mic_hdr->ccmp_pn[4] = pn64 >> 8;
342 mic_hdr->ccmp_pn[3] = pn64 >> 16;
343 mic_hdr->ccmp_pn[2] = pn64 >> 24;
344 mic_hdr->ccmp_pn[1] = pn64 >> 32;
345 mic_hdr->ccmp_pn[0] = pn64 >> 40;
347 if (ieee80211_has_a4(hdr->frame_control))
348 mic_hdr->hlen = cpu_to_be16(28);
350 mic_hdr->hlen = cpu_to_be16(22);
352 ether_addr_copy(mic_hdr->addr1, hdr->addr1);
353 ether_addr_copy(mic_hdr->addr2, hdr->addr2);
354 ether_addr_copy(mic_hdr->addr3, hdr->addr3);
356 mic_hdr->frame_control = cpu_to_le16(le16_to_cpu(hdr->frame_control) & 0xc78f);
357 mic_hdr->seq_ctrl = cpu_to_le16(le16_to_cpu(hdr->seq_ctrl) & 0xf);
359 if (ieee80211_has_a4(hdr->frame_control))
360 ether_addr_copy(mic_hdr->addr4, hdr->addr4);
362 memcpy(fifo->tx_key, tx_key->key, WLAN_KEY_LEN_CCMP);
364 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_AES);
373 static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context)
375 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
376 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
377 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
378 struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts;
379 union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
381 buf->rts_rrv_time_aa = vnt_get_rts_duration(tx_context);
382 buf->rts_rrv_time_ba = buf->rts_rrv_time_aa;
383 buf->rts_rrv_time_bb = buf->rts_rrv_time_aa;
385 buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
386 buf->rrv_time_b = buf->rrv_time_a;
388 if (info->control.hw_key) {
389 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
390 head = &tx_head->tx_rts.tx.mic.head;
393 vnt_rxtx_rts_g_head(tx_context, &head->rts_g);
396 static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context)
398 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
399 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
400 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
401 struct vnt_rrv_time_cts *buf = &tx_head->tx_cts.cts;
402 union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head;
404 buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
405 buf->rrv_time_b = buf->rrv_time_a;
407 buf->cts_rrv_time_ba = vnt_get_cts_duration(tx_context);
409 if (info->control.hw_key) {
410 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
411 head = &tx_head->tx_cts.tx.mic.head;
414 vnt_fill_cts_head(tx_context, head);
417 static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context)
419 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
420 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
421 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
422 struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab;
423 union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head;
425 buf->rrv_time = vnt_rxtx_rsvtime_le16(tx_context);
427 if (info->control.hw_key) {
428 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
429 head = &tx_head->tx_ab.tx.mic.head;
432 if (info->control.use_rts) {
433 buf->rts_rrv_time = vnt_get_rts_duration(tx_context);
435 vnt_rxtx_rts_ab_head(tx_context, &head->rts_ab);
440 vnt_rxtx_datahead_ab(tx_context, &head->data_head_ab);
443 static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context)
445 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
447 if (info->control.use_cts_prot) {
448 if (info->control.use_rts) {
449 vnt_rxtx_rts(tx_context);
454 vnt_rxtx_cts(tx_context);
459 vnt_rxtx_ab(tx_context);
462 static u16 vnt_get_hdr_size(struct ieee80211_tx_info *info)
464 u16 size = sizeof(struct vnt_tx_datahead_ab);
466 if (info->control.use_cts_prot) {
467 if (info->control.use_rts)
468 size = sizeof(struct vnt_rts_g);
470 size = sizeof(struct vnt_cts);
471 } else if (info->control.use_rts) {
472 size = sizeof(struct vnt_rts_ab);
475 if (info->control.hw_key) {
476 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP)
477 size += sizeof(struct vnt_mic_hdr);
480 /* Get rrv_time header */
481 if (info->control.use_cts_prot) {
482 if (info->control.use_rts)
483 size += sizeof(struct vnt_rrv_time_rts);
485 size += sizeof(struct vnt_rrv_time_cts);
487 size += sizeof(struct vnt_rrv_time_ab);
490 size += sizeof(struct vnt_tx_fifo_head);
495 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
497 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
498 struct ieee80211_tx_rate *tx_rate = &info->control.rates[0];
499 struct ieee80211_rate *rate;
500 struct ieee80211_hdr *hdr;
501 struct vnt_tx_buffer *tx_buffer;
502 struct vnt_tx_fifo_head *tx_buffer_head;
503 struct vnt_usb_send_context *tx_context;
507 hdr = (struct ieee80211_hdr *)(skb->data);
509 rate = ieee80211_get_tx_rate(priv->hw, info);
511 if (rate->hw_value > RATE_11M) {
512 if (info->band == NL80211_BAND_5GHZ) {
513 pkt_type = PK_TYPE_11A;
515 if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
516 if (priv->basic_rates & VNT_B_RATES)
517 pkt_type = PK_TYPE_11GB;
519 pkt_type = PK_TYPE_11GA;
521 pkt_type = PK_TYPE_11A;
525 pkt_type = PK_TYPE_11B;
528 spin_lock_irqsave(&priv->lock, flags);
530 tx_context = vnt_get_free_context(priv);
532 dev_dbg(&priv->usb->dev, "%s No free context\n", __func__);
533 spin_unlock_irqrestore(&priv->lock, flags);
537 tx_context->pkt_type = pkt_type;
538 tx_context->frame_len = skb->len + 4;
539 tx_context->tx_rate = rate->hw_value;
541 spin_unlock_irqrestore(&priv->lock, flags);
543 tx_context->skb = skb_clone(skb, GFP_ATOMIC);
544 if (!tx_context->skb) {
545 tx_context->in_use = false;
549 tx_buffer = skb_push(skb, vnt_get_hdr_size(info));
550 tx_context->tx_buffer = tx_buffer;
551 tx_buffer_head = &tx_buffer->fifo_head;
553 tx_context->type = CONTEXT_DATA_PACKET;
555 /*Set fifo controls */
556 if (pkt_type == PK_TYPE_11A)
557 tx_buffer_head->fifo_ctl = 0;
558 else if (pkt_type == PK_TYPE_11B)
559 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11B);
560 else if (pkt_type == PK_TYPE_11GB)
561 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11GB);
562 else if (pkt_type == PK_TYPE_11GA)
563 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11GA);
565 if (!ieee80211_is_data(hdr->frame_control)) {
566 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_GENINT |
568 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_TMOEN);
570 tx_buffer_head->time_stamp =
571 cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
573 tx_buffer_head->time_stamp =
574 cpu_to_le16(DEFAULT_MSDU_LIFETIME_RES_64us);
577 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
578 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_NEEDACK);
580 if (ieee80211_has_retry(hdr->frame_control))
581 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LRETRY);
583 if (info->control.use_rts)
584 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_RTS);
586 if (ieee80211_has_a4(hdr->frame_control))
587 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LHEAD);
589 tx_buffer_head->frag_ctl =
590 cpu_to_le16(ieee80211_hdrlen(hdr->frame_control) << 10);
592 if (info->control.hw_key)
593 tx_context->frame_len += info->control.hw_key->icv_len;
595 tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value);
597 vnt_generate_tx_parameter(tx_context);
599 tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG);
601 priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) &
602 IEEE80211_SCTL_SEQ) >> 4;
604 spin_lock_irqsave(&priv->lock, flags);
606 if (vnt_tx_context(priv, tx_context, skb)) {
607 dev_kfree_skb(tx_context->skb);
608 spin_unlock_irqrestore(&priv->lock, flags);
614 spin_unlock_irqrestore(&priv->lock, flags);
619 static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
621 struct vnt_tx_short_buf_head *short_head;
622 struct ieee80211_tx_info *info;
623 struct vnt_usb_send_context *context;
624 struct ieee80211_mgmt *mgmt_hdr;
626 u32 frame_size = skb->len + 4;
629 spin_lock_irqsave(&priv->lock, flags);
631 context = vnt_get_free_context(priv);
633 dev_dbg(&priv->usb->dev, "%s No free context!\n", __func__);
634 spin_unlock_irqrestore(&priv->lock, flags);
640 spin_unlock_irqrestore(&priv->lock, flags);
642 mgmt_hdr = (struct ieee80211_mgmt *)skb->data;
643 short_head = skb_push(skb, sizeof(*short_head));
645 if (priv->bb_type == BB_TYPE_11A) {
646 current_rate = RATE_6M;
648 /* Get SignalField,ServiceField,Length */
649 vnt_get_phy_field(priv, frame_size, current_rate,
650 PK_TYPE_11A, &short_head->ab);
652 /* Get TimeStampOff */
653 short_head->time_stamp_off =
654 vnt_time_stamp_off(priv, current_rate);
656 current_rate = RATE_1M;
657 short_head->fifo_ctl |= cpu_to_le16(FIFOCTL_11B);
659 /* Get SignalField,ServiceField,Length */
660 vnt_get_phy_field(priv, frame_size, current_rate,
661 PK_TYPE_11B, &short_head->ab);
663 /* Get TimeStampOff */
664 short_head->time_stamp_off =
665 vnt_time_stamp_off(priv, current_rate);
669 short_head->duration = mgmt_hdr->duration;
671 /* time stamp always 0 */
672 mgmt_hdr->u.beacon.timestamp = 0;
674 info = IEEE80211_SKB_CB(skb);
675 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
676 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)mgmt_hdr;
678 hdr->duration_id = 0;
679 hdr->seq_ctrl = cpu_to_le16(priv->seq_counter << 4);
683 if (priv->seq_counter > 0x0fff)
684 priv->seq_counter = 0;
686 context->type = CONTEXT_BEACON_PACKET;
688 spin_lock_irqsave(&priv->lock, flags);
690 if (vnt_tx_context(priv, context, skb))
691 ieee80211_free_txskb(priv->hw, context->skb);
693 spin_unlock_irqrestore(&priv->lock, flags);
698 int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif)
700 struct sk_buff *beacon;
702 beacon = ieee80211_beacon_get(priv->hw, vif);
706 if (vnt_beacon_xmit(priv, beacon)) {
707 ieee80211_free_txskb(priv->hw, beacon);
714 int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
715 struct ieee80211_bss_conf *conf)
717 vnt_mac_reg_bits_off(priv, MAC_REG_TCR, TCR_AUTOBCNTX);
719 vnt_mac_reg_bits_off(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
721 vnt_mac_set_beacon_interval(priv, conf->beacon_int);
723 vnt_clear_current_tsf(priv);
725 vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
727 vnt_reset_next_tbtt(priv, conf->beacon_int);
729 return vnt_beacon_make(priv, vif);