git: 31cfaf191b08 - main - IfAPI: Add l2com accessor for firewire.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 31 Jan 2023 20:03:20 UTC
The branch main has been updated by jhibbits:
URL: https://cgit.FreeBSD.org/src/commit/?id=31cfaf191b0861d54ce8e212c77b458fd8fc018e
commit 31cfaf191b0861d54ce8e212c77b458fd8fc018e
Author: Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2023-01-25 19:45:53 +0000
Commit: Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2023-01-31 20:02:17 +0000
IfAPI: Add l2com accessor for firewire.
Summary:
Firewire is the only device driver that accesses the l2com member, all
other accesses are handled within the netstack itself.
Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D38203
---
sys/net/firewire.h | 2 +-
sys/net/if.c | 6 ++++++
sys/net/if_var.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/sys/net/firewire.h b/sys/net/firewire.h
index dd7d23e49e73..527113aec720 100644
--- a/sys/net/firewire.h
+++ b/sys/net/firewire.h
@@ -131,7 +131,7 @@ struct fw_com {
uint16_t fc_node; /* our nodeid */
struct fw_reass_list fc_frags; /* partial datagrams */
};
-#define IFP2FWC(ifp) ((struct fw_com *)(ifp)->if_l2com)
+#define IFP2FWC(ifp) ((struct fw_com *)if_getl2com(ifp))
extern void firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src);
extern void firewire_ifattach(struct ifnet *, struct fw_hwaddr *);
diff --git a/sys/net/if.c b/sys/net/if.c
index ac8b6963172d..2ab12d1ac313 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -4941,6 +4941,12 @@ if_getpcp(if_t ifp)
return (ifp->if_pcp);
}
+void *
+if_getl2com(if_t ifp)
+{
+ return (ifp->if_l2com);
+}
+
#ifdef DDB
static void
if_show_ifnet(struct ifnet *ifp)
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index be7a5f059a7e..dbf8796865f0 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -644,6 +644,7 @@ struct label *if_getmaclabel(if_t ifp);
void if_setmaclabel(if_t ifp, struct label *label);
struct bpf_if *if_getbpf(if_t ifp);
uint8_t if_getpcp(if_t ifp);
+void *if_getl2com(if_t ifp);
struct ifvlantrunk *if_getvlantrunk(if_t ifp);
void *if_getafdata(if_t ifp, int);