Lines Matching defs:map

4736 	mac_address_t *map;
4740 for (map = mip->mi_addresses; map != NULL; map = map->ma_next) {
4741 if (bcmp(mac_addr, map->ma_addr, map->ma_len) == 0)
4745 return (map);
4752 mac_check_macaddr_shared(mac_address_t *map)
4754 ASSERT(MAC_PERIM_HELD((mac_handle_t)map->ma_mip));
4756 return (map->ma_nusers > 1);
4763 mac_free_macaddr(mac_address_t *map)
4765 mac_impl_t *mip = map->ma_mip;
4770 map = mac_find_macaddr(mip, map->ma_addr);
4772 ASSERT(map != NULL);
4773 ASSERT(map->ma_nusers == 0);
4775 if (map == mip->mi_addresses) {
4776 mip->mi_addresses = map->ma_next;
4781 while (pre->ma_next != map)
4783 pre->ma_next = map->ma_next;
4786 kmem_free(map, sizeof (mac_address_t));
4805 mac_address_t *map;
4811 map = mac_find_macaddr(mip, mac_addr);
4817 if (map == NULL) {
4818 map = kmem_zalloc(sizeof (mac_address_t), KM_SLEEP);
4819 map->ma_len = mip->mi_type->mt_addr_length;
4820 bcopy(mac_addr, map->ma_addr, map->ma_len);
4821 map->ma_nusers = 0;
4822 map->ma_group = group;
4823 map->ma_mip = mip;
4826 map->ma_next = mip->mi_addresses;
4827 mip->mi_addresses = map;
4832 ASSERT(map->ma_group == NULL || map->ma_group == group);
4833 if (map->ma_group == NULL)
4834 map->ma_group = group;
4840 if (map->ma_nusers++ > 0)
4849 map->ma_type = MAC_ADDRESS_TYPE_UNICAST_CLASSIFIED;
4870 (bcmp(map->ma_addr, mip->mi_addr, map->ma_len) == 0)) {
4871 map->ma_type = MAC_ADDRESS_TYPE_UNICAST_CLASSIFIED;
4880 map->ma_type = MAC_ADDRESS_TYPE_UNICAST_PROMISC;
4891 map->ma_nusers--;
4893 mac_free_macaddr(map);
4903 mac_remove_macaddr(mac_address_t *map)
4905 mac_impl_t *mip = map->ma_mip;
4910 ASSERT(map == mac_find_macaddr(mip, map->ma_addr));
4916 if (--map->ma_nusers > 0)
4924 switch (map->ma_type) {
4930 if (map->ma_group == NULL)
4933 err = mac_group_remmac(map->ma_group, map->ma_addr);
4935 map->ma_group = NULL;
4951 if (bcmp(map->ma_addr, mip->mi_addr, map->ma_len) != 0)
4952 mac_free_macaddr(map);
4962 mac_update_macaddr(mac_address_t *map, uint8_t *mac_addr)
4964 mac_impl_t *mip = map->ma_mip;
4970 switch (map->ma_type) {
4988 if (map->ma_nusers == 0)
4994 err = mac_group_remmac(map->ma_group, map->ma_addr);
4998 err = mac_group_addmac(map->ma_group, mac_addr);
5006 (void) mac_group_addmac(map->ma_group, map->ma_addr);
5022 bcopy(mac_addr, map->ma_addr, map->ma_len);
5034 mac_freshen_macaddr(mac_address_t *map, uint8_t *mac_addr)
5036 mac_impl_t *mip = map->ma_mip;
5044 bcopy(mac_addr, map->ma_addr, map->ma_len);
5045 bcopy(mac_addr, mip->mi_addr, map->ma_len);
5050 mac_unicast_update_clients(mip, map);
5059 mac_address_t *map;
5065 map = kmem_zalloc(sizeof (mac_address_t), KM_SLEEP);
5066 map->ma_len = mip->mi_type->mt_addr_length;
5067 bcopy(mip->mi_addr, map->ma_addr, map->ma_len);
5075 map->ma_type = MAC_ADDRESS_TYPE_UNICAST_CLASSIFIED;
5077 map->ma_mip = mip;
5079 mip->mi_addresses = map;
5089 mac_address_t *map = mip->mi_addresses;
5091 if (map == NULL)
5098 ASSERT(map->ma_nusers == 0);
5099 ASSERT(map->ma_next == NULL);
5101 kmem_free(map, sizeof (mac_address_t));
6181 mac_address_t *map;
6203 if (!move && (map = mac_find_macaddr(mip, mac_addr)) != NULL) {
6204 if (map->ma_group != NULL)
6205 return (map->ma_group);