1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
8 * Purpose: handle WMAC/802.3/802.11 rx & tx functions
15 * vnt_generate_tx_parameter - Generate tx dma required parameter.
16 * vnt_get_rsvtime- get frame reserved time
17 * vnt_fill_cts_head- fulfill CTS ctl header
23 #include <linux/etherdevice.h>
31 static const u16 vnt_time_stampoff[2][MAX_RATE] = {
33 {384, 288, 226, 209, 54, 43, 37, 31, 28, 25, 24, 23},
36 {384, 192, 130, 113, 54, 43, 37, 31, 28, 25, 24, 23},
42 static const u8 vnt_phy_signal[] = {
57 static struct vnt_usb_send_context
58 *vnt_get_free_context(struct vnt_private *priv)
60 struct vnt_usb_send_context *context = NULL;
63 dev_dbg(&priv->usb->dev, "%s\n", __func__);
65 for (ii = 0; ii < priv->num_tx_context; ii++) {
66 if (!priv->tx_context[ii])
69 context = priv->tx_context[ii];
70 if (!context->in_use) {
71 context->in_use = true;
76 if (ii == priv->num_tx_context) {
77 dev_dbg(&priv->usb->dev, "%s No Free Tx Context\n", __func__);
79 ieee80211_stop_queues(priv->hw);
85 /* Get Length, Service, and Signal fields of Phy for Tx */
86 static void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length,
87 u16 tx_rate, u8 pkt_type,
88 struct vnt_phy_field *phy)
96 u8 preamble_type = priv->preamble_type;
98 bit_count = frame_length * 8;
106 count = bit_count / 2;
109 count = DIV_ROUND_UP(bit_count * 10, 55);
112 count = bit_count / 11;
115 if (tmp != bit_count) {
118 if ((bit_count - tmp) <= 3)
125 if (tx_rate > RATE_11M) {
126 if (pkt_type == PK_TYPE_11A)
128 } else if (tx_rate > RATE_1M) {
129 if (preamble_type == PREAMBLE_SHORT)
133 i = tx_rate > RATE_54M ? RATE_54M : tx_rate;
134 phy->signal = vnt_phy_signal[i] | mask;
137 if (pkt_type == PK_TYPE_11B) {
139 phy->service |= 0x80;
140 phy->len = cpu_to_le16((u16)count);
142 phy->len = cpu_to_le16((u16)frame_length);
146 static __le16 vnt_time_stamp_off(struct vnt_private *priv, u16 rate)
148 return cpu_to_le16(vnt_time_stampoff[priv->preamble_type % 2]
152 static __le16 vnt_rxtx_rsvtime_le16(struct vnt_usb_send_context *context)
154 struct vnt_private *priv = context->priv;
155 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
156 struct ieee80211_rate *rate = ieee80211_get_tx_rate(priv->hw, info);
158 return ieee80211_generic_frame_duration(priv->hw,
159 info->control.vif, info->band,
164 static __le16 vnt_get_rts_duration(struct vnt_usb_send_context *context)
166 struct vnt_private *priv = context->priv;
167 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
169 return ieee80211_rts_duration(priv->hw, priv->vif,
170 context->frame_len, info);
173 static __le16 vnt_get_cts_duration(struct vnt_usb_send_context *context)
175 struct vnt_private *priv = context->priv;
176 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(context->skb);
178 return ieee80211_ctstoself_duration(priv->hw, priv->vif,
179 context->frame_len, info);
182 static void vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
183 struct vnt_tx_datahead_g *buf)
185 struct vnt_private *priv = tx_context->priv;
186 struct ieee80211_hdr *hdr =
187 (struct ieee80211_hdr *)tx_context->skb->data;
188 u32 frame_len = tx_context->frame_len;
189 u16 rate = tx_context->tx_rate;
191 /* Get SignalField,ServiceField,Length */
192 vnt_get_phy_field(priv, frame_len, rate, tx_context->pkt_type, &buf->a);
193 vnt_get_phy_field(priv, frame_len, priv->top_cck_basic_rate,
194 PK_TYPE_11B, &buf->b);
196 /* Get Duration and TimeStamp */
197 buf->duration_a = hdr->duration_id;
198 buf->duration_b = hdr->duration_id;
199 buf->time_stamp_off_a = vnt_time_stamp_off(priv, rate);
200 buf->time_stamp_off_b = vnt_time_stamp_off(priv,
201 priv->top_cck_basic_rate);
204 static void vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
205 struct vnt_tx_datahead_ab *buf)
207 struct vnt_private *priv = tx_context->priv;
208 struct ieee80211_hdr *hdr =
209 (struct ieee80211_hdr *)tx_context->skb->data;
210 u32 frame_len = tx_context->frame_len;
211 u16 rate = tx_context->tx_rate;
213 /* Get SignalField,ServiceField,Length */
214 vnt_get_phy_field(priv, frame_len, rate,
215 tx_context->pkt_type, &buf->ab);
217 /* Get Duration and TimeStampOff */
218 buf->duration = hdr->duration_id;
219 buf->time_stamp_off = vnt_time_stamp_off(priv, rate);
222 static void vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
223 struct ieee80211_rts *rts, __le16 duration)
225 struct ieee80211_hdr *hdr =
226 (struct ieee80211_hdr *)tx_context->skb->data;
228 rts->duration = duration;
230 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
232 ether_addr_copy(rts->ra, hdr->addr1);
233 ether_addr_copy(rts->ta, hdr->addr2);
236 static void vnt_rxtx_rts_g_head(struct vnt_usb_send_context *tx_context,
237 struct vnt_rts_g *buf)
239 struct vnt_private *priv = tx_context->priv;
240 u16 rts_frame_len = 20;
242 vnt_get_phy_field(priv, rts_frame_len, priv->top_cck_basic_rate,
243 PK_TYPE_11B, &buf->b);
244 vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
245 tx_context->pkt_type, &buf->a);
247 buf->duration_bb = vnt_get_rts_duration(tx_context);
248 buf->duration_aa = buf->duration_bb;
249 buf->duration_ba = buf->duration_bb;
251 vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration_aa);
253 vnt_rxtx_datahead_g(tx_context, &buf->data_head);
256 static void vnt_rxtx_rts_ab_head(struct vnt_usb_send_context *tx_context,
257 struct vnt_rts_ab *buf)
259 struct vnt_private *priv = tx_context->priv;
260 u16 rts_frame_len = 20;
262 vnt_get_phy_field(priv, rts_frame_len, priv->top_ofdm_basic_rate,
263 tx_context->pkt_type, &buf->ab);
265 buf->duration = vnt_get_rts_duration(tx_context);
267 vnt_fill_ieee80211_rts(tx_context, &buf->data, buf->duration);
269 vnt_rxtx_datahead_ab(tx_context, &buf->data_head);
272 static void vnt_fill_cts_head(struct vnt_usb_send_context *tx_context,
273 union vnt_tx_data_head *head)
275 struct vnt_private *priv = tx_context->priv;
276 struct vnt_cts *buf = &head->cts_g;
277 u32 cts_frame_len = 14;
279 /* Get SignalField,ServiceField,Length */
280 vnt_get_phy_field(priv, cts_frame_len, priv->top_cck_basic_rate,
281 PK_TYPE_11B, &buf->b);
282 /* Get CTSDuration_ba */
283 buf->duration_ba = vnt_get_cts_duration(tx_context);
284 /*Get CTS Frame body*/
285 buf->data.duration = buf->duration_ba;
286 buf->data.frame_control =
287 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
289 ether_addr_copy(buf->data.ra, priv->current_net_addr);
291 vnt_rxtx_datahead_g(tx_context, &buf->data_head);
294 /* returns true if mic_hdr is needed */
295 static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb)
297 struct vnt_tx_fifo_head *fifo = &tx_buffer->fifo_head;
298 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
299 struct ieee80211_key_conf *tx_key = info->control.hw_key;
300 struct vnt_mic_hdr *mic_hdr;
301 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
303 u16 payload_len = skb->len;
304 u8 *iv = ((u8 *)hdr + ieee80211_get_hdrlen_from_skb(skb));
306 /* strip header and icv len from payload */
307 payload_len -= ieee80211_get_hdrlen_from_skb(skb);
308 payload_len -= tx_key->icv_len;
310 switch (tx_key->cipher) {
311 case WLAN_CIPHER_SUITE_WEP40:
312 case WLAN_CIPHER_SUITE_WEP104:
313 memcpy(fifo->tx_key, iv, 3);
314 memcpy(fifo->tx_key + 3, tx_key->key, tx_key->keylen);
316 if (tx_key->keylen == WLAN_KEY_LEN_WEP40) {
317 memcpy(fifo->tx_key + 8, iv, 3);
318 memcpy(fifo->tx_key + 11,
319 tx_key->key, WLAN_KEY_LEN_WEP40);
322 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_LEGACY);
324 case WLAN_CIPHER_SUITE_TKIP:
325 ieee80211_get_tkip_p2k(tx_key, skb, fifo->tx_key);
327 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_TKIP);
329 case WLAN_CIPHER_SUITE_CCMP:
330 if (info->control.use_cts_prot) {
331 if (info->control.use_rts)
332 mic_hdr = &tx_buffer->tx_head.tx_rts.tx.mic.hdr;
334 mic_hdr = &tx_buffer->tx_head.tx_cts.tx.mic.hdr;
336 mic_hdr = &tx_buffer->tx_head.tx_ab.tx.mic.hdr;
340 mic_hdr->payload_len = cpu_to_be16(payload_len);
341 ether_addr_copy(mic_hdr->mic_addr2, hdr->addr2);
343 pn64 = atomic64_read(&tx_key->tx_pn);
344 mic_hdr->ccmp_pn[5] = pn64;
345 mic_hdr->ccmp_pn[4] = pn64 >> 8;
346 mic_hdr->ccmp_pn[3] = pn64 >> 16;
347 mic_hdr->ccmp_pn[2] = pn64 >> 24;
348 mic_hdr->ccmp_pn[1] = pn64 >> 32;
349 mic_hdr->ccmp_pn[0] = pn64 >> 40;
351 if (ieee80211_has_a4(hdr->frame_control))
352 mic_hdr->hlen = cpu_to_be16(28);
354 mic_hdr->hlen = cpu_to_be16(22);
356 ether_addr_copy(mic_hdr->addr1, hdr->addr1);
357 ether_addr_copy(mic_hdr->addr2, hdr->addr2);
358 ether_addr_copy(mic_hdr->addr3, hdr->addr3);
360 mic_hdr->frame_control = cpu_to_le16(
361 le16_to_cpu(hdr->frame_control) & 0xc78f);
362 mic_hdr->seq_ctrl = cpu_to_le16(
363 le16_to_cpu(hdr->seq_ctrl) & 0xf);
365 if (ieee80211_has_a4(hdr->frame_control))
366 ether_addr_copy(mic_hdr->addr4, hdr->addr4);
368 memcpy(fifo->tx_key, tx_key->key, WLAN_KEY_LEN_CCMP);
370 fifo->frag_ctl |= cpu_to_le16(FRAGCTL_AES);
379 static void vnt_rxtx_rts(struct vnt_usb_send_context *tx_context)
381 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
382 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
383 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
384 struct vnt_rrv_time_rts *buf = &tx_head->tx_rts.rts;
385 union vnt_tx_data_head *head = &tx_head->tx_rts.tx.head;
387 buf->rts_rrv_time_aa = vnt_get_rts_duration(tx_context);
388 buf->rts_rrv_time_ba = buf->rts_rrv_time_aa;
389 buf->rts_rrv_time_bb = buf->rts_rrv_time_aa;
391 buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
392 buf->rrv_time_b = buf->rrv_time_a;
394 if (info->control.hw_key) {
395 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
396 head = &tx_head->tx_rts.tx.mic.head;
399 vnt_rxtx_rts_g_head(tx_context, &head->rts_g);
402 static void vnt_rxtx_cts(struct vnt_usb_send_context *tx_context)
404 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
405 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
406 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
407 struct vnt_rrv_time_cts *buf = &tx_head->tx_cts.cts;
408 union vnt_tx_data_head *head = &tx_head->tx_cts.tx.head;
410 buf->rrv_time_a = vnt_rxtx_rsvtime_le16(tx_context);
411 buf->rrv_time_b = buf->rrv_time_a;
413 buf->cts_rrv_time_ba = vnt_get_cts_duration(tx_context);
415 if (info->control.hw_key) {
416 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
417 head = &tx_head->tx_cts.tx.mic.head;
420 vnt_fill_cts_head(tx_context, head);
423 static void vnt_rxtx_ab(struct vnt_usb_send_context *tx_context)
425 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
426 struct vnt_tx_buffer *tx_buffer = tx_context->tx_buffer;
427 union vnt_tx_head *tx_head = &tx_buffer->tx_head;
428 struct vnt_rrv_time_ab *buf = &tx_head->tx_ab.ab;
429 union vnt_tx_data_head *head = &tx_head->tx_ab.tx.head;
431 buf->rrv_time = vnt_rxtx_rsvtime_le16(tx_context);
433 if (info->control.hw_key) {
434 if (vnt_fill_txkey(tx_buffer, tx_context->skb))
435 head = &tx_head->tx_ab.tx.mic.head;
438 if (info->control.use_rts) {
439 buf->rts_rrv_time = vnt_get_rts_duration(tx_context);
441 vnt_rxtx_rts_ab_head(tx_context, &head->rts_ab);
446 vnt_rxtx_datahead_ab(tx_context, &head->data_head_ab);
449 static void vnt_generate_tx_parameter(struct vnt_usb_send_context *tx_context)
451 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx_context->skb);
453 if (info->control.use_cts_prot) {
454 if (info->control.use_rts) {
455 vnt_rxtx_rts(tx_context);
460 vnt_rxtx_cts(tx_context);
465 vnt_rxtx_ab(tx_context);
468 static u16 vnt_get_hdr_size(struct ieee80211_tx_info *info)
470 u16 size = sizeof(struct vnt_tx_datahead_ab);
472 if (info->control.use_cts_prot) {
473 if (info->control.use_rts)
474 size = sizeof(struct vnt_rts_g);
476 size = sizeof(struct vnt_cts);
477 } else if (info->control.use_rts) {
478 size = sizeof(struct vnt_rts_ab);
481 if (info->control.hw_key) {
482 if (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP)
483 size += sizeof(struct vnt_mic_hdr);
486 /* Get rrv_time header */
487 if (info->control.use_cts_prot) {
488 if (info->control.use_rts)
489 size += sizeof(struct vnt_rrv_time_rts);
491 size += sizeof(struct vnt_rrv_time_cts);
493 size += sizeof(struct vnt_rrv_time_ab);
496 size += sizeof(struct vnt_tx_fifo_head);
501 int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
503 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
504 struct ieee80211_tx_rate *tx_rate = &info->control.rates[0];
505 struct ieee80211_rate *rate;
506 struct ieee80211_hdr *hdr;
507 struct vnt_tx_buffer *tx_buffer;
508 struct vnt_tx_fifo_head *tx_buffer_head;
509 struct vnt_usb_send_context *tx_context;
513 hdr = (struct ieee80211_hdr *)(skb->data);
515 rate = ieee80211_get_tx_rate(priv->hw, info);
517 if (rate->hw_value > RATE_11M) {
518 if (info->band == NL80211_BAND_5GHZ) {
519 pkt_type = PK_TYPE_11A;
521 if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
522 if (priv->basic_rates & VNT_B_RATES)
523 pkt_type = PK_TYPE_11GB;
525 pkt_type = PK_TYPE_11GA;
527 pkt_type = PK_TYPE_11A;
531 pkt_type = PK_TYPE_11B;
534 spin_lock_irqsave(&priv->lock, flags);
536 tx_context = vnt_get_free_context(priv);
538 dev_dbg(&priv->usb->dev, "%s No free context\n", __func__);
539 spin_unlock_irqrestore(&priv->lock, flags);
543 tx_context->pkt_type = pkt_type;
544 tx_context->frame_len = skb->len + 4;
545 tx_context->tx_rate = rate->hw_value;
547 spin_unlock_irqrestore(&priv->lock, flags);
549 tx_context->skb = skb_clone(skb, GFP_ATOMIC);
550 if (!tx_context->skb) {
551 tx_context->in_use = false;
555 tx_buffer = skb_push(skb, vnt_get_hdr_size(info));
556 tx_context->tx_buffer = tx_buffer;
557 tx_buffer_head = &tx_buffer->fifo_head;
559 tx_context->type = CONTEXT_DATA_PACKET;
561 /*Set fifo controls */
562 if (pkt_type == PK_TYPE_11A)
563 tx_buffer_head->fifo_ctl = 0;
564 else if (pkt_type == PK_TYPE_11B)
565 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11B);
566 else if (pkt_type == PK_TYPE_11GB)
567 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11GB);
568 else if (pkt_type == PK_TYPE_11GA)
569 tx_buffer_head->fifo_ctl = cpu_to_le16(FIFOCTL_11GA);
571 if (!ieee80211_is_data(hdr->frame_control)) {
572 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_GENINT |
574 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_TMOEN);
576 tx_buffer_head->time_stamp =
577 cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
579 tx_buffer_head->time_stamp =
580 cpu_to_le16(DEFAULT_MSDU_LIFETIME_RES_64us);
583 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
584 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_NEEDACK);
586 if (ieee80211_has_retry(hdr->frame_control))
587 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LRETRY);
589 if (info->control.use_rts)
590 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_RTS);
592 if (ieee80211_has_a4(hdr->frame_control))
593 tx_buffer_head->fifo_ctl |= cpu_to_le16(FIFOCTL_LHEAD);
595 tx_buffer_head->frag_ctl =
596 cpu_to_le16(ieee80211_hdrlen(hdr->frame_control) << 10);
598 if (info->control.hw_key)
599 tx_context->frame_len += info->control.hw_key->icv_len;
601 tx_buffer_head->current_rate = cpu_to_le16(rate->hw_value);
603 vnt_generate_tx_parameter(tx_context);
605 tx_buffer_head->frag_ctl |= cpu_to_le16(FRAGCTL_NONFRAG);
607 priv->seq_counter = (le16_to_cpu(hdr->seq_ctrl) &
608 IEEE80211_SCTL_SEQ) >> 4;
610 spin_lock_irqsave(&priv->lock, flags);
612 if (vnt_tx_context(priv, tx_context, skb)) {
613 dev_kfree_skb(tx_context->skb);
614 spin_unlock_irqrestore(&priv->lock, flags);
620 spin_unlock_irqrestore(&priv->lock, flags);
625 static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb)
627 struct vnt_tx_short_buf_head *short_head;
628 struct ieee80211_tx_info *info;
629 struct vnt_usb_send_context *context;
630 struct ieee80211_mgmt *mgmt_hdr;
632 u32 frame_size = skb->len + 4;
635 spin_lock_irqsave(&priv->lock, flags);
637 context = vnt_get_free_context(priv);
639 dev_dbg(&priv->usb->dev, "%s No free context!\n", __func__);
640 spin_unlock_irqrestore(&priv->lock, flags);
646 spin_unlock_irqrestore(&priv->lock, flags);
648 mgmt_hdr = (struct ieee80211_mgmt *)skb->data;
649 short_head = skb_push(skb, sizeof(*short_head));
651 if (priv->bb_type == BB_TYPE_11A) {
652 current_rate = RATE_6M;
654 /* Get SignalField,ServiceField,Length */
655 vnt_get_phy_field(priv, frame_size, current_rate,
656 PK_TYPE_11A, &short_head->ab);
658 /* Get TimeStampOff */
659 short_head->time_stamp_off =
660 vnt_time_stamp_off(priv, current_rate);
662 current_rate = RATE_1M;
663 short_head->fifo_ctl |= cpu_to_le16(FIFOCTL_11B);
665 /* Get SignalField,ServiceField,Length */
666 vnt_get_phy_field(priv, frame_size, current_rate,
667 PK_TYPE_11B, &short_head->ab);
669 /* Get TimeStampOff */
670 short_head->time_stamp_off =
671 vnt_time_stamp_off(priv, current_rate);
675 short_head->duration = mgmt_hdr->duration;
677 /* time stamp always 0 */
678 mgmt_hdr->u.beacon.timestamp = 0;
680 info = IEEE80211_SKB_CB(skb);
681 if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
682 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)mgmt_hdr;
684 hdr->duration_id = 0;
685 hdr->seq_ctrl = cpu_to_le16(priv->seq_counter << 4);
689 if (priv->seq_counter > 0x0fff)
690 priv->seq_counter = 0;
692 context->type = CONTEXT_BEACON_PACKET;
694 spin_lock_irqsave(&priv->lock, flags);
696 if (vnt_tx_context(priv, context, skb))
697 ieee80211_free_txskb(priv->hw, context->skb);
699 spin_unlock_irqrestore(&priv->lock, flags);
704 int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif)
706 struct sk_buff *beacon;
708 beacon = ieee80211_beacon_get(priv->hw, vif);
712 if (vnt_beacon_xmit(priv, beacon)) {
713 ieee80211_free_txskb(priv->hw, beacon);
720 int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
721 struct ieee80211_bss_conf *conf)
723 vnt_mac_reg_bits_off(priv, MAC_REG_TCR, TCR_AUTOBCNTX);
725 vnt_mac_reg_bits_off(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
727 vnt_mac_set_beacon_interval(priv, conf->beacon_int);
729 vnt_clear_current_tsf(priv);
731 vnt_mac_reg_bits_on(priv, MAC_REG_TFTCTL, TFTCTL_TSFCNTREN);
733 vnt_reset_next_tbtt(priv, conf->beacon_int);
735 return vnt_beacon_make(priv, vif);