Skip to content

Commit

Permalink
net/realtek-re-kmod: allow building for other architectures
Browse files Browse the repository at this point in the history
Disable dash support on such archs and fix version number.

PR:		258473
Submitted by:	Franco Fichtner <franco@opnsense.org>
  • Loading branch information
alexdupre committed Jan 17, 2022
1 parent 651c748 commit 6a4e552
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
9 changes: 3 additions & 6 deletions net/realtek-re-kmod/Makefile
@@ -1,22 +1,19 @@
# Created by: Alex Dupre <ale@FreeBSD.org>

PORTNAME= re
DISTVERSION= v196.04
PORTREVISION= 3
PORTVERSION= 196.04
DISTVERSIONPREFIX= v
CATEGORIES= net
MASTER_SITES= LOCAL/ale
PKGNAMEPREFIX= realtek-
PKGNAMESUFFIX= -kmod
DISTNAME= rtl_bsd_drv_${DISTVERSION}
DISTNAME= rtl_bsd_drv_${DISTVERSIONPREFIX}${PORTVERSION}

MAINTAINER= ale@FreeBSD.org
COMMENT= Kernel driver for Realtek PCIe Ethernet Controllers

LICENSE= BSD4CLAUSE

ONLY_FOR_ARCHS= amd64 i386
ONLY_FOR_ARCHS_REASON= uses x86-specific code

USES= kmod tar:tgz uidfix

PLIST_FILES= ${KMODDIR}/if_re.ko
Expand Down
20 changes: 20 additions & 0 deletions net/realtek-re-kmod/files/patch-optional-dash
@@ -0,0 +1,20 @@
--- if_re.c.orig 2022-01-17 17:01:39 UTC
+++ if_re.c
@@ -4355,6 +4355,7 @@
sc->re_dash = re_check_dash(sc);

if (sc->re_dash) {
+#if defined(__amd64__) || defined(__i386__)
if (HW_DASH_SUPPORT_TYPE_3(sc)) {
u_int64_t CmacMemPhysAddress;
bus_space_handle_t cmac_ioaddr;
@@ -4374,6 +4375,9 @@
sc->re_mapped_cmac_handle = cmac_ioaddr;
}
}
+#else
+ sc->re_dash = 0;
+#endif
}

switch(sc->re_type) {

0 comments on commit 6a4e552

Please sign in to comment.