Lines Matching refs:mac_restrictions
340 switch (ap->mac_restrictions.policy) { in ap_control_proc_show()
355 seq_printf(m, "MAC entries: %u\n", ap->mac_restrictions.entries); in ap_control_proc_show()
368 spin_lock_bh(&ap->mac_restrictions.lock); in ap_control_proc_start()
369 return seq_list_start_head(&ap->mac_restrictions.mac_list, *_pos); in ap_control_proc_start()
375 return seq_list_next(v, &ap->mac_restrictions.mac_list, _pos); in ap_control_proc_next()
381 spin_unlock_bh(&ap->mac_restrictions.lock); in ap_control_proc_stop()
409 int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac) in ap_control_add_mac() argument
419 spin_lock_bh(&mac_restrictions->lock); in ap_control_add_mac()
420 list_add_tail(&entry->list, &mac_restrictions->mac_list); in ap_control_add_mac()
421 mac_restrictions->entries++; in ap_control_add_mac()
422 spin_unlock_bh(&mac_restrictions->lock); in ap_control_add_mac()
428 int ap_control_del_mac(struct mac_restrictions *mac_restrictions, u8 *mac) in ap_control_del_mac() argument
433 spin_lock_bh(&mac_restrictions->lock); in ap_control_del_mac()
434 for (ptr = mac_restrictions->mac_list.next; in ap_control_del_mac()
435 ptr != &mac_restrictions->mac_list; ptr = ptr->next) { in ap_control_del_mac()
441 mac_restrictions->entries--; in ap_control_del_mac()
442 spin_unlock_bh(&mac_restrictions->lock); in ap_control_del_mac()
446 spin_unlock_bh(&mac_restrictions->lock); in ap_control_del_mac()
451 static int ap_control_mac_deny(struct mac_restrictions *mac_restrictions, in ap_control_mac_deny() argument
457 if (mac_restrictions->policy == MAC_POLICY_OPEN) in ap_control_mac_deny()
460 spin_lock_bh(&mac_restrictions->lock); in ap_control_mac_deny()
461 list_for_each_entry(entry, &mac_restrictions->mac_list, list) { in ap_control_mac_deny()
467 spin_unlock_bh(&mac_restrictions->lock); in ap_control_mac_deny()
469 if (mac_restrictions->policy == MAC_POLICY_ALLOW) in ap_control_mac_deny()
476 void ap_control_flush_macs(struct mac_restrictions *mac_restrictions) in ap_control_flush_macs() argument
481 if (mac_restrictions->entries == 0) in ap_control_flush_macs()
484 spin_lock_bh(&mac_restrictions->lock); in ap_control_flush_macs()
485 for (ptr = mac_restrictions->mac_list.next, n = ptr->next; in ap_control_flush_macs()
486 ptr != &mac_restrictions->mac_list; in ap_control_flush_macs()
492 mac_restrictions->entries = 0; in ap_control_flush_macs()
493 spin_unlock_bh(&mac_restrictions->lock); in ap_control_flush_macs()
881 spin_lock_init(&ap->mac_restrictions.lock); in hostap_init_data()
882 INIT_LIST_HEAD(&ap->mac_restrictions.mac_list); in hostap_init_data()
947 ap_control_flush_macs(&ap->mac_restrictions); in hostap_free_data()
1395 ap_control_mac_deny(&ap->mac_restrictions, hdr->addr2)) { in handle_authen()