git: cabbfb60d050 - main - linux(4): Reduce code duplication between MD files
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Mar 2023 09:12:45 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cabbfb60d050f21eda60fb7d9a95718059048686 commit cabbfb60d050f21eda60fb7d9a95718059048686 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-03-04 09:11:38 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-03-04 09:11:38 +0000 linux(4): Reduce code duplication between MD files Move struct ifnet definitions under compat/linux. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38791 --- sys/amd64/linux/linux.h | 34 ---------------------------------- sys/amd64/linux32/linux.h | 34 ---------------------------------- sys/arm64/linux/linux.h | 34 ---------------------------------- sys/compat/linux/linux_socket.h | 35 +++++++++++++++++++++++++++++++++++ sys/i386/linux/linux.h | 33 --------------------------------- 5 files changed, 35 insertions(+), 135 deletions(-) diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index b31b520cb573..09125576d33a 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -224,40 +224,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_ifmap { - l_ulong mem_start; - l_ulong mem_end; - l_ushort base_addr; - u_char irq; - u_char dma; - u_char port; - /* 3 bytes spare */ -}; - -struct l_ifreq { - union { - char ifrn_name[LINUX_IFNAMSIZ]; - } ifr_ifrn; - - union { - struct l_sockaddr ifru_addr; - struct l_sockaddr ifru_dstaddr; - struct l_sockaddr ifru_broadaddr; - struct l_sockaddr ifru_netmask; - struct l_sockaddr ifru_hwaddr; - l_short ifru_flags[1]; - l_int ifru_ivalue; - l_int ifru_mtu; - struct l_ifmap ifru_map; - char ifru_slave[LINUX_IFNAMSIZ]; - l_uintptr_t ifru_data; - } ifr_ifru; -}; - -#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ - struct l_ifconf { int ifc_len; union { diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index c77897344506..9beee0b7079c 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -304,40 +304,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_ifmap { - l_ulong mem_start; - l_ulong mem_end; - l_ushort base_addr; - u_char irq; - u_char dma; - u_char port; - /* 3 bytes spare */ -}; - -struct l_ifreq { - union { - char ifrn_name[LINUX_IFNAMSIZ]; - } ifr_ifrn; - - union { - struct l_sockaddr ifru_addr; - struct l_sockaddr ifru_dstaddr; - struct l_sockaddr ifru_broadaddr; - struct l_sockaddr ifru_netmask; - struct l_sockaddr ifru_hwaddr; - l_short ifru_flags[1]; - l_int ifru_ivalue; - l_int ifru_mtu; - struct l_ifmap ifru_map; - char ifru_slave[LINUX_IFNAMSIZ]; - l_uintptr_t ifru_data; - } ifr_ifru; -}; - -#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ - struct l_ifconf { int ifc_len; union { diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h index 8ecadff2e220..5c95acd86771 100644 --- a/sys/arm64/linux/linux.h +++ b/sys/arm64/linux/linux.h @@ -181,40 +181,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_ifmap { - l_ulong mem_start; - l_ulong mem_end; - l_ushort base_addr; - u_char irq; - u_char dma; - u_char port; - /* 3 bytes spare*/ -}; - -struct l_ifreq { - union { - char ifrn_name[LINUX_IFNAMSIZ]; - } ifr_ifrn; - - union { - struct l_sockaddr ifru_addr; - struct l_sockaddr ifru_dstaddr; - struct l_sockaddr ifru_broadaddr; - struct l_sockaddr ifru_netmask; - struct l_sockaddr ifru_hwaddr; - l_short ifru_flags[1]; - l_int ifru_ivalue; - l_int ifru_mtu; - struct l_ifmap ifru_map; - char ifru_slave[LINUX_IFNAMSIZ]; - l_uintptr_t ifru_data; - } ifr_ifru; -}; - -#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ - #define linux_copyout_rusage(r, u) copyout(r, u, sizeof(*r)) struct linux_pt_regset { diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index 74b96fbb9c11..9b332a7a9b86 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -326,4 +326,39 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_TCP_INFO 11 #define LINUX_TCP_MD5SIG 14 +struct l_ifmap { + l_ulong mem_start; + l_ulong mem_end; + l_ushort base_addr; + u_char irq; + u_char dma; + u_char port; + /* 3 bytes spare */ +}; + +struct l_ifreq { + union { + char ifrn_name[LINUX_IFNAMSIZ]; + } ifr_ifrn; + + union { + struct l_sockaddr ifru_addr; + struct l_sockaddr ifru_dstaddr; + struct l_sockaddr ifru_broadaddr; + struct l_sockaddr ifru_netmask; + struct l_sockaddr ifru_hwaddr; + l_short ifru_flags[1]; + l_int ifru_ivalue; + l_int ifru_mtu; + struct l_ifmap ifru_map; + char ifru_slave[LINUX_IFNAMSIZ]; + char ifru_newname[LINUX_IFNAMSIZ]; + l_uintptr_t ifru_data; + } ifr_ifru; +}; + +#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ +#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ +#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ + #endif /* _LINUX_SOCKET_H_ */ diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index 43bf3ca126b6..7810f8d29ccd 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -279,39 +279,6 @@ union l_semun { l_uintptr_t __pad; }; -struct l_ifmap { - l_ulong mem_start; - l_ulong mem_end; - l_ushort base_addr; - u_char irq; - u_char dma; - u_char port; -}; - -struct l_ifreq { - union { - char ifrn_name[LINUX_IFNAMSIZ]; - } ifr_ifrn; - - union { - struct l_sockaddr ifru_addr; - struct l_sockaddr ifru_dstaddr; - struct l_sockaddr ifru_broadaddr; - struct l_sockaddr ifru_netmask; - struct l_sockaddr ifru_hwaddr; - l_short ifru_flags[1]; - l_int ifru_ivalue; - l_int ifru_mtu; - struct l_ifmap ifru_map; - char ifru_slave[LINUX_IFNAMSIZ]; - l_caddr_t ifru_data; - } ifr_ifru; -}; - -#define ifr_name ifr_ifrn.ifrn_name /* Interface name */ -#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */ -#define ifr_ifindex ifr_ifru.ifru_ivalue /* Interface index */ - struct l_user_desc { l_uint entry_number; l_uint base_addr;