Change in osmocom-bb[master]: trxcon/scheduler: refactor description of TRXC_* lchans

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Tue May 28 00:12:41 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/14218


Change subject: trxcon/scheduler: refactor description of TRXC_* lchans
......................................................................

trxcon/scheduler: refactor description of TRXC_* lchans

Let's avoid fancy alignment in the description of logical channels
for the benefits of having better readability, the ability to add
more comments and fields without making it look ugly.

Also, let's get rid of field 'chan' of 'trx_lchan_desc' structure
since it's not used anywhere, and not actually needed because the
position of each lchan description is defined by its TRXC_* type.

As a bonus, let's add a human readable description to each
lchan definition, so it can be printed in the VTY some day.

Change-Id: I2fc61e1cdca4690a34e2861b9ee3b7c64ea64843
---
M src/host/trxcon/sched_lchan_desc.c
M src/host/trxcon/sched_trx.h
2 files changed, 438 insertions(+), 211 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/18/14218/1

diff --git a/src/host/trxcon/sched_lchan_desc.c b/src/host/trxcon/sched_lchan_desc.c
index 8bc336e..5cee7c8 100644
--- a/src/host/trxcon/sched_lchan_desc.c
+++ b/src/host/trxcon/sched_lchan_desc.c
@@ -63,256 +63,482 @@
 	struct trx_lchan_state *lchan, uint32_t fn, uint8_t bid);
 
 const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = {
-	{
-		TRXC_IDLE,		"IDLE",
-		0x00,			TRX_CH_LID_DEDIC,
-		0x00,			0x00,
+	[TRXC_IDLE] = {
+		.name = "IDLE",
+		.desc = "Idle channel",
+		/* The MS needs to perform neighbour measurements during
+		 * IDLE slots, however this is not implemented (yet). */
+	},
+	[TRXC_FCCH] = {
+		.name = "FCCH", /* 3GPP TS 05.02, section 3.3.2.1 */
+		.desc = "Frequency correction channel",
+		/* Handled by transceiver, nothing to do. */
+	},
+	[TRXC_SCH] = {
+		.name = "SCH", /* 3GPP TS 05.02, section 3.3.2.2 */
+		.desc = "Synchronization channel",
 
-		/**
-		 * MS: do nothing, save power...
-		 * BTS: send dummy burst on C0
-		 */
-		NULL,			NULL,
+		/* 3GPP TS 05.03, section 4.7. Handled by transceiver,
+		 * however we still need to parse BSIC (BCC / NCC). */
+		.flags = TRX_CH_FLAG_AUTO,
+		.rx_fn = rx_sch_fn,
 	},
-	{
-		TRXC_FCCH,		"FCCH",
-		0x00,			TRX_CH_LID_DEDIC,
-		0x00,			0x00,
+	[TRXC_BCCH] = {
+		.name = "BCCH", /* 3GPP TS 05.02, section 3.3.2.3 */
+		.desc = "Broadcast control channel",
+		.chan_nr = RSL_CHAN_BCCH,
 
-		/* FCCH is handled by transceiver */
-		NULL,			NULL,
+		/* Rx only, xCCH convolutional coding (3GPP TS 05.03, section 4.4),
+		 * regular interleaving (3GPP TS 05.02, clause 7, table 3):
+		 * a L2 frame is interleaved over 4 consecutive bursts. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_AUTO,
+		.rx_fn = rx_data_fn,
 	},
-	{
-		TRXC_SCH, 		"SCH",
-		0x00,			TRX_CH_LID_DEDIC,
-		0x00,			TRX_CH_FLAG_AUTO,
+	[TRXC_RACH] = {
+		.name = "RACH", /* 3GPP TS 05.02, section 3.3.3.1 */
+		.desc = "Random access channel",
+		.chan_nr = RSL_CHAN_RACH,
 
-		/**
-		 * We already have clock indications from TRX,
-		 * but we also need BSIC (BCC / NCC) value.
-		 */
-		rx_sch_fn,		NULL,
+		/* Tx only, RACH convolutional coding (3GPP TS 05.03, section 4.6). */
+		.flags = TRX_CH_FLAG_AUTO,
+		.tx_fn = tx_rach_fn,
 	},
-	{
-		TRXC_BCCH,		"BCCH",
-		RSL_CHAN_BCCH,		TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_AUTO,
-		rx_data_fn,		NULL,
+	[TRXC_CCCH] = {
+		.name = "CCCH", /* 3GPP TS 05.02, section 3.3.3.1 */
+		.desc = "Common control channel",
+		.chan_nr = RSL_CHAN_PCH_AGCH,
+
+		/* Rx only, xCCH convolutional coding (3GPP TS 05.03, section 4.4),
+		 * regular interleaving (3GPP TS 05.02, clause 7, table 3):
+		 * a L2 frame is interleaved over 4 consecutive bursts. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_AUTO,
+		.rx_fn = rx_data_fn,
 	},
-	{
-		TRXC_RACH,		"RACH",
-		RSL_CHAN_RACH,		TRX_CH_LID_DEDIC,
-		0x00,			TRX_CH_FLAG_AUTO,
-		NULL,			tx_rach_fn,
+	[TRXC_TCHF] = {
+		.name = "TCH/F", /* 3GPP TS 05.02, section 3.2 */
+		.desc = "Full Rate traffic channel",
+		.chan_nr = RSL_CHAN_Bm_ACCHs,
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Rx and Tx, multiple convolutional coding types (3GPP TS 05.03,
+		 * chapter 3), block diagonal interleaving (3GPP TS 05.02, clause 7):
+		 *
+		 *   - a traffic frame is interleaved over 8 consecutive bursts
+		 *     using the even numbered bits of the first 4 bursts
+		 *     and odd numbered bits of the last 4 bursts;
+		 *   - a FACCH/F frame 'steals' (replaces) one traffic frame,
+		 *     interleaving is done in the same way.
+		 *
+		 * The MS shall continuously transmit bursts, even if there is nothing
+		 * to send, unless DTX (Discontinuous Transmission) is used. */
+		.burst_buf_size = 8 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_tchf_fn,
+		.tx_fn = tx_tchf_fn,
 	},
-	{
-		TRXC_CCCH,		"CCCH",
-		RSL_CHAN_PCH_AGCH,	TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_AUTO,
-		rx_data_fn,		NULL,
+	[TRXC_TCHH_0] = {
+		.name = "TCH/H(0)", /* 3GPP TS 05.02, section 3.2 */
+		.desc = "Half Rate traffic channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_Lm_ACCHs + (0 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Rx and Tx, multiple convolutional coding types (3GPP TS 05.03,
+		 * chapter 3), block diagonal interleaving (3GPP TS 05.02, clause 7):
+		 *
+		 *   - a traffic frame is interleaved over 6 consecutive bursts
+		 *     using the even numbered bits of the first 2 bursts,
+		 *     all bits of the middle two 2 bursts,
+		 *     and odd numbered bits of the last 2 bursts;
+		 *   - a FACCH/H frame 'steals' (replaces) two traffic frames,
+		 *     interleaving is done over 4 consecutive bursts,
+		 *     the same as given for a TCH/FS.
+		 *
+		 * The MS shall continuously transmit bursts, even if there is nothing
+		 * to send, unless DTX (Discontinuous Transmission) is used. */
+		.burst_buf_size = 6 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_tchh_fn,
+		.tx_fn = tx_tchh_fn,
 	},
-	{
-		TRXC_TCHF,		"TCH/F",
-		RSL_CHAN_Bm_ACCHs,		TRX_CH_LID_DEDIC,
-		8 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_tchf_fn,		tx_tchf_fn,
+	[TRXC_TCHH_1] = {
+		.name = "TCH/H(1)", /* 3GPP TS 05.02, section 3.2 */
+		.desc = "Half Rate traffic channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_Lm_ACCHs + (1 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_TCHH_0, see above. */
+		.burst_buf_size = 6 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_tchh_fn,
+		.tx_fn = tx_tchh_fn,
 	},
-	{
-		TRXC_TCHH_0,		"TCH/H(0)",
-		RSL_CHAN_Lm_ACCHs,		TRX_CH_LID_DEDIC,
-		6 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_tchh_fn,		tx_tchh_fn,
+	[TRXC_SDCCH4_0] = {
+		.name = "SDCCH/4(0)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (0 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_TCHH_1,		"TCH/H(1)",
-		0x18,			TRX_CH_LID_DEDIC,
-		6 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_tchh_fn,		tx_tchh_fn,
+	[TRXC_SDCCH4_1] = {
+		.name = "SDCCH/4(1)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (1 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH4_0,		"SDCCH/4(0)",
-		0x20,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH4_2] = {
+		.name = "SDCCH/4(2)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 2)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (2 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH4_1,		"SDCCH/4(1)",
-		0x28,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH4_3] = {
+		.name = "SDCCH/4(3)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 3)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (3 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH4_2,		"SDCCH/4(2)",
-		0x30,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_0] = {
+		.name = "SDCCH/8(0)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (0 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH4_3,		"SDCCH/4(3)",
-		0x38,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_1] = {
+		.name = "SDCCH/8(1)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (1 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_0,		"SDCCH/8(0)",
-		0x40,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_2] = {
+		.name = "SDCCH/8(2)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 2)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (2 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_1,		"SDCCH/8(1)",
-		0x48,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_3] = {
+		.name = "SDCCH/8(3)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 3)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (3 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_2,		"SDCCH/8(2)",
-		0x50,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_4] = {
+		.name = "SDCCH/8(4)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 4)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (4 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_3,		"SDCCH/8(3)",
-		0x58,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_5] = {
+		.name = "SDCCH/8(5)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 5)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (5 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_4,		"SDCCH/8(4)",
-		0x60,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_6] = {
+		.name = "SDCCH/8(6)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 6)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (6 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_5,		"SDCCH/8(5)",
-		0x68,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SDCCH8_7] = {
+		.name = "SDCCH/8(7)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Stand-alone dedicated control channel (sub-channel 7)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (7 << 3),
+		.link_id = TRX_CH_LID_DEDIC,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_6,		"SDCCH/8(6)",
-		0x70,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCHTF] = {
+		.name = "SACCH/TF", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow TCH/F associated control channel",
+		.chan_nr = RSL_CHAN_Bm_ACCHs,
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SDCCH8_7,		"SDCCH/8(7)",
-		0x78,			TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCHTH_0] = {
+		.name = "SACCH/TH(0)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow TCH/H associated control channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_Lm_ACCHs + (0 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCHTF,		"SACCH/TF",
-		0x08,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCHTH_1] = {
+		.name = "SACCH/TH(1)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow TCH/H associated control channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_Lm_ACCHs + (1 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCHTH_0,		"SACCH/TH(0)",
-		0x10,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH4_0] = {
+		.name = "SACCH/4(0)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/4 associated control channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (0 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCHTH_1,		"SACCH/TH(1)",
-		0x18,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH4_1] = {
+		.name = "SACCH/4(1)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/4 associated control channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (1 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH4_0,		"SACCH/4(0)",
-		0x20,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH4_2] = {
+		.name = "SACCH/4(2)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/4 associated control channel (sub-channel 2)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (2 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH4_1,		"SACCH/4(1)",
-		0x28,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH4_3] = {
+		.name = "SACCH/4(3)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/4 associated control channel (sub-channel 3)",
+		.chan_nr = RSL_CHAN_SDCCH4_ACCH + (3 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH4_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH4_2,		"SACCH/4(2)",
-		0x30,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_0] = {
+		.name = "SACCH/8(0)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 0)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (0 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH4_3,		"SACCH/4(3)",
-		0x38,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_1] = {
+		.name = "SACCH/8(1)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 1)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (1 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_0,		"SACCH/8(0)",
-		0x40,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_2] = {
+		.name = "SACCH/8(2)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 2)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (2 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_1,		"SACCH/8(1)",
-		0x48,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_3] = {
+		.name = "SACCH/8(3)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 3)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (3 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_2,		"SACCH/8(2)",
-		0x50,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_4] = {
+		.name = "SACCH/8(4)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 4)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (4 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_3,		"SACCH/8(3)",
-		0x58,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_5] = {
+		.name = "SACCH/8(5)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 5)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (5 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_4,		"SACCH/8(4)",
-		0x60,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_6] = {
+		.name = "SACCH/8(6)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 6)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (6 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_5,		"SACCH/8(5)",
-		0x68,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_SACCH8_7] = {
+		.name = "SACCH/8(7)", /* 3GPP TS 05.02, section 3.3.4.1 */
+		.desc = "Slow SDCCH/8 associated control channel (sub-channel 7)",
+		.chan_nr = RSL_CHAN_SDCCH8_ACCH + (7 << 3),
+		.link_id = TRX_CH_LID_SACCH,
+
+		/* Same as for TRXC_BCCH and TRXC_SDCCH8_* (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_CBTX,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
-	{
-		TRXC_SACCH8_6,		"SACCH/8(6)",
-		0x70,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_PDTCH] = {
+		.name = "PDTCH", /* 3GPP TS 05.02, sections 3.2.4, 3.3.2.4 */
+		.desc = "Packet data traffic & control channel",
+		.chan_nr = RSL_CHAN_OSMO_PDCH,
+
+		/* Rx and Tx, multiple coding schemes: CS-2..4 and MCS-1..9 (3GPP TS
+		 * 05.03, chapter 5), regular interleaving as specified for xCCH.
+		 * NOTE: the burst buffer is three times bigger because the
+		 * payload of EDGE bursts is three times longer. */
+		.burst_buf_size = 3 * 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_PDCH,
+		.rx_fn = rx_pdtch_fn,
+		.tx_fn = tx_pdtch_fn,
 	},
-	{
-		TRXC_SACCH8_7,		"SACCH/8(7)",
-		0x78,			TRX_CH_LID_SACCH,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_CBTX,
-		rx_data_fn,		tx_data_fn,
-	},
-	{
-		TRXC_PDTCH,		"PDTCH",
-		RSL_CHAN_OSMO_PDCH,	TRX_CH_LID_DEDIC,
-		12 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_PDCH,
-		rx_pdtch_fn,		tx_pdtch_fn,
-	},
-	{
-		TRXC_PTCCH,		"PTCCH",
-		RSL_CHAN_OSMO_PDCH,	TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_PDCH,
-		rx_data_fn,		tx_data_fn,
+	[TRXC_PTCCH] = {
+		.name = "PTCCH", /* 3GPP TS 05.02, section 3.3.4.2 */
+		.desc = "Packet Timing advance control channel",
+		.chan_nr = RSL_CHAN_OSMO_PDCH,
+
+		/* Same as for TRXC_BCCH (xCCH), see above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.flags = TRX_CH_FLAG_PDCH,
+		.rx_fn = rx_data_fn,
+		.tx_fn = tx_data_fn,
 	},
 	[TRXC_SDCCH4_CBCH] = {
-		TRXC_SDCCH4_CBCH,	"SDCCH/4(CBCH)",
-		RSL_CHAN_OSMO_CBCH4,		TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	TRX_CH_FLAG_AUTO,
-		rx_data_fn,		NULL,
+		.name = "SDCCH/4(CBCH)", /* 3GPP TS 05.02, section 3.3.5 */
+		.desc = "Cell Broadcast channel on SDCCH/4",
+		.chan_nr = RSL_CHAN_OSMO_CBCH4,
+
+		/* Same as for TRXC_BCCH (xCCH), but Rx only. See above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.rx_fn = rx_data_fn,
 	},
 	[TRXC_SDCCH8_CBCH] = {
-		TRXC_SDCCH8_CBCH,	"SDCCH/8(CBCH)",
-		RSL_CHAN_OSMO_CBCH8,	TRX_CH_LID_DEDIC,
-		4 * GSM_BURST_PL_LEN,	0x00,
-		rx_data_fn,		NULL,
+		.name = "SDCCH/8(CBCH)", /* 3GPP TS 05.02, section 3.3.5 */
+		.desc = "Cell Broadcast channel on SDCCH/8",
+		.chan_nr = RSL_CHAN_OSMO_CBCH8,
+
+		/* Same as for TRXC_BCCH (xCCH), but Rx only. See above. */
+		.burst_buf_size = 4 * GSM_BURST_PL_LEN,
+		.rx_fn = rx_data_fn,
 	},
 };
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 72d9549..fcb78a7 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -101,10 +101,11 @@
 	uint32_t fn, uint8_t bid);
 
 struct trx_lchan_desc {
-	/*! \brief TRX Channel Type */
-	enum trx_lchan_type chan;
 	/*! \brief Human-readable name */
 	const char *name;
+	/*! \brief Human-readable description */
+	const char *desc;
+
 	/*! \brief Channel Number (like in RSL) */
 	uint8_t chan_nr;
 	/*! \brief Link ID (like in RSL) */

-- 
To view, visit https://gerrit.osmocom.org/14218
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fc61e1cdca4690a34e2861b9ee3b7c64ea64843
Gerrit-Change-Number: 14218
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190528/428ce866/attachment.html>


More information about the gerrit-log mailing list