2fad613add5105c997e650d587f05d39290318a1
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / htc_drv_beacon.c
1 /*
2  * Copyright (c) 2010 Atheros Communications Inc.
3  *
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.
7  *
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.
15  */
16
17 #include "htc.h"
18
19 #define FUDGE 2
20
21 static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv,
22                                         struct htc_beacon_config *bss_conf)
23 {
24         struct ath_common *common = ath9k_hw_common(priv->ah);
25         struct ath9k_beacon_state bs;
26         enum ath9k_int imask = 0;
27         int dtimperiod, dtimcount, sleepduration;
28         int cfpperiod, cfpcount, bmiss_timeout;
29         u32 nexttbtt = 0, intval, tsftu;
30         __be32 htc_imask = 0;
31         u64 tsf;
32         int num_beacons, offset, dtim_dec_count, cfp_dec_count;
33         int ret;
34         u8 cmd_rsp;
35
36         memset(&bs, 0, sizeof(bs));
37
38         intval = bss_conf->beacon_interval & ATH9K_BEACON_PERIOD;
39         bmiss_timeout = (ATH_DEFAULT_BMISS_LIMIT * bss_conf->beacon_interval);
40
41         /*
42          * Setup dtim and cfp parameters according to
43          * last beacon we received (which may be none).
44          */
45         dtimperiod = bss_conf->dtim_period;
46         if (dtimperiod <= 0)            /* NB: 0 if not known */
47                 dtimperiod = 1;
48         dtimcount = 1;
49         if (dtimcount >= dtimperiod)    /* NB: sanity check */
50                 dtimcount = 0;
51         cfpperiod = 1;                  /* NB: no PCF support yet */
52         cfpcount = 0;
53
54         sleepduration = intval;
55         if (sleepduration <= 0)
56                 sleepduration = intval;
57
58         /*
59          * Pull nexttbtt forward to reflect the current
60          * TSF and calculate dtim+cfp state for the result.
61          */
62         tsf = ath9k_hw_gettsf64(priv->ah);
63         tsftu = TSF_TO_TU(tsf>>32, tsf) + FUDGE;
64
65         num_beacons = tsftu / intval + 1;
66         offset = tsftu % intval;
67         nexttbtt = tsftu - offset;
68         if (offset)
69                 nexttbtt += intval;
70
71         /* DTIM Beacon every dtimperiod Beacon */
72         dtim_dec_count = num_beacons % dtimperiod;
73         /* CFP every cfpperiod DTIM Beacon */
74         cfp_dec_count = (num_beacons / dtimperiod) % cfpperiod;
75         if (dtim_dec_count)
76                 cfp_dec_count++;
77
78         dtimcount -= dtim_dec_count;
79         if (dtimcount < 0)
80                 dtimcount += dtimperiod;
81
82         cfpcount -= cfp_dec_count;
83         if (cfpcount < 0)
84                 cfpcount += cfpperiod;
85
86         bs.bs_intval = intval;
87         bs.bs_nexttbtt = nexttbtt;
88         bs.bs_dtimperiod = dtimperiod*intval;
89         bs.bs_nextdtim = bs.bs_nexttbtt + dtimcount*intval;
90         bs.bs_cfpperiod = cfpperiod*bs.bs_dtimperiod;
91         bs.bs_cfpnext = bs.bs_nextdtim + cfpcount*bs.bs_dtimperiod;
92         bs.bs_cfpmaxduration = 0;
93
94         /*
95          * Calculate the number of consecutive beacons to miss* before taking
96          * a BMISS interrupt. The configuration is specified in TU so we only
97          * need calculate based on the beacon interval.  Note that we clamp the
98          * result to at most 15 beacons.
99          */
100         if (sleepduration > intval) {
101                 bs.bs_bmissthreshold = ATH_DEFAULT_BMISS_LIMIT / 2;
102         } else {
103                 bs.bs_bmissthreshold = DIV_ROUND_UP(bmiss_timeout, intval);
104                 if (bs.bs_bmissthreshold > 15)
105                         bs.bs_bmissthreshold = 15;
106                 else if (bs.bs_bmissthreshold <= 0)
107                         bs.bs_bmissthreshold = 1;
108         }
109
110         /*
111          * Calculate sleep duration. The configuration is given in ms.
112          * We ensure a multiple of the beacon period is used. Also, if the sleep
113          * duration is greater than the DTIM period then it makes senses
114          * to make it a multiple of that.
115          *
116          * XXX fixed at 100ms
117          */
118
119         bs.bs_sleepduration = roundup(IEEE80211_MS_TO_TU(100), sleepduration);
120         if (bs.bs_sleepduration > bs.bs_dtimperiod)
121                 bs.bs_sleepduration = bs.bs_dtimperiod;
122
123         /* TSF out of range threshold fixed at 1 second */
124         bs.bs_tsfoor_threshold = ATH9K_TSFOOR_THRESHOLD;
125
126         ath_dbg(common, ATH_DBG_CONFIG, "intval: %u tsf: %llu tsftu: %u\n",
127                 intval, tsf, tsftu);
128         ath_dbg(common, ATH_DBG_CONFIG,
129                 "bmiss: %u sleep: %u cfp-period: %u maxdur: %u next: %u\n",
130                 bs.bs_bmissthreshold, bs.bs_sleepduration,
131                 bs.bs_cfpperiod, bs.bs_cfpmaxduration, bs.bs_cfpnext);
132
133         /* Set the computed STA beacon timers */
134
135         WMI_CMD(WMI_DISABLE_INTR_CMDID);
136         ath9k_hw_set_sta_beacon_timers(priv->ah, &bs);
137         imask |= ATH9K_INT_BMISS;
138         htc_imask = cpu_to_be32(imask);
139         WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
140 }
141
142 static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,
143                                        struct htc_beacon_config *bss_conf)
144 {
145         struct ath_common *common = ath9k_hw_common(priv->ah);
146         enum ath9k_int imask = 0;
147         u32 nexttbtt, intval, tsftu;
148         __be32 htc_imask = 0;
149         int ret;
150         u8 cmd_rsp;
151         u64 tsf;
152
153         intval = bss_conf->beacon_interval & ATH9K_BEACON_PERIOD;
154         intval /= ATH9K_HTC_MAX_BCN_VIF;
155         nexttbtt = intval;
156
157         if (priv->op_flags & OP_TSF_RESET) {
158                 ath9k_hw_reset_tsf(priv->ah);
159                 priv->op_flags &= ~OP_TSF_RESET;
160         } else {
161                 /*
162                  * Pull nexttbtt forward to reflect the current TSF.
163                  */
164                 tsf = ath9k_hw_gettsf64(priv->ah);
165                 tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE;
166                 do {
167                         nexttbtt += intval;
168                 } while (nexttbtt < tsftu);
169         }
170
171         if (priv->op_flags & OP_ENABLE_BEACON)
172                 imask |= ATH9K_INT_SWBA;
173
174         ath_dbg(common, ATH_DBG_CONFIG,
175                 "AP Beacon config, intval: %d, nexttbtt: %u "
176                 "imask: 0x%x\n",
177                 bss_conf->beacon_interval, nexttbtt, imask);
178
179         WMI_CMD(WMI_DISABLE_INTR_CMDID);
180         ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval));
181         priv->cur_beacon_conf.bmiss_cnt = 0;
182         htc_imask = cpu_to_be32(imask);
183         WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
184 }
185
186 static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
187                                           struct htc_beacon_config *bss_conf)
188 {
189         struct ath_common *common = ath9k_hw_common(priv->ah);
190         enum ath9k_int imask = 0;
191         u32 nexttbtt, intval, tsftu;
192         __be32 htc_imask = 0;
193         int ret;
194         u8 cmd_rsp;
195         u64 tsf;
196
197         intval = bss_conf->beacon_interval & ATH9K_BEACON_PERIOD;
198         nexttbtt = intval;
199
200         /*
201          * Pull nexttbtt forward to reflect the current TSF.
202          */
203         tsf = ath9k_hw_gettsf64(priv->ah);
204         tsftu = TSF_TO_TU(tsf >> 32, tsf) + FUDGE;
205         do {
206                 nexttbtt += intval;
207         } while (nexttbtt < tsftu);
208
209         if (priv->op_flags & OP_ENABLE_BEACON)
210                 imask |= ATH9K_INT_SWBA;
211
212         ath_dbg(common, ATH_DBG_CONFIG,
213                 "IBSS Beacon config, intval: %d, nexttbtt: %u, imask: 0x%x\n",
214                 bss_conf->beacon_interval, nexttbtt, imask);
215
216         WMI_CMD(WMI_DISABLE_INTR_CMDID);
217         ath9k_hw_beaconinit(priv->ah, TU_TO_USEC(nexttbtt), TU_TO_USEC(intval));
218         priv->cur_beacon_conf.bmiss_cnt = 0;
219         htc_imask = cpu_to_be32(imask);
220         WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
221 }
222
223 void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
224                         enum htc_endpoint_id ep_id, bool txok)
225 {
226         dev_kfree_skb_any(skb);
227 }
228
229 static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
230                                   int slot)
231 {
232         struct ieee80211_vif *vif;
233         struct ath9k_htc_vif *avp;
234         struct tx_beacon_header beacon_hdr;
235         struct ath9k_htc_tx_ctl tx_ctl;
236         struct ieee80211_tx_info *info;
237         struct ieee80211_mgmt *mgmt;
238         struct sk_buff *beacon;
239         u8 *tx_fhdr;
240
241         memset(&beacon_hdr, 0, sizeof(struct tx_beacon_header));
242         memset(&tx_ctl, 0, sizeof(struct ath9k_htc_tx_ctl));
243
244         spin_lock_bh(&priv->beacon_lock);
245
246         vif = priv->cur_beacon_conf.bslot[slot];
247         avp = (struct ath9k_htc_vif *)vif->drv_priv;
248
249         if (unlikely(priv->op_flags & OP_SCANNING)) {
250                 spin_unlock_bh(&priv->beacon_lock);
251                 return;
252         }
253
254         /* Get a new beacon */
255         beacon = ieee80211_beacon_get(priv->hw, vif);
256         if (!beacon) {
257                 spin_unlock_bh(&priv->beacon_lock);
258                 return;
259         }
260
261         /*
262          * Update the TSF adjust value here, the HW will
263          * add this value for every beacon.
264          */
265         mgmt = (struct ieee80211_mgmt *)beacon->data;
266         mgmt->u.beacon.timestamp = avp->tsfadjust;
267
268         info = IEEE80211_SKB_CB(beacon);
269         if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
270                 struct ieee80211_hdr *hdr =
271                         (struct ieee80211_hdr *) beacon->data;
272                 avp->seq_no += 0x10;
273                 hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
274                 hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
275         }
276
277         tx_ctl.type = ATH9K_HTC_NORMAL;
278         beacon_hdr.vif_index = avp->index;
279         tx_fhdr = skb_push(beacon, sizeof(beacon_hdr));
280         memcpy(tx_fhdr, (u8 *) &beacon_hdr, sizeof(beacon_hdr));
281
282         htc_send(priv->htc, beacon, priv->beacon_ep, &tx_ctl);
283
284         spin_unlock_bh(&priv->beacon_lock);
285 }
286
287 static int ath9k_htc_choose_bslot(struct ath9k_htc_priv *priv)
288 {
289         struct ath_common *common = ath9k_hw_common(priv->ah);
290         unsigned long flags;
291         u64 tsf;
292         u32 tsftu;
293         u16 intval;
294         int slot;
295
296         intval = priv->cur_beacon_conf.beacon_interval & ATH9K_BEACON_PERIOD;
297
298         spin_lock_irqsave(&priv->wmi->wmi_lock, flags);
299         tsf = priv->wmi->tsf;
300         spin_unlock_irqrestore(&priv->wmi->wmi_lock, flags);
301
302         tsftu = TSF_TO_TU(tsf >> 32, tsf);
303         slot = ((tsftu % intval) * ATH9K_HTC_MAX_BCN_VIF) / intval;
304         slot = ATH9K_HTC_MAX_BCN_VIF - slot - 1;
305
306         ath_dbg(common, ATH_DBG_BEACON,
307                 "Choose slot: %d, tsf: %llu, tsftu: %u, intval: %u\n",
308                 slot, tsf, tsftu, intval);
309
310         return slot;
311 }
312
313 void ath9k_htc_swba(struct ath9k_htc_priv *priv)
314 {
315         struct ath_common *common = ath9k_hw_common(priv->ah);
316         unsigned long flags;
317         int slot;
318
319         spin_lock_irqsave(&priv->wmi->wmi_lock, flags);
320         if (priv->wmi->beacon_pending != 0) {
321                 spin_unlock_irqrestore(&priv->wmi->wmi_lock, flags);
322                 priv->cur_beacon_conf.bmiss_cnt++;
323                 if (priv->cur_beacon_conf.bmiss_cnt > BSTUCK_THRESHOLD) {
324                         ath_dbg(common, ATH_DBG_BEACON,
325                                 "Beacon stuck, HW reset\n");
326                         ath9k_htc_reset(priv);
327                 }
328                 return;
329         }
330         spin_unlock_irqrestore(&priv->wmi->wmi_lock, flags);
331
332         if (priv->cur_beacon_conf.bmiss_cnt) {
333                 ath_dbg(common, ATH_DBG_BEACON,
334                         "Resuming beacon xmit after %u misses\n",
335                         priv->cur_beacon_conf.bmiss_cnt);
336                 priv->cur_beacon_conf.bmiss_cnt = 0;
337         }
338
339         slot = ath9k_htc_choose_bslot(priv);
340         spin_lock_bh(&priv->beacon_lock);
341         if (priv->cur_beacon_conf.bslot[slot] == NULL) {
342                 spin_unlock_bh(&priv->beacon_lock);
343                 return;
344         }
345         spin_unlock_bh(&priv->beacon_lock);
346
347         ath9k_htc_send_beacon(priv, slot);
348 }
349
350 /* Currently, only for IBSS */
351 void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv)
352 {
353         struct ath_hw *ah = priv->ah;
354         struct ath9k_tx_queue_info qi, qi_be;
355         int qnum = priv->hwq_map[WME_AC_BE];
356
357         memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
358         memset(&qi_be, 0, sizeof(struct ath9k_tx_queue_info));
359
360         ath9k_hw_get_txq_props(ah, qnum, &qi_be);
361
362         qi.tqi_aifs = qi_be.tqi_aifs;
363         /* For WIFI Beacon Distribution
364          * Long slot time  : 2x cwmin
365          * Short slot time : 4x cwmin
366          */
367         if (ah->slottime == ATH9K_SLOT_TIME_20)
368                 qi.tqi_cwmin = 2*qi_be.tqi_cwmin;
369         else
370                 qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
371         qi.tqi_cwmax = qi_be.tqi_cwmax;
372
373         if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
374                 ath_err(ath9k_hw_common(ah),
375                         "Unable to update beacon queue %u!\n", qnum);
376         } else {
377                 ath9k_hw_resettxqueue(ah, priv->beaconq);
378         }
379 }
380
381 void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
382                             struct ieee80211_vif *vif)
383 {
384         struct ath_common *common = ath9k_hw_common(priv->ah);
385         struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv;
386         int i = 0;
387
388         spin_lock_bh(&priv->beacon_lock);
389         for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++) {
390                 if (priv->cur_beacon_conf.bslot[i] == NULL) {
391                         avp->bslot = i;
392                         break;
393                 }
394         }
395
396         priv->cur_beacon_conf.bslot[avp->bslot] = vif;
397         spin_unlock_bh(&priv->beacon_lock);
398
399         ath_dbg(common, ATH_DBG_CONFIG,
400                 "Added interface at beacon slot: %d\n", avp->bslot);
401 }
402
403 void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
404                             struct ieee80211_vif *vif)
405 {
406         struct ath_common *common = ath9k_hw_common(priv->ah);
407         struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv;
408
409         spin_lock_bh(&priv->beacon_lock);
410         priv->cur_beacon_conf.bslot[avp->bslot] = NULL;
411         spin_unlock_bh(&priv->beacon_lock);
412
413         ath_dbg(common, ATH_DBG_CONFIG,
414                 "Removed interface at beacon slot: %d\n", avp->bslot);
415 }
416
417 /*
418  * Calculate the TSF adjustment value for all slots
419  * other than zero.
420  */
421 void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
422                              struct ieee80211_vif *vif)
423 {
424         struct ath_common *common = ath9k_hw_common(priv->ah);
425         struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *)vif->drv_priv;
426         struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf;
427         u64 tsfadjust;
428
429         if (avp->bslot == 0)
430                 return;
431
432         /*
433          * The beacon interval cannot be different for multi-AP mode,
434          * and we reach here only for VIF slots greater than zero,
435          * so beacon_interval is guaranteed to be set in cur_conf.
436          */
437         tsfadjust = cur_conf->beacon_interval * avp->bslot / ATH9K_HTC_MAX_BCN_VIF;
438         avp->tsfadjust = cpu_to_le64(TU_TO_USEC(tsfadjust));
439
440         ath_dbg(common, ATH_DBG_CONFIG,
441                 "tsfadjust is: %llu for bslot: %d\n",
442                 (unsigned long long)tsfadjust, avp->bslot);
443 }
444
445 static void ath9k_htc_beacon_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
446 {
447         bool *beacon_configured = (bool *)data;
448         struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *) vif->drv_priv;
449
450         if (vif->type == NL80211_IFTYPE_STATION &&
451             avp->beacon_configured)
452                 *beacon_configured = true;
453 }
454
455 static bool ath9k_htc_check_beacon_config(struct ath9k_htc_priv *priv,
456                                           struct ieee80211_vif *vif)
457 {
458         struct ath_common *common = ath9k_hw_common(priv->ah);
459         struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf;
460         struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
461         bool beacon_configured;
462
463         /*
464          * Changing the beacon interval when multiple AP interfaces
465          * are configured will affect beacon transmission of all
466          * of them.
467          */
468         if ((priv->ah->opmode == NL80211_IFTYPE_AP) &&
469             (priv->num_ap_vif > 1) &&
470             (vif->type == NL80211_IFTYPE_AP) &&
471             (cur_conf->beacon_interval != bss_conf->beacon_int)) {
472                 ath_dbg(common, ATH_DBG_CONFIG,
473                         "Changing beacon interval of multiple AP interfaces !\n");
474                 return false;
475         }
476
477         /*
478          * If the HW is operating in AP mode, any new station interfaces that
479          * are added cannot change the beacon parameters.
480          */
481         if (priv->num_ap_vif &&
482             (vif->type != NL80211_IFTYPE_AP)) {
483                 ath_dbg(common, ATH_DBG_CONFIG,
484                         "HW in AP mode, cannot set STA beacon parameters\n");
485                 return false;
486         }
487
488         /*
489          * The beacon parameters are configured only for the first
490          * station interface.
491          */
492         if ((priv->ah->opmode == NL80211_IFTYPE_STATION) &&
493             (priv->num_sta_vif > 1) &&
494             (vif->type == NL80211_IFTYPE_STATION)) {
495                 beacon_configured = false;
496                 ieee80211_iterate_active_interfaces_atomic(priv->hw,
497                                                            ath9k_htc_beacon_iter,
498                                                            &beacon_configured);
499
500                 if (beacon_configured) {
501                         ath_dbg(common, ATH_DBG_CONFIG,
502                                 "Beacon already configured for a station interface\n");
503                         return false;
504                 }
505         }
506
507         return true;
508 }
509
510 void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
511                              struct ieee80211_vif *vif)
512 {
513         struct ath_common *common = ath9k_hw_common(priv->ah);
514         struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf;
515         struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
516         struct ath9k_htc_vif *avp = (struct ath9k_htc_vif *) vif->drv_priv;
517
518         if (!ath9k_htc_check_beacon_config(priv, vif))
519                 return;
520
521         cur_conf->beacon_interval = bss_conf->beacon_int;
522         if (cur_conf->beacon_interval == 0)
523                 cur_conf->beacon_interval = 100;
524
525         cur_conf->dtim_period = bss_conf->dtim_period;
526         cur_conf->bmiss_timeout =
527                 ATH_DEFAULT_BMISS_LIMIT * cur_conf->beacon_interval;
528
529         switch (vif->type) {
530         case NL80211_IFTYPE_STATION:
531                 ath9k_htc_beacon_config_sta(priv, cur_conf);
532                 avp->beacon_configured = true;
533                 break;
534         case NL80211_IFTYPE_ADHOC:
535                 ath9k_htc_beacon_config_adhoc(priv, cur_conf);
536                 break;
537         case NL80211_IFTYPE_AP:
538                 ath9k_htc_beacon_config_ap(priv, cur_conf);
539                 break;
540         default:
541                 ath_dbg(common, ATH_DBG_CONFIG,
542                         "Unsupported beaconing mode\n");
543                 return;
544         }
545 }
546
547 void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv)
548 {
549         struct ath_common *common = ath9k_hw_common(priv->ah);
550         struct htc_beacon_config *cur_conf = &priv->cur_beacon_conf;
551
552         switch (priv->ah->opmode) {
553         case NL80211_IFTYPE_STATION:
554                 ath9k_htc_beacon_config_sta(priv, cur_conf);
555                 break;
556         case NL80211_IFTYPE_ADHOC:
557                 ath9k_htc_beacon_config_adhoc(priv, cur_conf);
558                 break;
559         case NL80211_IFTYPE_AP:
560                 ath9k_htc_beacon_config_ap(priv, cur_conf);
561                 break;
562         default:
563                 ath_dbg(common, ATH_DBG_CONFIG,
564                         "Unsupported beaconing mode\n");
565                 return;
566         }
567 }