]>
git.saurik.com Git - apple/xnu.git/blob - bsd/net/firewire.h
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Fundamental constants relating to FireWire network device.
29 #ifndef _NET_FIREWIRE_H_
30 #define _NET_FIREWIRE_H_
32 #include <sys/appleapiopts.h>
35 * The number of bytes in a FireWire EUI-64.
37 #define FIREWIRE_EUI64_LEN 8
40 * The number of bytes in the type field.
42 #define FIREWIRE_TYPE_LEN 2
45 * The length of the header provided by the FireWire network device.
47 #define FIREWIRE_HDR_LEN (FIREWIRE_EUI64_LEN*2+FIREWIRE_TYPE_LEN)
50 * The minimum packet length.
52 #define FIREWIRE_MIN_LEN 64
55 * The maximum packet length.
57 #define FIREWIRE_MAX_LEN 4096
60 * A macro to validate a length with
62 #define FIREWIRE_IS_VALID_LEN(foo) \
63 ((foo) >= FIREWIRE_MIN_LEN && (foo) <= FIREWIRE_MAX_LEN)
66 * Structure of header provided by the FireWire network device.
68 * The device uses a simplified header with just the non-changing
69 * EUI-64 addresses and ethernet type specified;
71 struct firewire_header
{
72 u_char firewire_dhost
[FIREWIRE_EUI64_LEN
];
73 u_char firewire_shost
[FIREWIRE_EUI64_LEN
];
74 u_short firewire_type
; /* ethertype */
78 * Format of FireWire EUI-64.
80 struct firewire_eui64
{
81 u_char octet
[FIREWIRE_EUI64_LEN
];
85 * Format of FireWire hardware address.
87 struct firewire_address
{
88 u_char eui64
[FIREWIRE_EUI64_LEN
];
91 u_int16_t unicastFifoHi
;
92 u_int32_t unicastFifoLo
;
95 #define FIREWIRE_ADDR_LEN 16 /* sizeof(struct firewire_address) */
98 #define FIREWIRE_MTU (FIREWIRE_MAX_LEN - FIREWIRE_HDR_LEN)
99 #define FIREWIRE_MIN (FIREWIRE_MIN_LEN - FIREWIRE_HDR_LEN)
101 #endif /* !_NET_FIREWIRE_H_ */