Skip to content

Commit 1137943

Browse files
Bjoern A. ZeebBjoern A. Zeeb
Bjoern A. Zeeb
authored and
Bjoern A. Zeeb
committed
net80211: remove ieee80211_unref_node()
ieee80211_unref_node() was only used in two error cases in ieee80211_send_nulldata(). There we do not need to guard against ni pointer reuse after decrementing the refcount of the ni as we only update the stats and return. Update the man page and remove the link for the now gone function. Sponsored by: The FreeBSD Foundation X-MFC: never Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D42035
1 parent 7d48224 commit 1137943

File tree

5 files changed

+10
-22
lines changed

5 files changed

+10
-22
lines changed

ObsoleteFiles.inc

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
# xargs -n1 | sort | uniq -d;
5252
# done
5353

54+
# 20231005: Remove man page link for now gone net80211 function.
55+
OLD_FILES+=usr/share/man/man9/ieee80211_unref_node.9.gz
56+
5457
# 20231005: bsdconfig remove support for floppy and ftp
5558
OLD_FILES+=usr/share/bsdconfig/media/floppy.subr
5659
OLD_FILES+=usr/share/bsdconfig/media/ftp.subr

share/man/man9/Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,7 @@ MLINKS+=ieee80211_node.9 ieee80211_dump_node.9 \
12121212
ieee80211_node.9 ieee80211_find_rxnode_withkey.9 \
12131213
ieee80211_node.9 ieee80211_free_node.9 \
12141214
ieee80211_node.9 ieee80211_iterate_nodes.9 \
1215-
ieee80211_node.9 ieee80211_ref_node.9 \
1216-
ieee80211_node.9 ieee80211_unref_node.9
1215+
ieee80211_node.9 ieee80211_ref_node.9
12171216
MLINKS+=ieee80211_output.9 ieee80211_process_callback.9 \
12181217
ieee80211_output.9 M_SEQNO_GET.9 \
12191218
ieee80211_output.9 M_WME_GETAC.9

share/man/man9/ieee80211_node.9

+4-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2525
.\" SUCH DAMAGE.
2626
.\"
27-
.Dd April 28, 2010
27+
.Dd October 2, 2023
2828
.Dt IEEE80211_NODE 9
2929
.Os
3030
.Sh NAME
@@ -50,9 +50,6 @@
5050
.Fn ieee80211_ref_node "struct ieee80211_node *"
5151
.\"
5252
.Ft void
53-
.Fn ieee80211_unref_node "struct ieee80211_node *"
54-
.\"
55-
.Ft void
5653
.Fn ieee80211_free_node "struct ieee80211_node *"
5754
.\"
5855
.Ft void
@@ -106,14 +103,10 @@ Routines that lookup a table entry return a
106103
(i.e. a pointer to a table entry with the reference count incremented).
107104
The
108105
.Fn ieee80211_ref_node
109-
and
110-
.Fn ieee80211_unref_node
111-
calls explicitly increment/decrement the reference count of a node,
112-
but are rarely used.
113-
Instead most callers use
106+
call explicitly increments the reference count of a node.
114107
.Fn ieee80211_free_node
115-
to release a reference and, if the count goes to zero, reclaim the
116-
table entry.
108+
decrements the reference count of a node and if the count goes to zero
109+
reclaims the table entry.
117110
.Pp
118111
The station table and its entries are exposed to drivers in several ways.
119112
Each frame transmitted to a station includes a reference to the

sys/net80211/ieee80211_node.h

-7
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,6 @@ ieee80211_ref_node(struct ieee80211_node *ni)
326326
return ni;
327327
}
328328

329-
static __inline void
330-
ieee80211_unref_node(struct ieee80211_node **ni)
331-
{
332-
ieee80211_node_decref(*ni);
333-
*ni = NULL; /* guard against use */
334-
}
335-
336329
void ieee80211_node_attach(struct ieee80211com *);
337330
void ieee80211_node_lateattach(struct ieee80211com *);
338331
void ieee80211_node_detach(struct ieee80211com *);

sys/net80211/ieee80211_output.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni)
11041104
if (vap->iv_state == IEEE80211_S_CAC) {
11051105
IEEE80211_NOTE(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_DOTH,
11061106
ni, "block %s frame in CAC state", "null data");
1107-
ieee80211_unref_node(&ni);
1107+
ieee80211_node_decref(ni);
11081108
vap->iv_stats.is_tx_badstate++;
11091109
return EIO; /* XXX */
11101110
}
@@ -1122,7 +1122,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni)
11221122
m = ieee80211_getmgtframe(&frm, ic->ic_headroom + hdrlen, 0);
11231123
if (m == NULL) {
11241124
/* XXX debug msg */
1125-
ieee80211_unref_node(&ni);
1125+
ieee80211_node_decref(ni);
11261126
vap->iv_stats.is_tx_nobuf++;
11271127
return ENOMEM;
11281128
}

0 commit comments

Comments
 (0)