MCPcopy Create free account
hub / github.com/F-Stack/f-stack / firewire_ifattach

Function firewire_ifattach

freebsd/net/if_fwsubr.c:741–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

739}
740
741void
742firewire_ifattach(struct ifnet *ifp, struct fw_hwaddr *llc)
743{
744 struct fw_com *fc = IFP2FWC(ifp);
745 struct ifaddr *ifa;
746 struct sockaddr_dl *sdl;
747 static const char* speeds[] = {
748 "S100", "S200", "S400", "S800",
749 "S1600", "S3200"
750 };
751
752 fc->fc_speed = llc->sspd;
753 STAILQ_INIT(&fc->fc_frags);
754
755 ifp->if_addrlen = sizeof(struct fw_hwaddr);
756 ifp->if_hdrlen = 0;
757 if_attach(ifp);
758 ifp->if_mtu = 1500; /* XXX */
759 ifp->if_output = firewire_output;
760 ifp->if_resolvemulti = firewire_resolvemulti;
761 ifp->if_broadcastaddr = (u_char *) &firewire_broadcastaddr;
762
763 ifa = ifp->if_addr;
764 KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
765 sdl = (struct sockaddr_dl *)ifa->ifa_addr;
766 sdl->sdl_type = IFT_IEEE1394;
767 sdl->sdl_alen = ifp->if_addrlen;
768 bcopy(llc, LLADDR(sdl), ifp->if_addrlen);
769
770 bpfattach(ifp, DLT_APPLE_IP_OVER_IEEE1394,
771 sizeof(struct fw_hwaddr));
772
773 if_printf(ifp, "Firewire address: %8D @ 0x%04x%08x, %s, maxrec %d\n",
774 (uint8_t *) &llc->sender_unique_ID_hi, ":",
775 ntohs(llc->sender_unicast_FIFO_hi),
776 ntohl(llc->sender_unicast_FIFO_lo),
777 speeds[llc->sspd],
778 (2 << llc->sender_max_rec));
779}
780
781void
782firewire_ifdetach(struct ifnet *ifp)

Callers

nothing calls this directly

Calls 3

if_attachFunction · 0.85
bpfattachFunction · 0.85
if_printfFunction · 0.85

Tested by

no test coverage detected