diff --git a/net/aquantia-atlantic-kmod/Makefile b/net/aquantia-atlantic-kmod/Makefile index 5a25693ba3c6..31180830588a 100644 --- a/net/aquantia-atlantic-kmod/Makefile +++ b/net/aquantia-atlantic-kmod/Makefile @@ -1,22 +1,22 @@ PORTNAME= aquantia-atlantic-kmod PORTVERSION= 0.0.5 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net MAINTAINER= bofh@FreeBSD.org COMMENT= Aquantia AQtion (Atlantic) Network Driver (Development Preview) WWW= https://github.com/Aquantia/aqtion-freebsd LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USES= kmod uidfix USE_GITHUB= yes GH_ACCOUNT= Aquantia GH_PROJECT= aqtion-freebsd -GH_TAGNAME= 4816644 +GH_TAGNAME= c61d27b PLIST_FILES= ${KMODDIR}/if_atlantic.ko .include diff --git a/net/aquantia-atlantic-kmod/distinfo b/net/aquantia-atlantic-kmod/distinfo index f1ad9428e216..a8cc3b9aadbb 100644 --- a/net/aquantia-atlantic-kmod/distinfo +++ b/net/aquantia-atlantic-kmod/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1569378863 -SHA256 (Aquantia-aqtion-freebsd-0.0.5-4816644_GH0.tar.gz) = 5eb09be0ecc3e4c000ae4c9ecc9285cafb64df168010c0505592e877272dc2a5 -SIZE (Aquantia-aqtion-freebsd-0.0.5-4816644_GH0.tar.gz) = 61312 +TIMESTAMP = 1683052703 +SHA256 (Aquantia-aqtion-freebsd-0.0.5-c61d27b_GH0.tar.gz) = 586015dad6ee4898bc640016d0c352f2cd3655a91f02597550882ae4c8c73a3b +SIZE (Aquantia-aqtion-freebsd-0.0.5-c61d27b_GH0.tar.gz) = 61538 diff --git a/net/aquantia-atlantic-kmod/files/patch-aq__hw.c b/net/aquantia-atlantic-kmod/files/patch-aq__hw.c index 2fc5ccc8e999..903d423c2995 100644 --- a/net/aquantia-atlantic-kmod/files/patch-aq__hw.c +++ b/net/aquantia-atlantic-kmod/files/patch-aq__hw.c @@ -1,30 +1,13 @@ Upstream PR: -https://github.com/Aquantia/aqtion-freebsd/pull/11 +https://github.com/Aquantia/aqtion-freebsd/pull/27 ---- aq_hw.c.orig 2019-09-24 14:45:34 UTC +--- aq_hw.c.orig +++ aq_hw.c -@@ -160,7 +160,7 @@ static int aq_hw_init_ucp(struct aq_hw *hw) - unsigned int rnd = 0; - unsigned int ucp_0x370 = 0; - -- rnd = random(); -+ rnd = arc4random(); - - ucp_0x370 = 0x02020202 | (0xFEFEFEFE & rnd); - AQ_WRITE_REG(hw, AQ_HW_UCP_0X370_REG, ucp_0x370); -@@ -307,7 +307,6 @@ int aq_hw_get_mac_permanent(struct aq_hw *hw, u8 *mac - - /* Couldn't get MAC address from HW. Use auto-generated one. */ - if ((mac[0] & 1) || ((mac[0] | mac[1] | mac[2]) == 0)) { -- u64 seed = get_cyclecount(); - u16 rnd; - u32 h = 0; - u32 l = 0; -@@ -315,7 +314,6 @@ int aq_hw_get_mac_permanent(struct aq_hw *hw, u8 *mac - printf("atlantic: HW MAC address %x:%x:%x:%x:%x:%x is multicast or empty MAC", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); - printf("atlantic: Use random MAC address"); - -- srandom(seed); - rnd = random(); - - /* chip revision */ +@@ -32,7 +32,6 @@ + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-#include + #include + #include + #include diff --git a/net/aquantia-atlantic-kmod/files/patch-aq__main.c b/net/aquantia-atlantic-kmod/files/patch-aq__main.c index 1f2353725bed..dea156a428fa 100644 --- a/net/aquantia-atlantic-kmod/files/patch-aq__main.c +++ b/net/aquantia-atlantic-kmod/files/patch-aq__main.c @@ -1,133 +1,15 @@ -Upstream PR: -https://github.com/Aquantia/aqtion-freebsd/pull/11 - --- aq_main.c.orig 2019-09-24 14:45:34 UTC +++ aq_main.c @@ -193,8 +193,12 @@ static driver_t aq_driver = { "aq", aq_methods, sizeof(struct aq_dev), }; +#if __FreeBSD_version >= 1400058 +DRIVER_MODULE(atlantic, pci, aq_driver, 0, 0); +#else static devclass_t aq_devclass; DRIVER_MODULE(atlantic, pci, aq_driver, aq_devclass, 0, 0); +#endif MODULE_DEPEND(atlantic, pci, 1, 1, 1); MODULE_DEPEND(atlantic, ether, 1, 1, 1); -@@ -282,8 +286,6 @@ static struct if_shared_ctx aq_sctx_init = { - .isc_ntxd_default = {PAGE_SIZE / sizeof(aq_txc_desc_t) * 4}, - }; - --if_shared_ctx_t aq_sctx = &aq_sctx_init; -- - /* - * TUNEABLE PARAMETERS: - */ -@@ -300,7 +302,7 @@ static void *aq_register(device_t dev) - */ - static void *aq_register(device_t dev) - { -- return (aq_sctx); -+ return (&aq_sctx_init); - } - - static int aq_if_attach_pre(if_ctx_t ctx) -@@ -417,13 +419,11 @@ static int aq_if_attach_post(if_ctx_t ctx) - static int aq_if_attach_post(if_ctx_t ctx) - { - struct aq_dev *softc; -- if_t ifp; - int rc; - - AQ_DBG_ENTER(); - - softc = iflib_get_softc(ctx); -- ifp = iflib_get_ifp(ctx); - rc = 0; - - aq_update_hw_stats(softc); -@@ -635,13 +635,11 @@ static void aq_if_init(if_ctx_t ctx) - struct aq_dev *softc; - struct aq_hw *hw; - struct ifmediareq ifmr; -- struct ifnet *ifp; - int i, err; - - AQ_DBG_ENTER(); - softc = iflib_get_softc(ctx); - hw = &softc->hw; -- ifp = iflib_get_ifp(ctx); - - err = aq_hw_init(&softc->hw, softc->hw.mac_addr, softc->msix, - softc->scctx->isc_intr == IFLIB_INTR_MSIX); -@@ -735,6 +733,23 @@ static uint64_t aq_if_get_counter(if_ctx_t ctx, ift_co - } - } - -+#if __FreeBSD_version >= 1300054 -+static u_int aq_mc_filter_apply(void *arg, struct sockaddr_dl *dl, u_int count) -+{ -+ struct aq_dev *softc = arg; -+ struct aq_hw *hw = &softc->hw; -+ u8 *mac_addr = NULL; -+ -+ if (count == AQ_HW_MAC_MAX) -+ return (0); -+ -+ mac_addr = LLADDR(dl); -+ aq_hw_mac_addr_set(hw, mac_addr, count + 1); -+ -+ aq_log_detail("set %u mc address %6D", count + 1, mac_addr, ":"); -+ return (1); -+} -+#else - static int aq_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int count) - { - struct aq_dev *softc = arg; -@@ -752,6 +767,7 @@ static int aq_mc_filter_apply(void *arg, struct ifmult - aq_log_detail("set %d mc address %6D", count + 1, mac_addr, ":"); - return (1); - } -+#endif - - static bool aq_is_mc_promisc_required(struct aq_dev *softc) - { -@@ -764,15 +780,22 @@ static void aq_if_multi_set(if_ctx_t ctx) - struct ifnet *ifp = iflib_get_ifp(ctx); - struct aq_hw *hw = &softc->hw; - AQ_DBG_ENTER(); -- -+#if __FreeBSD_version >= 1300054 -+ softc->mcnt = if_llmaddr_count(iflib_get_ifp(ctx)); -+#else - softc->mcnt = if_multiaddr_count(iflib_get_ifp(ctx), AQ_HW_MAC_MAX); -+#endif - if (softc->mcnt >= AQ_HW_MAC_MAX) - { - aq_hw_set_promisc(hw, !!(ifp->if_flags & IFF_PROMISC), - aq_is_vlan_promisc_required(softc), - !!(ifp->if_flags & IFF_ALLMULTI) || aq_is_mc_promisc_required(softc)); - }else{ -+#if __FreeBSD_version >= 1300054 -+ if_foreach_llmaddr(iflib_get_ifp(ctx), aq_mc_filter_apply, softc); -+#else - if_multi_apply(iflib_get_ifp(ctx), aq_mc_filter_apply, softc); -+#endif - } - AQ_DBG_EXIT(0); - } -@@ -825,12 +848,10 @@ static int aq_if_promisc_set(if_ctx_t ctx, int flags) - static int aq_if_promisc_set(if_ctx_t ctx, int flags) - { - struct aq_dev *softc; -- struct ifnet *ifp; - - AQ_DBG_ENTER(); - - softc = iflib_get_softc(ctx); -- ifp = iflib_get_ifp(softc->ctx); - - aq_hw_set_promisc(&softc->hw, !!(flags & IFF_PROMISC), - aq_is_vlan_promisc_required(softc), diff --git a/net/aquantia-atlantic-kmod/files/patch-aq__ring.c b/net/aquantia-atlantic-kmod/files/patch-aq__ring.c deleted file mode 100644 index bc01c89d484e..000000000000 --- a/net/aquantia-atlantic-kmod/files/patch-aq__ring.c +++ /dev/null @@ -1,23 +0,0 @@ ---- aq_ring.c.orig 2022-05-13 21:22:45 UTC -+++ aq_ring.c -@@ -456,8 +456,8 @@ static int aq_isc_txd_encap(void *arg, if_pkt_info_t p - aq_tx_desc_t *txd = NULL; - bus_dma_segment_t *segs; - qidx_t pidx; -- uint32_t hdrlen=0, pay_len, eop; -- uint8_t tx_cmd = 0, ct_en, ct_idx; -+ uint32_t hdrlen=0, pay_len; -+ uint8_t tx_cmd = 0; - int i, desc_count = 0; - - AQ_DBG_ENTERA("[%d] start=%d", pi->ipi_qsidx, pi->ipi_pidx); -@@ -469,9 +469,6 @@ static int aq_isc_txd_encap(void *arg, if_pkt_info_t p - AQ_DBG_PRINT("txc at 0x%p, txd at 0x%p len %d", txc, txd, pi->ipi_len); - - pay_len = pi->ipi_len; -- eop = 0; -- ct_en = 0; -- ct_idx = 0; - - txc->flags1 = 0U; - txc->flags2 = 0U;