diff --git a/sys/compat/netbsd32/netbsd32_ioctl.c b/sys/compat/netbsd32/netbsd32_ioctl.c index f96ca483ff27e..9d3f37e2b7708 100644 --- a/sys/compat/netbsd32/netbsd32_ioctl.c +++ b/sys/compat/netbsd32/netbsd32_ioctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.76 2015/05/31 22:16:16 roy Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.77 2015/05/31 22:19:41 roy Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,8 +31,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.76 2015/05/31 22:16:16 roy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.77 2015/05/31 22:19:41 roy Exp $"); +#include "pppoe.h" #include "sppp.h" #include @@ -67,6 +68,9 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.76 2015/05/31 22:16:16 roy Exp #include #include +#if NPPPOE > 0 +#include +#endif #if NSPPP > 0 #include #endif @@ -165,6 +169,21 @@ netbsd32_to_ifmediareq(struct netbsd32_ifmediareq *s32p, struct ifmediareq *p, u p->ifm_ulist = (int *)NETBSD32PTR64(s32p->ifm_ulist); } +#if NPPPOE > 0 +static inline void +netbsd32_to_pppoediscparms(struct netbsd32_pppoediscparms *s32p, + struct pppoediscparms *p, u_long cmd) +{ + + memcpy(p->ifname, s32p->ifname, sizeof p->ifname); + memcpy(p->eth_ifname, s32p->eth_ifname, sizeof p->eth_ifname); + p->ac_name = (char *)NETBSD32PTR64(s32p->ac_name); + p->ac_name_len = s32p->ac_name_len; + p->service_name = (char *)NETBSD32PTR64(s32p->service_name); + p->service_name_len = s32p->service_name_len; +} +#endif + #if NSPPP > 0 static inline void netbsd32_to_spppauthcfg(struct netbsd32_spppauthcfg *s32p, @@ -529,6 +548,21 @@ netbsd32_from_ifmediareq(struct ifmediareq *p, struct netbsd32_ifmediareq *s32p, #endif } +#if NPPPOE > 0 +static inline void +netbsd32_from_pppoediscparms(struct pppoediscparms *p, + struct netbsd32_pppoediscparms *s32p, u_long cmd) +{ + + memcpy(s32p->ifname, p->ifname, sizeof s32p->ifname); + memcpy(s32p->eth_ifname, p->eth_ifname, sizeof s32p->eth_ifname); + NETBSD32PTR32(s32p->ac_name, p->ac_name); + s32p->ac_name_len = p->ac_name_len; + NETBSD32PTR32(s32p->service_name, p->service_name); + s32p->service_name_len = p->service_name_len; +} +#endif + #if NSPPP > 0 static inline void netbsd32_from_spppauthcfg(struct spppauthcfg *p, @@ -1090,6 +1124,12 @@ netbsd32_ioctl(struct lwp *l, const struct netbsd32_ioctl_args *uap, register_t case SIOCGIFMEDIA32: IOCTL_STRUCT_CONV_TO(SIOCGIFMEDIA, ifmediareq); +#if NPPPOE > 0 + case PPPOESETPARMS32: + IOCTL_STRUCT_CONV_TO(PPPOESETPARMS, pppoediscparms); + case PPPOEGETPARMS32: + IOCTL_STRUCT_CONV_TO(PPPOEGETPARMS, pppoediscparms); +#endif #if NSPPP > 0 case SPPPGETAUTHCFG32: IOCTL_STRUCT_CONV_TO(SPPPGETAUTHCFG, spppauthcfg); diff --git a/sys/compat/netbsd32/netbsd32_ioctl.h b/sys/compat/netbsd32/netbsd32_ioctl.h index b1dd4a394f8d9..ffd246704ff2f 100644 --- a/sys/compat/netbsd32/netbsd32_ioctl.h +++ b/sys/compat/netbsd32/netbsd32_ioctl.h @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.50 2015/05/31 22:16:16 roy Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.51 2015/05/31 22:19:41 roy Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -426,6 +426,18 @@ struct netbsd32_ifmediareq { /* from */ #define SIOCGIFMEDIA32 _IOWR('i', 54, struct netbsd32_ifmediareq) /* get net media */ +/* from net/if_pppoe.h */ +struct netbsd32_pppoediscparms { + char ifname[IFNAMSIZ]; /* pppoe interface name */ + char eth_ifname[IFNAMSIZ]; /* external ethernet interface name */ + netbsd32_charp ac_name; /* access concentrator name (or NULL) */ + netbsd32_size_t ac_name_len; /* on write: length of buffer for ac_name */ + netbsd32_charp service_name; /* service name (or NULL) */ + netbsd32_size_t service_name_len; /* on write: length of buffer for service name */ +}; +#define PPPOESETPARMS32 _IOW('i', 110, struct netbsd32_pppoediscparms) +#define PPPOEGETPARMS32 _IOWR('i', 111, struct netbsd32_pppoediscparms) + /* from net/if_sppp.h */ struct netbsd32_spppauthcfg { char ifname[IFNAMSIZ]; /* pppoe interface name */