git: be4315dcbb8c - main - ifnet/DrvAPI: Move if_t typedef to a better place
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 04 Jan 2023 20:11:25 UTC
The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=be4315dcbb8c54b9965815c5152c2c0bcb6e52e8 commit be4315dcbb8c54b9965815c5152c2c0bcb6e52e8 Author: Justin Hibbits <jhibbits@FreeBSD.org> AuthorDate: 2022-12-21 21:15:09 +0000 Commit: Justin Hibbits <jhibbits@FreeBSD.org> CommitDate: 2023-01-04 20:15:10 +0000 ifnet/DrvAPI: Move if_t typedef to a better place Summary: <net/if_var.h> should really be used by the netstack only, not by drivers. Eventually all the accessors will be moved to <net/if.h> as well, but for now just move the typedef while the KPI gets sorted and drivers get converted. Sponsored by: Juniper Networks, Inc. Reviewed By: melifaro, glebius Differential Revision: https://reviews.freebsd.org/D37784 --- sys/net/if.h | 6 ++++++ sys/net/if_var.h | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/net/if.h b/sys/net/if.h index b39eb933993c..85c217a888bd 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -657,6 +657,12 @@ MALLOC_DECLARE(M_IFADDR); MALLOC_DECLARE(M_IFMADDR); #endif +/* + * Opaque interface structure. + */ + +typedef struct ifnet * if_t; + extern struct sx ifnet_detach_sxlock; struct nvlist; diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 6ec95da4c0cd..2712ac74a09d 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -124,8 +124,6 @@ typedef enum { IFCOUNTERS /* Array size. */ } ift_counter; -typedef struct ifnet * if_t; - typedef void (*if_start_fn_t)(if_t); typedef int (*if_ioctl_fn_t)(if_t, u_long, caddr_t); typedef void (*if_init_fn_t)(void *);