aboutsummaryrefslogtreecommitdiffstats
path: root/package/broadcom-57xx/src/proto
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-06-26 20:43:32 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-06-26 20:43:32 +0000
commit08e4d51c29ea57920f6e5f7906b19b19e1c71a50 (patch)
tree587ae60c092c92cb965d1b5976f85a91aaf41f65 /package/broadcom-57xx/src/proto
parentda1bb88a2b900f0392b731ec47c5e1bff956fd8f (diff)
downloadupstream-08e4d51c29ea57920f6e5f7906b19b19e1c71a50.tar.gz
upstream-08e4d51c29ea57920f6e5f7906b19b19e1c71a50.tar.bz2
upstream-08e4d51c29ea57920f6e5f7906b19b19e1c71a50.zip
remove broadcom-57xx (only used on linux 2.4)
SVN-Revision: 21953
Diffstat (limited to 'package/broadcom-57xx/src/proto')
-rw-r--r--package/broadcom-57xx/src/proto/bcmip.h151
-rw-r--r--package/broadcom-57xx/src/proto/bcmtcp.h67
-rw-r--r--package/broadcom-57xx/src/proto/ethernet.h172
-rw-r--r--package/broadcom-57xx/src/proto/vlan.h51
4 files changed, 0 insertions, 441 deletions
diff --git a/package/broadcom-57xx/src/proto/bcmip.h b/package/broadcom-57xx/src/proto/bcmip.h
deleted file mode 100644
index 07777b95b8..0000000000
--- a/package/broadcom-57xx/src/proto/bcmip.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright 2007, Broadcom Corporation
- * All Rights Reserved.
- *
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * Fundamental constants relating to IP Protocol
- *
- */
-
-#ifndef _bcmip_h_
-#define _bcmip_h_
-
-/* enable structure packing */
-#if defined(__GNUC__)
-#define PACKED __attribute__((packed))
-#else
-#pragma pack(1)
-#define PACKED
-#endif
-
-
-/* IPV4 and IPV6 common */
-#define IP_VER_OFFSET 0x0 /* offset to version field */
-#define IP_VER_MASK 0xf0 /* version mask */
-#define IP_VER_SHIFT 4 /* version shift */
-#define IP_VER_4 4 /* version number for IPV4 */
-#define IP_VER_6 6 /* version number for IPV6 */
-
-#define IP_VER(ip_body) \
- ((((uint8 *)(ip_body))[IP_VER_OFFSET] & IP_VER_MASK) >> IP_VER_SHIFT)
-
-#define IP_PROT_ICMP 0x1 /* ICMP protocol */
-#define IP_PROT_TCP 0x6 /* TCP protocol */
-#define IP_PROT_UDP 0x11 /* UDP protocol type */
-
-/* IPV4 field offsets */
-#define IPV4_VER_HL_OFFSET 0 /* version and ihl byte offset */
-#define IPV4_TOS_OFFSET 1 /* type of service offset */
-#define IPV4_PKTLEN_OFFSET 2 /* packet length offset */
-#define IPV4_PKTFLAG_OFFSET 6 /* more-frag,dont-frag flag offset */
-#define IPV4_PROT_OFFSET 9 /* protocol type offset */
-#define IPV4_CHKSUM_OFFSET 10 /* IP header checksum offset */
-#define IPV4_SRC_IP_OFFSET 12 /* src IP addr offset */
-#define IPV4_DEST_IP_OFFSET 16 /* dest IP addr offset */
-#define IPV4_OPTIONS_OFFSET 20 /* IP options offset */
-
-/* IPV4 field decodes */
-#define IPV4_VER_MASK 0xf0 /* IPV4 version mask */
-#define IPV4_VER_SHIFT 4 /* IPV4 version shift */
-
-#define IPV4_HLEN_MASK 0x0f /* IPV4 header length mask */
-#define IPV4_HLEN(ipv4_body) (4 * (((uint8 *)(ipv4_body))[IPV4_VER_HL_OFFSET] & IPV4_HLEN_MASK))
-
-#define IPV4_ADDR_LEN 4 /* IPV4 address length */
-
-#define IPV4_ADDR_NULL(a) ((((uint8 *)(a))[0] | ((uint8 *)(a))[1] | \
- ((uint8 *)(a))[2] | ((uint8 *)(a))[3]) == 0)
-
-#define IPV4_ADDR_BCAST(a) ((((uint8 *)(a))[0] & ((uint8 *)(a))[1] & \
- ((uint8 *)(a))[2] & ((uint8 *)(a))[3]) == 0xff)
-
-#define IPV4_TOS_DSCP_MASK 0xfc /* DiffServ codepoint mask */
-#define IPV4_TOS_DSCP_SHIFT 2 /* DiffServ codepoint shift */
-
-#define IPV4_TOS(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_TOS_OFFSET])
-
-#define IPV4_TOS_PREC_MASK 0xe0 /* Historical precedence mask */
-#define IPV4_TOS_PREC_SHIFT 5 /* Historical precedence shift */
-
-#define IPV4_TOS_LOWDELAY 0x10 /* Lowest delay requested */
-#define IPV4_TOS_THROUGHPUT 0x8 /* Best throughput requested */
-#define IPV4_TOS_RELIABILITY 0x4 /* Most reliable delivery requested */
-
-#define IPV4_PROT(ipv4_body) (((uint8 *)(ipv4_body))[IPV4_PROT_OFFSET])
-
-#define IPV4_FRAG_RESV 0x8000 /* Reserved */
-#define IPV4_FRAG_DONT 0x4000 /* Don't fragment */
-#define IPV4_FRAG_MORE 0x2000 /* More fragments */
-#define IPV4_FRAG_OFFSET_MASK 0x1fff /* Fragment offset */
-
-#define IPV4_ADDR_STR_LEN 16 /* Max IP address length in string format */
-
-/* IPv4, no options only. */
-#define IPV4_NO_OPTIONS_HDR_LEN 20
-#define IPV4_NO_OPTIONS_PAYLOAD(ip_hdr) (&(((uint8 *)(ip_hdr))[IPV4_NO_OPTIONS_HDR_LEN]))
-
-#define IPV4_PAYLOAD_LEN(ip_body) \
- (((int)(((uint8 *)(ip_body))[IPV4_PKTLEN_OFFSET + 0]) << 8) | \
- ((uint8 *)(ip_body))[IPV4_PKTLEN_OFFSET + 1])
-
-/* IPV4 packet formats */
-struct ipv4_addr {
- uint8 addr[IPV4_ADDR_LEN];
-} PACKED;
-
-struct ipv4_hdr {
- uint8 version_ihl; /* Version and Internet Header Length */
- uint8 tos; /* Type Of Service */
- uint16 tot_len; /* Number of bytes in packet (max 65535) */
- uint16 id;
- uint16 frag; /* 3 flag bits and fragment offset */
- uint8 ttl; /* Time To Live */
- uint8 prot; /* Protocol */
- uint16 hdr_chksum; /* IP header checksum */
- uint8 src_ip[IPV4_ADDR_LEN]; /* Source IP Address */
- uint8 dst_ip[IPV4_ADDR_LEN]; /* Destination IP Address */
-} PACKED;
-
-/* IPV6 field offsets */
-#define IPV6_PAYLOAD_LEN_OFFSET 4 /* payload length offset */
-#define IPV6_NEXT_HDR_OFFSET 6 /* next header/protocol offset */
-#define IPV6_HOP_LIMIT_OFFSET 7 /* hop limit offset */
-#define IPV6_SRC_IP_OFFSET 8 /* src IP addr offset */
-#define IPV6_DEST_IP_OFFSET 24 /* dst IP addr offset */
-
-/* IPV6 field decodes */
-#define IPV6_TRAFFIC_CLASS(ipv6_body) \
- (((((uint8 *)(ipv6_body))[0] & 0x0f) << 4) | \
- ((((uint8 *)(ipv6_body))[1] & 0xf0) >> 4))
-
-#define IPV6_FLOW_LABEL(ipv6_body) \
- (((((uint8 *)(ipv6_body))[1] & 0x0f) << 16) | \
- (((uint8 *)(ipv6_body))[2] << 8) | \
- (((uint8 *)(ipv6_body))[3]))
-
-#define IPV6_PAYLOAD_LEN(ipv6_body) \
- ((((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 0] << 8) | \
- ((uint8 *)(ipv6_body))[IPV6_PAYLOAD_LEN_OFFSET + 1])
-
-#define IPV6_NEXT_HDR(ipv6_body) \
- (((uint8 *)(ipv6_body))[IPV6_NEXT_HDR_OFFSET])
-
-#define IPV6_PROT(ipv6_body) IPV6_NEXT_HDR(ipv6_body)
-
-#define IPV6_ADDR_LEN 16 /* IPV6 address length */
-
-/* IPV4 TOS or IPV6 Traffic Classifier or 0 */
-#define IP_TOS(ip_body) \
- (IP_VER(ip_body) == IP_VER_4 ? IPV4_TOS(ip_body) : \
- IP_VER(ip_body) == IP_VER_6 ? IPV6_TRAFFIC_CLASS(ip_body) : 0)
-
-#undef PACKED
-#if !defined(__GNUC__)
-#pragma pack()
-#endif
-
-#endif /* _bcmip_h_ */
diff --git a/package/broadcom-57xx/src/proto/bcmtcp.h b/package/broadcom-57xx/src/proto/bcmtcp.h
deleted file mode 100644
index ab7c2bceb0..0000000000
--- a/package/broadcom-57xx/src/proto/bcmtcp.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2007, Broadcom Corporation
- * All Rights Reserved.
- *
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- * Fundamental constants relating to TCP Protocol
- *
- */
-
-#ifndef _bcmtcp_h_
-#define _bcmtcp_h_
-
-/* enable structure packing */
-#if defined(__GNUC__)
-#define PACKED __attribute__((packed))
-#else
-#pragma pack(1)
-#define PACKED
-#endif
-
-#define TCP_SRC_PORT_OFFSET 0 /* TCP source port offset */
-#define TCP_DEST_PORT_OFFSET 2 /* TCP dest port offset */
-#define TCP_CHKSUM_OFFSET 16 /* TCP body checksum offset */
-
-/* These fields are stored in network order */
-struct bcmtcp_hdr
-{
- uint16 src_port; /* Source Port Address */
- uint16 dst_port; /* Destination Port Address */
- uint32 seq_num; /* TCP Sequence Number */
- uint32 ack_num; /* TCP Sequence Number */
- uint16 hdrlen_rsvd_flags; /* Header length, reserved bits and flags */
- uint16 tcpwin; /* TCP window */
- uint16 chksum; /* Segment checksum with pseudoheader */
- uint16 urg_ptr; /* Points to seq-num of byte following urg data */
-} PACKED;
-
-#undef PACKED
-#if !defined(__GNUC__)
-#pragma pack()
-#endif
-
-/* Byte offset of flags in TCP header */
-#define TCP_FLAGS_OFFSET 13
-
-#define TCP_FLAGS_FIN 0x01
-#define TCP_FLAGS_SYN 0x02
-#define TCP_FLAGS_RST 0x03
-#define TCP_FLAGS_PSH 0x04
-#define TCP_FLAGS_ACK 0x10
-#define TCP_FLAGS_URG 0x20
-#define TCP_FLAGS_ECN 0x40
-#define TCP_FLAGS_CWR 0x80
-
-#define TCP_FLAGS(tcp_hdr) (((uint8 *)(tcp_hdr))[TCP_FLAGS_OFFSET])
-#define TCP_IS_ACK(tcp_hdr) (TCP_FLAGS(tcp_hdr) & TCP_FLAGS_ACK)
-
-#define TCP_SRC_PORT(tcp_hdr) (ntoh16(((struct bcmtcp_hdr*)(tcp_hdr))->src_port))
-#define TCP_DST_PORT(tcp_hdr) (ntoh16(((struct bcmtcp_hdr*)(tcp_hdr))->dst_port))
-#define TCP_SEQ_NUM(tcp_hdr) (ntoh32(((struct bcmtcp_hdr*)(tcp_hdr))->seq_num))
-#define TCP_ACK_NUM(tcp_hdr) (ntoh32(((struct bcmtcp_hdr*)(tcp_hdr))->ack_num))
-
-#endif /* #ifndef _bcmtcp_h_ */
diff --git a/package/broadcom-57xx/src/proto/ethernet.h b/package/broadcom-57xx/src/proto/ethernet.h
deleted file mode 100644
index 072592a8d9..0000000000
--- a/package/broadcom-57xx/src/proto/ethernet.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * From FreeBSD 2.2.7: Fundamental constants relating to ethernet.
- *
- * Copyright 2007, Broadcom Corporation
- * All Rights Reserved.
- *
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- */
-
-#ifndef _NET_ETHERNET_H_ /* use native BSD ethernet.h when available */
-#define _NET_ETHERNET_H_
-
-#ifndef _TYPEDEFS_H_
-#include "typedefs.h"
-#endif
-
-/* enable structure packing */
-#if defined(__GNUC__)
-#define PACKED __attribute__((packed))
-#else
-#pragma pack(1)
-#define PACKED
-#endif
-
-/*
- * The number of bytes in an ethernet (MAC) address.
- */
-#define ETHER_ADDR_LEN 6
-
-/*
- * The number of bytes in the type field.
- */
-#define ETHER_TYPE_LEN 2
-
-/*
- * The number of bytes in the trailing CRC field.
- */
-#define ETHER_CRC_LEN 4
-
-/*
- * The length of the combined header.
- */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN)
-
-/*
- * The minimum packet length.
- */
-#define ETHER_MIN_LEN 64
-
-/*
- * The minimum packet user data length.
- */
-#define ETHER_MIN_DATA 46
-
-/*
- * The maximum packet length.
- */
-#define ETHER_MAX_LEN 1518
-
-/*
- * The maximum packet user data length.
- */
-#define ETHER_MAX_DATA 1500
-
-/* ether types */
-#define ETHER_TYPE_MIN 0x0600 /* Anything less than MIN is a length */
-#define ETHER_TYPE_IP 0x0800 /* IP */
-#define ETHER_TYPE_ARP 0x0806 /* ARP */
-#define ETHER_TYPE_8021Q 0x8100 /* 802.1Q */
-#define ETHER_TYPE_BRCM 0x886c /* Broadcom Corp. */
-#define ETHER_TYPE_802_1X 0x888e /* 802.1x */
-#ifdef BCMWPA2
-#define ETHER_TYPE_802_1X_PREAUTH 0x88c7 /* 802.1x preauthentication */
-#endif
-
-/* Broadcom subtype follows ethertype; First 2 bytes are reserved; Next 2 are subtype; */
-#define ETHER_BRCM_SUBTYPE_LEN 4 /* Broadcom 4 byte subtype */
-#define ETHER_BRCM_CRAM 0x1 /* Broadcom subtype cram protocol */
-
-/* ether header */
-#define ETHER_DEST_OFFSET (0 * ETHER_ADDR_LEN) /* dest address offset */
-#define ETHER_SRC_OFFSET (1 * ETHER_ADDR_LEN) /* src address offset */
-#define ETHER_TYPE_OFFSET (2 * ETHER_ADDR_LEN) /* ether type offset */
-
-/*
- * A macro to validate a length with
- */
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-
-#ifndef __INCif_etherh /* Quick and ugly hack for VxWorks */
-/*
- * Structure of a 10Mb/s Ethernet header.
- */
-struct ether_header {
- uint8 ether_dhost[ETHER_ADDR_LEN];
- uint8 ether_shost[ETHER_ADDR_LEN];
- uint16 ether_type;
-} PACKED;
-
-/*
- * Structure of a 48-bit Ethernet address.
- */
-struct ether_addr {
- uint8 octet[ETHER_ADDR_LEN];
-} PACKED;
-#endif /* !__INCif_etherh Quick and ugly hack for VxWorks */
-
-/*
- * Takes a pointer, set, test, clear, toggle locally admininistered
- * address bit in the 48-bit Ethernet address.
- */
-#define ETHER_SET_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] | 2))
-#define ETHER_IS_LOCALADDR(ea) (((uint8 *)(ea))[0] & 2)
-#define ETHER_CLR_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & 0xd))
-#define ETHER_TOGGLE_LOCALADDR(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] ^ 2))
-
-/* Takes a pointer, marks unicast address bit in the MAC address */
-#define ETHER_SET_UNICAST(ea) (((uint8 *)(ea))[0] = (((uint8 *)(ea))[0] & ~1))
-
-/*
- * Takes a pointer, returns true if a 48-bit multicast address
- * (including broadcast, since it is all ones)
- */
-#define ETHER_ISMULTI(ea) (((const uint8 *)(ea))[0] & 1)
-
-
-/* compare two ethernet addresses - assumes the pointers can be referenced as shorts */
-#define ether_cmp(a, b) (!(((short*)a)[0] == ((short*)b)[0]) | \
- !(((short*)a)[1] == ((short*)b)[1]) | \
- !(((short*)a)[2] == ((short*)b)[2]))
-
-/* copy an ethernet address - assumes the pointers can be referenced as shorts */
-#define ether_copy(s, d) { \
- ((short*)d)[0] = ((short*)s)[0]; \
- ((short*)d)[1] = ((short*)s)[1]; \
- ((short*)d)[2] = ((short*)s)[2]; }
-
-/*
- * Takes a pointer, returns true if a 48-bit broadcast (all ones)
- */
-#define ETHER_ISBCAST(ea) ((((uint8 *)(ea))[0] & \
- ((uint8 *)(ea))[1] & \
- ((uint8 *)(ea))[2] & \
- ((uint8 *)(ea))[3] & \
- ((uint8 *)(ea))[4] & \
- ((uint8 *)(ea))[5]) == 0xff)
-
-static const struct ether_addr ether_bcast = {{255, 255, 255, 255, 255, 255}};
-static const struct ether_addr ether_null = {{0, 0, 0, 0, 0, 0}};
-
-/*
- * Takes a pointer, returns true if a 48-bit null address (all zeros)
- */
-#define ETHER_ISNULLADDR(ea) ((((uint8 *)(ea))[0] | \
- ((uint8 *)(ea))[1] | \
- ((uint8 *)(ea))[2] | \
- ((uint8 *)(ea))[3] | \
- ((uint8 *)(ea))[4] | \
- ((uint8 *)(ea))[5]) == 0)
-
-#undef PACKED
-#if !defined(__GNUC__)
-#pragma pack()
-#endif
-
-#endif /* _NET_ETHERNET_H_ */
diff --git a/package/broadcom-57xx/src/proto/vlan.h b/package/broadcom-57xx/src/proto/vlan.h
deleted file mode 100644
index 8085c71833..0000000000
--- a/package/broadcom-57xx/src/proto/vlan.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 802.1Q VLAN protocol definitions
- *
- * Copyright 2007, Broadcom Corporation
- * All Rights Reserved.
- *
- * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
- * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
- * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
- * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
- *
- */
-
-#ifndef _vlan_h_
-#define _vlan_h_
-
-/* enable structure packing */
-#if defined(__GNUC__)
-#define PACKED __attribute__((packed))
-#else
-#pragma pack(1)
-#define PACKED
-#endif
-
-#define VLAN_VID_MASK 0xfff /* low 12 bits are vlan id */
-#define VLAN_CFI_SHIFT 12 /* canonical format indicator bit */
-#define VLAN_PRI_SHIFT 13 /* user priority */
-
-#define VLAN_PRI_MASK 7 /* 3 bits of priority */
-
-#define VLAN_TAG_LEN 4
-#define VLAN_TAG_OFFSET (2 * ETHER_ADDR_LEN) /* offset in Ethernet II packet only */
-
-#define VLAN_TPID 0x8100 /* VLAN ethertype/Tag Protocol ID */
-
-struct ethervlan_header {
- uint8 ether_dhost[ETHER_ADDR_LEN];
- uint8 ether_shost[ETHER_ADDR_LEN];
- uint16 vlan_type; /* 0x8100 */
- uint16 vlan_tag; /* priority, cfi and vid */
- uint16 ether_type;
-};
-
-#define ETHERVLAN_HDR_LEN (ETHER_HDR_LEN + VLAN_TAG_LEN)
-
-#undef PACKED
-#if !defined(__GNUC__)
-#pragma pack()
-#endif
-
-#endif /* _vlan_h_ */