mirror of
https://git.freebsd.org/ports.git
synced 2026-06-02 11:08:52 +00:00
net/intel-em-kmod: unbreak for FreeBSD 15+
FreeBSD 15 introduced some incompatible KAPI changes. Apply some patches to this code dated back 2019. This fixes build, so PORTREVISION not changed. The change is run-tested using 15.0-RELEASE and 82574L-based network adapters. Compile-tested only for recent 16.0-CURRENT.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- e1000_osdep.h.orig 2020-04-08 15:13:17 UTC
|
||||
+++ e1000_osdep.h
|
||||
@@ -134,7 +134,7 @@ struct e1000_osdep
|
||||
bus_space_handle_t io_bus_space_handle;
|
||||
bus_space_tag_t flash_bus_space_tag;
|
||||
bus_space_handle_t flash_bus_space_handle;
|
||||
- struct device *dev;
|
||||
+ device_t dev;
|
||||
};
|
||||
|
||||
#define E1000_REGISTER(hw, reg) (((hw)->mac.type >= e1000_82543) \
|
||||
@@ -0,0 +1,20 @@
|
||||
--- em_compat.c.orig 2020-04-08 22:13:17.000000000 +0700
|
||||
+++ em_compat.c 2026-05-24 15:19:17.203086000 +0700
|
||||
@@ -30,6 +30,17 @@
|
||||
|
||||
#include "em_compat.h"
|
||||
|
||||
+/* Forward compatibility for post-15 */
|
||||
+#if __FreeBSD_version >= 1500000
|
||||
+
|
||||
+void
|
||||
+if_etherbpfmtap(if_t ifh, struct mbuf *m)
|
||||
+{
|
||||
+ ether_bpf_mtap_if(ifh, m);
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
/* Backward compatibility for pre-11 */
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- em_compat.h.orig 2020-04-08 22:13:17.000000000 +0700
|
||||
+++ em_compat.h 2026-05-24 15:21:37.852854000 +0700
|
||||
@@ -43,6 +43,11 @@
|
||||
#include <net/if_var.h>
|
||||
#include <net/if_vlan_var.h>
|
||||
|
||||
+/* Forward compatibility for 15+ */
|
||||
+#if __FreeBSD_version >= 1500000
|
||||
+void if_etherbpfmtap(if_t ifp, struct mbuf *m);
|
||||
+#endif
|
||||
+
|
||||
/* Backward compatibility for pre-11 */
|
||||
#if __FreeBSD_version < 1100000
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- if_em.h.orig 2020-04-08 15:13:17 UTC
|
||||
+++ if_em.h
|
||||
@@ -395,7 +395,7 @@ struct adapter {
|
||||
|
||||
/* FreeBSD operating-system-specific structures. */
|
||||
struct e1000_osdep osdep;
|
||||
- struct device *dev;
|
||||
+ device_t dev;
|
||||
struct cdev *led_dev;
|
||||
|
||||
struct resource *memory;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- if_lem.h.orig 2020-04-08 15:13:17 UTC
|
||||
+++ if_lem.h
|
||||
@@ -297,7 +297,7 @@ struct adapter {
|
||||
|
||||
/* FreeBSD operating-system-specific structures. */
|
||||
struct e1000_osdep osdep;
|
||||
- struct device *dev;
|
||||
+ device_t dev;
|
||||
struct cdev *led_dev;
|
||||
|
||||
struct resource *memory;
|
||||
@@ -0,0 +1,23 @@
|
||||
--- if_em.c.orig 2026-05-24 14:44:46.949390000 +0700
|
||||
+++ if_em.c 2026-05-24 14:50:16.444411000 +0700
|
||||
@@ -1584,10 +1588,7 @@ em_irq_fast(void *arg)
|
||||
em_irq_fast(void *arg)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
- if_t ifp;
|
||||
u32 reg_icr;
|
||||
-
|
||||
- ifp = adapter->ifp;
|
||||
|
||||
reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR);
|
||||
|
||||
@@ -4478,6 +4479,9 @@ em_setup_receive_ring(struct rx_ring *rxr)
|
||||
goto fail;
|
||||
}
|
||||
rxbuf->m_head->m_len = adapter->rx_mbuf_sz;
|
||||
+#ifndef M_HASFCS
|
||||
+#define M_HASFCS M_PROTO5
|
||||
+#endif
|
||||
rxbuf->m_head->m_flags &= ~M_HASFCS; /* we strip it */
|
||||
rxbuf->m_head->m_pkthdr.len = adapter->rx_mbuf_sz;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- if_lem.c.orig 2026-05-24 15:03:45.830943000 +0700
|
||||
+++ if_lem.c 2026-05-24 15:06:00.908555000 +0700
|
||||
@@ -1483,11 +1483,8 @@ lem_irq_fast(void *arg)
|
||||
lem_irq_fast(void *arg)
|
||||
{
|
||||
struct adapter *adapter = arg;
|
||||
- if_t ifp;
|
||||
u32 reg_icr;
|
||||
|
||||
- ifp = adapter->ifp;
|
||||
-
|
||||
reg_icr = E1000_READ_REG(&adapter->hw, E1000_ICR);
|
||||
|
||||
/* Hot eject? */
|
||||
Reference in New Issue
Block a user