openbsd_network: Add a real implementation of MCLGETL.
The old alias had a number of shortcomings which made it not match OpenBSD and thus special-casing had to be used in drivers. The new version should match OpenBSD's semantics precisely.
This commit is contained in:
@@ -5681,11 +5681,7 @@ iwx_send_cmd(struct iwx_softc *sc, struct iwx_host_cmd *hcmd)
|
|||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#ifdef __FreeBSD_version
|
|
||||||
m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWX_RBUF_SIZE);
|
|
||||||
#else
|
|
||||||
m = MCLGETL(NULL, M_DONTWAIT, totlen);
|
m = MCLGETL(NULL, M_DONTWAIT, totlen);
|
||||||
#endif
|
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
printf("%s: could not get fw cmd mbuf (%zd bytes)\n",
|
printf("%s: could not get fw cmd mbuf (%zd bytes)\n",
|
||||||
DEVNAME(sc), totlen);
|
DEVNAME(sc), totlen);
|
||||||
|
|||||||
@@ -6366,11 +6366,7 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd)
|
|||||||
err = EINVAL;
|
err = EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
#ifdef __FreeBSD_version
|
|
||||||
m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWM_RBUF_SIZE);
|
|
||||||
#else
|
|
||||||
m = MCLGETL(NULL, M_DONTWAIT, totlen);
|
m = MCLGETL(NULL, M_DONTWAIT, totlen);
|
||||||
#endif
|
|
||||||
if (m == NULL) {
|
if (m == NULL) {
|
||||||
printf("%s: could not get fw cmd mbuf (%zd bytes)\n",
|
printf("%s: could not get fw cmd mbuf (%zd bytes)\n",
|
||||||
DEVNAME(sc), totlen);
|
DEVNAME(sc), totlen);
|
||||||
|
|||||||
@@ -27,8 +27,16 @@
|
|||||||
|
|
||||||
#define MAXMCLBYTES MJUM16BYTES
|
#define MAXMCLBYTES MJUM16BYTES
|
||||||
|
|
||||||
#define MCLGETL m_cljget
|
|
||||||
|
|
||||||
|
static struct mbuf*
|
||||||
|
MCLGETL(struct mbuf* m, int how, int size)
|
||||||
|
{
|
||||||
|
if (m == NULL)
|
||||||
|
return m_get2(size, how, MT_DATA, M_PKTHDR);
|
||||||
|
|
||||||
|
m_cljget(m, how, size);
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
m_dup_pkthdr_openbsd(struct mbuf* to, const struct mbuf* from, int how)
|
m_dup_pkthdr_openbsd(struct mbuf* to, const struct mbuf* from, int how)
|
||||||
|
|||||||
Reference in New Issue
Block a user