mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 08:37:41 +08:00
Revert superfluous changes
This commit is contained in:
@@ -562,10 +562,10 @@ if_rele(struct ifnet *ifp)
|
||||
void
|
||||
ifq_init(struct ifaltq *ifq, struct ifnet *ifp)
|
||||
{
|
||||
|
||||
|
||||
mtx_init(&ifq->ifq_mtx, ifp->if_xname, "if send queue", MTX_DEF);
|
||||
|
||||
if (ifq->ifq_maxlen == 0)
|
||||
if (ifq->ifq_maxlen == 0)
|
||||
ifq->ifq_maxlen = ifqmaxlen;
|
||||
|
||||
ifq->altq_type = 0;
|
||||
@@ -622,7 +622,7 @@ if_attach_internal(struct ifnet *ifp, int vmove)
|
||||
if_addgroup(ifp, IFG_ALL);
|
||||
|
||||
getmicrotime(&ifp->if_lastchange);
|
||||
ifp->if_data.ifi_epoch = time_uptime;
|
||||
ifp->if_data.ifi_epoch = time_uptime;
|
||||
ifp->if_data.ifi_datalen = sizeof(struct if_data);
|
||||
|
||||
KASSERT((ifp->if_transmit == NULL && ifp->if_qflush == NULL) ||
|
||||
@@ -632,7 +632,7 @@ if_attach_internal(struct ifnet *ifp, int vmove)
|
||||
ifp->if_transmit = if_transmit;
|
||||
ifp->if_qflush = if_qflush;
|
||||
}
|
||||
|
||||
|
||||
if (!vmove) {
|
||||
#ifdef MAC
|
||||
mac_ifnet_create(ifp);
|
||||
@@ -1694,7 +1694,7 @@ ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp)
|
||||
|
||||
if (ifa->ifa_addr->sa_family != af)
|
||||
next: continue;
|
||||
if (af == AF_INET &&
|
||||
if (af == AF_INET &&
|
||||
ifp->if_flags & IFF_POINTOPOINT && !ignore_ptp) {
|
||||
/*
|
||||
* This is a bit broken as it doesn't
|
||||
@@ -1989,7 +1989,7 @@ if_qflush(struct ifnet *ifp)
|
||||
{
|
||||
struct mbuf *m, *n;
|
||||
struct ifaltq *ifq;
|
||||
|
||||
|
||||
ifq = &ifp->if_snd;
|
||||
IFQ_LOCK(ifq);
|
||||
#ifdef ALTQ
|
||||
@@ -2259,7 +2259,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
|
||||
* changes (renames, vmoves, if_attach, etc).
|
||||
*/
|
||||
ifp->if_flags |= IFF_RENAMING;
|
||||
|
||||
|
||||
/* Announce the departure of the interface. */
|
||||
rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
|
||||
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
|
||||
@@ -2667,7 +2667,7 @@ if_setflag(struct ifnet *ifp, int flag, int pflag, int *refcount, int onswitch)
|
||||
/* Save ifnet parameters for if_ioctl() may fail */
|
||||
oldcount = *refcount;
|
||||
oldflags = ifp->if_flags;
|
||||
|
||||
|
||||
/*
|
||||
* See if we aren't the only and touching refcount is enough.
|
||||
* Actually toggle interface flag if we are the first or last.
|
||||
@@ -3367,7 +3367,7 @@ if_start(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
/*
|
||||
* Backwards compatibility interface for drivers
|
||||
* Backwards compatibility interface for drivers
|
||||
* that have not implemented it
|
||||
*/
|
||||
static int
|
||||
@@ -3408,7 +3408,7 @@ void
|
||||
if_register_com_alloc(u_char type,
|
||||
if_com_alloc_t *a, if_com_free_t *f)
|
||||
{
|
||||
|
||||
|
||||
KASSERT(if_com_alloc[type] == NULL,
|
||||
("if_register_com_alloc: %d already registered", type));
|
||||
KASSERT(if_com_free[type] == NULL,
|
||||
@@ -3421,7 +3421,7 @@ if_register_com_alloc(u_char type,
|
||||
void
|
||||
if_deregister_com_alloc(u_char type)
|
||||
{
|
||||
|
||||
|
||||
KASSERT(if_com_alloc[type] != NULL,
|
||||
("if_deregister_com_alloc: %d not registered", type));
|
||||
KASSERT(if_com_free[type] != NULL,
|
||||
|
@@ -40,18 +40,13 @@
|
||||
#endif
|
||||
|
||||
#if __BSD_VISIBLE
|
||||
|
||||
#ifdef __rtems__
|
||||
#include <rtems/bsd/sys/time.h>
|
||||
#else
|
||||
#ifndef _KERNEL
|
||||
/*
|
||||
* <net/if.h> does not depend on <sys/time.h> on most other systems. This
|
||||
* helps userland compatibility. (struct timeval ifi_lastchange)
|
||||
*/
|
||||
#ifndef _KERNEL
|
||||
#include <rtems/bsd/sys/time.h>
|
||||
#endif
|
||||
#endif /* __rtems__ */
|
||||
|
||||
struct ifnet;
|
||||
#endif
|
||||
|
@@ -210,7 +210,7 @@ epair_dpcpu_init(void)
|
||||
s = &epair_dpcpu->epair_ifp_drain_list;
|
||||
s->stqh_first = NULL;
|
||||
s->stqh_last = &s->stqh_first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -486,7 +486,7 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m)
|
||||
|
||||
if (m == NULL)
|
||||
return (0);
|
||||
|
||||
|
||||
/*
|
||||
* We are not going to use the interface en/dequeue mechanism
|
||||
* on the TX side. We are called from ether_output_frame()
|
||||
@@ -531,7 +531,7 @@ epair_transmit_locked(struct ifnet *ifp, struct mbuf *m)
|
||||
ifp->if_obytes += len;
|
||||
if (mflags & (M_BCAST|M_MCAST))
|
||||
ifp->if_omcasts++;
|
||||
|
||||
|
||||
if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0)
|
||||
epair_start_locked(ifp);
|
||||
else
|
||||
@@ -606,7 +606,7 @@ static void
|
||||
epair_qflush(struct ifnet *ifp)
|
||||
{
|
||||
struct epair_softc *sc;
|
||||
|
||||
|
||||
sc = ifp->if_softc;
|
||||
KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n",
|
||||
__func__, ifp, sc));
|
||||
@@ -769,7 +769,7 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
|
||||
ifc_free_unit(ifc, unit);
|
||||
return (ENOSPC);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Cross-reference the interfaces so we will be able to free both.
|
||||
*/
|
||||
@@ -786,7 +786,7 @@ epair_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
|
||||
netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount());
|
||||
scb->cpuid =
|
||||
netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount());
|
||||
|
||||
|
||||
/* Finish initialization of interface <n>a. */
|
||||
ifp = sca->ifp;
|
||||
ifp->if_softc = sca;
|
||||
@@ -865,7 +865,7 @@ epair_clone_destroy(struct if_clone *ifc, struct ifnet *ifp)
|
||||
*/
|
||||
if (ifp->if_softc == NULL)
|
||||
return (0);
|
||||
|
||||
|
||||
unit = ifp->if_dunit;
|
||||
sca = ifp->if_softc;
|
||||
oifp = sca->oifp;
|
||||
@@ -926,7 +926,7 @@ epair_modevent(module_t mod, int type, void *data)
|
||||
#ifndef __rtems__
|
||||
if (TUNABLE_INT_FETCH("net.link.epair.netisr_maxqlen", &qlimit))
|
||||
epair_nh.nh_qlimit = qlimit;
|
||||
#endif
|
||||
#endif /* __rtems__ */
|
||||
netisr_register(&epair_nh);
|
||||
if_clone_attach(&epair_cloner);
|
||||
if (bootverbose)
|
||||
|
@@ -312,7 +312,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
error = EINVAL; /* is there better errno? */
|
||||
goto end;
|
||||
}
|
||||
memset(&mob_h, 0, MOB_HH_SIZ_L);
|
||||
memset(&mob_h, 0, MOB_H_SIZ_L);
|
||||
mob_h.proto = (ip->ip_p) << 8;
|
||||
mob_h.odst = ip->ip_dst.s_addr;
|
||||
ip->ip_dst.s_addr = sc->g_dst.s_addr;
|
||||
@@ -323,12 +323,12 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
|
||||
* Else we also need to save and change the source
|
||||
*/
|
||||
if (in_hosteq(ip->ip_src, sc->g_src)) {
|
||||
msiz = MOB_HH_SIZ_S;
|
||||
msiz = MOB_H_SIZ_S;
|
||||
} else {
|
||||
mob_h.proto |= MOB_HH_SBIT;
|
||||
mob_h.proto |= MOB_H_SBIT;
|
||||
mob_h.osrc = ip->ip_src.s_addr;
|
||||
ip->ip_src.s_addr = sc->g_src.s_addr;
|
||||
msiz = MOB_HH_SIZ_L;
|
||||
msiz = MOB_H_SIZ_L;
|
||||
}
|
||||
mob_h.proto = htons(mob_h.proto);
|
||||
mob_h.hcrc = gre_in_cksum((u_int16_t *)&mob_h, msiz);
|
||||
|
@@ -162,9 +162,9 @@ struct mobip_h {
|
||||
} __packed;
|
||||
|
||||
|
||||
#define MOB_HH_SIZ_S (sizeof(struct mobile_h) - sizeof(u_int32_t))
|
||||
#define MOB_HH_SIZ_L (sizeof(struct mobile_h))
|
||||
#define MOB_HH_SBIT 0x0080
|
||||
#define MOB_H_SIZ_S (sizeof(struct mobile_h) - sizeof(u_int32_t))
|
||||
#define MOB_H_SIZ_L (sizeof(struct mobile_h))
|
||||
#define MOB_H_SBIT 0x0080
|
||||
|
||||
#define GRE_TTL 30
|
||||
|
||||
|
Reference in New Issue
Block a user