net1080.c (e37c83c06c2690157a989df40dc99a6b61c9ea15) net1080.c (ba2d3587912f82d1ab4367975b1df460db60fb1e)
1/*
2 * Net1080 based USB host-to-host cables
3 * Copyright (C) 2000-2005 by David Brownell
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 50 unchanged lines hidden (view full) ---

59 __le16 hdr_len; // sizeof nc_header (LE, all)
60 __le16 packet_len; // payload size (including ethhdr)
61 __le16 packet_id; // detects dropped packets
62#define MIN_HEADER 6
63
64 // all else is optional, and must start with:
65 // __le16 vendorId; // from usb-if
66 // __le16 productId;
1/*
2 * Net1080 based USB host-to-host cables
3 * Copyright (C) 2000-2005 by David Brownell
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.

--- 50 unchanged lines hidden (view full) ---

59 __le16 hdr_len; // sizeof nc_header (LE, all)
60 __le16 packet_len; // payload size (including ethhdr)
61 __le16 packet_id; // detects dropped packets
62#define MIN_HEADER 6
63
64 // all else is optional, and must start with:
65 // __le16 vendorId; // from usb-if
66 // __le16 productId;
67} __attribute__((__packed__));
67} __packed;
68
69#define PAD_BYTE ((unsigned char)0xAC)
70
71struct nc_trailer {
72 __le16 packet_id;
68
69#define PAD_BYTE ((unsigned char)0xAC)
70
71struct nc_trailer {
72 __le16 packet_id;
73} __attribute__((__packed__));
73} __packed;
74
75// packets may use FLAG_FRAMING_NC and optional pad
76#define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \
77 + sizeof (struct ethhdr) \
78 + (mtu) \
79 + 1 \
80 + sizeof (struct nc_trailer))
81

--- 525 unchanged lines hidden ---
74
75// packets may use FLAG_FRAMING_NC and optional pad
76#define FRAMED_SIZE(mtu) (sizeof (struct nc_header) \
77 + sizeof (struct ethhdr) \
78 + (mtu) \
79 + 1 \
80 + sizeof (struct nc_trailer))
81

--- 525 unchanged lines hidden ---