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);
215 if (!new_ap && ap != iface->ap_list) {
218 ap_ap_list_del(iface, ap);
219 ap_ap_list_add(iface, ap);
222 if (!iface->olbc &&
223 ap_list_beacon_olbc(iface, ap)) {
224 iface->olbc = 1;
232 if (!iface->olbc_ht && !ap->ht_support &&
234 ap->channel == iface->conf->channel ||
235 ap->channel == iface->conf->channel +
236 iface->conf->secondary_channel * 4)) {
237 iface->olbc_ht = 1;
238 hostapd_ht_operation_update(iface);
247 ieee802_11_update_beacons(iface);
251 void ap_list_timer(struct hostapd_iface *iface)
257 if (!iface->ap_list)
262 while (iface->ap_list) {
263 ap = iface->ap_list->prev;
265 iface->conf->ap_table_expiration_time))
268 ap_free_ap(iface, ap);
271 if (iface->olbc || iface->olbc_ht) {
275 ap = iface->ap_list;
277 if (ap_list_beacon_olbc(iface, ap))
283 if (!olbc && iface->olbc) {
285 iface->olbc = 0;
289 if (!olbc_ht && iface->olbc_ht) {
291 iface->olbc_ht = 0;
292 hostapd_ht_operation_update(iface);
299 ieee802_11_update_beacons(iface);
303 int ap_list_init(struct hostapd_iface *iface)
309 void ap_list_deinit(struct hostapd_iface *iface)
311 hostapd_free_aps(iface);