changeset 301:31369f326ee3

c1xx-calextr: preparations for Rx calchan conversion
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 19 Nov 2017 22:37:16 +0000
parents 0cfb2e3aeda4
children e05563f0dfcf
files ffstools/caltools/c1xx-calextr.c
diffstat 1 files changed, 72 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ffstools/caltools/c1xx-calextr.c	Sun Nov 19 21:45:12 2017 +0000
+++ b/ffstools/caltools/c1xx-calextr.c	Sun Nov 19 22:37:16 2017 +0000
@@ -23,18 +23,80 @@
 u_char record_magic[4] = {0xAA, 0x00, 0x00, 0x00};
 char *ascii_output_dir, *bin_output_dir;
 
+struct rx_calchan_map {
+	unsigned	upper_bound;
+	unsigned	compal_start;
+	unsigned	compal_num;
+};
+
+#define	RF_RX_CAL_CHAN_SIZE	10	/* TI/FC canonical version */
+
+struct rx_calchan_map rx_calchan_map_850[RF_RX_CAL_CHAN_SIZE] = {
+	{140,  0, 2},
+	{152,  2, 2},
+	{164,  4, 2},
+	{176,  6, 2},
+	{188,  8, 2},
+	{200, 10, 2},
+	{212, 12, 2},
+	{224, 14, 2},
+	{236, 16, 2},
+	{251, 18, 3}
+};
+
+struct rx_calchan_map rx_calchan_map_900[RF_RX_CAL_CHAN_SIZE] = {
+	{  18,  0, 3},
+	{  36,  3, 3},
+	{  54,  6, 3},
+	{  72,  9, 3},
+	{  90, 12, 3},
+	{ 108, 15, 3},
+	{ 124, 18, 3},
+	{ 987, 21, 3},
+	{1005, 24, 3},
+	{1023, 27, 3}
+};
+
+struct rx_calchan_map rx_calchan_map_1800[RF_RX_CAL_CHAN_SIZE] = {
+	{548,  0, 6},
+	{584,  6, 6},
+	{620, 12, 6},
+	{656, 18, 6},
+	{692, 24, 6},
+	{728, 30, 6},
+	{764, 36, 6},
+	{806, 42, 7},
+	{848, 49, 7},
+	{885, 56, 7}
+};
+
+struct rx_calchan_map rx_calchan_map_1900[RF_RX_CAL_CHAN_SIZE] = {
+	{542,  0, 5},
+	{572,  5, 5},
+	{602, 10, 5},
+	{632, 15, 5},
+	{662, 20, 5},
+	{692, 25, 5},
+	{722, 30, 5},
+	{752, 35, 5},
+	{782, 40, 5},
+	{810, 45, 5}
+};
+
 struct band {
-	char		*name;
-	unsigned	compal_record_id;
-	unsigned	record_length;
-	unsigned	magic2_offset;
-	unsigned	start_plnum;
-	unsigned	end_plnum;
+	char			*name;
+	unsigned		compal_record_id;
+	unsigned		record_length;
+	unsigned		magic2_offset;
+	struct rx_calchan_map	*rx_calchan_map;
+	unsigned		start_plnum;
+	unsigned		end_plnum;
 } bands[] = {
-	{"900",  0x00, 0x94, 0x54, 5, 19},
-	{"1800", 0x01, 0xC8, 0x74, 0, 15},
-	{"1900", 0x02, 0xB4, 0x68, 0, 15},
-	{"850",  0x18, 0x88, 0x4C, 5, 19},
+	{"900",  0x00, 0x94, 0x54, rx_calchan_map_900,  5, 19},
+	{"1800", 0x01, 0xC8, 0x74, rx_calchan_map_1800, 0, 15},
+	{"1900", 0x02, 0xB4, 0x68, rx_calchan_map_1900, 0, 15},
+	{"850",  0x18, 0x88, 0x4C, rx_calchan_map_850,  5, 19},
+	{0,      0,    0,    0,    0,                   0, 0}
 };
 
 read_binfile(filename, offset_arg)