#ifndef _NET_FIREWIRE_H_
#define _NET_FIREWIRE_H_
#define FW_ENCAP_UNFRAG 0
#define FW_ENCAP_FIRST 1
#define FW_ENCAP_LAST 2
#define FW_ENCAP_NEXT 3
union fw_encap {
uint32_t ul[2];
struct {
#if BYTE_ORDER == BIG_ENDIAN
uint32_t lf :2;
uint32_t reserved :14;
uint32_t ether_type :16;
#else
uint32_t ether_type :16;
uint32_t reserved :14;
uint32_t lf :2;
#endif
} unfrag;
struct {
#if BYTE_ORDER == BIG_ENDIAN
uint32_t lf :2;
uint32_t reserved1 :2;
uint32_t datagram_size :12;
uint32_t ether_type :16;
uint32_t dgl :16;
uint32_t reserved2 :16;
#else
uint32_t ether_type :16;
uint32_t datagram_size :12;
uint32_t reserved1 :2;
uint32_t lf :2;
uint32_t reserved2 :16;
uint32_t dgl :16;
#endif
} firstfrag;
struct {
#if BYTE_ORDER == BIG_ENDIAN
uint32_t lf :2;
uint32_t reserved1 :2;
uint32_t datagram_size :12;
uint32_t reserved2 :4;
uint32_t fragment_offset :12;
uint32_t dgl :16;
uint32_t reserved3 :16;
#else
uint32_t fragment_offset :12;
uint32_t reserved2 :4;
uint32_t datagram_size :12;
uint32_t reserved1 :2;
uint32_t lf :2;
uint32_t reserved3 :16;
uint32_t dgl :16;
#endif
} nextfrag;
};
#define MTAG_FIREWIRE 1394
#define MTAG_FIREWIRE_HWADDR 0
#define MTAG_FIREWIRE_SENDER_EUID 1
struct fw_hwaddr {
uint32_t sender_unique_ID_hi;
uint32_t sender_unique_ID_lo;
uint8_t sender_max_rec;
uint8_t sspd;
uint16_t sender_unicast_FIFO_hi;
uint32_t sender_unicast_FIFO_lo;
};
struct fw_bpfhdr {
uint8_t firewire_dhost[8];
uint8_t firewire_shost[8];
uint16_t firewire_type;
};
#ifdef _KERNEL
struct fw_reass {
STAILQ_ENTRY(fw_reass) fr_link;
uint32_t fr_id;
struct mbuf *fr_frags;
};
STAILQ_HEAD(fw_reass_list, fw_reass);
struct fw_com {
struct ifnet *fc_ifp;
struct fw_hwaddr fc_hwaddr;
struct firewire_comm *fc_fc;
uint8_t fc_broadcast_channel;
uint8_t fc_speed;
uint16_t fc_node;
struct fw_reass_list fc_frags;
};
#define IFP2FWC(ifp) ((struct fw_com *)if_getl2com(ifp))
extern void firewire_input(struct ifnet *ifp, struct mbuf *m, uint16_t src);
extern void firewire_ifattach(struct ifnet *, struct fw_hwaddr *);
extern void firewire_ifdetach(struct ifnet *);
extern void firewire_busreset(struct ifnet *);
extern int firewire_ioctl(struct ifnet *, u_long, caddr_t);
#endif
#endif