Lines Matching defs:if_map
186 * the map is an array of struct ifnet pointers prefixed by an if_map
187 * structure. the if_map structure stores the length of its array.
205 * infrastructure to manage updates and accesses to the current if_map.
297 if_idxmap_limit(struct ifnet **if_map)
299 return ((uintptr_t)if_map[0]);
311 struct ifnet **if_map;
316 if_map = mallocarray(limit, sizeof(*if_map), M_IFADDR,
319 if_map[0] = (struct ifnet *)(uintptr_t)limit;
326 SMR_PTR_SET_LOCKED(&if_idxmap.map, if_map);
332 struct ifnet **if_map;
343 if_map = SMR_PTR_GET_LOCKED(&if_idxmap.map);
344 limit = if_idxmap_limit(if_map);
354 oif_map = if_map;
358 if_map = mallocarray(limit, sizeof(*if_map), M_IFADDR,
360 if_map[0] = (struct ifnet *)(uintptr_t)limit;
371 if_map[i] = if_ref(oifp);
378 /* use the old usedidx bitmap as an smr_entry for the if_map */
382 SMR_PTR_SET_LOCKED(&if_idxmap.map, if_map);
423 struct ifnet **if_map;
428 if_map = SMR_PTR_GET_LOCKED(&if_idxmap.map);
430 KASSERTMSG(index != 0 && index < if_idxmap_limit(if_map),
432 if_idxmap_limit(if_map));
433 KASSERT(SMR_PTR_GET_LOCKED(&if_map[index]) == NULL);
437 SMR_PTR_SET_LOCKED(&if_map[index], if_ref(ifp));
445 struct ifnet **if_map;
450 if_map = SMR_PTR_GET_LOCKED(&if_idxmap.map);
452 KASSERT(index != 0 && index < if_idxmap_limit(if_map));
453 KASSERT(SMR_PTR_GET_LOCKED(&if_map[index]) == ifp);
456 SMR_PTR_SET_LOCKED(&if_map[index], NULL);
1889 struct ifnet **if_map;
1896 if_map = SMR_PTR_GET(&if_idxmap.map);
1897 if (index < if_idxmap_limit(if_map)) {
1898 ifp = SMR_PTR_GET(&if_map[index]);