]>
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 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Fundamental constants relating to FireWire network device.
26 #ifndef _NET_FIREWIRE_H_
27 #define _NET_FIREWIRE_H_
29 #include <sys/appleapiopts.h>
32 * The number of bytes in a FireWire EUI-64.
34 #define FIREWIRE_EUI64_LEN 8
37 * The number of bytes in the type field.
39 #define FIREWIRE_TYPE_LEN 2
42 * The length of the header provided by the FireWire network device.
44 #define FIREWIRE_HDR_LEN (FIREWIRE_EUI64_LEN*2+FIREWIRE_TYPE_LEN)
47 * The minimum packet length.
49 #define FIREWIRE_MIN_LEN 64
52 * The maximum packet length.
54 #define FIREWIRE_MAX_LEN 4096
57 * A macro to validate a length with
59 #define FIREWIRE_IS_VALID_LEN(foo) \
60 ((foo) >= FIREWIRE_MIN_LEN && (foo) <= FIREWIRE_MAX_LEN)
63 * Structure of header provided by the FireWire network device.
65 * The device uses a simplified header with just the non-changing
66 * EUI-64 addresses and ethernet type specified;
68 struct firewire_header
{
69 u_char firewire_dhost
[FIREWIRE_EUI64_LEN
];
70 u_char firewire_shost
[FIREWIRE_EUI64_LEN
];
71 u_short firewire_type
; /* ethertype */
75 * Format of FireWire EUI-64.
77 struct firewire_eui64
{
78 u_char octet
[FIREWIRE_EUI64_LEN
];
82 * Format of FireWire hardware address.
84 struct firewire_address
{
85 u_char eui64
[FIREWIRE_EUI64_LEN
];
88 u_int16_t unicastFifoHi
;
89 u_int32_t unicastFifoLo
;
92 #define FIREWIRE_ADDR_LEN 16 /* sizeof(struct firewire_address) */
95 #define FIREWIRE_MTU (FIREWIRE_MAX_LEN - FIREWIRE_HDR_LEN)
96 #define FIREWIRE_MIN (FIREWIRE_MIN_LEN - FIREWIRE_HDR_LEN)
98 #endif /* !_NET_FIREWIRE_H_ */