libosmogsm  1.3.1
Osmocom GSM library
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. More...
 

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_tablefn_remap_table_ptr [FN_REMAP_MAX]
 

Detailed Description

Paging helper code.

Macro Definition Documentation

#define FACCH_F_REPEAT_LENGTH   13

Referenced by __attribute__().

#define FACCH_H_REPEAT_LENGTH   26

Referenced by __attribute__().

#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;
if(vty->type==VTY_SHELL_SERV)

Referenced by __attribute__().

#define TCH_REPEAT_LENGTH   13

Referenced by __attribute__().

Function Documentation

unsigned int gsm0502_calc_paging_group ( struct gsm48_control_channel_descr chan_desc,
uint64_t  imsi 
)
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]fnframe number of the block ending.
[in]channelchannel 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::blockend, fn_remap_table::cycle, fn_remap_table::distance, DLGLOBAL, GSM_MAX_FN, fn_remap_table::len, LOGL_ERROR, LOGP, and OSMO_ASSERT.

Variable Documentation

struct fn_remap_table facch_f_remap_table
static

Referenced by __attribute__().

struct fn_remap_table facch_h0_remap_table
static

Referenced by __attribute__().

struct fn_remap_table facch_h1_remap_table
static

Referenced by __attribute__().

struct fn_remap_table* fn_remap_table_ptr[FN_REMAP_MAX]
static
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__().

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__().

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__().

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__().

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__().

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__().

struct fn_remap_table tch_f_remap_table
static

Referenced by __attribute__().

struct fn_remap_table tch_h0_remap_table
static

Referenced by __attribute__().

struct fn_remap_table tch_h1_remap_table
static

Referenced by __attribute__().