3 * Copyright 2009 Free Software Foundation, Inc.
5 * This file is part of GNU Radio
7 * GNU Radio is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * GNU Radio is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef INCLUDED_VRT_BITS_H
23 #define INCLUDED_VRT_BITS_H
30 #define VRTH_PT_MASK (0xf << 28)
31 #define VRTH_PT_IF_DATA_NO_SID (0x0 << 28) // IF-Data, no stream id
32 #define VRTH_PT_IF_DATA_WITH_SID (0x1 << 28) // IF-Data, w/ stream id
33 #define VRTH_PT_EXT_DATA_NO_SID (0x2 << 28)
34 #define VRTH_PT_EXT_DATA_WITH_SID (0x3 << 28)
35 #define VRTH_PT_IF_CONTEXT (0x4 << 28)
36 #define VRTH_PT_EXT_CONTEXT (0x5 << 28)
38 #define VRTH_HAS_CLASSID (1 << 27)
39 #define VRTH_HAS_TRAILER (1 << 26) // Data pkts only
40 #define VRTH_START_OF_BURST (1 << 25) // Data (Tx) pkts only
41 #define VRTH_END_OF_BURST (1 << 24) // Data (Tx) pkts only
42 #define VRTH_TSM (1 << 24) // Context pkts only
44 #define VRTH_TSI_MASK (0x3 << 22)
45 #define VRTH_TSI_NONE (0x0 << 22)
46 #define VRTH_TSI_UTC (0x1 << 22)
47 #define VRTH_TSI_GPS (0x2 << 22)
48 #define VRTH_TSI_OTHER (0x3 << 22)
50 #define VRTH_TSF_MASK (0x3 << 20)
51 #define VRTH_TSF_NONE (0x0 << 20)
52 #define VRTH_TSF_SAMPLE_CNT (0x1 << 20)
53 #define VRTH_TSF_REAL_TIME_PS (0x2 << 20)
54 #define VRTH_TSF_FREE_RUNNING (0x3 << 20)
56 #define VRTH_PKT_CNT_MASK (0xf << 16)
57 #define VRTH_PKT_SIZE_MASK 0xffff
61 vrth_pkt_cnt(uint32_t h)
63 return (h & VRTH_PKT_CNT_MASK) >> 16;
67 vrth_pkt_size(uint32_t h)
69 return h & VRTH_PKT_SIZE_MASK;
72 #endif /* INCLUDED_VRT_BITS_H */