FreeBSD/sys/net/if_arcsubr.c
/*
 * Perform common duties while attaching to interface list
 */
Perform common duties while attaching to interface list
Perform common duties while attaching to interface list
void
arc_ifattach(struct ifnet *ifp, u_int8_t lla)
{
	struct ifaddr *ifa;
	struct sockaddr_dl *sdl;
	struct arccom *ac;
	if_attach(ifp);
	ifp->if_addrlen = 1;
	ifp->if_hdrlen = ARC_HDRLEN;
	ifp->if_mtu = 1500;
	ifp->if_resolvemulti = arc_resolvemulti;
	if (ifp->if_baudrate == 0)
		ifp->if_baudrate = 2500000;
	ifa = ifp->if_addr;
	KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
	sdl = (struct sockaddr_dl *)ifa->ifa_addr;
	sdl->sdl_type = IFT_ARCNET;
	sdl->sdl_alen = ifp->if_addrlen;
	if (ifp->if_flags & IFF_BROADCAST)
		ifp->if_flags |= IFF_MULTICAST|IFF_ALLMULTI;
	ac = (struct arccom *)ifp->if_l2com;
	ac->ac_seqid = (time_second) & 0xFFFF; 
	if (lla == 0) {
		log(LOG_ERR,"%s: link address 0 reserved for broadcasts.  Please change it and ifconfig %s down up\n",
		   ifp->if_xname, ifp->if_xname);
	}
	arc_storelladdr(ifp, lla);
	ifp->if_broadcastaddr = &arcbroadcastaddr;
	bpfattach(ifp, DLT_ARCNET, ARC_HDRLEN);
}
void arc_ifattach ( struct ifnet * ifp , u_int8_t lla ) { struct ifaddr * ifa ; struct sockaddr_dl * sdl ; struct arccom * ac ; if_attach ( ifp ) ; ifp -> if_addrlen = 1 ; ifp -> if_hdrlen = ARC_HDRLEN ; ifp -> if_mtu = 1500 ; ifp -> if_resolvemulti = arc_resolvemulti ; if ( ifp -> if_baudrate == 0 ) ifp -> if_baudrate = 2500000 ; ifa = ifp -> if_addr ; KASSERT ( ifa != NULL , ( " \n " , __func__ ) ) ; sdl = ( struct sockaddr_dl * ) ifa -> ifa_addr ; sdl -> sdl_type = IFT_ARCNET ; sdl -> sdl_alen = ifp -> if_addrlen ; if ( ifp -> if_flags & IFF_BROADCAST ) ifp -> if_flags |= IFF_MULTICAST | IFF_ALLMULTI ; ac = ( struct arccom * ) ifp -> if_l2com ; ac -> ac_seqid = ( time_second ) & 0xFFFF ; if ( lla == 0 ) { log ( LOG_ERR , " \n " , ifp -> if_xname , ifp -> if_xname ) ; } arc_storelladdr ( ifp , lla ) ; ifp -> if_broadcastaddr = & arcbroadcastaddr ; bpfattach ( ifp , DLT_ARCNET , ARC_HDRLEN ) ; }
Perform common duties while attaching to interface list
Perform common duties while attaching to interface list
/* try to make seqid unique */ /* XXX this message isn't entirely clear, to me -- cgd */