[U-Boot] [PATCH 18/28] net: Add NetUpdateEther() to handle ARP or Ping replies (VLAN or SNAP)

Mike Frysinger vapier at gentoo.org
Fri Feb 3 13:25:04 CET 2012


On Thursday 19 January 2012 19:53:21 Joe Hershberger wrote:
> --- a/net/net.c
> +++ b/net/net.c
> 
> +int
> +NetUpdateEther(struct Ethernet_t *et, uchar *addr, uint prot)
> +{
> +	ushort protlen;
> +
> +	memcpy(et->et_dest, addr, 6);
> +	memcpy(et->et_src, NetOurEther, 6);
> +	protlen = ntohs(et->et_protlen);
> +	if (protlen == PROT_VLAN) {
> +		struct VLAN_Ethernet_t *vet = (struct VLAN_Ethernet_t *)et;
> +		vet->vet_type = htons(prot);
> +		return VLAN_ETHER_HDR_SIZE;
> +	} else if (protlen > 1514) {
> +		et->et_protlen = htons(prot);
> +		return ETHER_HDR_SIZE;
> +	} else {
> +		/* 802.2 + SNAP */
> +		et->et_prot = htons(prot);
> +		return E802_HDR_SIZE;
> +	}
> +}

seems to overlap a bit with NetSetEther.  can't you have one use the other ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120203/0b6a03f9/attachment.pgp>


More information about the U-Boot mailing list