Loading...
Searching...
No Matches
gsm0502.c File Reference

Paging helper code. More...

`#include <stdint.h>`
`#include <osmocom/gsm/protocol/gsm_04_08.h>`
`#include <osmocom/gsm/gsm0502.h>`
`#include <osmocom/gsm/gsm48.h>`
`#include <osmocom/gsm/rsl.h>`
`#include <osmocom/gsm/gsm_utils.h>`
`#include <osmocom/core/logging.h>`
`#include <inttypes.h>`

## Data Structures

struct | fn_remap_table

## Macros

#define | TCH_REPEAT_LENGTH 13
#define | FACCH_F_REPEAT_LENGTH 13
#define | FACCH_H_REPEAT_LENGTH 26
#define | fn_remap_table_from_traffic_block_map(table, map, rows, cols, repeat)

## Functions

unsigned int | gsm0502_calc_paging_group (struct gsm48_control_channel_descr *chan_desc, uint64_t imsi)
static | __attribute__ ((constructor))
uint32_t | gsm0502_fn_remap (uint32_t fn, enum gsm0502_fn_remap_channel channel)
| Calculate the frame number of the beginning of a block.
uint16_t | gsm0502_hop_seq_gen (const struct gsm_time *t, uint8_t hsn, uint8_t maio, size_t n, const uint16_t *ma)
| Hopping sequence generation as per 3GPP TS 45.002, section 6.2.3.

## Variables

static const uint8_t | gsm0502_tch_f_traffic_block_map [3][8]
static const uint8_t | gsm0502_tch_h0_traffic_block_map [3][4]
static const uint8_t | gsm0502_tch_h1_traffic_block_map [3][4]
static const uint8_t | gsm0502_tch_f_facch_block_map [3][8]
static const uint8_t | gsm0502_tch_h0_facch_block_map [3][6]
static const uint8_t | gsm0502_tch_h1_facch_block_map [3][6]
static struct fn_remap_table | tch_f_remap_table
static struct fn_remap_table | tch_h0_remap_table
static struct fn_remap_table | tch_h1_remap_table
static struct fn_remap_table | facch_f_remap_table
static struct fn_remap_table | facch_h0_remap_table
static struct fn_remap_table | facch_h1_remap_table
static struct fn_remap_table * | fn_remap_table_ptr [FN_REMAP_MAX]
static const uint8_t | rn_table [114]

## Detailed Description

Paging helper code.

## Macro Definition Documentation

## FACCH_F_REPEAT_LENGTH

#define FACCH_F_REPEAT_LENGTH 13

## FACCH_H_REPEAT_LENGTH

#define FACCH_H_REPEAT_LENGTH 26

## fn_remap_table_from_traffic_block_map

#define fn_remap_table_from_traffic_block_map | ( |  | table,
|  |  | map,
|  |  | rows,
|  |  | cols,
|  |  | repeat
| ) |  |

Value:
for(i=0;i<rows;i++) { \
table.blockend[i] = map[i][cols-1]; \
if(map[i][0] <= map[i][cols-1]) \
table.distance[i] = map[i][cols-1] - map[i][0]; \
else \
table.distance[i] = repeat - map[i][0] + map[i][cols-1]; \
} \
table.cycle = repeat; \
table.len = rows;
len
uint8_t len
Definition gsm_04_11.h:0

## TCH_REPEAT_LENGTH

#define TCH_REPEAT_LENGTH 13

## Function Documentation

## __attribute__()

static __attribute__ | ( | (constructor) |  | ) |

static

References __attribute__, facch_f_remap_table, FACCH_F_REPEAT_LENGTH, facch_h0_remap_table, facch_h1_remap_table, FACCH_H_REPEAT_LENGTH, FN_REMAP_FACCH_F, FN_REMAP_FACCH_H0, FN_REMAP_FACCH_H1, fn_remap_table_from_traffic_block_map, fn_remap_table_ptr, FN_REMAP_TCH_F, FN_REMAP_TCH_H0, FN_REMAP_TCH_H1, gsm0502_tch_f_facch_block_map, gsm0502_tch_f_traffic_block_map, gsm0502_tch_h0_facch_block_map, gsm0502_tch_h0_traffic_block_map, gsm0502_tch_h1_facch_block_map, gsm0502_tch_h1_traffic_block_map, len, tch_f_remap_table, tch_h0_remap_table, tch_h1_remap_table, and TCH_REPEAT_LENGTH.

## gsm0502_calc_paging_group()

unsigned int gsm0502_calc_paging_group | ( | struct gsm48_control_channel_descr * | chan_desc,
|  | uint64_t | imsi
| ) |  |

References chan_desc, gsm0502_get_paging_group(), gsm48_number_of_paging_subchannels(), len, and rsl_ccch_conf_to_bs_cc_chans().

## gsm0502_fn_remap()

uint32_t gsm0502_fn_remap | ( | uint32_t | fn,
|  | enum gsm0502_fn_remap_channel | channel
| ) |  |

Calculate the frame number of the beginning of a block.

Parameters

  [in] | fn | frame number of the block ending.
  [in] | channel | channel type (see also enum fn_remap_channel).

Returns
  frame number of the beginning of the block or input frame number if remapping was not possible.

References ARRAY_SIZE, fn_remap_table::cycle, DLGLOBAL, fn_remap_table_ptr, GSM_MAX_FN, len, LOGL_ERROR, LOGP, and OSMO_ASSERT.

## gsm0502_hop_seq_gen()

uint16_t gsm0502_hop_seq_gen | ( | const struct gsm_time * | t,
|  | uint8_t | hsn,
|  | uint8_t | maio,
|  | size_t | n,
|  | const uint16_t * | ma
| ) |  |

Hopping sequence generation as per 3GPP TS 45.002, section 6.2.3.

Parameters

  [in] | t | GSM time (TDMA frame number, T1/T2/T3).
  [in] | hsn | Hopping Sequence Number.
  [in] | maio | Mobile Allocation Index Offset.
  [in] | n | number of entries in mobile allocation (arfcn table).
  [in] | ma | array of ARFCNs (sorted in ascending order) representing the Mobile Allocation.

Returns
  ARFCN to use for given input parameters at time 't' or Mobile Allocation Index if ma == NULL.

References len, n, and rn_table.

## Variable Documentation

## facch_f_remap_table

struct fn_remap_table facch_f_remap_table

static

Referenced by __attribute__().

## facch_h0_remap_table

struct fn_remap_table facch_h0_remap_table

static

Referenced by __attribute__().

## facch_h1_remap_table

struct fn_remap_table facch_h1_remap_table

static

Referenced by __attribute__().

## fn_remap_table_ptr

struct fn_remap_table* fn_remap_table_ptr[FN_REMAP_MAX]

static

Referenced by __attribute__(), and gsm0502_fn_remap().

## gsm0502_tch_f_facch_block_map

const uint8_t gsm0502_tch_f_facch_block_map[3][8]

static

Initial value:
= {
{0, 1, 2, 3, 4, 5, 6, 7},
{4, 5, 6, 7, 8, 9, 10, 11},
{8, 9, 10, 11, 0, 1, 2, 3}
}

Referenced by __attribute__().

## gsm0502_tch_f_traffic_block_map

const uint8_t gsm0502_tch_f_traffic_block_map[3][8]

static

Initial value:
= {
{0, 1, 2, 3, 4, 5, 6, 7},
{4, 5, 6, 7, 8, 9, 10, 11},
{8, 9, 10, 11, 0, 1, 2, 3}
}

Referenced by __attribute__().

## gsm0502_tch_h0_facch_block_map

const uint8_t gsm0502_tch_h0_facch_block_map[3][6]

static

Initial value:
= {
{0, 2, 4, 6, 8, 10},
{8, 10, 13, 15, 17, 19},
{17, 19, 21, 23, 0, 2}
}

Referenced by __attribute__().

## gsm0502_tch_h0_traffic_block_map

const uint8_t gsm0502_tch_h0_traffic_block_map[3][4]

static

Initial value:
= {
{0, 2, 4, 6},
{4, 6, 8, 10},
{8, 10, 0, 2}
}

Referenced by __attribute__().

## gsm0502_tch_h1_facch_block_map

const uint8_t gsm0502_tch_h1_facch_block_map[3][6]

static

Initial value:
= {
{1, 3, 5, 7, 9, 11},
{9, 11, 14, 16, 18, 20},
{18, 20, 22, 24, 1, 3}
}

Referenced by __attribute__().

## gsm0502_tch_h1_traffic_block_map

const uint8_t gsm0502_tch_h1_traffic_block_map[3][4]

static

Initial value:
= {
{1, 3, 5, 7},
{5, 7, 9, 11},
{9, 11, 1, 3}
}

Referenced by __attribute__().

## rn_table

const uint8_t rn_table[114]

static

Initial value:
= {
48, 98, 63, 1, 36, 95, 78, 102, 94, 73,
0, 64, 25, 81, 76, 59, 124, 23, 104, 100,
101, 47, 118, 85, 18, 56, 96, 86, 54, 2,
80, 34, 127, 13, 6, 89, 57, 103, 12, 74,
55, 111, 75, 38, 109, 71, 112, 29, 11, 88,
87, 19, 3, 68, 110, 26, 33, 31, 8, 45,
82, 58, 40, 107, 32, 5, 106, 92, 62, 67,
77, 108, 122, 37, 60, 66, 121, 42, 51, 126,
117, 114, 4, 90, 43, 52, 53, 113, 120, 72,
16, 49, 7, 79, 119, 61, 22, 84, 9, 97,
91, 15, 21, 24, 46, 39, 93, 105, 65, 70,
125, 99, 17, 123,
}

Referenced by gsm0502_hop_seq_gen().

## tch_f_remap_table

struct fn_remap_table tch_f_remap_table

static

Referenced by __attribute__().

## tch_h0_remap_table

struct fn_remap_table tch_h0_remap_table

static

Referenced by __attribute__().

## tch_h1_remap_table

struct fn_remap_table tch_h1_remap_table

static

Referenced by __attribute__().