From nobody Wed Sep 21 14:01:21 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MXg7Q1k8Pz4cY0b; Wed, 21 Sep 2022 14:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MXg7Q0v4dz49Ry; Wed, 21 Sep 2022 14:01:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ocPKcYy7ZSPPiOar2aRFPvttTG/7e51nyUoUBz4aHzM=; b=KNyxBsOuzs4llErucs7bGZpGSeNR9SZvZgr2giAzuQf9TQSwL8Zfw5bmXV+p3U10ydc4TT GQf9R24THZNRSj9QuRwqMcDdF8cOCfrXt34d9O4E6v4hGrtxnBLbkHoLz3R3XB/hF9WFya svCMEAj/980zBxOK+ARPOo2ppaJm4aa9DktxSPsjEq8NfHVVzhpp86K5fO5THf9FXTmj9e N9NRcBZAIvdJkaL+Cy4qwYfEf0EM0NrAYFLsQaja5eZ6snRETlBnsJ7Lcr9DK3iWdCgBmv YbqQ21GmYxZv7K+qA6GMTnf+Z9l7gZ5x3FlLNnezcMaGRASv8xDecG4sbFnpzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MXg7P74rFz14md; Wed, 21 Sep 2022 14:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28LE1LCE099945; Wed, 21 Sep 2022 14:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28LE1LdS099944; Wed, 21 Sep 2022 14:01:21 GMT (envelope-from git) Date: Wed, 21 Sep 2022 14:01:21 GMT Message-Id: <202209211401.28LE1LdS099944@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f36e7c583ae1 - stable/13 - net80211: consistently use the IEEE80211_M_ memory related options List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f36e7c583ae145acbbe0ce2dc6db405efc930ee6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663768882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ocPKcYy7ZSPPiOar2aRFPvttTG/7e51nyUoUBz4aHzM=; b=OksgOvQBA2fr+I4MAfsa27K8K99gXqD605sFXOiK1rFS3afI/918rNdTOuMpmTUvui50e4 XO7fQzakbTd18WyRgBEkycRHxp2i76KZnW2y8Fh5JfZb8eqtD9e12KwSuI8dpigviwuB3V YOlm8uerNz9q02k65V49DeY9qpx5fWrwQNLs0JJhcbE9cK75jFS8YgiZ3RPeg8qClvJhHJ NB+tsasckCrKgA35FsjRzHQ/qKiRvrka1Xt1ELfLB4DRLMhUMmiVG/gqer2fa8gytnHvRU e7KuB2Tmkgw5LiFhM3xCAVWoawP5x/277S0SSYxtOSxKEle9xJEMbwgfoWf7TA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663768882; a=rsa-sha256; cv=none; b=gjnn3mNPXgpOMfFgl2of5/GbNRAOSJX9/SENp2LPC0MfcJxA4IIOs3BnlNH7L8lnww42+S a9bjhvdBWB9UmWm/ovJ4Xw58htdzTh3Wbti9RBoj6cybQGewLhEvdPUVZTd3uYHnx9CIkU sI7zly7C8GnsQQM8MICeiLPtpitptqtk+UtinaKC0DIh2XtiUDohrPU+wTZw7gRUEyqQNY Lb0QusVJzJ0l7msNLFLqiMb1xcxQ4alv9fzD61Kqv7Mef7mBTZ+druQhf575A+hvnnQkeN 5jR6h75AihBfIvd1s23UqJrWz0L8HoQFxvF5ki4GdcZCppkQmVZrIlsdpWqecw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f36e7c583ae145acbbe0ce2dc6db405efc930ee6 commit f36e7c583ae145acbbe0ce2dc6db405efc930ee6 Author: Bjoern A. Zeeb AuthorDate: 2022-08-17 18:33:08 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-09-21 11:46:45 +0000 net80211: consistently use the IEEE80211_M_ memory related options Replace a malloc() by IEEE80211_MALLOC(). For malloc flags even in the local ieee80211_freebsd.c there was a mix of both versions M_ and IEEE80211_M_. Consistently use the IEEE80211_M_ malloc options everywhere. If the field is changed for malloc, it'll also be changed for the other accessor functions taking a "how" field to avoid any confusion. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36249 (cherry picked from commit bd29f81763aa9cac74c75b663c2cf46723f05528) --- sys/net80211/ieee80211.c | 7 ++++--- sys/net80211/ieee80211_crypto_ccmp.c | 2 +- sys/net80211/ieee80211_crypto_tkip.c | 2 +- sys/net80211/ieee80211_crypto_wep.c | 2 +- sys/net80211/ieee80211_freebsd.c | 16 ++++++++-------- sys/net80211/ieee80211_hostap.c | 4 ++-- sys/net80211/ieee80211_ht.c | 2 +- sys/net80211/ieee80211_hwmp.c | 2 +- sys/net80211/ieee80211_input.c | 2 +- sys/net80211/ieee80211_ioctl.c | 4 ++-- sys/net80211/ieee80211_mesh.c | 6 +++--- sys/net80211/ieee80211_output.c | 27 ++++++++++++++------------- sys/net80211/ieee80211_superg.c | 6 +++--- sys/net80211/ieee80211_wds.c | 2 +- 14 files changed, 43 insertions(+), 41 deletions(-) diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index c2e868d811dd..1034088c6fb6 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -333,12 +333,13 @@ ieee80211_ifattach(struct ieee80211com *ic) TAILQ_INIT(&ic->ic_vaps); /* Create a taskqueue for all state changes */ - ic->ic_tq = taskqueue_create("ic_taskq", M_WAITOK | M_ZERO, + ic->ic_tq = taskqueue_create("ic_taskq", + IEEE80211_M_WAITOK | IEEE80211_M_ZERO, taskqueue_thread_enqueue, &ic->ic_tq); taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s net80211 taskq", ic->ic_name); - ic->ic_ierrors = counter_u64_alloc(M_WAITOK); - ic->ic_oerrors = counter_u64_alloc(M_WAITOK); + ic->ic_ierrors = counter_u64_alloc(IEEE80211_M_WAITOK); + ic->ic_oerrors = counter_u64_alloc(IEEE80211_M_WAITOK); /* * Fill in 802.11 available channel set, mark all * available channels as active, and pick a default diff --git a/sys/net80211/ieee80211_crypto_ccmp.c b/sys/net80211/ieee80211_crypto_ccmp.c index c4423e8a4ca9..a8ef3dab7635 100644 --- a/sys/net80211/ieee80211_crypto_ccmp.c +++ b/sys/net80211/ieee80211_crypto_ccmp.c @@ -189,7 +189,7 @@ ccmp_encap(struct ieee80211_key *k, struct mbuf *m) /* * Copy down 802.11 header and add the IV, KeyID, and ExtIV. */ - M_PREPEND(m, ccmp.ic_header, M_NOWAIT); + M_PREPEND(m, ccmp.ic_header, IEEE80211_M_NOWAIT); if (m == NULL) return 0; ivp = mtod(m, uint8_t *); diff --git a/sys/net80211/ieee80211_crypto_tkip.c b/sys/net80211/ieee80211_crypto_tkip.c index 59230d3538a7..cfd1392e2075 100644 --- a/sys/net80211/ieee80211_crypto_tkip.c +++ b/sys/net80211/ieee80211_crypto_tkip.c @@ -214,7 +214,7 @@ tkip_encap(struct ieee80211_key *k, struct mbuf *m) /* * Copy down 802.11 header and add the IV, KeyID, and ExtIV. */ - M_PREPEND(m, tkip.ic_header, M_NOWAIT); + M_PREPEND(m, tkip.ic_header, IEEE80211_M_NOWAIT); if (m == NULL) return 0; ivp = mtod(m, uint8_t *); diff --git a/sys/net80211/ieee80211_crypto_wep.c b/sys/net80211/ieee80211_crypto_wep.c index 164157559cb2..113bb726a54b 100644 --- a/sys/net80211/ieee80211_crypto_wep.c +++ b/sys/net80211/ieee80211_crypto_wep.c @@ -202,7 +202,7 @@ wep_encap(struct ieee80211_key *k, struct mbuf *m) /* * Copy down 802.11 header and add the IV + KeyID. */ - M_PREPEND(m, wep.ic_header, M_NOWAIT); + M_PREPEND(m, wep.ic_header, IEEE80211_M_NOWAIT); if (m == NULL) return 0; ivp = mtod(m, uint8_t *); diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 011ae7060a6c..5511791ae2aa 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -487,7 +487,7 @@ ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen) len = roundup2(headroom + pktlen, 4); KASSERT(len <= MCLBYTES, ("802.11 mgt frame too large: %u", len)); if (len < MINCLSIZE) { - m = m_gethdr(M_NOWAIT, MT_DATA); + m = m_gethdr(IEEE80211_M_NOWAIT, MT_DATA); /* * Align the data in case additional headers are added. * This should only happen when a WEP header is added @@ -497,7 +497,7 @@ ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen) if (m != NULL) M_ALIGN(m, len); } else { - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(IEEE80211_M_NOWAIT, MT_DATA, M_PKTHDR); if (m != NULL) MC_ALIGN(m, len); } @@ -522,9 +522,9 @@ ieee80211_realign(struct ieee80211vap *vap, struct mbuf *m, size_t align) pktlen = m->m_pkthdr.len; space = pktlen + align; if (space < MINCLSIZE) - n = m_gethdr(M_NOWAIT, MT_DATA); + n = m_gethdr(IEEE80211_M_NOWAIT, MT_DATA); else { - n = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + n = m_getjcl(IEEE80211_M_NOWAIT, MT_DATA, M_PKTHDR, space <= MCLBYTES ? MCLBYTES : #if MJUMPAGESIZE != MCLBYTES space <= MJUMPAGESIZE ? MJUMPAGESIZE : @@ -555,7 +555,7 @@ ieee80211_add_callback(struct mbuf *m, struct ieee80211_cb *cb; mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_CALLBACK, - sizeof(struct ieee80211_cb), M_NOWAIT); + sizeof(struct ieee80211_cb), IEEE80211_M_NOWAIT); if (mtag == NULL) return 0; @@ -575,7 +575,7 @@ ieee80211_add_xmit_params(struct mbuf *m, struct ieee80211_tx_params *tx; mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_XMIT_PARAMS, - sizeof(struct ieee80211_tx_params), M_NOWAIT); + sizeof(struct ieee80211_tx_params), IEEE80211_M_NOWAIT); if (mtag == NULL) return (0); @@ -626,7 +626,7 @@ ieee80211_add_rx_params(struct mbuf *m, const struct ieee80211_rx_stats *rxs) struct ieee80211_rx_params *rx; mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_RECV_PARAMS, - sizeof(struct ieee80211_rx_stats), M_NOWAIT); + sizeof(struct ieee80211_rx_stats), IEEE80211_M_NOWAIT); if (mtag == NULL) return (0); @@ -675,7 +675,7 @@ ieee80211_add_toa_params(struct mbuf *m, const struct ieee80211_toa_params *p) struct ieee80211_toa_params *rp; mtag = m_tag_alloc(MTAG_ABI_NET80211, NET80211_TAG_TOA_PARAMS, - sizeof(struct ieee80211_toa_params), M_NOWAIT); + sizeof(struct ieee80211_toa_params), IEEE80211_M_NOWAIT); if (mtag == NULL) return (0); diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index f3a85848fc84..ec3336ed5535 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -386,7 +386,7 @@ hostap_deliver_data(struct ieee80211vap *vap, struct mbuf *mcopy = NULL; if (m->m_flags & M_MCAST) { - mcopy = m_dup(m, M_NOWAIT); + mcopy = m_dup(m, IEEE80211_M_NOWAIT); if (mcopy == NULL) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); else @@ -1654,7 +1654,7 @@ ieee80211_deliver_l2uf(struct ieee80211_node *ni) struct l2_update_frame *l2uf; struct ether_header *eh; - m = m_gethdr(M_NOWAIT, MT_DATA); + m = m_gethdr(IEEE80211_M_NOWAIT, MT_DATA); if (m == NULL) { IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, "%s", "no mbuf for l2uf frame"); diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c index e680db5faa52..2fbb5a10febf 100644 --- a/sys/net80211/ieee80211_ht.c +++ b/sys/net80211/ieee80211_ht.c @@ -495,7 +495,7 @@ ieee80211_decap_amsdu(struct ieee80211_node *ni, struct mbuf *m) } if (m->m_pkthdr.len == framelen) break; - n = m_split(m, framelen, M_NOWAIT); + n = m_split(m, framelen, IEEE80211_M_NOWAIT); if (n == NULL) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, "a-msdu", diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index de07d501513b..77ba218ccd50 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -646,7 +646,7 @@ hwmp_send_action(struct ieee80211vap *vap, } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); vap->iv_stats.is_tx_nobuf++; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 7406c92d6d0e..10e8f6e7e628 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -146,7 +146,7 @@ ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m) * so do a deep copy of the packet. * NB: tags are copied too. */ - mcopy = m_dup(m, M_NOWAIT); + mcopy = m_dup(m, IEEE80211_M_NOWAIT); if (mcopy == NULL) { /* XXX stat+msg */ continue; diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 419518eb1224..839f965f542f 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -332,7 +332,7 @@ ieee80211_ioctl_getscanresults(struct ieee80211vap *vap, void *p; space = req.space; - /* XXX M_WAITOK after driver lock released */ + /* XXX IEEE80211_M_WAITOK after driver lock released */ p = IEEE80211_MALLOC(space, M_TEMP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (p == NULL) @@ -478,7 +478,7 @@ getstainfo_common(struct ieee80211vap *vap, struct ieee80211req *ireq, req.space = ireq->i_len; if (req.space > 0) { space = req.space; - /* XXX M_WAITOK after driver lock released */ + /* XXX IEEE80211_M_WAITOK after driver lock released */ p = IEEE80211_MALLOC(space, M_TEMP, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (p == NULL) { diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 8dcbfa918e3b..210ca25b6206 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1119,7 +1119,7 @@ ieee80211_mesh_forward_to_gates(struct ieee80211vap *vap, ieee80211_mesh_rt_update(rt_dest, ms->ms_ppath->mpp_inact); MESH_RT_UNLOCK(ms); /* XXX: lock?? */ - mcopy = m_dup(m, M_NOWAIT); + mcopy = m_dup(m, IEEE80211_M_NOWAIT); for (; mcopy != NULL; mcopy = next) { next = mcopy->m_nextpkt; mcopy->m_nextpkt = NULL; @@ -1175,7 +1175,7 @@ mesh_forward(struct ieee80211vap *vap, struct mbuf *m, vap->iv_stats.is_mesh_fwd_disabled++; return; } - mcopy = m_dup(m, M_NOWAIT); + mcopy = m_dup(m, IEEE80211_M_NOWAIT); if (mcopy == NULL) { IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, cannot dup"); @@ -2668,7 +2668,7 @@ mesh_send_action(struct ieee80211_node *ni, return EIO; /* XXX */ } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); return ENOMEM; diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 69d25d5b1ba2..42dab8e75a5c 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1031,7 +1031,7 @@ ieee80211_mgmt_output(struct ieee80211_node *ni, struct mbuf *m, int type, return EIO; /* XXX */ } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); return ENOMEM; @@ -1129,7 +1129,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni) } KASSERT(M_LEADINGSPACE(m) >= hdrlen, ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, hdrlen, M_NOWAIT); + M_PREPEND(m, hdrlen, IEEE80211_M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -1358,7 +1358,7 @@ ieee80211_mbuf_adjust(struct ieee80211vap *vap, int hdrsize, * XXX handle SWMIC specially */ if (key->wk_flags & (IEEE80211_KEY_SWENCRYPT|IEEE80211_KEY_SWENMIC)) { - m = m_unshare(m, M_NOWAIT); + m = m_unshare(m, IEEE80211_M_NOWAIT); if (m == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: cannot get writable mbuf\n", __func__); @@ -1377,7 +1377,7 @@ ieee80211_mbuf_adjust(struct ieee80211vap *vap, int hdrsize, */ /* XXX check trailing space and copy instead? */ if (M_LEADINGSPACE(m) < needed_space - TO_BE_RECLAIMED) { - struct mbuf *n = m_gethdr(M_NOWAIT, m->m_type); + struct mbuf *n = m_gethdr(IEEE80211_M_NOWAIT, m->m_type); if (n == NULL) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, "%s: cannot expand storage\n", __func__); @@ -1682,7 +1682,7 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, } datalen = m->m_pkthdr.len; /* NB: w/o 802.11 header */ - M_PREPEND(m, hdrspace + meshhdrsize, M_NOWAIT); + M_PREPEND(m, hdrspace + meshhdrsize, IEEE80211_M_NOWAIT); if (m == NULL) { vap->iv_stats.is_tx_nobuf++; goto bad; @@ -1991,7 +1991,7 @@ ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0, prev = m0; do { fragsize = MIN(totalhdrsize + remainder, mtu); - m = m_get2(fragsize, M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get2(fragsize, IEEE80211_M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) goto bad; /* leave room to prepend any cipher header */ @@ -2480,7 +2480,8 @@ ieee80211_probereq_ie(struct ieee80211vap *vap, struct ieee80211com *ic, len -= (2 + IEEE80211_NWID_LEN); if (alloc) { - frm = malloc(len, M_80211_VAP, M_WAITOK | M_ZERO); + frm = IEEE80211_MALLOC(len, M_80211_VAP, + IEEE80211_M_WAITOK | IEEE80211_M_ZERO); *frmp = frm; *frmlen = len; } else @@ -2597,7 +2598,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni, m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame), ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -3259,7 +3260,7 @@ ieee80211_send_proberesp(struct ieee80211vap *vap, return ENOMEM; } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); KASSERT(m != NULL, ("no room for header")); IEEE80211_TX_LOCK(ic); @@ -3295,7 +3296,7 @@ ieee80211_alloc_rts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_NOWAIT, MT_DATA); + m = m_gethdr(IEEE80211_M_NOWAIT, MT_DATA); if (m != NULL) { rts = mtod(m, struct ieee80211_frame_rts *); rts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -3321,7 +3322,7 @@ ieee80211_alloc_cts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_NOWAIT, MT_DATA); + m = m_gethdr(IEEE80211_M_NOWAIT, MT_DATA); if (m != NULL) { cts = mtod(m, struct ieee80211_frame_cts *); cts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -3748,7 +3749,7 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni) } ieee80211_beacon_construct(m, frm, ni); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), IEEE80211_M_NOWAIT); KASSERT(m != NULL, ("no space for 802.11 header?")); wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | @@ -4132,7 +4133,7 @@ ieee80211_ff_encap1(struct ieee80211vap *vap, struct mbuf *m, llc->llc_snap.ether_type = eh->ether_type; payload = m->m_pkthdr.len; /* NB: w/o Ethernet header */ - M_PREPEND(m, sizeof(struct ether_header), M_NOWAIT); + M_PREPEND(m, sizeof(struct ether_header), IEEE80211_M_NOWAIT); if (m == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for ether_header\n", __func__); diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c index 4ac7813d2811..5da97577165b 100644 --- a/sys/net80211/ieee80211_superg.c +++ b/sys/net80211/ieee80211_superg.c @@ -326,7 +326,7 @@ ieee80211_ff_decap(struct ieee80211_node *ni, struct mbuf *m) vap->iv_stats.is_ff_tooshort++; return NULL; } - n = m_split(m, framelen, M_NOWAIT); + n = m_split(m, framelen, IEEE80211_M_NOWAIT); if (n == NULL) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY, ni->ni_macaddr, "fast-frame", @@ -445,7 +445,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, */ m->m_next = m2; /* NB: last mbuf from above */ m1->m_pkthdr.len += m2->m_pkthdr.len; - M_PREPEND(m1, sizeof(uint32_t)+2, M_NOWAIT); + M_PREPEND(m1, sizeof(uint32_t)+2, IEEE80211_M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for tunnel header\n", __func__); @@ -454,7 +454,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, } memset(mtod(m1, void *), 0, sizeof(uint32_t)+2); - M_PREPEND(m1, sizeof(struct llc), M_NOWAIT); + M_PREPEND(m1, sizeof(struct llc), IEEE80211_M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for llc header\n", __func__); diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index 464e658797e6..c48c957313c8 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -257,7 +257,7 @@ ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) /* * Duplicate the frame and send it. */ - mcopy = m_copypacket(m, M_NOWAIT); + mcopy = m_copypacket(m, IEEE80211_M_NOWAIT); if (mcopy == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* XXX stat + msg */