Lines Matching refs:iface

31 static int ap_list_beacon_olbc(struct hostapd_iface *iface, struct ap_info *ap)
35 if (iface->current_mode == NULL ||
36 iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G ||
37 iface->conf->channel != ap->channel)
53 static struct ap_info * ap_get_ap(struct hostapd_iface *iface, const u8 *ap)
57 s = iface->ap_hash[STA_HASH(ap)];
64 static void ap_ap_list_add(struct hostapd_iface *iface, struct ap_info *ap)
66 if (iface->ap_list) {
67 ap->prev = iface->ap_list->prev;
68 iface->ap_list->prev = ap;
71 ap->next = iface->ap_list;
72 iface->ap_list = ap;
76 static void ap_ap_list_del(struct hostapd_iface *iface, struct ap_info *ap)
78 if (iface->ap_list == ap)
79 iface->ap_list = ap->next;
85 else if (iface->ap_list)
86 iface->ap_list->prev = ap->prev;
90 static void ap_ap_hash_add(struct hostapd_iface *iface, struct ap_info *ap)
92 ap->hnext = iface->ap_hash[STA_HASH(ap->addr)];
93 iface->ap_hash[STA_HASH(ap->addr)] = ap;
97 static void ap_ap_hash_del(struct hostapd_iface *iface, struct ap_info *ap)
101 s = iface->ap_hash[STA_HASH(ap->addr)];
104 iface->ap_hash[STA_HASH(ap->addr)] = s->hnext;
119 static void ap_free_ap(struct hostapd_iface *iface, struct ap_info *ap)
121 ap_ap_hash_del(iface, ap);
122 ap_ap_list_del(iface, ap);
124 iface->num_ap--;
129 static void hostapd_free_aps(struct hostapd_iface *iface)
133 ap = iface->ap_list;
138 ap_free_ap(iface, prev);
141 iface->ap_list = NULL;
145 static struct ap_info * ap_ap_add(struct hostapd_iface *iface, const u8 *addr)
155 ap_ap_list_add(iface, ap);
156 iface->num_ap++;
157 ap_ap_hash_add(iface, ap);
159 if (iface->num_ap > iface->conf->ap_table_max_size && ap != ap->prev) {
162 ap_free_ap(iface, ap->prev);
169 void ap_list_process_beacon(struct hostapd_iface *iface,
178 if (iface->conf->ap_table_max_size < 1)
181 ap = ap_get_ap(iface, mgmt->bssid);
183 ap = ap_ap_add(iface, mgmt->bssid);
214 if (!new_ap && ap != iface->ap_list) {
217 ap_ap_list_del(iface, ap);
218 ap_ap_list_add(iface, ap);
221 if (!iface->olbc &&
222 ap_list_beacon_olbc(iface, ap)) {
223 iface->olbc = 1;
231 if (!iface->olbc_ht && !ap->ht_support &&
233 ap->channel == iface->conf->channel ||
234 ap->channel == iface->conf->channel +
235 iface->conf->secondary_channel * 4)) {
236 iface->olbc_ht = 1;
237 hostapd_ht_operation_update(iface);
246 ieee802_11_update_beacons(iface);
252 struct hostapd_iface *iface = eloop_ctx;
257 eloop_register_timeout(10, 0, ap_list_timer, iface, NULL);
259 if (!iface->ap_list)
264 while (iface->ap_list) {
265 ap = iface->ap_list->prev;
267 iface->conf->ap_table_expiration_time))
270 ap_free_ap(iface, ap);
273 if (iface->olbc || iface->olbc_ht) {
277 ap = iface->ap_list;
279 if (ap_list_beacon_olbc(iface, ap))
285 if (!olbc && iface->olbc) {
287 iface->olbc = 0;
291 if (!olbc_ht && iface->olbc_ht) {
293 iface->olbc_ht = 0;
294 hostapd_ht_operation_update(iface);
301 ieee802_11_update_beacons(iface);
305 int ap_list_init(struct hostapd_iface *iface)
307 eloop_register_timeout(10, 0, ap_list_timer, iface, NULL);
312 void ap_list_deinit(struct hostapd_iface *iface)
314 eloop_cancel_timeout(ap_list_timer, iface, NULL);
315 hostapd_free_aps(iface);