* Reclaim a node. If this is the last reference count then * do the normal free work. Otherwise remove it from the node * table and mark it gone by clearing the back-reference. */
| 2208 | * table and mark it gone by clearing the back-reference. |
| 2209 | */ |
| 2210 | static void |
| 2211 | node_reclaim(struct ieee80211_node_table *nt, struct ieee80211_node *ni) |
| 2212 | { |
| 2213 | |
| 2214 | IEEE80211_NODE_LOCK_ASSERT(nt); |
| 2215 | |
| 2216 | IEEE80211_DPRINTF(ni->ni_vap, IEEE80211_MSG_NODE, |
| 2217 | "%s: remove %p<%s> from %s table, refcnt %d\n", |
| 2218 | __func__, ni, ether_sprintf(ni->ni_macaddr), |
| 2219 | nt->nt_name, ieee80211_node_refcnt(ni)-1); |
| 2220 | /* |
| 2221 | * Clear any entry in the unicast key mapping table. |
| 2222 | * We need to do it here so rx lookups don't find it |
| 2223 | * in the mapping table even if it's not in the hash |
| 2224 | * table. We cannot depend on the mapping table entry |
| 2225 | * being cleared because the node may not be free'd. |
| 2226 | */ |
| 2227 | (void)node_clear_keyixmap(nt, ni); |
| 2228 | if (!ieee80211_node_dectestref(ni)) { |
| 2229 | /* |
| 2230 | * Other references are present, just remove the |
| 2231 | * node from the table so it cannot be found. When |
| 2232 | * the references are dropped storage will be |
| 2233 | * reclaimed. |
| 2234 | */ |
| 2235 | ieee80211_del_node_nt(nt, ni); |
| 2236 | } else |
| 2237 | _ieee80211_free_node(ni); |
| 2238 | } |
| 2239 | |
| 2240 | /* |
| 2241 | * Node table support. |
no test coverage detected