Merge branch 'master' into failing_ut_fix

This commit is contained in:
mdlewisfb
2018-11-07 08:22:40 -08:00
347 changed files with 3984 additions and 79981 deletions

9
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,9 @@
## Summary
Description of the changes present in this pull request.
## Test Plan
What was done to test these changes.
## Issues
Any issues associated with this PR. Use GitHub keywords (i.e. "closes", "resolves", "fixes") with the issue number to automatically close
the issue when this PR is merged.

5
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,5 @@
# Code of Conduct
Telecom Infra Project has adopted a Code of Conduct that we expect project participants to adhere to.
Please read the [full text](https://code.fb.com/codeofconduct/)
so that you can understand what actions will and will not be tolerated.

24
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,24 @@
# Contributing to OpenCellular
We want to make contributing to this project as easy and transparent as
possible.
## Pull Requests
We actively welcome your pull requests.
1. Fork the repo and create your branch from `master`.
2. Make sure all commits are signed and verified.
3. If you've added code that should be tested, add tests.
4. If you've changed APIs, update the documentation.
5. Ensure the test suite passes.
6. Make sure your code lints.
## Issues
We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.
## Coding Style
See wiki
## License
By contributing to OpenCellular, you agree that your contributions will be licensed
under the LICENSE file in the root directory of this source tree.

View File

@@ -29,10 +29,10 @@ OpenCellular@fb.com
## Join the OpenCellular community
* Website: oc.telecominfraproject.com
* github: https://github.com/Telecominfraproject/OpenCellular
* Project group: http://telecominfraproject.com/project/access-projects/opencellular-wireless-access-platform-design/
* Mailing list:
* Website: https://oc.telecominfraproject.com
* GitHub: https://github.com/Telecominfraproject/OpenCellular
* Project group: https://telecominfraproject.com/opencellular-wireless-access-platform-design/
* Forum: https://ocforum.telecominfraproject.com/
## License

View File

@@ -574,10 +574,11 @@ m3Hwi1Params.instance.name = "m3Hwi1";
Program.global.m3Hwi1 = m3Hwi.create(60, "&uDMAIntHandler", m3Hwi1Params);
*/
var m3Hwi2Params = new m3Hwi.Params();
/*Below configuration has some conflict with SPI DMA, doesn't work with it */
/*var m3Hwi2Params = new m3Hwi.Params();
m3Hwi2Params.instance.name = "m3Hwi2";
m3Hwi2Params.enableInt = false;
Program.global.m3Hwi2 = m3Hwi.create(61, "&uDMAErrorHandler", m3Hwi2Params);
Program.global.m3Hwi2 = m3Hwi.create(61, "&uDMAErrorHandler", m3Hwi2Params);*/
/* ================ Application Specific Instances ================ */
/* ================ NDK configuration ================ */

View File

@@ -204,6 +204,16 @@ typedef enum OC_CONNECT1_I2CName {
OC_CONNECT1_I2CCOUNT
} OC_CONNECT1_I2CName;
/*!
* @def DK_TM4C129X_SPIName
* @brief Enum of SPI names on the DK_TM4C129X dev board
*/
typedef enum DK_TM4C129X_SPIName {
OC_CONNECT1_SPI0 = 0,
OC_CONNECT1_SPICOUNT
} OC_CONNECT1_SPIName;
/*!
* @def OC_CONNECT1_debugMdioName
* @brief Enum of debug MDIO names for Ethernet components

View File

@@ -0,0 +1,19 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_
#define COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_
#define FRAME_SIZE 64
#define LAST_MSG_FLAG 0
#define NEXT_MSG_FLAG_POS 17
#define NEXT_MSG_FLAG 1
#define PAYLOAD_SIZE 47
#endif /* COMMON_INC_OCMP_WRAPPERS_OCMP_FLASH_H_ */

View File

@@ -13,6 +13,7 @@
SCHEMA_IMPORT bool SYS_post_get_results(void **getpostResult);
SCHEMA_IMPORT bool SYS_post_enable(void **postActivate);
SCHEMA_IMPORT const Driver_fxnTable AT45DB641E_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_sid_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_inv_fxnTable;
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_sdr_inv_fxnTable;
@@ -75,4 +76,9 @@ static const Driver SYSTEMDRV = {
}
};
static const Driver FLASHDRV = {
.name = "FLASHDRV",
.fxnTable = &AT45DB641E_fxnTable,
};
#endif /* INC_DEVICES_OCMP_EEPROM_H_ */

View File

@@ -0,0 +1,50 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#ifndef INC_COMMON_SPIBUS_H_
#define INC_COMMON_SPIBUS_H_
/*****************************************************************************
* HEADER FILES
*****************************************************************************/
#include "drivers/OcGpio.h"
#include "inc/common/global_header.h"
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/gates/GateMutex.h>
typedef struct SPI_Dev {
unsigned int bus;
OcGpio_Pin *chip_select;
} SPI_Dev;
/*****************************************************************************
* FUNCTION DECLARATIONS
*****************************************************************************/
SPI_Handle spi_get_handle(unsigned int index);
ReturnStatus spi_reg_read(SPI_Handle spiHandle,
OcGpio_Pin *chip_select,
void *regAddress,
uint8_t *data,
uint32_t data_size,
uint32_t byte,
uint8_t numofBytes);
ReturnStatus spi_reg_write(SPI_Handle spiHandle,
OcGpio_Pin *chip_select,
void *regAddress,
uint8_t *data,
uint32_t data_size,
uint32_t byte,
uint8_t numofBytes);
#endif /* INC_COMMON_SPIBUS_H_ */

View File

@@ -0,0 +1,52 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#ifndef INC_DEVICES_AT45DB_H_
#define INC_DEVICES_AT45DB_H_
#include "common/inc/global/post_frame.h"
#include "drivers/OcGpio.h"
#include "inc/common/spibus.h"
#include "inc/common/global_header.h"
/*****************************************************************************
* STRUCT/ENUM DEFINITIONS
*****************************************************************************/
typedef enum AT45DB_Event {
AT45DB_READ_EVENT = 0,
} AT45DB_Event;
typedef void (*AT45DB_CallbackFn) (AT45DB_Event evt, uint16_t value,
void *context);
typedef struct AT45DB_Cfg {
SPI_Dev dev;
OcGpio_Pin *pin_alert;
} AT45DB_Cfg;
typedef struct AT45DB_Obj {
AT45DB_CallbackFn alert_cb;
void *cb_context;
AT45DB_Event evt_to_monitor;
} AT45DB_Obj;
typedef struct AT45DB_Dev {
const AT45DB_Cfg cfg;
AT45DB_Obj obj;
} AT45DB_Dev;
ePostCode at45db_probe(AT45DB_Dev *dev, POSTData *postData);
ReturnStatus at45db_data_read(AT45DB_Dev *dev, uint8_t *data, uint32_t data_size, uint32_t byte, uint32_t page);
ReturnStatus at45db_data_write(AT45DB_Dev *dev, uint8_t *data, uint32_t data_size, uint32_t byte, uint32_t page);
ReturnStatus at45db_erasePage(AT45DB_Dev *dev, uint32_t page);
uint8_t at45db_readStatusRegister(AT45DB_Dev *dev);
#endif /* INC_DEVICES_AT45DB_H_ */

View File

@@ -278,6 +278,8 @@ extern GPIO_PinConfig gpioPinConfigs[];
GPIO_PinConfig gpioPinConfigs[OC_EC_GPIOCOUNT] = {
[OC_EC_SOC_UART3_TX] =
GPIOTiva_PA_5 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_BOTH_EDGES,
[OC_EC_FLASH_nCS] =
GPIOTiva_PB_4 | GPIO_CFG_OUT_STD | GPIO_CFG_OUT_STR_HIGH | GPIO_CFG_OUT_HIGH,
[OC_EC_SDR_INA_ALERT] =
GPIOTiva_PD_2 | GPIO_CFG_IN_NOPULL | GPIO_CFG_IN_INT_FALLING,
[OC_EC_PWR_PSE_RESET] =
@@ -686,6 +688,70 @@ void OC_CONNECT1_initI2C(void)
I2C_init();
}
/*
* =============================== SPI ===============================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiTivaDMAHWAttrs, ".const:spiTivaDMAHWAttrs")
#endif
#include <ti/drivers/SPI.h>
#include <ti/drivers/spi/SPITivaDMA.h>
SPITivaDMA_Object spiTivaDMAObjects[OC_CONNECT1_SPICOUNT];
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_ALIGN(spiTivaDMAscratchBuf, 32)
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=32
#elif defined(__GNUC__)
__attribute__ ((aligned (32)))
#endif
uint32_t spiTivaDMAscratchBuf[OC_CONNECT1_SPICOUNT];
const SPITivaDMA_HWAttrs spiTivaDMAHWAttrs[OC_CONNECT1_SPICOUNT] = {
{
.baseAddr = SSI1_BASE,
.intNum = INT_SSI1,
.intPriority = (~0),
.scratchBufPtr = &spiTivaDMAscratchBuf[0],
.defaultTxBufValue = 0,
.rxChannelIndex = UDMA_CHANNEL_SSI1RX,
.txChannelIndex = UDMA_CHANNEL_SSI1TX,
.channelMappingFxn = uDMAChannelAssign,
.rxChannelMappingFxnArg = UDMA_CH24_SSI1RX,
.txChannelMappingFxnArg = UDMA_CH25_SSI1TX
},
};
const SPI_Config SPI_config[] = {
[OC_CONNECT1_SPI0] = {
.fxnTablePtr = &SPITivaDMA_fxnTable,
.object = &spiTivaDMAObjects[OC_CONNECT1_SPI0],
.hwAttrs = &spiTivaDMAHWAttrs[OC_CONNECT1_SPI0]
},
{NULL, NULL, NULL},
};
/*
* ======== OC_CONNECT1_initSPI ========
*/
void OC_CONNECT1_initSPI(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI1);
GPIOPinConfigure(GPIO_PB5_SSI1CLK);
GPIOPinConfigure(GPIO_PB4_SSI1FSS);
GPIOPinConfigure(GPIO_PE4_SSI1XDAT0);
GPIOPinConfigure(GPIO_PE5_SSI1XDAT1);
GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_5);
GPIOPinTypeSSI(GPIO_PORTE_BASE, GPIO_PIN_4 | GPIO_PIN_5);
OC_CONNECT1_initDMA();
SPI_init();
}
/*
* =============================== UART ===============================
*/
@@ -965,4 +1031,4 @@ void OC_CONNECT1_initWatchdog(void)
SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
Watchdog_init();
}
}

View File

@@ -25,6 +25,8 @@
#include "inc/subsystem/power/power.h"
#include "inc/devices/eth_sw.h"
#include "inc/devices/eeprom.h"
#include "inc/common/spibus.h"
#include "inc/devices/at45db.h"
#include <stdint.h>
#include <stdbool.h>
@@ -63,6 +65,17 @@ Eeprom_Cfg eeprom_gbc_inv = {
/*****************************************************************************
* SYSTEM CONFIG
*****************************************************************************/
/* SPI AT45DB Flash Config */
AT45DB_Dev gbc_spi_flash_memory = {
.cfg = {
.dev = {
.bus = OC_CONNECT1_SPI0,
.chip_select = &(OcGpio_Pin){ &ec_io, OC_EC_FLASH_nCS },
},
.pin_alert = NULL,
},
.obj = {},
};
/* Power SubSystem Config */
//Lead Acid Temperature sensor.
SE98A_Dev gbc_pwr_lead_acid_ts = {
@@ -565,4 +578,4 @@ const INA226_Config fact_ap_3v_ps_cfg = {
const INA226_Config fact_msata_3v_ps_cfg = {
.current_lim = 1500,
};
};

View File

@@ -38,6 +38,7 @@ SCHEMA_IMPORT DriverStruct eeprom_gbc_sid;
SCHEMA_IMPORT DriverStruct eeprom_gbc_inv;
SCHEMA_IMPORT DriverStruct eeprom_sdr_inv;
SCHEMA_IMPORT DriverStruct eeprom_fe_inv;
SCHEMA_IMPORT DriverStruct gbc_spi_flash_memory;
/* Power SubSystem Configs */
SCHEMA_IMPORT DriverStruct gbc_pwr_lead_acid_ts;
SCHEMA_IMPORT DriverStruct gbc_pwr_ext_bat_charger;
@@ -214,6 +215,7 @@ SCHEMA_IMPORT bool SYNC_Init(void *driver, void *returnValue);
SCHEMA_IMPORT bool SYNC_reset(void *driver, void *params);
SCHEMA_IMPORT bool SYS_cmdReset(void *driver, void *params);
SCHEMA_IMPORT bool SYS_cmdEcho(void *driver, void *params);
SCHEMA_IMPORT bool sys_post_init(void* driver, void *returnValue);
SCHEMA_IMPORT bool TestMod_cmdEnable(void *driver, void *params);
SCHEMA_IMPORT bool TestMod_cmdDisable(void *driver, void *params);
SCHEMA_IMPORT bool TestMod_cmdDisconnect(void *driver, void *params);
@@ -250,6 +252,11 @@ const Component sys_schema[] = {
.name = "eeprom_mac",
.driver = &Driver_MAC,
},
{
.name = "SPI_flash",
.driver = &FLASHDRV,
.driver_cfg = &gbc_spi_flash_memory,
},
{}
},
.commands = (Command[]){
@@ -266,6 +273,10 @@ const Component sys_schema[] = {
},
{}
},
.driver_cfg = &gbc_spi_flash_memory,
.ssHookSet = &(SSHookSet) {
.postInitFxn = (ssHook_Cb)sys_post_init,
},
},
{
.name = "power",

View File

@@ -48,6 +48,7 @@ extern "C" {
#define Board_initGeneral OC_CONNECT1_initGeneral
#define Board_initGPIO OC_CONNECT1_initGPIO
#define Board_initI2C OC_CONNECT1_initI2C
#define Board_initSPI OC_CONNECT1_initSPI
#define Board_initUART OC_CONNECT1_initUART
#define Board_initUSB OC_CONNECT1_initUSB
#define Board_initWatchdog OC_CONNECT1_initWatchdog

View File

@@ -0,0 +1,283 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* This file is used as Device layer for AT45DB641E. Mainly it contains Data read,
* Data write, Page erase, Status check functions, these functions are called by
* littlefs filesystyem in order to perform read/write operation for data using SPI
* interface. Also while post execution device and manufacturing id's of AT45DB641E
* will be verified by probe function.
*/
#include "inc/devices/at45db.h"
#include "inc/common/spibus.h"
#include "inc/common/global_header.h"
#include "inc/global/OC_CONNECT1.h"
#define AT45DB_DATA_WR_OPCODE_WR_COUNT 4
#define AT45DB_DATA_RD_OPCODE_WR_COUNT 8
#define AT45DB_DEVICE_ID 0x0028
#define AT45DB_DEVID_RD_BYTES 2
#define AT45DB_DEVID_RD_OPCODE 0x9F
#define AT45DB_DEVID_OPCODE_WR_COUNT 1
#define AT45DB_ERASE_OPCODE_WR_COUNT 4
#define AT45DB_MANFACTURE_ID 0x1F
#define AT45DB_PAGE_ERASE_OPCODE 0x81
#define AT45DB_PAGE_RD_OPCODE 0xD2
#define AT45DB_PAGE_WR_OPCODE 0x86
#define AT45DB_READY 0x80 /* AT45DB Ready Value */
#define AT45DB_SRAM_BUFF2_WR_OPCODE 0x87
#define AT45DB_STATUS_OPCODE 0xD7
#define AT45DB_STATUS_OPCODE_WR_COUNT 1
#define AT45DB_STATUS_RD_BYTES 1
#define waitForReady(dev) \
while (!(AT45DB_READY & at45db_readStatusRegister(dev)));
/*****************************************************************************
** FUNCTION NAME : AT45DB_read_reg
**
** DESCRIPTION : Reads 8 bit values from at45db page or register.
**
** ARGUMENTS : spi device configuration, cmd buffer, register value,
** page offset, numOfBytes to be read, cmd write count.
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
static ReturnStatus AT45DB_read_reg(AT45DB_Dev *dev,
void *cmdbuffer, /* cmd or opcode buffer */
uint8_t *regValue,
uint32_t pageOffset,
uint32_t NumOfbytes,
uint8_t writeCount)
{
ReturnStatus status = RETURN_NOTOK;
SPI_Handle at45dbHandle = spi_get_handle(dev->cfg.dev.bus);
if (!at45dbHandle) {
LOGGER_ERROR("AT45DBFLASHMEMORY:ERROR:: Failed to get SPI Bus for at45db flash memory "
"0x%x on bus 0x%x.\n", dev->cfg.dev.chip_select,
dev->cfg.dev.bus);
} else {
status = spi_reg_read(at45dbHandle,
dev->cfg.dev.chip_select,
cmdbuffer,
regValue,
NumOfbytes,
pageOffset,
writeCount);
}
return status;
}
/*****************************************************************************
** FUNCTION NAME : AT45DB_write_reg
**
** DESCRIPTION : Write 8 bit value to at45db page or register.
**
** ARGUMENTS : spi device configuration, cmd buffer, register value,
** page offset, numOfBytes to be written, cmd write count.
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
static ReturnStatus AT45DB_write_reg(AT45DB_Dev *dev,
void *cmdbuffer, /* cmd or opcode buffer */
uint8_t *regValue,
uint32_t pageOffset,
uint32_t NumOfbytes,
uint8_t writeCount)
{
ReturnStatus status = RETURN_NOTOK;
SPI_Handle at45dbHandle = spi_get_handle(dev->cfg.dev.bus);
if (!at45dbHandle) {
LOGGER_ERROR("AT45DBFLASHMEMORY:ERROR:: Failed to get SPI Bus for at45db flash memory "
"0x%x on bus 0x%x.\n", dev->cfg.dev.chip_select,
dev->cfg.dev.bus);
} else {
status = spi_reg_write(at45dbHandle,
dev->cfg.dev.chip_select,
cmdbuffer,
regValue,
NumOfbytes,
pageOffset,
writeCount);
}
return status;
}
/*****************************************************************************
** FUNCTION NAME : at45db_readStatusRegister
**
** DESCRIPTION : Reads status of at45db device whether it is ready for
**
** r/w operation
**
** ARGUMENTS : spi device configuration
**
** RETURN TYPE : 8-bit status code
**
*****************************************************************************/
uint8_t at45db_readStatusRegister(AT45DB_Dev *dev)
{
uint8_t txBuffer = AT45DB_STATUS_OPCODE; /* opcode for ready status of AT45DB */;
uint8_t status;
AT45DB_read_reg(dev, &txBuffer, &status, NULL, AT45DB_STATUS_RD_BYTES, AT45DB_STATUS_OPCODE_WR_COUNT);
return (status);
}
/*****************************************************************************
** FUNCTION NAME : at45db_erasePage
**
** DESCRIPTION : Erases at45db memory page before writing data to it
**
** ARGUMENTS : spi device configuration, page number to be erased
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
ReturnStatus at45db_erasePage(AT45DB_Dev *dev, uint32_t page)
{
ReturnStatus status = RETURN_NOTOK;
uint8_t txBuffer[4];
waitForReady(dev);
txBuffer[0] = AT45DB_PAGE_ERASE_OPCODE; /* opcode to erase main memory page */
txBuffer[1] = (uint8_t)(page >> 7); /* Page size is 15 bits 8 in tx1 and 7 in tx2 */
txBuffer[2] = (uint8_t)(page << 1);
txBuffer[3] = 0x00;
status = AT45DB_write_reg(dev, txBuffer, NULL, NULL, NULL, AT45DB_ERASE_OPCODE_WR_COUNT);
return status;
}
/*****************************************************************************
** FUNCTION NAME : at45db_data_read
**
** DESCRIPTION : Reads data from at45db memory page
**
** ARGUMENTS : spi device configuration, data pointer, data size,
**
** page offset, page number
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
ReturnStatus at45db_data_read(AT45DB_Dev *dev, uint8_t *data, uint32_t data_size, uint32_t byte, uint32_t page)
{
ReturnStatus status = RETURN_NOTOK;
uint8_t txBuffer[8]; /* last 4 bytes are needed, but have don't care values */
waitForReady(dev);
txBuffer[0] = AT45DB_PAGE_RD_OPCODE; /* opcode to read main memory page */
txBuffer[1] = (uint8_t)(page >> 7); /* Page size is 15 bits 8 in tx1 and 7 in tx2 */
txBuffer[2] = (uint8_t)((page << 1));
txBuffer[3] = (uint8_t)(0xFF & byte);
status = AT45DB_read_reg(dev, &txBuffer, data, byte, data_size, AT45DB_DATA_RD_OPCODE_WR_COUNT);
return status;
}
/*****************************************************************************
** FUNCTION NAME : at45db_data_write
**
** DESCRIPTION : Writes data to at45db memory page
**
** ARGUMENTS : spi device configuration, data pointer, data size,
**
** page offset, page number
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
ReturnStatus at45db_data_write(AT45DB_Dev *dev, uint8_t *data, uint32_t data_size, uint32_t byte, uint32_t page)
{
ReturnStatus status = RETURN_NOTOK;
uint8_t txBuffer[4];
waitForReady(dev);
txBuffer[0] = AT45DB_SRAM_BUFF2_WR_OPCODE; /* opcode to write data to AT45DB SRAM Buffer2 */
txBuffer[1] = 0x00;
txBuffer[2] = (uint8_t)(0x1 & (byte >> 8)); /* 9 bit buffer address */
txBuffer[3] = (uint8_t)(0xFF & byte);
status = AT45DB_write_reg(dev, &txBuffer, data, byte, data_size, AT45DB_DATA_WR_OPCODE_WR_COUNT);
if(status == RETURN_OK) {
waitForReady(dev);
txBuffer[0] = AT45DB_PAGE_WR_OPCODE; /* opcode to Push the data from AT45DB SRAM Buffer2 to the page */
txBuffer[1] = (uint8_t)(page >> 7); /* Page size is 15 bits 8 in tx1 and 7 in tx2 */
txBuffer[2] = (uint8_t)(page << 1);
txBuffer[3] = 0x00;
status = AT45DB_write_reg(dev, &txBuffer, data, byte, data_size, AT45DB_DATA_WR_OPCODE_WR_COUNT);
}
return status;
}
/*****************************************************************************
** FUNCTION NAME : at45db_getDevID
**
** DESCRIPTION : Reads Device id and manufacturing id of at45db device
**
** ARGUMENTS : spi device configuration, data pointer
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
static ReturnStatus at45db_getDevID(AT45DB_Dev *dev, uint32_t *devID)
{
uint8_t txBuffer = AT45DB_DEVID_RD_OPCODE; /* opcode to get device id */
return AT45DB_read_reg(dev, &txBuffer, devID, NULL, AT45DB_DEVID_RD_BYTES, AT45DB_DEVID_OPCODE_WR_COUNT);
}
/*****************************************************************************
** FUNCTION NAME : at45db_probe
**
** DESCRIPTION : Compares device and manufacturing id's for post
**
** ARGUMENTS : spi device configuration, post data pointer
**
** RETURN TYPE : ePostCode type status, can be found in post_frame.h
**
*****************************************************************************/
ePostCode at45db_probe(AT45DB_Dev *dev, POSTData *postData)
{
uint32_t value = 0;
uint16_t devId = 0;
uint8_t manfId = 0;
if (at45db_getDevID(dev, &value) != RETURN_OK) {
return POST_DEV_MISSING;
}
devId = (value >> 8) & 0xFFFF;
if (devId != AT45DB_DEVICE_ID) {
return POST_DEV_ID_MISMATCH;
}
manfId = value & 0xFF;
if (manfId != AT45DB_MANFACTURE_ID) {
return POST_DEV_ID_MISMATCH;
}
post_update_POSTData(postData, dev->cfg.dev.bus, NULL,manfId, devId);
return POST_DEV_FOUND;
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* This is wrapper file for at45db device contains wrapper functions like probe
* and function table of it. probe function calls device layer functions to
* complete post execution
*/
#include "common/inc/global/Framework.h"
#include "common/inc/ocmp_wrappers/ocmp_at45db.h"
#include "inc/devices/at45db.h"
/*****************************************************************************
** FUNCTION NAME : _probe
**
** DESCRIPTION : Wrapper function for post execution
**
** ARGUMENTS : spi device configuration, post data pointer
**
** RETURN TYPE : ePostCode type status, can be found in post_frame.h
**
*****************************************************************************/
static ePostCode _probe(void *driver, POSTData *postData)
{
return at45db_probe(driver,postData);
}
const Driver_fxnTable AT45DB641E_fxnTable = {
/* Message handlers */
.cb_probe = _probe,
};

View File

@@ -0,0 +1,167 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* This file contains SPI driver's API within spi_get_handle, spi_reg_read and
* spi_reg_write which ccan be called by device layer to communicate any SPI device.
*/
//*****************************************************************************
// HANDLES DEFINITION
//*****************************************************************************
#include "Board.h"
#include "drivers/OcGpio.h"
#include "inc/common/spibus.h"
#include "inc/global/OC_CONNECT1.h"
#include <ti/drivers/GPIO.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/gates/GateMutex.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Memory.h>
#define PIN_LOW (0)
#define PIN_HIGH ~(0)
/*****************************************************************************
** FUNCTION NAME : spi_get_handle
**
** DESCRIPTION : Initialize SPI Bus
**
** ARGUMENTS : SPI bus index
**
** RETURN TYPE : SPI_Handle (NULL on failure)
**
*****************************************************************************/
SPI_Handle spi_get_handle(uint32_t index) {
SPI_Params spiParams;
SPI_Handle spiHandle;
SPI_Params_init(&spiParams);
spiHandle = SPI_open(index, &spiParams);
if (spiHandle == NULL) {
LOGGER_ERROR("SPI_open failed\n");
return false;
}
return spiHandle;
}
/*****************************************************************************
** FUNCTION NAME : spi_reg_read
**
** DESCRIPTION : Writing device register over SPI bus.
**
** ARGUMENTS : SPI handle, chip select, register address, data, data
**
** length, offset byte, numOfBytes for cmd write count
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
ReturnStatus spi_reg_read(SPI_Handle spiHandle,
OcGpio_Pin *chip_select,
void *regAddress,
uint8_t *data,
uint32_t data_size,
uint32_t byte,
uint8_t numofBytes)
{
ReturnStatus status = RETURN_OK;
SPI_Transaction spiTransaction;
spiTransaction.count = numofBytes; /* Initialize master SPI transaction structure */
spiTransaction.txBuf = regAddress;
spiTransaction.rxBuf = NULL;
OcGpio_write(chip_select, PIN_LOW);/* Initiate SPI transfer */
if (SPI_transfer(spiHandle, &spiTransaction)) {
status = RETURN_OK;
} else {
LOGGER_ERROR("SPIBUS:ERROR:: SPI write failed");
status = RETURN_NOTOK;
}
spiTransaction.count = data_size;
spiTransaction.txBuf = NULL;
spiTransaction.rxBuf = data;
if (SPI_transfer(spiHandle, &spiTransaction)) {
status = RETURN_OK;
} else {
LOGGER_ERROR("SPIBUS:ERROR:: SPI read failed");
status = RETURN_NOTOK;
}
OcGpio_write(chip_select, PIN_HIGH);
SPI_close(spiHandle);
return (status);
}
/*****************************************************************************
** FUNCTION NAME : spi_reg_write
**
** DESCRIPTION : Writing device register over SPI bus.
**
** ARGUMENTS : SPI handle, chip select, register address, data, data
**
** length, offset byte, numOfBytes for cmd write count
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
ReturnStatus spi_reg_write(SPI_Handle spiHandle,
OcGpio_Pin *chip_select,
void *regAddress,
uint8_t *data,
uint32_t data_size,
uint32_t byte,
uint8_t numofBytes)
{
ReturnStatus status = RETURN_OK;
SPI_Transaction spiTransaction;
spiTransaction.count = numofBytes; /* Initialize master SPI transaction structure */
spiTransaction.txBuf = regAddress;
spiTransaction.rxBuf = NULL;
OcGpio_write(chip_select, PIN_LOW); /* Initiate SPI transfer */
if (SPI_transfer(spiHandle, &spiTransaction)) {
status = RETURN_OK;
} else {
LOGGER_ERROR("SPIBUS:ERROR:: SPI write failed");
status = RETURN_NOTOK;
}
spiTransaction.count = data_size;
spiTransaction.txBuf = data;
spiTransaction.rxBuf = NULL;
if(data_size > 0) {
if (SPI_transfer(spiHandle, &spiTransaction)) {
status = RETURN_OK;
} else {
LOGGER_ERROR("SPIBUS:ERROR:: SPI write failed");
status = RETURN_NOTOK;
}
}
OcGpio_write(chip_select, PIN_HIGH);
SPI_close(spiHandle);
return (status);
}

View File

@@ -0,0 +1,271 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* This file acts as wrapper for little filesystem, contains filesystem initialization,
* block read, block write, block erase as a main functions moreover provides API's
* like fileRead, fileWrite for external application to read and write data to
* at45db flash memory by using SPI interface.
*/
#include "Board.h"
#include "common/inc/global/Framework.h"
#include "common/inc/global/ocmp_frame.h"
#include "inc/common/bigbrother.h"
#include "inc/common/global_header.h"
#include "inc/devices/at45db.h"
#include "inc/global/OC_CONNECT1.h"
#include "inc/utils/util.h"
#include "src/filesystem/fs_wrapper.h"
#include "src/filesystem/lfs.h"
#include <string.h>
#include <stdlib.h>
#include <ti/drivers/GPIO.h>
#include <ti/drivers/SPI.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Task.h>
#define BLOCK_SIZE 256
#define BLOCK_COUNT 32768
#define FRAME_SIZE 64
#define LOOK_AHEAD 256
#define PAGE_SIZE 256
#define READ_SIZE 256
#define WRITE_SIZE 256
static Queue_Struct fsRxMsg;
static Queue_Struct fsTxMsg;
lfs_t lfs;
lfs_file_t file;
/*****************************************************************************
** FUNCTION NAME : block_device_read
**
** DESCRIPTION : It is called by filesystem to read block device
**
** ARGUMENTS : context for device configuration, block or page number,
**
** block or page offset, data buffer, size of data to read
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
int block_device_read(const struct lfs_config *cfg, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size)
{
if(at45db_data_read(cfg->context, buffer, size, off, block) != RETURN_OK) {
return LFS_ERR_IO;
}
return LFS_ERR_OK;
}
/*****************************************************************************
** FUNCTION NAME : block_device_write
**
** DESCRIPTION : it is called by filesystem to write block device
**
** ARGUMENTS : context for device configuration, block or page number,
**
** block or page offset, data buffer, size of data to write
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
int block_device_write(const struct lfs_config *cfg, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size)
{
if(at45db_data_write(cfg->context, buffer, size, off, block) != RETURN_OK){
return LFS_ERR_IO;
}
return LFS_ERR_OK;
}
/*****************************************************************************
** FUNCTION NAME : block_device_erase
**
** DESCRIPTION : It is called by filesystem to erase block device
**
** ARGUMENTS : context for device configuration, block or page number,
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
int block_device_erase(const struct lfs_config *cfg, lfs_block_t block)
{
if(at45db_erasePage(cfg->context, block) != RETURN_OK) {
return LFS_ERR_IO;
}
return LFS_ERR_OK;
}
/*****************************************************************************
** FUNCTION NAME : block_device_sync
**
** DESCRIPTION : It is called by filesystem to sync with block device
**
** ARGUMENTS : context for device configuration
**
** RETURN TYPE : Success or failure
**
*****************************************************************************/
int block_device_sync(const struct lfs_config *cfg)
{
if(at45db_readStatusRegister(cfg->context) != RETURN_OK) {
return LFS_ERR_IO;
}
return LFS_ERR_OK;
}
/*****************************************************************************
** FUNCTION NAME : fileSize
**
** DESCRIPTION : Returns size of saved file
**
** ARGUMENTS : Path or file name
**
** RETURN TYPE : file size
**
*****************************************************************************/
int fileSize(const char *path)
{
uint32_t fileSize = 0;
if(lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File open successfully \n");
}
fileSize = lfs_file_size(&lfs, &file);
lfs_file_close(&lfs, &file);
return fileSize;
}
/*****************************************************************************
** FUNCTION NAME : fileWrite
**
** DESCRIPTION : It write data to specified file
**
** ARGUMENTS : Path or file name, pointer to data, data length or size
**
** RETURN TYPE : true or flase
**
*****************************************************************************/
bool fileWrite(const char *path, uint8_t *pMsg, uint32_t size )
{
if(lfs_file_open(&lfs, &file, path, LFS_O_RDWR | LFS_O_CREAT | LFS_O_APPEND) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File open successfully \n");
}
if(lfs_file_write(&lfs, &file, pMsg, size) == size) {
LOGGER_DEBUG("FS:: File written successfully \n");
}
if(lfs_file_close(&lfs, &file) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File closed successfully \n");
}
return true;
}
/*****************************************************************************
** FUNCTION NAME : fileRead
**
** DESCRIPTION : It reads data from specified file
**
** ARGUMENTS : Path or file name, pointer to data, data length or size
**
** RETURN TYPE : true or flase
**
*****************************************************************************/
bool fileRead(const char *path, UChar *buf, uint32_t size)
{
if(lfs_file_open(&lfs, &file, path, LFS_O_RDONLY) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File open successfully \n");
}
if(lfs_file_read(&lfs, &file, buf, size) == size) {
LOGGER_DEBUG("FS:: File read successfully \n");
}
if(lfs_file_close(&lfs, &file) == LFS_ERR_OK) {
LOGGER_DEBUG("FS:: File closed successfully \n");
}
return true;
}
/*****************************************************************************
** FUNCTION NAME : fsMsgHandler
**
** DESCRIPTION : It is called when data to be written
**
** ARGUMENTS : data pointer
**
** RETURN TYPE : true or flase
**
*****************************************************************************/
static bool fsMsgHandler(OCMPMessageFrame *pMsg)
{
char fileName[] = "logs";
fileWrite(fileName, pMsg, FRAME_SIZE);
return true;
}
/*****************************************************************************
** FUNCTION NAME : fs_init
**
** DESCRIPTION : It initializes filesystem by mounting device
**
** ARGUMENTS : arg0 for SPI device configuration, arg1 for return
**
** RETURN TYPE : true or flase
**
*****************************************************************************/
void fs_init(UArg arg0, UArg arg1)
{
/*configuration of the filesystem is provided by this struct */
const struct lfs_config cfg = {
.context = (void*)arg0,
.read = block_device_read,
.prog = block_device_write,
.erase = block_device_erase,
.sync = block_device_sync,
.read_size = READ_SIZE,
.prog_size = WRITE_SIZE,
.block_size = BLOCK_SIZE,
.block_count = BLOCK_COUNT,
.lookahead = LOOK_AHEAD,
};
int err = lfs_mount(&lfs, &cfg);
if (err) {
lfs_format(&lfs, &cfg);
lfs_mount(&lfs, &cfg);
}
if(!err) {
LOGGER_DEBUG("FS:: Filesystem mounted successfully \n");
}
while (true) {
if (Semaphore_pend(semFilesysMsg, BIOS_WAIT_FOREVER)) {
while (!Queue_empty(fsTxMsgQueue)) {
OCMPMessageFrame *pMsg = (OCMPMessageFrame *)Util_dequeueMsg(fsTxMsgQueue);
if (pMsg != NULL) {
if (!fsMsgHandler(pMsg)) {
LOGGER_ERROR("ERROR:: Unable to route message \n");
free(pMsg);
}
}
}
}
}
}

View File

@@ -0,0 +1,25 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#ifndef SRC_FILESYSTEM_FS_H_
#define SRC_FILESYSTEM_FS_H_
#include "common/inc/global/post_frame.h"
extern Queue_Handle fsRxMsgQueue;
extern Queue_Handle fsTxMsgQueue;
extern Semaphore_Handle semFilesysMsg;
int fileSize(const char *path);
void fs_init(UArg arg0, UArg arg1);
bool fileRead(const char *path, UChar *buf, uint32_t size);
bool fileWrite(const char *path, uint8_t *pMsg, uint32_t size);
#endif /* SRC_FILESYSTEM_FS_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,330 @@
/*
* The little filesystem
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LFS_H
#define LFS_H
#include <stdbool.h>
#include <stdint.h>
/* Type definitions */
typedef uint32_t lfs_size_t;
typedef uint32_t lfs_off_t;
typedef int32_t lfs_ssize_t;
typedef int32_t lfs_soff_t;
typedef uint32_t lfs_block_t;
/* Max name size in bytes */
#ifndef LFS_NAME_MAX
#define LFS_NAME_MAX 255
#endif
/* Possible error codes, these are negative to allow
* valid positive return values
*/
enum lfs_error {
LFS_ERR_OK = 0, /* No error */
LFS_ERR_IO = -5, /* Error during device operation */
LFS_ERR_CORRUPT = -52, /* Corrupted */
LFS_ERR_NOENT = -2, /* No directory entry */
LFS_ERR_EXIST = -17, /* Entry already exists */
LFS_ERR_NOTDIR = -20, /* Entry is not a dir */
LFS_ERR_ISDIR = -21, /* Entry is a dir */
LFS_ERR_INVAL = -22, /* Invalid parameter */
LFS_ERR_NOSPC = -28, /* No space left on device */
LFS_ERR_NOMEM = -12, /* No more memory available */
};
/* File types */
enum lfs_type {
LFS_TYPE_REG = 0x11,
LFS_TYPE_DIR = 0x22,
LFS_TYPE_SUPERBLOCK = 0x2e,
};
/* File open flags */
enum lfs_open_flags {
/* open flags */
LFS_O_RDONLY = 1, /* Open a file as read only */
LFS_O_WRONLY = 2, /* Open a file as write only */
LFS_O_RDWR = 3, /* Open a file as read and write */
LFS_O_CREAT = 0x0100, /* Create a file if it does not exist */
LFS_O_EXCL = 0x0200, /* Fail if a file already exists */
LFS_O_TRUNC = 0x0400, /* Truncate the existing file to zero size */
LFS_O_APPEND = 0x0800, /* Move to end of file on every write */
/* internally used flags */
LFS_F_DIRTY = 0x10000, /* File does not match storage */
LFS_F_WRITING = 0x20000, /* File has been written since last flush */
LFS_F_READING = 0x40000, /* File has been read since last flush */
LFS_F_ERRED = 0x80000, /* An error occured during write */
};
/* File seek flags */
enum lfs_whence_flags {
LFS_SEEK_SET = 0, /* Seek relative to an absolute position */
LFS_SEEK_CUR = 1, /* Seek relative to the current file position */
LFS_SEEK_END = 2, /* Seek relative to the end of the file */
};
/* Configuration provided during initialization of the filesystem */
struct lfs_config {
void *context;
/* Read a region in a block */
int (*read)(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size);
/* Program a region in a block, function must return LFS_ERR_CORRUPT
* if the block should be considered bad
*/
int (*prog)(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, const void *buffer, lfs_size_t size);
/* Erase a block, A block must be erased before being programmed */
int (*erase)(const struct lfs_config *c, lfs_block_t block);
/* Sync the state of the underlying block device */
int (*sync)(const struct lfs_config *c);
/* Minimum size of a block read. This determines the size of read buffers.
* This may be larger than the physical read size to improve performance
* by caching more of the block device
*/
lfs_size_t read_size;
/* Minimum size of a block program. This determines the size of program
* buffers. This may be larger than the physical program size to improve
* performance by caching more of the block device.
*/
lfs_size_t prog_size;
/* Size of an erasable block. This does not impact ram consumption and
* may be larger than the physical erase size. However, this should be
* kept small as each file currently takes up an entire block .
*/
lfs_size_t block_size;
/* Number of erasable blocks on the device. */
lfs_size_t block_count;
/* Number of blocks to lookahead during block allocation. A larger
* lookahead reduces the number of passes required to allocate a block.
* The lookahead buffer requires only 1 bit per block so it can be quite
* large with little ram impact. Should be a multiple of 32.
*/
lfs_size_t lookahead;
/* Optional, statically allocated read buffer. Must be read sized. */
void *read_buffer;
/* Optional, statically allocated program buffer. Must be program sized. */
void *prog_buffer;
/* Optional, statically allocated lookahead buffer. Must be 1 bit per
* lookahead block
*/
void *lookahead_buffer;
/* Optional, statically allocated buffer for files. Must be program sized.
* If enabled, only one file may be opened at a time.
*/
void *file_buffer;
};
/* File info structure */
struct lfs_info {
/* Type of the file, either LFS_TYPE_REG or LFS_TYPE_DIR */
uint8_t type;
/* Size of the file, only valid for REG files */
lfs_size_t size;
/* Name of the file stored as a null-terminated string */
char name[LFS_NAME_MAX+1];
};
/* filesystem data structures */
typedef struct lfs_entry {
lfs_off_t off;
struct lfs_disk_entry {
uint8_t type;
uint8_t elen;
uint8_t alen;
uint8_t nlen;
union {
struct {
lfs_block_t head;
lfs_size_t size;
} file;
lfs_block_t dir[2];
} u;
} d;
} lfs_entry_t;
typedef struct lfs_cache {
lfs_block_t block;
lfs_off_t off;
uint8_t *buffer;
} lfs_cache_t;
typedef struct lfs_file {
struct lfs_file *next;
lfs_block_t pair[2];
lfs_off_t poff;
lfs_block_t head;
lfs_size_t size;
uint32_t flags;
lfs_off_t pos;
lfs_block_t block;
lfs_off_t off;
lfs_cache_t cache;
} lfs_file_t;
typedef struct lfs_dir {
struct lfs_dir *next;
lfs_block_t pair[2];
lfs_off_t off;
lfs_block_t head[2];
lfs_off_t pos;
struct lfs_disk_dir {
uint32_t rev;
lfs_size_t size;
lfs_block_t tail[2];
} d;
} lfs_dir_t;
typedef struct lfs_superblock {
lfs_off_t off;
struct lfs_disk_superblock {
uint8_t type;
uint8_t elen;
uint8_t alen;
uint8_t nlen;
lfs_block_t root[2];
uint32_t block_size;
uint32_t block_count;
uint32_t version;
char magic[8];
} d;
} lfs_superblock_t;
typedef struct lfs_free {
lfs_block_t begin;
lfs_block_t end;
lfs_block_t off;
uint32_t *buffer;
} lfs_free_t;
/* The filesystem type */
typedef struct lfs {
const struct lfs_config *cfg;
const struct lfs_config cfgs;
lfs_block_t root[2];
lfs_file_t *files;
lfs_dir_t *dirs;
lfs_cache_t rcache;
lfs_cache_t pcache;
lfs_free_t free;
bool deorphaned;
} lfs_t;
/* Format a block device with the filesystem */
int lfs_format(lfs_t *lfs, const struct lfs_config *config);
/* Mounts a filesystem */
int lfs_mount(lfs_t *lfs, const struct lfs_config *config);
/* Unmounts a filesystem */
int lfs_unmount(lfs_t *lfs);
/* Removes a file or directory */
int lfs_remove(lfs_t *lfs, const char *path);
/* Rename or move a file or directory */
int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath);
/* Find info about a file or directory */
int lfs_stat(lfs_t *lfs, const char *path, struct lfs_info *info);
/* Open a file */
int lfs_file_open(lfs_t *lfs, lfs_file_t *file,
const char *path, int flags);
/* Close a file */
int lfs_file_close(lfs_t *lfs, lfs_file_t *file);
/* Synchronize a file on storage */
int lfs_file_sync(lfs_t *lfs, lfs_file_t *file);
/* Read data from file */
lfs_ssize_t lfs_file_read(lfs_t *lfs, lfs_file_t *file,
void *buffer, lfs_size_t size);
/* Write data to file */
lfs_ssize_t lfs_file_write(lfs_t *lfs, lfs_file_t *file,
const void *buffer, lfs_size_t size);
/* Change the position of the file */
lfs_soff_t lfs_file_seek(lfs_t *lfs, lfs_file_t *file,
lfs_soff_t off, int whence);
/* Return the position of the file */
lfs_soff_t lfs_file_tell(lfs_t *lfs, lfs_file_t *file);
/* Change the position of the file to the beginning of the file */
int lfs_file_rewind(lfs_t *lfs, lfs_file_t *file);
/* Return the size of the file */
lfs_soff_t lfs_file_size(lfs_t *lfs, lfs_file_t *file);
/* Create a directory */
int lfs_mkdir(lfs_t *lfs, const char *path);
/* Open a directory */
int lfs_dir_open(lfs_t *lfs, lfs_dir_t *dir, const char *path);
/* Close a directory */
int lfs_dir_close(lfs_t *lfs, lfs_dir_t *dir);
/* Read an entry in the directory */
int lfs_dir_read(lfs_t *lfs, lfs_dir_t *dir, struct lfs_info *info);
/* Change the position of the directory */
int lfs_dir_seek(lfs_t *lfs, lfs_dir_t *dir, lfs_off_t off);
/* Return the position of the directory */
lfs_soff_t lfs_dir_tell(lfs_t *lfs, lfs_dir_t *dir);
/* Change the position of the directory to the beginning of the directory */
int lfs_dir_rewind(lfs_t *lfs, lfs_dir_t *dir);
/* Traverse through all blocks in use by the filesystem */
int lfs_traverse(lfs_t *lfs, int (*cb)(void*, lfs_block_t), void *data);
/* Prunes any recoverable errors that may have occured in the filesystem
* Not needed to be called by user unless an operation is interrupted
* but the filesystem is still mounted. This is already called on first
* allocation.
* Returns a negative error code on failure.
*/
int lfs_deorphan(lfs_t *lfs);
#endif

View File

@@ -0,0 +1,24 @@
/*
* The little filesystem
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "lfs_util.h"
void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) {
static const uint32_t rtable[16] = {
0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c,
};
const uint8_t *data = buffer;
for (size_t i = 0; i < size; i++) {
*crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 0)) & 0xf];
*crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 4)) & 0xf];
}
}

View File

@@ -0,0 +1,124 @@
/*
* The little filesystem
*
* Copyright (c) 2017, Arm Limited. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LFS_UTIL_H
#define LFS_UTIL_H
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#ifdef __ICCARM__
#include <intrinsics.h>
#endif
/* Builtin functions, these may be replaced by more
* efficient implementations in the system
*/
static inline uint32_t lfs_max(uint32_t a, uint32_t b) {
return (a > b) ? a : b;
}
static inline uint32_t lfs_min(uint32_t a, uint32_t b) {
return (a < b) ? a : b;
}
static inline uint32_t lfs_ctz(uint32_t a) {
#if defined(__GNUC__) || defined(__CC_ARM)
return __builtin_ctz(a);
#elif defined(__ICCARM__)
return __CLZ(__RBIT(a));
#else
uint32_t r = 32;
a &= -a;
if (a) r -= 1;
if (a & 0x0000ffff) r -= 16;
if (a & 0x00ff00ff) r -= 8;
if (a & 0x0f0f0f0f) r -= 4;
if (a & 0x33333333) r -= 2;
if (a & 0x55555555) r -= 1;
return r;
#endif
}
static inline uint32_t lfs_npw2(uint32_t a) {
#if defined(__GNUC__) || defined(__CC_ARM)
return 32 - __builtin_clz(a-1);
#elif defined(__ICCARM__)
return 32 - __CLZ(a-1);
#else
uint32_t r = 0;
uint32_t s;
s = (a > 0xffff) << 4; a >>= s; r |= s;
s = (a > 0xff ) << 3; a >>= s; r |= s;
s = (a > 0xf ) << 2; a >>= s; r |= s;
s = (a > 0x3 ) << 1; a >>= s; r |= s;
return r | (a >> 1);
#endif
}
static inline uint32_t lfs_popc(uint32_t a) {
#if defined(__GNUC__) || defined(__CC_ARM)
return __builtin_popcount(a);
#else
a = a - ((a >> 1) & 0x55555555);
a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
return (((a + (a >> 4)) & 0xf0f0f0f) * 0x1010101) >> 24;
#endif
}
static inline int lfs_scmp(uint32_t a, uint32_t b) {
return (int)(unsigned)(a - b);
}
/* CRC-32 with polynomial = 0x04c11db7 */
void lfs_crc(uint32_t *crc, const void *buffer, size_t size);
/* Logging functions */
#ifdef __MBED__
#include "mbed_debug.h"
#else
#define MBED_LFS_ENABLE_INFO false
#define MBED_LFS_ENABLE_DEBUG true
#define MBED_LFS_ENABLE_WARN true
#define MBED_LFS_ENABLE_ERROR true
#endif
#if MBED_LFS_ENABLE_INFO
#define LFS_INFO(fmt, ...) printf("lfs info: " fmt "\n", __VA_ARGS__)
#elif !defined(MBED_LFS_ENABLE_INFO)
#define LFS_INFO(fmt, ...) debug("lfs info: " fmt "\n", __VA_ARGS__)
#else
#define LFS_INFO(fmt, ...)
#endif
#if MBED_LFS_ENABLE_DEBUG
#define LFS_DEBUG(fmt, ...) printf("lfs debug: " fmt "\n", __VA_ARGS__)
#elif !defined(MBED_LFS_ENABLE_DEBUG)
#define LFS_DEBUG(fmt, ...) debug("lfs debug: " fmt "\n", __VA_ARGS__)
#else
#define LFS_DEBUG(fmt, ...)
#endif
#if MBED_LFS_ENABLE_WARN
#define LFS_WARN(fmt, ...) printf("lfs warn: " fmt "\n", __VA_ARGS__)
#elif !defined(MBED_LFS_ENABLE_WARN)
#define LFS_WARN(fmt, ...) debug("lfs warn: " fmt "\n", __VA_ARGS__)
#else
#define LFS_WARN(fmt, ...)
#endif
#if MBED_LFS_ENABLE_ERROR
#define LFS_ERROR(fmt, ...) printf("lfs error: " fmt "\n", __VA_ARGS__)
#elif !defined(MBED_LFS_ENABLE_ERROR)
#define LFS_ERROR(fmt, ...) debug("lfs error: " fmt "\n", __VA_ARGS__)
#else
#define LFS_ERROR(fmt, ...)
#endif
#endif

View File

@@ -62,6 +62,7 @@ int main(void)
Board_initGeneral();
Board_initGPIO();
Board_initI2C();
Board_initSPI();
Board_initUSB(Board_USBDEVICE);
Board_initUART();
ethernet_start();

View File

@@ -6,20 +6,43 @@
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "inc/subsystem/sys/sys.h"
#include "common/inc/global/Framework.h"
#include "helpers/memory.h"
#include "inc/common/bigbrother.h"
#include "inc/common/global_header.h"
#include "inc/common/post.h"
#include "inc/devices/eeprom.h"
#include "inc/subsystem/gpp/gpp.h" /* For resetting AP */
#include "inc/subsystem/sys/sys.h"
#include "inc/utils/ocmp_util.h"
#include "src/filesystem/fs_wrapper.h"
#include <driverlib/flash.h>
#include <driverlib/sysctl.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
#include <ti/sysbios/knl/Task.h>
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <stdio.h>
#include <string.h>
#define FRAME_SIZE 64
#define OCFS_TASK_PRIORITY 5
#define OCFS_TASK_STACK_SIZE 4096
#define OC_MAC_ADDRESS_SIZE 13
Task_Struct ocFSTask;
Char ocFSTaskStack[OCFS_TASK_STACK_SIZE];
Semaphore_Handle semFilesysMsg;
Semaphore_Struct semFSstruct;
static Queue_Struct fsRxMsg;
static Queue_Struct fsTxMsg;
Queue_Handle fsRxMsgQueue;
Queue_Handle fsTxMsgQueue;
extern POSTData PostResult[POST_RECORDS];
@@ -54,7 +77,6 @@ bool SYS_cmdEcho(void *driver, void *params)
return true;
}
/*
/*****************************************************************************
** FUNCTION NAME : SYS_post_enable
**
@@ -137,3 +159,30 @@ bool SYS_post_get_results(void **getpostResult)
memcpy(((OCMPMessageFrame*)getpostResult), postResultMsg, 64);
return status;
}
bool sys_post_init(void* driver, void *returnValue)
{
Semaphore_construct(&semFSstruct, 0, NULL);
semFilesysMsg = Semaphore_handle(&semFSstruct);
if (!semFilesysMsg) {
LOGGER_DEBUG("FS:ERROR:: Failed in Creating Semaphore");
return false;
}
/* Create Message Queue for RX Messages */
fsTxMsgQueue = Util_constructQueue(&fsTxMsg);
if (!fsTxMsgQueue) {
LOGGER_ERROR("FS:ERROR:: Failed in Constructing Message Queue for");
return false;
}
Task_Params taskParams;
Task_Params_init(&taskParams);
taskParams.stackSize = OCFS_TASK_STACK_SIZE;
taskParams.stack = &ocFSTaskStack;
taskParams.instance->name = "FS_TASK";
taskParams.priority = OCFS_TASK_PRIORITY;
taskParams.arg0 = (UArg)driver;
taskParams.arg1 = (UArg)returnValue;
Task_construct(&ocFSTask,fs_init, &taskParams,NULL);
LOGGER_DEBUG("FS:INFO:: Creating filesystem task function.\n");
return true;
}

View File

@@ -1,82 +0,0 @@
*.o
*.a
Makefile.in
Makefile
.deps
btsconfig.h
btsconfig.h.in
aclocal.m4
autom4te.cache
config.log
config.status
config.guess
config.sub
configure
compile
depcomp
install-sh
missing
stamp-h1
libtool
ltmain.sh
core
core.*
# git-version-gen magic
.tarball-version
.version
src/osmo-bts-sysmo/sysmobts-calib
src/osmo-bts-sysmo/l1fwd-proxy
src/osmo-bts-sysmo/osmo-bts-sysmo
src/osmo-bts-sysmo/osmo-bts-sysmo-remote
src/osmo-bts-sysmo/sysmobts-mgr
src/osmo-bts-sysmo/sysmobts-util
src/osmo-bts-litecell15/lc15bts-mgr
src/osmo-bts-litecell15/lc15bts-util
src/osmo-bts-litecell15/misc/.dirstamp
src/osmo-bts-litecell15/osmo-bts-lc15
src/osmo-bts-trx/osmo-bts-trx
src/osmo-bts-octphy/osmo-bts-octphy
src/osmo-bts-virtual/osmo-bts-virtual
src/osmo-bts-omldummy/osmo-bts-omldummy
tests/atconfig
tests/package.m4
tests/agch/agch_test
tests/paging/paging_test
tests/cipher/cipher_test
tests/sysmobts/sysmobts_test
tests/meas/meas_test
tests/misc/misc_test
tests/handover/handover_test
tests/tx_power/tx_power_test
tests/testsuite
tests/testsuite.log
# Possible generated file
doc/vty_reference.xml
# Backups, vi, merges
*~
*.sw?
*.orig
*.sav
# debian
.tarball-version
debian/autoreconf.after
debian/autoreconf.before
debian/files
debian/*.debhelper.log
debian/*.substvars
debian/osmo-bts-trx-dbg/
debian/osmo-bts-trx/
debian/tmp/
/tests/power/power_test

View File

@@ -1,3 +0,0 @@
[gerrit]
host=gerrit.osmocom.org
project=osmo-bts

View File

@@ -1,12 +0,0 @@
Harald Welte <laforge@gnumonks.org>
Harald Welte <laforge@gnumonks.org> <laflocal@hanuman.gnumonks.org>
Harald Welte <laforge@gnumonks.org> <laflocal@goeller.de.gnumonks.org>
Holger Hans Peter Freyther <holger@moiji-mobile.com> <zecke@selfish.org>
Holger Hans Peter Freyther <holger@moiji-mobile.com> <ich@tamarin.(none)>
Holger Hans Peter Freyther <holgre@moiji-mobile.com> <holger@freyther.de>
Andreas Eversberg <jolly@eversberg.eu>
Andreas Eversberg <jolly@eversberg.eu> <Andreas.Eversberg@versatel.de>
Andreas Eversberg <jolly@eversberg.eu> <root@nuedel.(none)>
Pablo Neira Ayuso <pablo@soleta.eu> <pablo@gnumonks.org>
Max Suraev <msuraev@sysmocom.de>
Tom Tsou <tom.tsou@ettus.com> <tom@tsou.cc>

View File

@@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

View File

@@ -1,24 +0,0 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
SUBDIRS = include src tests
# package the contrib and doc
EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd contrib/osmo-bts-sysmo.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
doc/examples/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
doc/examples/virtual/osmobts-virtual.cfg \
git-version-gen .version \
README.md
@RELMAKE@
BUILT_SOURCES = $(top_srcdir)/.version
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version

View File

@@ -1,127 +0,0 @@
osmo-bts - Osmocom BTS Implementation
====================================
This repository contains a C-language implementation of a GSM Base
Transceiver Station (BTS). It is part of the
[Osmocom](https://osmocom.org/) Open Source Mobile Communications
project.
This code implements Layer 2 and higher of a more or less conventional GSM BTS
(Base Transceiver Station) - however, using an Abis/IP interface, rather than
the old-fashioned E1/T1.
Specifically, this includes
* BTS-side implementation of TS 08.58 (RSL) and TS 12.21 (OML)
* BTS-side implementation of LAPDm (using libosmocore/libosmogsm)
* A somewhat separated interface between those higher layer parts and the
Layer1 interface.
Several kinds of BTS hardware are supported:
* sysmocom sysmoBTS
* Octasic octphy
* Nutaq litecell 1.5
* software-defined radio based osmo-bts-trx (e.g. USRP B210, UmTRX)
Homepage
--------
The official homepage of the project is
https://osmocom.org/projects/osmobts/wiki
GIT Repository
--------------
You can clone from the official osmo-bts.git repository using
git clone git://git.osmocom.org/osmo-bts.git
There is a cgit interface at http://git.osmocom.org/osmo-bts/
Documentation
-------------
We provide a
[User Manual](http://ftp.osmocom.org/docs/latest/osmobts-usermanual.pdf)
as well as a
[VTY Reference Manual](http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf)
and a
[Abis refrence MAnual](http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
describing the OsmoBTS specific A-bis dialect.
Mailing List
------------
Discussions related to osmo-bts are happening on the
openbsc@lists.osmocom.org mailing list, please see
https://lists.osmocom.org/mailman/listinfo/openbsc for subscription
options and the list archive.
Please observe the [Osmocom Mailing List
Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
when posting.
Contributing
------------
Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We us a gerrit based patch submission/review process for managing
contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details
The current patch queue for osmo-bts can be seen at
https://gerrit.osmocom.org/#/q/project:osmo-bts+status:open
Known Limitations
=================
As of March 17, 2017, the following known limitations exist in this
implementation:
Common Core
-----------
* No Extended BCCH support
* System Information limited to 1,2,2bis,2ter,2quater,3,4,5,6,9,13
* No RATSCCH in AMR
* Will reject TS 12.21 STARTING TIME in SET BTS ATTR / SET CHAN ATTR
* No support for frequency hopping
* No reporting of interference levels as part of TS 08.58 RF RES IND
* No error reporting in case PAGING COMMAND fails due to queue overflow
* No use of TS 08.58 BS Power and MS Power parameters
* No support of TS 08.58 MultiRate Control
* No support of TS 08.58 Supported Codec Types
* No support of Bter frame / ENHANCED MEASUREMENT REPORT
osmo-bts-sysmo
--------------
* No CSD / ECSD support (not planned)
* GSM-R frequency band supported, but no NCH/ASCI/SoLSA
* All timeslots on one TRX have to use same training sequence (TSC)
* No multi-TRX support yet, though hardware+L1 support stacking
* Makes no use of 12.21 Intave Parameters and Interference
Level Boundaries
* MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power
and ciphering. The dispatch should take a look at the hLayer3.
osmo-bts-octphy
---------------
* No support of EFR, HR voice codec (lack of PHY support?)
* No re-transmission of PHY primitives in case of time-out
* Link Quality / Measurement processing incomplete
* impossible to modify encryption parameters using RSL MODE MODIFY
* no clear indication of nominal transmit power, various power related
computations are likely off
* no OML attribute validation during bts_model_check_oml()
osmo-bts-trx
------------
* TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865)
* No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855)
* No 11bit RACH support (https://osmocom.org/issues/1854)
* No CBCH support (https://osmocom.org/issues/1617)

View File

@@ -1,340 +0,0 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([osmo-bts],
m4_esyscmd([./git-version-gen .tarball-version]),
[openbsc@lists.osmocom.org])
dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_TESTDIR(tests)
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl include release helper
RELMAKE='-include osmo-release.mk'
AC_SUBST([RELMAKE])
dnl checks for programs
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
LT_INIT
dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
AC_MSG_WARN([You need to install pkg-config])
fi
PKG_PROG_PKG_CONFIG([0.20])
dnl checks for header files
AC_HEADER_STDC
dnl Checks for typedefs, structures and compiler characteristics
AC_ARG_ENABLE(sanitize,
[AS_HELP_STRING([--enable-sanitize], [Compile with address sanitizer enabled], )],
[sanitize=$enableval], [sanitize="no"])
if test x"$sanitize" = x"yes"
then
CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
fi
AC_ARG_ENABLE(werror,
[AS_HELP_STRING(
[--enable-werror],
[Turn all compiler warnings into errors, with exceptions:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
]
)],
[werror=$enableval], [werror="no"])
if test x"$werror" = x"yes"
then
WERROR_FLAGS="-Werror"
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
CFLAGS="$CFLAGS $WERROR_FLAGS"
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
fi
dnl checks for libraries
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.11.0)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.5.0)
PKG_CHECK_MODULES(ORTP, ortp)
AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
AC_ARG_ENABLE(sysmobts-calib,
AC_HELP_STRING([--enable-sysmobts-calib],
[enable code for sysmobts calibration tool [default=no]]),
[enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
AC_MSG_RESULT([$enable_sysmobts_calib])
AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files, implies --enable-sysmocom-bts])],
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
if test "x$sysmobts_incdir" != "x"; then
# --with-sysmobts was passed, imply enable_sysmocom_bts
enable_sysmocom_bts="yes"
fi
AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir)
AC_MSG_RESULT([$enable_sysmocom_bts])
AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
if test "$enable_sysmocom_bts" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
[AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])],
[#include <sysmocom/femtobts/superfemto.h>])
# Check for the sbts2050_header.h that was added after the 3.6 release
AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"], [])
if test "$sysmo_uc_header" = "yes" ; then
AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050])
fi
PKG_CHECK_MODULES(LIBGPS, libgps)
CPPFLAGS=$oldCPPFLAGS
fi
AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes")
AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
AC_ARG_ENABLE(trx,
AC_HELP_STRING([--enable-trx],
[enable code for osmo-trx L1/PHY [default=no]]),
[enable_trx="yes"],[enable_trx="no"])
AC_MSG_RESULT([$enable_trx])
AM_CONDITIONAL(ENABLE_TRX, test "x$enable_trx" = "xyes")
AC_MSG_CHECKING([whether to enable support for Octasic OCTPHY-2G])
AC_ARG_ENABLE(octphy,
AC_HELP_STRING([--enable-octphy],
[enable code for Octasic OCTPHY-2G [default=no]]),
[enable_octphy="yes"],[enable_octphy="no"])
AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])],
[octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"])
AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir)
AC_MSG_RESULT([$enable_octphy])
AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes")
if test "$enable_octphy" = "yes" ; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[],
[AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])],
[#include <octphy/octvc1/gsm/octvc1_gsm_default.h>])
AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn],
AC_DEFINE([OCTPHY_MULTI_TRX],
[1],
[Define to 1 if your octphy header files support multi-trx]),
[],
[#include <octphy/octvc1/gsm/octvc1_gsm_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_RF_PORT_RX_STATS.Frequency],
AC_DEFINE([OCTPHY_USE_FREQUENCY],
[1],
[Define to 1 if your octphy header files support tOCTVC1_RADIO_FREQUENCY_VALUE type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_RSP.TxConfig],
AC_DEFINE([OCTPHY_USE_TX_CONFIG],
[1],
[Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_TX_CONFIG type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_RSP.RxConfig],
AC_DEFINE([OCTPHY_USE_RX_CONFIG],
[1],
[Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_RX_CONFIG type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_GSM_RF_CONFIG.ulTxAntennaId],
AC_DEFINE([OCTPHY_USE_ANTENNA_ID],
[1],
[Define to 1 if your octphy header files support antenna ids in tOCTVC1_GSM_RF_CONFIG]),
[],
[#include <octphy/octvc1/gsm/octvc1_gsm_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP.ulClkSourceSelection],
AC_DEFINE([OCTPHY_USE_CLK_SOURCE_SELECTION],
[1],
[Define to 1 if your octphy header files supports ulClkSourceSelection in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lClockError],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_CLOCK_ERROR],
[1],
[Define to 1 if your octphy header files supports lClockError in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lDroppedCycles],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DROPPED_CYCLES],
[1],
[Define to 1 if your octphy header files supports lDroppedCycles in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFreqHz],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FREQ_HZ],
[1],
[Define to 1 if your octphy header files supports ulPllFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFractionalFreqHz],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FRACTIONAL_FREQ_HZ],
[1],
[Define to 1 if your octphy header files supports ulPllFractionalFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSlipCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SLIP_CNT],
[1],
[Define to 1 if your octphy header files supports ulSlipCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLosseCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSSE_CNT],
[1],
[Define to 1 if your octphy header files supports ulSyncLosseCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSS_CNT],
[1],
[Define to 1 if your octphy header files supports ulSyncLossCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSourceState],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SOURCE_STATE],
[1],
[Define to 1 if your octphy header files supports ulSourceState in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulDacState],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DAC_STATE],
[1],
[Define to 1 if your octphy header files supports ulDacState in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulDriftElapseTimeUs],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DRIFT_ELAPSE_TIME_US],
[1],
[Define to 1 if your octphy header files supports ulDriftElapseTimeUs in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
CPPFLAGS=$oldCPPFLAGS
fi
AC_MSG_CHECKING([whether to enable NuRAN Wireless Litecell 1.5 hardware support])
AC_ARG_ENABLE(litecell15,
AC_HELP_STRING([--enable-litecell15],
[enable code for NuRAN Wireless Litecell15 bts [default=no]]),
[enable_litecell15="yes"],[enable_litecell15="no"])
AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])],
[litecell15_incdir="$withval"],[litecell15_incdir="$incdir"])
AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir)
AC_MSG_RESULT([$enable_litecell15])
AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes")
if test "$enable_litecell15" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[],
[AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])],
[#include <nrw/litecell15/litecell15.h>])
PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
CPPFLAGS=$oldCPPFLAGS
fi
AC_MSG_CHECKING([whether to enable NuRAN Wireless OC-2G hardware support])
AC_ARG_ENABLE(oc2g,
AC_HELP_STRING([--enable-oc2g],
[enable code for NuRAN Wireless OC-2G bts [default=no]]),
[enable_oc2g="yes"],[enable_oc2g="no"])
AC_ARG_WITH([oc2g], [AS_HELP_STRING([--with-oc2g=INCLUDE_DIR], [Location of the OC-2G API header files])],
[oc2g_incdir="$withval"],[oc2g_incdir="$incdir"])
AC_SUBST([OC2G_INCDIR], -I$oc2g_incdir)
AC_MSG_RESULT([$enable_oc2g])
AM_CONDITIONAL(ENABLE_OC2GBTS, test "x$enable_oc2g" = "xyes")
if test "$enable_oc2g" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $OC2G_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([nrw/oc2g/oc2g.h],[],
[AC_MSG_ERROR([nrw/oc2g/oc2g.h can not be found in $oc2g_incdir])],
[#include <nrw/oc2g/oc2g.h>])
PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
PKG_CHECK_MODULES(LIBGPS, libgps)
CPPFLAGS=$oldCPPFLAGS
fi
# https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
[with_systemdsystemunitdir=auto])
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
AM_CONFIG_HEADER(btsconfig.h)
AC_OUTPUT(
src/Makefile
src/common/Makefile
src/osmo-bts-virtual/Makefile
src/osmo-bts-omldummy/Makefile
src/osmo-bts-sysmo/Makefile
src/osmo-bts-litecell15/Makefile
src/osmo-bts-oc2g/Makefile
src/osmo-bts-trx/Makefile
src/osmo-bts-octphy/Makefile
include/Makefile
include/osmo-bts/Makefile
tests/Makefile
tests/paging/Makefile
tests/agch/Makefile
tests/cipher/Makefile
tests/sysmobts/Makefile
tests/misc/Makefile
tests/handover/Makefile
tests/tx_power/Makefile
tests/power/Makefile
tests/meas/Makefile
Makefile)

View File

@@ -1,89 +0,0 @@
#!/usr/bin/gawk -f
# Expected input format: FN TYPE
BEGIN {
DELTA = 0
ERR = 0
FORCE = 0
FN = 0
SILENCE = 0
TYPE = ""
CHK = ""
U_MAX = 8 * 20 + 120 / 26
U_MIN = 8 * 20 - 120 / 26
F_MAX = 3 * 20 + 120 / 26
F_MIN = 3 * 20 - 120 / 26
}
{
if (NR > 2) { # we have data from previous record to compare to
DELTA = ($1 - FN) * 120 / 26
CHK = "OK"
if ("FACCH" == $2 && "ONSET" == TYPE) { # ONSET due to FACCH is NOT a talkspurt
SILENCE = 1
}
if (("UPDATE" == TYPE || "FIRST" == TYPE) && ("FACCH" == $2 || "SPEECH" == $2)) { # check for missing ONSET:
CHK = "FAIL: missing ONSET (" $2 ") after " TYPE "."
ERR++
}
if ("SID_P1" == $2) {
CHK = "FAIL: regular AMR payload with FT SID and STI=0 (should be either pyaload Update or STI=1)."
ERR++
}
if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2 || "FORCED_F_P2" == $2 || "FORCED_F_INH" == $2 || "FORCED_U_INH" == $2) {
CHK = "FAIL: event " $2 " inserted by DSP."
FORCE++
ERR++
}
if ("FIRST_P2" != $2 && "FIRST_P1" == TYPE) {
CHK = "FAIL: " TYPE " followed by " $2 " instead of P2."
ERR++
}
if ("FIRST" == $2 && "FIRST" == TYPE) {
CHK = "FAIL: multiple SID FIRST in a row."
ERR++
}
if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances:
if ("UPDATE" == TYPE) {
if (DELTA > U_MAX) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms."
ERR++
}
if ("UPDATE" == $2 && DELTA < U_MIN) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " U_MIN "ms."
ERR++
}
}
if ("FIRST" == TYPE) {
if (DELTA > F_MAX) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID FIRST (@" FN ") too big " DELTA "ms > " F_MAX "ms."
ERR++
}
if ("UPDATE" == $2 && DELTA < F_MIN) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " F_MIN "ms."
ERR++
}
}
}
if ("FACCH" == TYPE && "FIRST" != $2 && "FACCH" != $2 && 1 == SILENCE) { # check FACCH handling
CHK = "FAIL: incorrect silence resume with " $2 " after FACCH."
ERR++
}
}
if ("SPEECH" == $2 || "ONSET" == $2) { # talkspurt
SILENCE = 0
}
if ("UPDATE" == $2 || "FIRST" == $2) { # silence
SILENCE = 1
}
print $1, $2, CHK
if ($2 != "EMPTY") { # skip over EMPTY records
TYPE = $2
FN = $1
}
}
END {
print "Check completed: found " ERR " errors (" FORCE " events inserted by DSP) in " NR " records."
}

View File

@@ -1,40 +0,0 @@
#!/usr/bin/env python
"""
Start the process and dump the documentation to the doc dir
"""
import socket, subprocess, time,os
env = os.environ
env['L1FWD_BTS_HOST'] = '127.0.0.1'
bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
"-c", "./doc/examples/sysmo/osmo-bts.cfg"], env = env,
stdin=None, stdout=None)
time.sleep(1)
try:
sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sck.setblocking(1)
sck.connect(("localhost", 4241))
sck.recv(4096)
# Now send the command
sck.send("show online-help\r")
xml = ""
while True:
data = sck.recv(4096)
xml = "%s%s" % (xml, data)
if data.endswith('\r\nOsmoBTS> '):
break
# Now write everything until the end to the file
out = open('doc/vty_reference.xml', 'w')
out.write(xml[18:-11])
out.close()
finally:
# Clean-up
bts_proc.kill()
bts_proc.wait()

View File

@@ -1,91 +0,0 @@
/* GPLv3+ to read sysmobts-v2 revD or later EEPROM from userspace */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
/* Can read a 16bit at24 eeprom with 8192 byte in storage (24c64) */
static int dump_eeprom(int fd, int out)
{
#define STEP 8192
#define SIZE 8192
uint8_t buf[STEP + 2];
int rc = 0;
int i;
for (i = 0; i < SIZE; i += STEP) {
/* write the address */
buf[0] = i >> 8;
buf[1] = i;
rc = write(fd, buf, 2);
if (rc != 2) {
fprintf(stderr, "writing address failed: %d/%d/%s\n", rc, errno, strerror(errno));
return 1;
}
/* execute step amount of reads */
rc = read(fd, buf, STEP);
if (rc != STEP) {
fprintf(stderr, "Failed to read: %d/%d/%s\n", rc, errno, strerror(errno));
return 1;
}
write(out, buf, STEP);
}
return 0;
}
int main(int argc, char **argv)
{
int i2c_fd, out_fd;
char *filename = "/dev/i2c-1";
char *out_file = "eeprom.out";
int addr = 0x50;
int rc;
i2c_fd = open(filename, O_RDWR);
if (i2c_fd < 0) {
fprintf(stderr, "Failed to open i2c device %d/%d/%s\n",
i2c_fd, errno, strerror(errno));
return EXIT_FAILURE;
}
/* force using that address it is already bound with a driver */
rc = ioctl(i2c_fd, I2C_SLAVE_FORCE, addr);
if (rc < 0) {
fprintf(stderr, "Failed to claim i2c device %d/%d/%s\n",
rc, errno, strerror(errno));
return EXIT_FAILURE;
}
if (argc >= 2)
out_file = argv[1];
out_fd = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (out_fd < 0) {
fprintf(stderr, "Failed to open out device %s %d/%d/%s\n",
out_file, rc, errno, strerror(errno));
return EXIT_FAILURE;
}
if (dump_eeprom(i2c_fd, out_fd) != 0) {
unlink(out_file);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

View File

@@ -1,45 +0,0 @@
#!/bin/sh
# this is a dispatcher script which will call the bts-model-specific
# script based on the bts model specified as command line argument
bts_model="$1"
if [ "x$bts_model" = "x" ]; then
echo "Error: You have to specify the BTS model as first argument, e.g. $0 sysmo"
exit 2
fi
if [ ! -d "./contrib" ]; then
echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
exit 1
fi
set -x -e
case "$bts_model" in
sysmo)
./contrib/jenkins_sysmobts.sh
;;
oct)
./contrib/jenkins_oct.sh
;;
lc15)
./contrib/jenkins_lc15.sh
;;
trx)
./contrib/jenkins_bts_trx.sh
;;
oct+trx)
./contrib/jenkins_oct_and_bts_trx.sh
;;
*)
set +x
echo "Unknown BTS model '$bts_model'"
;;
esac

View File

@@ -1,24 +0,0 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-trx
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
configure_flags="\
--with-osmo-pcu=$deps/osmo-pcu/include \
--enable-trx \
--enable-sanitize \
"
build_bts "osmo-bts-trx" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,47 +0,0 @@
#!/bin/sh
# this is a common helper script that is shared among all BTS model
# specific helper scripts like jenkins_sysmobts.sh. You shouldn't call
# this directly, but rather indirectly via the bts-specific scripts
if ! [ -x "$(command -v osmo-deps.sh)" ]; then
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
exit 2
fi
set -ex
base="$PWD"
deps="$base/deps"
inst="$deps/install"
export deps inst
osmo-clean-workspace.sh
mkdir -p "$deps"
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
# generic project build function, usage:
# build "PROJECT-NAME" "CONFIGURE OPTIONS"
build_bts() {
set +x
echo
echo
echo
echo " =============================== $1 ==============================="
echo
set -x
cd $deps
osmo-deps.sh libosmocore
cd $base
shift
conf_flags="$*"
autoreconf --install --force
./configure $conf_flags
$MAKE $PARALLEL_MAKE
$MAKE check || cat-testlogs.sh
DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh
}

View File

@@ -1,21 +0,0 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-lc15
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
configure_flags="--enable-sanitize --with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15"
build_bts "osmo-bts-lc15" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,21 +0,0 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-octphy
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="--enable-sanitize --with-octsdr-2g=$deps/layer1-headers/ --enable-octphy"
build_bts "osmo-bts-octphy" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,27 +0,0 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-octphy + osmo-bts-trx
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="\
--with-osmo-pcu=$deps/osmo-pcu/include \
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
--enable-trx \
"
build_bts "osmo-bts-octphy+trx" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,28 +0,0 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-sysmo
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION"
mkdir -p "$inst/include/sysmocom/femtobts"
ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
configure_flags="--enable-sanitize --enable-sysmocom-bts --with-sysmobts=$inst/include/"
# This will not work for the femtobts
if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
configure_flags="$configure_flags --enable-sysmobts-calib"
fi
build_bts "osmo-bts-sysmo" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,31 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: l1fwd
# Required-Start:
# Required-Stop: $local_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: Start screen session with l1fwd software
# Description:
### END INIT INFO
. /etc/default/rcS
case "$1" in
start)
/usr/bin/screen -d -m -c /etc/osmocom/screenrc-l1fwd
;;
stop)
echo "This script doesn't support stop"
exit 1
;;
restart|reload|force-reload)
exit 0
;;
show)
;;
*)
echo "Usage: sysmobts {start|stop|show|reload|restart}" >&2
exit 1
;;
esac

View File

@@ -1,29 +0,0 @@
[Unit]
Description=osmo-bts manager for LC15 / sysmoBTS 2100
After=lc15-sysdev-remap.service
Wants=lc15-sysdev-remap.service
[Service]
Type=simple
NotifyAccess=all
WatchdogSec=21780s
Restart=always
RestartSec=2
# Make sure directories and symbolic link exist
ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/lc15bts-mgr || mkdir -p /mnt/storage/var/run/lc15bts-mgr ; test -d /var/run/lc15bts-mgr || ln -sf /mnt/storage/var/run/lc15bts-mgr/ /var/run'
# Make sure BTS operation hour exist
ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/lc15bts-mgr/hours-running || echo 0 > /mnt/storage/var/run/lc15bts-mgr/hours-running'
# Shutdown all PA correctly
ExecStartPre=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state'
ExecStartPre=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts'
ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg
# Shutdown all PA correctly
ExecStopPost=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state'
ExecStopPost=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts'
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

View File

@@ -1,29 +0,0 @@
[Unit]
Description=osmo-bts manager for OC2G / sysmoBTS 2100
After=oc2g-sysdev-remap.service
Wants=oc2g-sysdev-remap.service
[Service]
Type=simple
NotifyAccess=all
WatchdogSec=21780s
Restart=always
RestartSec=2
# Make sure directories and symbolic link exist
ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/oc2gbts-mgr || mkdir -p /mnt/storage/var/run/oc2gbts-mgr ; test -d /var/run/oc2gbts-mgr || ln -sf /mnt/storage/var/run/oc2gbts-mgr/ /var/run'
# Make sure BTS operation hour exist
ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/oc2gbts-mgr/hours-running || echo 0 > /mnt/storage/var/run/oc2gbts-mgr/hours-running'
# Shutdown all PA correctly
ExecStartPre=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
#ExecStartPre=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
ExecStart=/usr/bin/oc2gbts-mgr -s -c /etc/osmocom/oc2gbts-mgr.cfg
# Shutdown all PA correctly
ExecStopPost=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
ExecStopPost=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

View File

@@ -1,21 +0,0 @@
[Unit]
Description=osmo-bts for LC15 / sysmoBTS 2100
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts.service

View File

@@ -1,21 +0,0 @@
[Unit]
Description=osmo-bts for LC15 / sysmoBTS 2100
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts.service

View File

@@ -1,21 +0,0 @@
[Unit]
Description=osmo-bts for sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=sysmobts.service
Alias=osmo-bts.service

View File

@@ -1,13 +0,0 @@
#!/bin/sh
PID=$$
echo "-1000" > /proc/$PID/oom_score_adj
trap "{ kill 0; kill -2 0; }" EXIT
while [ -f $1 ]; do
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
LAST_PID=$!
wait $LAST_PID
sleep 10s
done

View File

@@ -1,18 +0,0 @@
#!/bin/sh
PID=$$
echo "-1000" > /proc/$PID/oom_score_adj
trap "kill 0" EXIT
while [ -e /etc/passwd ]; do
cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0
sleep 2s
cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0
sleep 1s
echo "0" > /sys/class/leds/activity_led/brightness
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
LAST_PID=$!
wait $LAST_PID
sleep 10s
done

View File

@@ -1,3 +0,0 @@
chdir /tmp
screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/l1fwd-proxy
detach

View File

@@ -1,5 +0,0 @@
chdir /tmp
screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/osmo-bts-sysmo -c /etc/osmocom/osmo-bts.cfg -r 1 -M
screen -t PCU 1 /etc/osmocom/respawn-only.sh /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e
screen -t MGR 2 /etc/osmocom/respawn-only.sh /usr/bin/sysmobts-mgr -n -c /etc/osmocom/sysmobts-mgr.cfg
detach

View File

@@ -1,91 +0,0 @@
#!/usr/bin/gawk -f
# Usage example:
# tshark -2 -t r -E 'header=n' -E 'separator=,' -E 'quote=n' -T fields -e gsmtap.frame_nr -e gsmtap.ts -e gsmtap.arfcn -e _ws.col.Info -Y 'gsmtap' -r test.pcapng.gz | grep Information | env ARFCN=878 ./si_check.gawk
# read summary on number of bis/ter messages and adjust BT_BOTH and BT_NONE environment variables accordingly
BEGIN {
FS = ","
FAILED = 0
IGNORE = 0
BIS = 0
TER = 0
QUA = 0
BT_BOTH = ENVIRON["BOTH"]
BT_NONE = ENVIRON["NONE"]
TC_INDEX = 0
TC4[4] = 0
}
{ # expected .csv input as follows: gsmtap.frame_nr,gsmtap.ts,gsmtap.arfcn,_ws.col.Info
if ("ARFCN" in ENVIRON) { # ARFCN filtering is enabled
if (ENVIRON["ARFCN"] != $3) { # ignore other ARFCNs
IGNORE++
next
}
}
type = get_si_type($4)
tc = get_tc($1)
result = "FAIL"
if (1 == check_si_tc(tc, type)) { result = "OK" }
else { FAILED++ }
if (4 == tc) {
TC4[TC_INDEX] = type
TC_INDEX = int((TC_INDEX + 1) % 4)
if (0 == check_tc4c(type) && "OK" == result) {
result = "FAIL"
FAILED++
}
}
if (type == "2bis") { BIS++ }
if (type == "2ter") { TER++ }
if (type == "2quater") { QUA++ }
# for (i in TC4) print TC4[i] # debugging
printf "ARFCN=%d FN=%d TS=%d TC=%d TYPE=%s %s\n", $3, $1, $2, tc, type, result
}
END {
printf "check completed: total %d, failed %d, ignored %d, ok %d\nSI2bis = %d, SI2ter = %d, SI2quater = %d\n", NR, FAILED, IGNORE, NR - FAILED - IGNORE, BIS, TER, QUA
if ((BIS > 0 || TER > 0) && BT_NONE) { printf "please re-run with correct environment: unset 'NONE' variable\n" }
if ((BIS > 0 && TER > 0) && !BT_BOTH) { printf "please re-run with correct environment: set 'BOTH' variable\n" }
}
func get_si_type(s, x) { # we rely on format of Info column in wireshark output - if it's changed we're screwed
return x[split(s, x, " ")]
}
func get_tc(f) { # N. B: all numbers in awk are float
return int(int(f / 51) % 8)
}
func check_tc4c(si, count) { # check for "once in 4 consecutive occurrences" rule
count = 0
if ("2quater" != si || "2ter" != si) { return 1 } # rules is not applicable to other types
if (BT_NONE && "2quater" == si) { return 0 } # should be on TC=5 instead
if (!BT_BOTH && "2ter" == si) { return 0 } # should be on TC=5 instead
if (0 in TC4 && 1 in TC4 && 2 in TC4 && 3 in TC4) { # only check if we have 4 consecutive occurrences already
if (si == TC4[0]) { count++ }
if (si == TC4[1]) { count++ }
if (si == TC4[2]) { count++ }
if (si == TC4[3]) { count++ }
if (0 == count) { return 0 }
}
return 1
}
func check_si_tc(tc, si) { # check that SI scheduling on BCCH Norm is matching rules from 3GPP TS 05.02 § 6.3.1.3
switch (si) {
case "1": return (0 == tc) ? 1 : 0
case "2": return (1 == tc) ? 1 : 0
case "2bis": return (5 == tc) ? 1 : 0
case "13": return (4 == tc) ? 1 : 0
case "9": return (4 == tc) ? 1 : 0
case "2ter": if (BT_BOTH) { return (4 == tc) ? 1 : 0 } else { return (5 == tc) ? 1 : 0 }
case "2quater": if (BT_NONE) { return (5 == tc) ? 1 : 0 } else { return (4 == tc) ? 1 : 0 }
case "3": return (2 == tc || 6 == tc) ? 1 : 0
case "4": return (3 == tc || 7 == tc) ? 1 : 0
}
return 0
}

View File

@@ -1,110 +0,0 @@
#!/bin/sh
# Split common DSP call log file (produced by superfemto-compatible firmware) into 4 separate call leg files (MO/MT & DL/UL) with events in format "FN EVENT_TYPE":
# MO Mobile Originated
# MT Mobile Terminated
# DL DownLink (BTS -> L1)
# UL UpLink (L1 -> BTS)
if [ -z $1 ]; then
echo "expecting DSP log file name as parameter"
exit 1
fi
# MO handle appear 1st in the logs
MO=$(grep 'h=' $1 | head -n 1 | cut -f2 -d',' | cut -f2 -d= | cut -f1 -d']')
# direction markers:
DLST="_CodeBurst"
ULST="_DecodeAndIdentify"
# DL sed filters:
D_EMP='s/ Empty frame request!/EMPTY/i'
D_FAC='s/ Coding a FACCH\/. frame !!/FACCH/i'
D_FST='s/ Coding a RTP SID First frame !!/FIRST/i'
D_FS1='s/ Coding a SID First P1 frame !!/FIRST_P1/i'
D_FS2='s/ Coding a SID First P2 frame !!/FIRST_P2/i'
D_RP1='s/ Coding a RTP SID P1 frame !!/SID_P1/i'
D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/i'
D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/i'
D_ONS='s/ Coding a Onset frame !!/ONSET/i'
D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/i'
D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/i'
D_FP2='s/ A speech frame is following a NoData or SID_FIRST_P2 without an Onset./FORCED_F_P2/i'
D_FIN='s/ A speech frame is following a SID_FIRST without inhibit. A SID_FIRST_INH will be inserted./FORCED_F_INH/i'
D_UIN='s/ A speech frame is following a SID_UPDATE without inhibit. A SID_UPDATE_INH will be inserted./FORCED_U_INH/i'
# UL sed filters:
U_NOD='s/ It is a No Data frame !!/NODATA/i'
U_ONS='s/ It is an ONSET frame !!/ONSET/i'
U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/i'
U_FST='s/ It is a SID FIRST frame !!/FIRST/i'
U_FP1='s/ It is a SID-First P1 frame !!/FIRST_P1/i'
U_FP2='s/ It is a SID-First P2 frame !!/FIRST_P2/i'
U_SPE='s/ It is a SPEECH frame *!!/SPEECH/i'
U_UIN='s/ It is a SID update InH frame !!/UPD_INH/i'
U_FIN='s/ It is a SID-First InH frame !!/FST_INH/i'
U_RAT='s/ It is a RATSCCH data frame !!/RATSCCH/i'
DL () { # filter downlink-related entries
grep $DLST $1 > $1.DL.tmp
}
UL () { # uplink does not require special fix
grep $ULST $1 > $1.UL.tmp.fix
}
DL $1
UL $1
FIX() { # add MO/MT marker from preceding line to inserted ONSETs so filtering works as expected
cat $1.DL.tmp | awk 'BEGIN{ FS=" h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix
}
FIX $1
MO() { # filter MO call DL or UL logs
grep "h=$MO" $1.tmp.fix > $1.MO.raw
}
MT() { # filter MT call DL or UL logs
grep -v "h=$MO" $1.tmp.fix > $1.MT.raw
}
MO $1.DL
MT $1.DL
MO $1.UL
MT $1.UL
PREP() { # prepare logs for reformatting
cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/\[ u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1
}
PREP "$1.DL.MT"
PREP "$1.DL.MO"
PREP "$1.UL.MT"
PREP "$1.UL.MO"
RD() { # reformat DL logs for consistency checks
cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_FS1" | sed "$D_FS2" | sed "$D_UIN" | sed "$D_FIN" | sed "$D_UPD" | sed "$D_INH" | sed "$D_RP1" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" | sed "$D_FP2" > $1.tmp2
}
RU() { # reformat UL logs for consistency checks
cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_FP1" | sed "$U_FP2" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" | sed "$U_UIN" | sed "$U_FIN" | sed "$U_RAT" > $1.tmp2
}
RD "$1.DL.MT"
RD "$1.DL.MO"
RU "$1.UL.MT"
RU "$1.UL.MO"
SW() { # swap fields
cat $1.tmp2 | awk '{ print $2, $1 }' > $1
}
SW "$1.DL.MT"
SW "$1.DL.MO"
SW "$1.UL.MT"
SW "$1.UL.MO"
rm $1.*.tmp*

View File

@@ -1,12 +0,0 @@
[Unit]
Description=osmo-bts manager for sysmoBTS
[Service]
Type=simple
ExecStart=/usr/bin/sysmobts-mgr -ns -c /etc/osmocom/sysmobts-mgr.cfg
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

View File

@@ -1,29 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: sysmobts
# Required-Start:
# Required-Stop: $local_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: Start screen session with sysmobts software
# Description:
### END INIT INFO
case "$1" in
start)
/usr/bin/screen -d -m -c /etc/osmocom/screenrc-sysmobts -S sysmobts
;;
stop)
/usr/bin/screen -d -r sysmobts -X quit
exit 1
;;
restart|reload|force-reload)
exit 0
;;
show)
;;
*)
echo "Usage: sysmobts {start|stop|show|reload|restart}" >&2
exit 1
;;
esac

View File

@@ -1,20 +0,0 @@
[Unit]
Description=sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-sysmo.service

View File

@@ -1,755 +0,0 @@
osmo-bts (0.8.1) unstable; urgency=medium
[ Neels Hofmeyr ]
* cosmetic: dyn TS: clarify rsl_tx_rf_rel_ack() with a switch
* dyn TS: fix TCH/F_TCH/H_PDCH: properly record release of PDCH TS
* dyn TS: rx_rf_chan_rel: properly mark PDCH rel when no PCU, clarify
* dyn TS: clear TCH state upon reconnecting as PDCH
* cosmetic: dyn TS: clarify chan_nr composition
* ignore RSL RF CHAN REL for inactive lchans
* fix RSL Chan Activ Nack messages
* ip.access dyn ts: properly NACK a PDCH ACT on a still active lchan
* add/improve various logging around dyn ts
* dyn TS: be less strict on chan_nr, to allow arbitrary pchan switches
[ Stefan Sperling ]
* send a State Changed Event Report when rf is locked/unlocked
[ Harald Welte ]
* rsl: log errors when parsing of encryption information fails
* rsl: Make channel activation fail if encryption algorithm not supported
* rsl: Properly NACK CHAN_ACKT / MODE_MODIFY
* rsl: If CHAN ACT or MODE MODIF fails, send respective NACK
* osmo-bts-trx: Enable A5/3 cipher support
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 15 May 2018 14:08:47 +0200
osmo-bts (0.8.0) unstable; urgency=medium
[ Neels Hofmeyr ]
* vty: skip installing cmds now always installed by default
* jenkins_common.sh: fix build_bts distcheck for more than one conf_flag
* fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR)
* fix handover: handle_ph_ra_ind(): evaluate ra_ind before msgb_trim()
* implement support for 3-digit MNC with leading zeros
* configure: add --enable-werror
* use osmo_init_logging2() with proper talloc ctx
[ Pau Espin Pedrol ]
* lc15: Fix cfg indentation
* l1sap: Fix abort on big RTP packet received
* bts-trx: trx_ctrl_cmd: Simplify var assignment logic
* bts-trx: Avoid enqueueing consecutive duplicate messages to TRX
* Fix malformed Resource Indication packet
* debian/control: Remove uneeded dep libosmo-netif-dev
* jenkins.sh: Disable building doxygen for deps
* oml.c: Fix use of htons instead of ntohs
* bts-trx: trx_if.c: Log timedout+retransmitted CMD
* bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func
* bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX
* bts-trx: Detect duplicated responses for retransmitted commands
* gsm_pchan2chan_nr: move warning to pragma message and track issue
* Remove unused variables
* bts-trx: scheduler_trx.c: Fix missing header
* l1sap.c: l1sap_tch_rts_ind: Remove unused variables
* octphy: octpkt.c: Remove unused static functions
* vty.c: Remove warning message
* virtual: l1_if.c: Remove unneeded warning message
* main.c: bts_main: fix typo in error message
* l1sap: Validate incoming RTP payload, drop bw-efficient AMR
* l1sap: Avoid assumption that l1sap is at head of msgb
* contrib: jenkins_bts_model: Fix bashism expr
* Include missing headers for osmo_init_logging2
* common/sysinfo.c: Fix no return on on-void function
* gsm_data_shared.h: Remove unused enum gsm_paging_event
* scheduler_trx: Fix signed integer overflow in clock calculations
[ Harald Welte ]
* trx: Better be safe than sorry before calling strlen
* trx: Avoid NULL+1 dereference in trx_ctrl_read_cb()
* trx: Don't call osmo_fr_check_sid with negative 'rc'
* trx: Don't assume phy_instance_by_num() returns non-NULL
* l1sap: fix wrong return value of is_fill_frame()
* measurement.c: Fix various typos in comments
* Comments on individual members of struct gsm_abis_mo
* scheduler: Harmonize log line format; Always print TS name + decoded FN
* scheduler_trx: L1P is for PH (data), L1M for MPH (control)
* l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH
* measurment.c: Introduce INFO category for DMEAS logging
* osmo-bts-octphy: Remove bogus warning about BS_AG_BLKS_RES
* rsl.c: Log RTP socket related errors as DRTP, not DRSL
* Put useful information in RTCP SDES.
* osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS
* DTX: avoid illegal character contained in DTX FSM allocation which causes BTS crash
* gsm_lchan: remove unused member fields
* Add 'show (bts|trx|ts|lchan)' commands
* Print much more information during 'show lchan'
* vty: don't print "Bound IP / Port" if it isn't bound [yet]
* osmo-bts: Add talloc context introspection via VTY
* sysmo: Fix compiler warnings in eeprom.c
* sysmo+lc15: Add missign include for readv/writev
* trx: make l1if_fill_meas_res() static
* RSL: Properly reject RSL CHAN_NR IE for incompatible PCHAN
* RSL: Ensure we don't accept DCHAN messages for CCHAN
* osmo-bts-virtual: Shut down gracefully on socket creation failure
* osmo-bts-virtual: Generate PRIM_INFO_MEAS (with bogus values)
* Introduce + use LOG/DEBUGP with frame number prefixing/printing
* osmo-bts-virtual: Make use of LOGL1S() macro for context
* osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number
* scheduler.c: Factor out find_sched_mframe_idx() function
* scheduler: add trx_sched_is_sacch_fn() function
* Revert "measurement: fix measurement computation"
* measurement.c: Hand Frame Number into measurement computation
* l1sap: Pass is_sub from L1 primitive into the Uplink Measurement
* osmo-bts-trx: Add missing frame number to l1if_process_meas_res()
* scheduler.c: Print message when burst substitution happens
* load_indication: Fix start of load indication timer
* RSL: Implement DELETE INDICATION on AGCH overflow
* RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator
* BTS: add rate_ctr about CCCH (paging, agch, pch)
* paging: Drop + Log paging requests for non-existant paging groups
* paging.c: Fix encoding of optional Mobile ID RR PAGING TYPE 1 / 2
* rsl: Improve ERROR REPORTing
* paging: Fix encoding of PAGING TYPE 3 Rest Octets
* RSL IPA DLCX: Avoid null-pointer dereference
* RSL: Fix encoding of ConnectionID in IPA_DLCX_ACK
* RSL IPA DLCX: Avoid another null-pointer dereference
* measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_fn102
* counters: split rach:sent into rach:drop, rach:ho, rach:cs and rach:ps
* octphy: Remove code duplication for BER / RSSI conversion
* {sysmo,lc15}: Correctly report BER to L1SAP in INFO_MEAS_IND
* {sysmo,lc15}: Fix RACH reporting in combined CBCH case
* split scheduler_mframe.c from scheduler.c
* measurement: Compute RX{LEV,QUAL}-SUB for SDCCH and non-AMR TCH
* measurement.c: Don't silently copy "FULL" measurements to "SUB"
* scheduler: Add missing \n at end of LOG statement
* Move rach_busy counting above L1SAP
* RACH decoding: Use BER threshold for RACH ghost detection
* trx/scheduler: Use integer math for TOA (Timing of Arrival)
* measurement.c: higher-precision TA/TOA math
* L1SAP: Increase resolution of reported burst timing
* measurement: Keep average of high-accurate ToA value in lchan
* Add high-accuracy ToA value to Uplink Measurement Reports
* pcu_sock: Discard messages that are too short
* pcu_sock: Don't overflow the timeslot array
* pcu_sock: Log an error message and discard PCU primitives for BTS != 0
* pcu_sock: LOG + drop DATA.req from PCU for non-PDCH timeslot
* pcu_sock: LOG + drop PCU DATA.req for inactive lchan
* sysinfo.c: SI1 is optional; Send SI2 at TC=0 if no SI1 exists
* sysmobts: Compatibility with older firmware versions
* cosmetic: Document some SI scheduling related function API
* sysinfo: Fix scheduling of downlink SACCH information
* gsm_data_shared: Remove unused definitions/members/functions
* cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
* Get rid of 'struct gsm_bts_role_bts'
* virtual: Correctly set+report BTS variant in OML attributes
* Add 'osmo-bts-omldummy' to bring up only OML without RSL
* fix inverted logic bug in omldummy patch
* omldummy: Suppress RSL transmission errors
* debian: Split osmo-bts-virtual from osmo-bts-trx
* fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH
* rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element
* fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H
[ Philipp Maier ]
* octphy: override firmware version check
* cosmetic: meas_test: fix section comment
* cosmetic: tests/Makefile.am: remove excess whitespace
* cosmetic: tests/power: remove unused var "ret"
* cosmetic: tests/agch: remove unused var "static_ilv"
* octphy: l1_oml: check returncode of trx_by_l1h()
* meas_test: fix header file references
* rsl: fix double-free in rsl_rx_mode_modif()
* fix nullpointer deref in rsl_tx_mode_modif_nack()
* rsl: do not allow MODE MODIFY request with unsupp. codec/rate
* gsm_data_shared: extend bts feature list with speech codecs
* octphy: ensure all BTS models set features
* vty: display bts features in vty command show bts
* bts: use feature list instead of speech codec table
* octphy: replace #warning with #pragma message
* ipac: fix log output
* rsl: remove unused variable
* l1_tch: remove dead code
* cosmetic: remove dead code
* cosmetic: remove unused variable
* cosmetic: remove unused variable in osmo-bts-omldummy/main.c
* octphy: integrate octasics latest header release
* osmo-bts-trx: perform error concealment for FR frames
[ Max ]
* Remove leftover comments and checks
* Log filenames on L1 errors
* Add --enable-sanitize configure option
* Use existing function to obtain TSC
* Remove BSC-specific parts
* Print FN delta on L1 errors
* Move sysmobts-calib into osmo-bts-sysmo
* Allow specifying sysmocom headers explicitly
* fix build: tests/misc: missing libosmo-abis and -trau flags
* Enable optional static builds
* Remove unneeded LIBOSMOCORE_CFLAGS from tests
* sysmobts: use proper includes for sbts2050 test
* Move -I inside *INCDIR variable
* sysmobts: remove weird default header location
* sysmobts: move header check to appropriate place
* CI: drop unused OsmoPCU dependency
* Enable sanitize for CI tests
* Add helper to get BCC from BSIC
* osmo-bts-trx: init nbits to know value
* osmo-bts-trx: ignore frame offset error on startup
[ Vadim Yanitskiy ]
* doc/examples: add CalypsoBTS configuration example
* common/pcu_sock.c: fix double field assignment
* scheduler_trx.c: remove ToA (Time of Arrival) hack
* common/l1sap.c: increase the BTS_CTR_RACH_DROP in RACH BER check
* common/l1sap.c: increment valid RACH counter after all checks
* common/l1sap.c: clean up noise / ghost RACH filtering
* common/l1sap.c: perform noise / ghost filtering for handover RACH
* common/l1sap.c: limit the minimal ToA for RACH bursts
* common/vty.c: remove unused variables
* common/main.c: track talloc NULL contexts by default
[ Alexander Huemer ]
* cosmetic: Makefile.am whitespace
* various Makefile.am: add missing CFLAGS
* gitignore: add missing entries
[ Stefan Sperling ]
* Cosmetic fixes for power ramping code.
* respond with NACK for non-hopping BTS with multiple ARFCN
* cosmetic: fix typos in src/common/oml.c
* return NACK codes instead of errno values from oml_tx_attr_resp()
[ Alexander Couzens ]
* pcuif_proto: correct indention of gsm_pcu_if_data
* pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.h
* pcuif_proto: add version 8 features
[ Keith ]
* osmo-bts-sysmo eeprom.c Restore ability to read/write EEPROM
-- Pau Espin Pedrol <pespin@sysmocom.de> Thu, 03 May 2018 17:02:19 +0200
osmo-bts (0.7.0) unstable; urgency=medium
[ Max ]
* Use value string check from osmo-ci
* Support sending SI13 to PCU
* Support removing SI13 from PCU
* trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT
* Check readv() return value to prevent crash
* OML: print actual type of report sent to BSC
* Replace dead code
* vty: print version and description for each phy
* Remove build dependency on legacy OpenBSC
* Fix multiple SI2q reception
* jenkins: remove openbsc dependency
* sysmo: use clock calibration source wrapper
* sysmo: don't override clock source with defaults
* Fix race condition in attribute reporting
* Move power loop to generic tests
* Make power test more verbose
[ Neels Hofmeyr ]
* vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE
* osmo-bts-trx: vty: various fixes of 'write file' and doc
* jenkins: use osmo-clean-workspace.sh before and after build
[ Pau Espin Pedrol ]
* l1sap: Improve log msg when frame diff >1
* vty: Print string for Administrative state
[ Harald Welte ]
* Fix Downlink AMR FSM name to avoid illegal space character
* update dependencies to latest libosmo-*
* configure.ac: Fix Mailing list address
-- Harald Welte <laforge@gnumonks.org> Sat, 28 Oct 2017 20:53:21 +0200
osmo-bts (0.6.0) unstable; urgency=medium
[ Holger Hans Peter Freyther ]
* Initial release.
* misc: Ignore files generated by a debian packaging build
* jenkins: Add the build script from jenkins here
* jenkins: Add the build script from jenkins here
* sysmobts: Add the barebox boot state reservation
* sysmobts: Fix eeprom padding before gpg key
* ci/spatch: Remove the "static" analysis handling
* oct: Attempt to enable the Octphy for the osmo-bts-oct build
* debian: Use the header files installed by openbsc-dev
* build: Do not require more headers from OpenBSC
* sysmobts: Make reservation for mode/netmask/ip and suc
* sysmobts: Store a simple network config in the EEPROM as well
[ Max ]
* Ensure TRX invariant
* Use libosmocore function for uplink measurements
* Fix debug output
* Fix RTP timestamps in case of DTX
* Add DTXd support for sysmoBTS and LC15
* Use libosmocodec for AMR RTP
* octphy: Use the app. info. defaults as base
* Fix debug output
* DTXd: store/repeat last SID
* DTXd: store/repeat last SID
* DTXu: mark beginning of speech burst in RTP
* Fix OML activation
* TRX: Add vty command to power on/off transceiver
* TRX: add configuration example
* Add .gitreview
* DTX: add support for AMR/HR
* Move copy-pasted code into common part
* Use libosmocodec functions for AMR
* Use error values instead of number for RSL error
* Clarify logging message
* Make get_lchan_by_chan_nr globally available
* DTXu: move copy-pasted code to common part
* Remove duplicated nibble shift code
* TRX: add Uplink DTX support for FR/HR
* Mark array as static const
* sysmobts: dump PRACH and PTCCH parameters
* Activate PTCCH UL
* Fix dsp tracing at phy config
* octphy: fix build
* Fill measurements data for L1SAP
* sysmo: ts_connect: log channel combination name instead of number
* DTX: fix last SID saving
* DTX: fix SID repeat scheduling
* DTX: fix SID logic
* lc15, sysmo: Use SID_FIRST_P1 to initiate DTX
* DTX: check Marker bit to send ONSET to L1
* DTX: remove misleading comment
* LC15: Clarify msgb ownership / fix memory leaks
* DTX: move scheduling check inside repeat_last_sid
* DTX: further AMR SID cache fixes (lc15, sysmo)
* DTX: move ONSET detection into separate function
* DTX: send AMR voice alongside with ONSET
* DTX: fix conversion from fn to ms
* Move copy-pasted array into shared header
* DTX DL: use FSM for AMR
* TRX: fix building with latest DTX changes
* DTX: fix array size calculation
* DTX AMR - fix buffer length check
* Replace magic number with define
* Fix lc15 build
* Extend RTP RX callback parameters
* DTX HR - fix array size calculation
* Fix DTX DL AMR SIDscheduling logic
* Add tools to check DTX operation
* DTX DL: split ONSET state handling
* Remove obsolete define
* DTX DL: add AMR HR support to scheduling check
* DTX fix ONSET handling
* dtx_check.gawk: Fix false-positives in DTX check
* Fix tests linking with libosmocodec
* DTX DL: tighten check for enabled operation
* DTX: wrap FSM signal dispatching
* Add libosmocodec for octphy build
* dtx_check.gawk: add check for repetitive SID FIRST
* Remove duplicated code
* Replace link_id constant with define
* DTX DL AMR: rewrite FSM recursion
* Remove duplicated code
* Fix AGCH/PCH proportional allocation
* TRX: prevent segfault upon phy init
* DTX: add explicit check if DTX enabled
* Save RTP metadata in Control Buffer
* osmo-bts-trx: fix lchan deactivation
* DTX: fix TS adjustment for ONSET
* Optionally use adaptive RTP jitter buffering
* Integrate Debian packaging changes
* DTX AMR HR: fix inhibition
* Add copyright for .deb packages
* Move code to libosmocore
* Log socket path on error
* Add Abis OML failure event reporting
* Alarm on various errors
* Remove obsolete define TLVP_PRES_LEN
* scheduler: log lchan on which prim error occured
* deb: use gsm_data_shared.* from openbsc-dev
* OML: internalize failure reporting
* Add ctrl command to send OML alert
* Fix typo in TCH/H interleaving table
* Use oml-alert CTRL command for temp report
* Remove code duplication
* Handle ctrl cmd allocation failures
* Check for suitable lchan type when detecting HO
* osmo-bts-trx: fix scheduling of broken frames
* Sync protocol with OsmoPCU
* vty: reduce code duplication
* Handle TXT indication from OsmoPCU
* Add MS TO to RSL measurements
* Signal to BSC when PCU disconnects
* Prepare for extended SI2quater support
* Set BTS variant while initializing BTS model
* Prepare for BTS attribute reporting via OML
* osmo-bts-trx: use libosmocoding
* Remove redundant test
* Implement basic Get Attribute responder
* Add version to phy_instance
* OML: fix Coverity-reported issues
* Re-add version to phy_instance
* Use systemd template specifiers
* Place *-mgr config examples according to BTS model
* lc15: add example systemd service file
* Extend Get Attribute responder
* Set and report BTS features
* Cleanup SI scheduling
* RSL: receive and send multiple SI2q messages
* RSL: check for abnormal SI2q values
* lc15bts-mgr: use extended config file example
* Move parameter file opening into separate function
* Move common steps into common jenkins helper
* lc15: add jenkins helper
* Use generic L1 headers helper
* Copy sysmobts.service to osmo-bts-sysmo
* OML: move BTS number check into separate function
* lc15: make jenkins helper executable
* lc15: fix jenkins build
* Add missing include for abis.h header file
* RSL: receive and send multiple SI2q messages
* Use release helper from libosmocore
* si2q: do not consider count update as error
* Cleanup example config files
* Fix .deb build
* Unify *.service files
* lc15: cleanup board parameters reading
* lc15-mgr: update parameter read/write
* lc15: fix BTS revision and hw options
* lc15: make default config usable
* lc15: port lc15bts-mgr changes
* lc15bts-mgr: separate service file
* lc15: port lc15bts-mgr dependency changes
* Simplify jenkins build scripts
* OML: use fom_hdr while handling attr. request
* osmo-bts-trx: fix 'osmotrx legacy-setbsic'
* osmo-bts-trx: remove global variables from loops
[ Daniel Laszlo Sitzer ]
* octphy: Update outdated config param name in error message.
[ Jason DSouza ]
* Close TRX session before opening new one
[ Minh-Quang Nguyen ]
* l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6
* common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703)
* LC15: Bring back DSP trace argument
* LC15: Hardware changes
* LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration
* rsl: Fix dropping of LAPDm UA message.
* LC15: properly handle BS-AG-BLKS-RES as received from BSC
[ Neels Hofmeyr ]
* sysmo: add L3 handle to l1prim messages
* pcu_sock: add pcu_connected() to query PCU availability
* tests/stubs.c: remove unused stubs
* fix typo in error message ('at lEast')
* oml, Set Chan Attr: treat unknown PCHAN types as error
* dyn PDCH: rsl rx dchan: also log ip.access message names
* doc: add ladder diagram on dynamic PDCH, add msc-README
* add missing DSUM entry to bts_log_info_cat
* fix compiler warning: printf format for sizeof()
* fix compiler warning: add missing case (PHY_LINK_CONNECTING)
* fix two compiler warnings: add two opaque struct declarations
* dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
* dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH
* dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode
* dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
* dyn PDCH: implement main dyn PDCH logic in common/
* dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts
* dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F
* dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*()
* error log: two minor clarifications
* debug log: log lchan state transitions
* debug log: log TS pchan type on connect
* fix lc15 build: put src/common/libbts.a left of -losmogsm
* lc15: add L3 handle to l1prim messages
* dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
* dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts
* dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F
* dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*()
* dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected()
* vty: install orphaned trx nominal power command
* fix compiler warnings: include bts_model.h in phy_link.c
* fix compiler warning: remove useless 'static' storage class for struct decl
* fix compiler warning: remove unused variable 'i' in calib_verify()
* log: osmo-bts-trx: change access burst logs to DEBUG level
* log: osmo-bts-trx: change PDTCH block logs to DEBUG level
* osmo-bts-trx: init OML only once by sending AVSTATE_OK with OPSTATE_ENABLED
* doc: move dyn_pdch.msc to osmo-gsm-manuals.git
* error log: rsl.c: typo x2
* info log: l1sap.c: add '0x' to hex output
* fix compiler warning: msg_utils.c: fn_chk() constify arg
* fix compiler warning: msg_utils.c: fn_chk() constify arg
* info log: l1sap.c: add '0x' to hex output
* error log: rsl.c: typo x2
* dyn PDCH: code dup: use conf_lchans_as_pchan()
* prepare dyn TS: split/replace conf_lchans_for_pchan()
* code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts
* dyn TS: common TCH/F_TCH/H_PDCH implementation
* sysmo/oml.c: rename ts_connect() to ts_opstart()
* dyn TS: implement SysmoBTS specifics
* lc15/oml.c: rename ts_connect() to ts_opstart()
* dyn TS: implement litecell15 specifics
* comment typo: common/l1sap.c
* log typo: trx_sched_set_pchan()
* dyn TS: sysmo,lc15: chan_nr_by_sapi(): add missing assertion
* fix comment in common/l1sap.c, function name changed
* dyn TS, dyn PDCH: common/l1sap.c: properly notice PDCH
* dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts()
* dyn PDCH: complete for trx: implement bts_model_ts_[dis]connect()
* dyn PDCH: trx l1_if.c: drop fixme, add comment
* dyn TS: complete for TRX
* dyn TS: measurement.c: replace fixme with comment
* sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH
* sysmo: fix dyn TS: Revert "Activate PTCCH UL" [in sysmobts]
* log: l1sap: add 0x to hex output of chan_nr, 5 times
* dyn TS: measurement: use correct nr of subslots, rm code dup
* dyn TS: sysmo,lc15: ph_data_req: fix PDCH mode detection
* Fix ip.access style dyn PDCH, broken in 37af36e85eca546595081246aec010fa7f6fd0be
* common/rsl: move decision whether to chan act ack/nack to common function
* octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp"
* octphy: fix build: Revert "octphy: add support for multiple trx ids"
* octphy: fix build with OCTSDR-OPENBSC-02.07.00-B708: name changed
* dyn TS: if PCU is not connected, allow operation as TCH
* log: sysmo,lc15: tweak log about sapi_cmds queue
* log causing rx event for lchan_lookup errors
* heed VTY 'line vty'/'bind' command
* sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vty
* build: be robust against install-sh files above the root dir
* configure: check for pkg-config presence
* jenkins.sh: use osmo-build-dep.sh, log test failures
* msgb ctx: use new msgb_talloc_ctx_init() in various main()s
* jenkins-oct.sh: fix build: typo in deps path
* fix 'osmo-bts-* --version' segfault
* osmo-bts-trx: remove obsolete include of netif/rtp.h
* add jenkins_bts_trx.sh
* add jenkins_oct_and_bts_trx.sh
* jenkins: add jenkins_bts_model.sh
* bursts test: test_pdtch: pre-init result mem
* fix: dyn ts: uplink measurement report
* fix missing ~ in bit logic for lchan->si.valid in rsl_rx_sacch_inf_mod()
* SACCH: fix sending of SI with an enum value > 7
* SACCH SI: assert that SI enum vals fit in bit mask
* all models: fix vty write: bts_model_config_write_phy
* jenkins: add value_string termination check
* Revert "Add version to phy_instance"
* Revert "RSL: check for abnormal SI2q values"
* Revert "RSL: receive and send multiple SI2q messages"
[ Harald Welte ]
* sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts
* Add .mailmap for mapping mail addresses in shortlog
* vty: Ensure to not use negative (error) sapi value
* sysmobts: Add correct nominal transmit power for sysmoBTS 1020
* sysmobts_eeprom.h: Fix/extend model number definitions
* Revert "sysmobts: Add correct nominal transmit power for sysmoBTS 1020"
* tx_power: Change PA calibration tables to use delta vales
* Add new unit-test for transmit power computation code
* sysmobts: fully support trx_power_params
* README: Add general project information and convert to markdown
* README: update some of the limitations
* sysmobts: Don't start with 0dBm TRX output power before ramping
* Remove unusued left-over gsm0503_conv.c
* scheduler_trx.c: Avoid code duplication for BER10k computation
* scheduler_trx: Avoid copy+pasting determining CMR from FN
* rx_tchh_fn(): Avoid copy+pasting formula to determine odd-ness of fn
* Consistently check for minimum attribute/TLV length in RSL and OML
* l1sap.c: Add spec reference to link timeout implementation
* osmo-bts-trx: Remove duplicate parsing of NM_ATT_CONN_FAIL_CRIT
* vty: Remove command for manual channel activation/deactivation
* l1_if: Add inline functions to check dsp/fgpa version at runtime
* sysmobts: Re-order the bit-endianness of every HR codec parameter
* OML Add osmocom-specific way to deactivate radio link timeout
* measurement: Remove dead code
* l1sap.c: Factor out function to limit message queue
* osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C
* l1sap: if lchan is in loopback, don't accept incoming RTP
* TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer (Closes: #2325)
* Add loopback support for PDTCH
* TRX: trx_if: Improve code description / comments
* trx_if: Improve error handling
* TRX: Rename trx_if_data() -> trx_if_send_burst()
* TRX: merge/simplify l1_if and trx_if code
* TRX: don't free l1h in trx_phy_inst_close()
* l1sap: Don't enqueue PTCCH blocks for loopback
* TRX: permit transmission of all-zero loopback frames
* jenkins helpers: some minimal documentation/comments + print errors
* VIRT-PHY: Initial check-in of a new virtual BTS
* VIRT-PHY: Fix handling of default values for vty configuration
* VIRT-PHY: Use IPv4 multicast groups for private / local scope
* VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0
* Ensure we don't send dummy UI frames on BCCH for TC=5
* virt: Don't print NOTICE log message if ARFCN doesn't match
* VIRT-PHY: Report virtual RACH bursts with plausible burst type
* scheduler: Fix wrong log subsystem: L1C is L1 *control* not user data
* VIRT-PHY: Print NOTICE log message from unimplemented stubs
* TRX / VIRT-PHY: Make check for BCCH/CCCH more specific
* L1SAP: Print chan_nr and link_id always as hex
* VIRT-BTS: Support for GPRS
* L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
* GSMTAP: Don't log fill frames via GSMTAP
* TRX: Remove bogus extern global variable declarations
* l1sap/osmo-bts-sysmo: Improve logging
* TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link
* Fix build after recent gsm_bts_alloc() change
* Treat SIGTERM just like SIGINT in our programs
[ Tom Tsou ]
* trx: Add EGPRS tables, sequences, and mappings
* trx: Add EGPRS coding and decoding procedures
* trx: Enable EGPRS handling through burst lengths
* trx: Fix coverity BER calculation NULL dereference
[ Vadim Yanitskiy ]
* pcu_sock: use osmo_sock_unix_init() from libosmocore
* osmo-bts-trx/l1_if.c: use channel combination III for TCH/H
* scheduler_trx.c: strip unused variable
[ Mike McTernan ]
* osmo-bts-trx: Fix PCS1900 operation
* osmo-bts-trx: log decoder bit errors as DEBUG, not NOTICE
[ bhargava ]
* Change interface in osmo-bts for 11 bit RACH
* Update parameters in osmo-bts-sysmo for 11bit RACH
* 11bit RACH support for osmo-bts-litecell15
* Initialize parameters in osmo-trx for 11bit RACH
[ Philipp ]
* octphy: Fixing missing payload type in ph. chan. activation
* octphy: Fixing band selection for ARFCN 0
* octphy: reintroducing multi-trx support
* octopy: fixing renamed constant
* octphy: prevent mismatch between dsp-firmware and octphy headers
* rsl: improving the log output
* octphy: multi-trx support: fix AC_CHECK order
* RSL: drop obsolete NULL check
* RSL: add assertions to check args of public API
* OML: fix possible segfault: add NULL check in oml_ipa_set_attr()
* CTRL: make the CTRL-Interface IP address configurable
* l1sap: Fix expired rach slot counting
* l1sap: fix missing 'else's causing wrong rach frame expiry counts
* octphy: set tx attenuation via VTY
* octphy: Improve OML ADM state handling
[ Yves Godin ]
* DTX: fix 1st RTP packet drop
[ Alexander Chemeris ]
* l1sap: Fix use-after-free in loopback mode.
* vty: Add commands to manually activate/deactivate a channel.
* trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.
* rsl: Output RTP stats before closing the socket.
* osmo-bts-trx: Fix MS power control loop.
* osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.
* osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB.
* Fix static build of osmo-bts-trx and osmo-bts-virtual.
[ Jean-Francois Dionne ]
* DTX: don't always perform AMR HR specific check
* DTX: fix SID-FIRST detection
* lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind()
* sysmo,lc15: fix memory leak at each call placed
* DTX: fix "unexpected burst" error
* Fix AMR HR DTX FSM logic.
* Fix SACCH channel release indication not sent to BSC after location update.
* Fix RTP duration adjustment not done when speech resumes in DTX mode.
[ Ruben Undheim ]
* Fix some spelling errors
[ Holger Freyther ]
* Revert "deb: use gsm_data_shared.* from openbsc-dev"
[ Philipp Maier ]
* octphy VTY: fix vty write output for octphy's phy section
* octphy: Fix VTY commands
* l1sap: fix rach reason (ra) parsing
* l1sap: fix PTCCH detection
* octphy: fix usage of wrong define constant
* octphy: add CBCH support
* l1sap: improve log output
* octphy: print log message for multi-trx support
* octphy: display hint in case of wrongly configured transceiver number
* octphy: add conditional compilation to support latest octasic header release
* octphy: set tx/rx antenne IDs via VTY
* bts: revert trx shutdown order
* octphy: activate CBCH after all physical channels are activated
* octphy: align frame number for new firmware versions
* octphy: ensure that 11 bit rach flag is not set
* measurement: fix measurement reporting period
* measurement: make lchan_meas_check_compute() available to l1sap.c
* measurement: Compute measurement results on measurement idication
* measurement: exclude idle channels from uplink measurement
* octphy: integrate channel measurement handling
* octphy: remove old event control code
* osmo-bts-sysmo: Include frame number in MEAS IND
* measurement: fix measurement computation
* octphy: fix segfault
* Revert "measurement: exclude idle channels from uplink measurement"
* sysmobts: normalize frame number in measurement indication
* measurement: Improve log output
* measurement: improve log output
* octphy: improve log output
* octphy: initalize l1msg and only when needed
* octphy: initalize nmsg only when needed
* octphy: remove log output
* Revert "sysmobts: normalize frame number in measurement indication"
* osmo-bts-trx: fix missing frame number in MEAS IND
* osmo-bts-litecell15: Fix missing frame number in MEAS IND
* Revert "osmo-bts-sysmo: Include frame number in MEAS IND"
* octphy: complete value strings (octphy_cid_vals)
* octphy: do not send empty frames to phy
* osmo-bts-sysmo: Include frame number in MEAS IND
* measurement: fix measurment report
* octphy: remap frame number in MEAS_IND
* octphy: implement support for dynamic timeslots
[ Ivan Klyuchnikov ]
* osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx
* osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file
* osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis connection closure
* osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss from osmo-trx
[ Ivan Kluchnikov ]
* oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa
[ Pau Espin Pedrol ]
* phy_link: Fix typo in state being printed
* trx: Allow BTS and TRX to be on different IPs
* trx: Save osmotrx base-port vty properties
* sysmo/tch.c: Clean up use of empty buffer
* litecell15/tch.c: Clean up use of empty buffer
* Use L1P instead of L1C for TCH logging and allocation
* Fix annoying trailing whitespace
* sysmo, litecell15: Make sure all TCH events are triggered
* sysmo: Remove non longer valid -p option from help
* Allow passing low link quality buffers to upper layers
* l1sap.c: Avoid sending RTP frame with empty payload
* l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION
* Move dump_gsmtime to libosmocore as osmo_dump_gsmtime
* Use osmo_dump_gsmtime to log fn across different layers
* lc15bts-mgr.cfg: Set default vswr to a value inside valid range
* litecell15: Register in vty limits for paX_pwr
* lc15: Tweak led colors used in service file
* lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi
* lc15bts-mgr.service: Prepare dirs and sysctls for the process
* osmo-bts-trx: Enable osmotrx tx-attenuation oml by default
* osmo-bts-trx: Relax validation to allow TRX data bursts without padding
[ Sebastian Stumpf ]
* VIRT-PHY: Added example configurations for openbsc and osmobts.
* VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0.
* VIRT-PHY: Added test option for fast hyperframe repeat.
-- Max <msuraev@sysmocom.de> Fri, 25 Aug 2017 15:16:56 +0200
osmo-bts (0.5.0) unstable; urgency=medium
* Initial release.
-- Holger Hans Peter Freyther <holger@moiji-mobile.com> Fri, 01 Apr 2016 16:13:40 +0200

View File

@@ -1,41 +0,0 @@
Source: osmo-bts
Maintainer: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Section: net
Priority: optional
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
dh-systemd (>= 1.5),
autotools-dev,
pkg-config,
libosmocore-dev,
libosmo-abis-dev,
libgps-dev,
libortp-dev,
txt2man
Standards-Version: 3.9.8
Vcs-Browser: http://git.osmocom.org/osmo-bts/
Vcs-Git: git://git.osmocom.org/osmo-bts
Homepage: https://projects.osmocom.org/projects/osmobts
Package: osmo-bts-trx
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: osmo-bts-trx GSM BTS with osmo-trx
osmo-bts-trx to be used with the osmo-trx application
Package: osmo-bts-trx-dbg
Architecture: any
Section: debug
Priority: extra
Depends: osmo-bts-trx (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the osmo-bts-trx
Make debugging possible
Package: osmo-bts-virtual
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP)
This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but
utilizes GSMTAP-over-UDP frames for the Um interface. This is useful
in fully virtualized setups e.g. in combination with OsmocomBB virt_phy.

View File

@@ -1,81 +0,0 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: osmo-bts
Source: http://cgit.osmocom.org/osmo-bts/
Files: *
Copyright: 2008-2014 Harald Welte <laforge@gnumonks.org>
2009,2011,2013 Andreas Eversberg <jolly@eversberg.eu>
2010,2011 On-Waves
2012-2015 Holger Hans Peter Freyther
2014 sysmocom s.f.m.c. Gmbh
2015 Alexander Chemeris <Alexander.Chemeris@fairwaves.co>
License: AGPL-3+
Files: src/osmo-bts-sysmo/eeprom.c
src/osmo-bts-sysmo/eeprom.h
Copyright: 2012 Nutaq
License: MIT
Comment: Yves Godin is the author
Files: src/common/pcu_sock.c
Copyright: 2008-2010 Harald Welte <laforge@gnumonks.org>
2009-2012 Andreas Eversberg <jolly@eversberg.eu>
2012 Holger Hans Peter Freyther
License: GPL-2+
Files: debian/*
Copyright: 2015-2016 Ruben Undheim <ruben.undheim@gmail.com>
License: AGPL-3+
License: AGPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
License: GPL-2+
This package is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,15 +0,0 @@
[Unit]
Description=Osmocom osmo-bts for osmo-trx
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts.cfg
Restart=always
RestartSec=2
# Let it process messages quickly enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target

View File

@@ -1,2 +0,0 @@
usr/bin/osmo-bts-virtual
usr/bin/osmo-bts-omldummy

View File

@@ -1,15 +0,0 @@
[Unit]
Description=Osmocom GSM BTS for virtual Um layer based on GSMTAP/UDP
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-virtual -s -c /etc/osmocom/osmo-bts-virtual.cfg
Restart=always
RestartSec=2
# Let it process messages quickly enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target

View File

@@ -1,32 +0,0 @@
#!/usr/bin/make -f
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@ --with=systemd --with autoreconf --fail-missing
override_dh_strip:
dh_strip --dbg-package=osmo-bts-trx-dbg
override_dh_autoreconf:
echo $(VERSION) > .tarball-version
dh_autoreconf
override_dh_auto_configure:
dh_auto_configure -- --enable-trx
override_dh_clean:
dh_clean
$(RM) tests/package.m4
$(RM) tests/testsuite
# Print test results in case of a failure
override_dh_auto_test:
dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)

View File

@@ -1,61 +0,0 @@
The osmo-bts control interface is currently supporting the following operations:
h2. generic
h3. trx.0.thermal-attenuation
The idea of this paramter is to attenuate the system output power as part of
thermal management. In some cases the PA might be passing a critical level,
so an external control process can use this attribute to reduce the system
output power.
Please note that all values in the context of transmit power calculation
are integers in milli-dB (1/10000 bel), so the below example is setting
the attenuation at 3 dB:
<pre>
bsc_control.py -d localhost -p 4238 -s trx.0.thermal-attenuation 3000
Got message: SET_REPLY 1 trx.0.thermal-attenuation 3000
</pre>
<pre>
bsc_control.py -d localhost -p 4238 -g trx.0.thermal-attenuation
Got message: GET_REPLY 1 trx.0.thermal-attenuation 3000
</pre>
h2. sysmobts specific
h3. trx.0.clock-info
obtain information on the current clock status:
<pre>
bsc_control.py -d localhost -p 4238 -g trx.0.clock-info
Got message: GET_REPLY 1 trx.0.clock-info -100,ocxo,0,0,gps
</pre>
which is to be interpreted as:
* current clock correction value is -100 ppb
* current clock source is OCXO
* deviation between clock source and calibration source is 0 ppb
* resolution of clock error measurement is 0 ppt (0 means no result yet)
* current calibration source is GPS
When this attribute is set, any value passed on is discarded, but the clock
calibration process is re-started.
h3. trx.0.clock-correction
This attribute can get and set the current clock correction value:
<pre>
bsc_control.py -d localhost -p 4238 -g trx.0.clock-correction
Got message: GET_REPLY 1 trx.0.clock-correction -100
</pre>
<pre>
bsc_control.py -d localhost -p 4238 -s trx.0.clock-correction -- -99
Got message: SET_REPLY 1 trx.0.clock-correction success
</pre>

View File

@@ -1,38 +0,0 @@
!
! OsmoBTS configuration example for CalypsoBTS
! http://osmocom.org/projects/baseband/wiki/CalypsoBTS
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl notice
logging level oml notice
logging level rll notice
logging level rr notice
logging level meas error
logging level pag error
logging level l1c error
logging level l1p error
logging level dsp error
logging level abis error
!
line vty
no login
!
phy 0
instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1
osmotrx timing-advance-loop
osmotrx ms-power-loop -65
osmotrx legacy-setbsic
bts 0
oml remote-ip 127.0.0.1
ipa unit-id 1801 0
gsmtap-sapi pdtch
gsmtap-sapi ccch
band 900
trx 0
phy 0 instance 0

View File

@@ -1,43 +0,0 @@
!
! lc15bts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level temp info
logging level fw info
logging level find info
logging level calib info
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
!
line vty
no login
!
lc15bts-mgr
limits supply_volt
threshold warning min 17500
threshold critical min 19000
limits tx0_vswr
threshold warning max 1000
limits tx1_vswr
threshold warning max 1000
limits supply_pwr
threshold warning max 110
threshold critical max 120
limits pa0_pwr
threshold warning max 50
threshold critical max 60
limits pa1_pwr
threshold warning max 50
threshold critical max 60

View File

@@ -1,43 +0,0 @@
!
! OsmoBTS (0.0.1.100-0455-dirty) configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level abis notice
logging level rtp notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
phy 0
instance 0
trx-calibration-path /mnt/rom/factory/calib
phy 1
instance 0
trx-calibration-path /mnt/rom/factory/calib
bts 0
band 900
ipa unit-id 1500 0
oml remote-ip 192.168.234.185
trx 0
phy 0 instance 0
trx 1
phy 1 instance 0

View File

@@ -1,33 +0,0 @@
!
! oc2gbts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level temp info
logging level fw info
logging level find info
logging level calib info
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
!
line vty
no login
!
oc2gbts-mgr
limits supply_volt
threshold warning min 17500
threshold critical min 19000
limits supply_pwr
threshold warning max 110
threshold critical max 120

View File

@@ -1,38 +0,0 @@
!
! OsmoBTS (0.0.1.100-0455-dirty) configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level abis notice
logging level rtp notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
phy 0
instance 0
trx-calibration-path /mnt/rom/factory/calib
bts 0
band 900
ipa unit-id 1500 0
oml remote-ip 10.42.123.1
trx 0
phy 0 instance 0

View File

@@ -1,34 +0,0 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
octphy hw-addr 00:0c:de:ad:fa:ce
octphy net-device eth2
instance 0
instance 1
bts 0
band 1800
ipa unit-id 1234 0
oml remote-ip 127.0.0.1
trx 0
phy 0 instance 0
trx 1
phy 0 instance 1

View File

@@ -1,31 +0,0 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
octphy hw-addr 00:0C:90:2e:80:1e
octphy net-device eth0.2342
instance 0
bts 0
band 1800
ipa unit-id 1234 0
oml remote-ip 127.0.0.1
trx 0
phy 0 instance 0

View File

@@ -1,29 +0,0 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
instance 0
bts 0
band 1800
ipa unit-id 666 0
oml remote-ip 10.1.2.3
trx 0
phy 0 instance 0

View File

@@ -1,23 +0,0 @@
!
! SysmoMgr (0.3.0.141-33e5) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging timestamp 0
logging level temp info
logging level fw info
logging level find info
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
sysmobts-mgr

View File

@@ -1,34 +0,0 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl notice
logging level oml notice
logging level rll notice
logging level rr notice
logging level meas error
logging level pag error
logging level l1c error
logging level l1p error
logging level dsp error
logging level abis error
!
line vty
no login
!
phy 0
instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1
bts 0
band 1800
ipa unit-id 6969 0
oml remote-ip 192.168.122.1
gsmtap-sapi ccch
gsmtap-sapi pdtch
trx 0
phy 0 instance 0

View File

@@ -1,151 +0,0 @@
!
! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging level all info
logging level rll notice
logging level cc notice
logging level mm debug
logging level rr notice
logging level rsl notice
logging level nm info
logging level mncc notice
logging level pag notice
logging level meas notice
logging level sccp notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level gprs debug
logging level ns info
logging level bssgp debug
logging level llc debug
logging level sndcp debug
logging level nat notice
logging level ctrl notice
logging level smpp debug
logging level filter debug
logging level ranap debug
logging level sua debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
!
stats interval 5
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
network
network country code 262
mobile network code 42
short name OpenBSC
long name OpenBSC
auth policy accept-all
authorized-regexp .*
location updating reject cause 13
encryption a5 0
neci 1
paging any use tch 0
rrlp mode ms-based
mm info 1
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 4
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 10
timer t3141 0
subscriber-keep-in-ram 0
bts 0
type sysmobts
band DCS1800
cell_identity 6969
location_area_code 1
base_station_id_code 63
ms max power 0
cell reselection hysteresis 4
rxlev access min 0
periodic location update 30
radio-link-timeout 32
channel allocator descending
rach tx integer 9
rach max transmission 7
channel-descrption attach 1
channel-descrption bs-pa-mfrms 5
channel-descrption bs-ag-blks-res 1
ip.access unit_id 6969 0
oml ip.access stream_id 255 line 0
neighbor-list mode automatic
codec-support fr
gprs mode none
no force-combined-si
trx 0
rf_locked 0
arfcn 666
nominal power 0
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config SDCCH8
hopping enabled 0
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
mncc-int
default-codec tch-f fr
default-codec tch-h hr
nitb
subscriber-create-on-demand
subscriber-create-on-demand random 1 24
assign-tmsi

View File

@@ -1,61 +0,0 @@
!
! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 0
logging color 0
logging print category 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp error
logging level pcu notice
logging level ho debug
logging level trx notice
logging level loop notice
logging level abis debug
logging level rtp notice
logging level sum error
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats error
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
phy 0
instance 0
bts 0
band DCS1800
ipa unit-id 6969 0
oml remote-ip 127.0.0.1
rtp jitter-buffer 100
paging queue-size 200
paging lifetime 0
uplink-power-target -75
min-qual-rach 50
min-qual-norm -5
trx 0
power-ramp max-initial 23000 mdBm
power-ramp step-size 2000 mdB
power-ramp step-interval 1
ms-power-control dsp
phy 0 instance 0

View File

@@ -1,57 +0,0 @@
== OsmoBTS PHY interface abstraction
The OsmoBTS PHY interface serves as an abstraction layer between given
PHY hardware and the actual logical transceivers (TRXs) of a BTS inside
the OsmoBTS code base.
=== PHY link
A PHY link is a physical connection / link towards a given PHY. This
might be, for example,
* a set of file descriptors to device nodes in the /dev/ directory
(sysmobts, litecell15)
* a packet socket for sending raw Ethernet frames to an OCTPHY
* a set of UDP sockets for interacting with OsmoTRX
Each PHY interface has a set of attribute/parameters and a list of 1 to
n PHY instances.
PHY links are numbered 0..n globally inside OsmoBTS.
Each PHY link is configured via the VTY using its individual top-level
vty node. Given the different bts-model / phy specific properties, the
VTY configuration options (if any) of the PHY instance differ between
BTS models.
The PHY links and instances must be configured above the BTS/TRX nodes
in the configuration file. If the file is saved via the VTY, the code
automatically ensures this.
=== PHY instance
A PHY instance is an instance of a PHY, accessed via a PHY link.
In the case of osmo-bts-sysmo and osmo-bts-trx, there is only one
instance in every PHY link. This is due to the fact that the API inside
that PHY link does not permit for distinguishing multiple different
logical TRXs.
Other PHY implementations like the OCTPHY however do support addressing
multiple PHY instances via a single PHY link.
PHY instances are numbered 0..n inside each PHY link.
Each PHY instance is configured via the VTY as a separate node beneath each
PHY link. Given the different bts-model / phy specific properties, the
VTY configuration options (if any) of the PHY instance differ between
BTS models.
=== Mapping PHY instances to TRXs
Each TRX node in the VTY must use the 'phy N instance M' command in
order to specify which PHY instance is allocated to this specific TRX.

View File

@@ -1,42 +0,0 @@
== start-up / sequencing during OsmoBTS start
The start-up procedure of OsmoBTS can be described as follows:
|===
| bts-specific | main() |
| common | bts_main() | initialization of talloc contexts
| common | osmo_init_logging2() | initialization of logging
| common | handle_options() | common option parsing
| bts-specific | bts_model_handle_options() | model-specific option parsing
| common | gsm_bts_alloc() | allocation of BTS/TRX/TS data structures
| common | vty_init() | Initialziation of VTY core, libosmo-abis and osmo-bts VTY
| common | main() | Setting of scheduler RR priority (if configured)
| common | main() | Initialization of GSMTAP (if configured)
| common | bts_init() | configuration of defaults in bts/trx/s object
| bts-specific | bts_model_init | ?
| common | abis_init() | Initialization of libosmo-abis
| common | vty_read_config_file() | Reading of configuration file
| bts-specific | bts_model_phy_link_set_defaults() | Called for every PHY link created
| bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created
| common | bts_controlif_setup() | Initialization of Control Interface
| bts-specific | bts_model_ctrl_cmds_install()
| common | telnet_init() | Initialization of telnet interface
| common | pcu_sock_init() | Initializaiton of PCU socket
| common | main() | Installation of signal handlers
| common | abis_open() | Start of the A-bis connection to BSC
| common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
| common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2
| bts-specific | bts_model_oml_estab() | Called by core once OML link is established
| bts-specific | bts_model_check_oml() | called each time OML sets some attributes on a MO, checks if attributes are valid
| bts-specific | bts_model_apply_oml() | called each time OML sets some attributes on a MO, stores attribute contents in data structures
| bts-specific | bts_model_opstart() | for NM_OC_BTS, NM_OC_SITE_MANAGER, NM_OC_GPRS_NSE, NM_OC_GPRS_CELL, NMO_OC_GPRS_NSVC
| bts-specific | bts_model_opstart() | for NM_OC_RADIO_CARRIER for each trx
| bts-specific | bts_model_opstart() | for NM_OC_BASEB_TRANSC for each trx
| bts-specific | bts_model_opstart() | for NM_OC_CHANNEL for each timeslot on each trx
| bts-specific | bts_model_change_power() | change transmit power for each trx (power ramp-up/ramp-down
| bts-specific | bts_model_abis_close() | called when either one of the RSL links or the OML link are down

View File

@@ -1,151 +0,0 @@
#!/bin/sh
# Print a version string.
scriptversion=2010-01-28.01
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
# - from a non-git-repo directory containing a .tarball-version file, which
# presumes this script is invoked like "./git-version-gen .tarball-version".
# In order to use intra-version strings in your project, you will need two
# separate generated version string files:
#
# .tarball-version - present only in a distribution tarball, and not in
# a checked-out repository. Created with contents that were learned at
# the last time autoconf was run, and used by git-version-gen. Must not
# be present in either $(srcdir) or $(builddir) for git-version-gen to
# give accurate answers during normal development with a checked out tree,
# but must be present in a tarball when there is no version control system.
# Therefore, it cannot be used in any dependencies. GNUmakefile has
# hooks to force a reconfigure at distribution time to get the value
# correct, without penalizing normal development with extra reconfigures.
#
# .version - present in a checked-out repository and in a distribution
# tarball. Usable in dependencies, particularly for files that don't
# want to depend on config.h but do want to track version changes.
# Delete this file prior to any autoconf run where you want to rebuild
# files to pick up a version string change; and leave it stale to
# minimize rebuild time after unrelated changes to configure sources.
#
# It is probably wise to add these two files to .gitignore, so that you
# don't accidentally commit either generated file.
#
# Use the following line in your configure.ac, so that $(VERSION) will
# automatically be up-to-date each time configure is run (and note that
# since configure.ac no longer includes a version string, Makefile rules
# should not depend on configure.ac for version updates).
#
# AC_INIT([GNU project],
# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
# [bug-project@example])
#
# Then use the following lines in your Makefile.am, so that .version
# will be present for dependencies, and so that .tarball-version will
# exist in distribution tarballs.
#
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo $(VERSION) > $(distdir)/.tarball-version
case $# in
1) ;;
*) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version"; exit 1;;
esac
tarball_version_file=$1
nl='
'
# First see if there is a tarball-only version file.
# then try "git describe", then default.
if test -f $tarball_version_file
then
v=`cat $tarball_version_file` || exit 1
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test -z "$v" \
&& echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
fi
if test -n "$v"
then
: # use $v
elif
v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
&& case $v in
[0-9]*) ;;
v[0-9]*) ;;
*) (exit 1) ;;
esac
then
# Is this a new git that lists number of commits since the last
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
case $v in
*-*-*) : git describe is okay three part flavor ;;
*-*)
: git describe is older two part flavor
# Recreate the number of commits and rewrite such that the
# result is the same as if we were using the newer version
# of git describe.
vtag=`echo "$v" | sed 's/-.*//'`
numcommits=`git rev-list "$vtag"..HEAD | wc -l`
v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
;;
esac
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
else
v=UNKNOWN
fi
v=`echo "$v" |sed 's/^v//'`
# Don't declare a version "dirty" merely because a time stamp has changed.
git status > /dev/null 2>&1
dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
case "$dirty" in
'') ;;
*) # Append the suffix only if there isn't one already.
case $v in
*-dirty) ;;
*) v="$v-dirty" ;;
esac ;;
esac
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
echo "$v" | tr -d '\012'
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@@ -1,5 +0,0 @@
noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h measurement.h \
oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \
handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \
power_control.h scheduler.h scheduler_backend.h phy_link.h \
dtx_dl_amr_fsm.h

View File

@@ -1,29 +0,0 @@
#ifndef _ABIS_H
#define _ABIS_H
#include <osmocom/core/select.h>
#include <osmocom/core/timer.h>
#include <osmo-bts/gsm_data.h>
#define OML_RETRY_TIMER 5
#define OML_PING_TIMER 20
enum {
LINK_STATE_IDLE = 0,
LINK_STATE_RETRYING,
LINK_STATE_CONNECTING,
LINK_STATE_CONNECT,
};
void abis_init(struct gsm_bts *bts);
struct e1inp_line *abis_open(struct gsm_bts *bts, char *dst_host,
char *model_name);
int abis_oml_sendmsg(struct msgb *msg);
int abis_bts_rsl_sendmsg(struct msgb *msg);
uint32_t get_signlink_remote_ip(struct e1inp_sign_link *link);
#endif /* _ABIS_H */

View File

@@ -1,18 +0,0 @@
#ifndef _OSMO_BTS_AMR_H
#define _OSMO_BTS_AMR_H
#include <osmo-bts/gsm_data.h>
#define AMR_TOC_QBIT 0x04
#define AMR_CMR_NONE 0xF
void amr_log_mr_conf(int ss, int logl, const char *pfx,
struct amr_multirate_conf *amr_mrc);
int amr_parse_mr_conf(struct amr_multirate_conf *amr_mrc,
const uint8_t *mr_conf, unsigned int len);
void amr_set_mode_pref(uint8_t *data, const struct amr_multirate_conf *amr_mrc,
uint8_t cmi, uint8_t cmr);
unsigned int amr_get_initial_mode(struct gsm_lchan *lchan);
#endif /* _OSMO_BTS_AMR_H */

View File

@@ -1,67 +0,0 @@
#ifndef _BTS_H
#define _BTS_H
#include <osmocom/core/rate_ctr.h>
#include <osmo-bts/gsm_data.h>
enum bts_global_status {
BTS_STATUS_RF_ACTIVE,
BTS_STATUS_RF_MUTE,
BTS_STATUS_LAST,
};
enum {
BTS_CTR_PAGING_RCVD,
BTS_CTR_PAGING_DROP,
BTS_CTR_PAGING_SENT,
BTS_CTR_RACH_RCVD,
BTS_CTR_RACH_DROP,
BTS_CTR_RACH_HO,
BTS_CTR_RACH_CS,
BTS_CTR_RACH_PS,
BTS_CTR_AGCH_RCVD,
BTS_CTR_AGCH_SENT,
BTS_CTR_AGCH_DELETED,
};
extern void *tall_bts_ctx;
int bts_init(struct gsm_bts *bts);
void bts_shutdown(struct gsm_bts *bts, const char *reason);
struct gsm_bts *create_bts(uint8_t num_trx, char *id);
int create_ms(struct gsm_bts_trx *trx, int maskc, uint8_t *maskv_tx,
uint8_t *maskv_rx);
void destroy_bts(struct gsm_bts *bts);
int work_bts(struct gsm_bts *bts);
int bts_link_estab(struct gsm_bts *bts);
int trx_link_estab(struct gsm_bts_trx *trx);
int trx_set_available(struct gsm_bts_trx *trx, int avail);
void bts_new_si(void *arg);
void bts_setup_slot(struct gsm_bts_trx_ts *slot, uint8_t comb);
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg);
struct msgb *bts_agch_dequeue(struct gsm_bts *bts);
int bts_agch_max_queue_length(int T, int bcch_conf);
int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt,
int is_ag_res);
uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time);
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan);
int lchan_init_lapdm(struct gsm_lchan *lchan);
void load_timer_start(struct gsm_bts *bts);
uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg);
void bts_update_status(enum bts_global_status which, int on);
int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
struct gsm_time *get_time(struct gsm_bts *bts);
int bts_main(int argc, char **argv);
int bts_supports_cm(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
enum gsm48_chan_mode cm);
#endif /* _BTS_H */

View File

@@ -1,64 +0,0 @@
#ifndef BTS_MODEL_H
#define BTS_MODEL_H
#include <stdint.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmo-bts/gsm_data.h>
struct phy_link;
struct phy_instance;
/* BTS model specific functions needed by the common code */
int bts_model_init(struct gsm_bts *bts);
int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
struct tlv_parsed *old_attr, struct tlv_parsed *new_attr,
void *obj);
int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
struct tlv_parsed *new_attr, int obj_kind, void *obj);
int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
void *obj);
int bts_model_chg_adm_state(struct gsm_bts *bts, struct gsm_abis_mo *mo,
void *obj, uint8_t adm_state);
int bts_model_trx_deact_rf(struct gsm_bts_trx *trx);
int bts_model_trx_close(struct gsm_bts_trx *trx);
int bts_model_vty_init(struct gsm_bts *bts);
void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts);
void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx);
void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink);
void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst);
int bts_model_oml_estab(struct gsm_bts *bts);
int bts_model_change_power(struct gsm_bts_trx *trx, int p_trxout_mdBm);
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan);
int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap);
int bts_model_lchan_deactivate(struct gsm_lchan *lchan);
int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan);
void bts_model_abis_close(struct gsm_bts *bts);
int bts_model_ctrl_cmds_install(struct gsm_bts *bts);
int bts_model_handle_options(int argc, char **argv);
void bts_model_print_help();
void bts_model_phy_link_set_defaults(struct phy_link *plink);
void bts_model_phy_instance_set_defaults(struct phy_instance *pinst);
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts);
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
#endif

View File

@@ -1,16 +0,0 @@
#pragma once
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/bts.h>
/* incoming SMS broadcast command from RSL */
int bts_process_smscb_cmd(struct gsm_bts *bts,
struct rsl_ie_cb_cmd_type cmd_type,
uint8_t msg_len, const uint8_t *msg);
/* call-back from bts model specific code when it wants to obtain a CBCH
* block for a given gsm_time. outbuf must have 23 bytes of space. */
int bts_cbch_get(struct gsm_bts *bts, uint8_t *outbuf, struct gsm_time *g_time);

View File

@@ -1,5 +0,0 @@
#pragma once
int bts_ctrl_cmds_install(struct gsm_bts *bts);
struct ctrl_handle *bts_controlif_setup(struct gsm_bts *bts,
const char *bind_addr, uint16_t port);

View File

@@ -1,44 +0,0 @@
#pragma once
#include <osmocom/core/fsm.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
/* DTX DL AMR FSM */
#define X(s) (1 << (s))
enum dtx_dl_amr_fsm_states {
ST_VOICE,
ST_SID_F1,
ST_SID_F2,
ST_F1_INH_V,
ST_F1_INH_F,
ST_U_INH_V,
ST_U_INH_F,
ST_U_NOINH,
ST_F1_INH_V_REC,
ST_F1_INH_F_REC,
ST_U_INH_V_REC,
ST_U_INH_F_REC,
ST_SID_U,
ST_ONSET_V,
ST_ONSET_F,
ST_ONSET_V_REC,
ST_ONSET_F_REC,
ST_FACCH,
};
enum dtx_dl_amr_fsm_events {
E_VOICE,
E_ONSET,
E_FACCH,
E_COMPL,
E_FIRST,
E_INHIB,
E_SID_F,
E_SID_U,
};
extern const struct value_string dtx_dl_amr_fsm_event_names[];
extern struct osmo_fsm dtx_dl_amr_fsm;

View File

@@ -1,58 +0,0 @@
#ifndef _GSM_DATA_H
#define _GSM_DATA_H
#include <osmocom/core/timer.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/gsm/lapdm.h>
#include <osmocom/gsm/gsm23003.h>
#include <osmo-bts/paging.h>
#include <osmo-bts/tx_power.h>
#define GSM_FR_BITS 260
#define GSM_EFR_BITS 244
#define GSM_FR_BYTES 33 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */
#define GSM_HR_BYTES 14 /* TS 101318 Chapter 5.2: 112 bits, no sig */
#define GSM_EFR_BYTES 31 /* TS 101318 Chapter 5.3: 244 bits + 4bit sig */
#define GSM_SUPERFRAME (26*51) /* 1326 TDMA frames */
#define GSM_HYPERFRAME (2048*GSM_SUPERFRAME) /* GSM_HYPERFRAME frames */
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DEFAULT 41
#define GSM_BTS_AGCH_QUEUE_THRESH_LEVEL_DISABLE 999999
#define GSM_BTS_AGCH_QUEUE_LOW_LEVEL_DEFAULT 41
#define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91
struct gsm_network {
struct llist_head bts_list;
unsigned int num_bts;
struct osmo_plmn_id plmn;
struct pcu_sock_state *pcu_state;
};
enum lchan_ciph_state {
LCHAN_CIPH_NONE,
LCHAN_CIPH_RX_REQ,
LCHAN_CIPH_RX_CONF,
LCHAN_CIPH_RXTX_REQ,
LCHAN_CIPH_RX_CONF_TX_REQ,
LCHAN_CIPH_RXTX_CONF,
};
#include <osmo-bts/gsm_data_shared.h>
void lchan_set_state(struct gsm_lchan *lchan, enum gsm_lchan_state state);
int conf_lchans_as_pchan(struct gsm_bts_trx_ts *ts,
enum gsm_phys_chan_config pchan);
/* cipher code */
#define CIPHER_A5(x) (1 << (x-1))
int bts_supports_cipher(struct gsm_bts *bts, int rsl_cipher);
bool ts_is_pdch(const struct gsm_bts_trx_ts *ts);
int bts_model_check_cm_mode(enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm);
#endif /* _GSM_DATA_H */

View File

@@ -1,818 +0,0 @@
#ifndef _GSM_DATA_SHAREDH
#define _GSM_DATA_SHAREDH
#include <regex.h>
#include <stdbool.h>
#include <stdint.h>
#include <osmocom/codec/ecu.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/bitvec.h>
#include <osmocom/core/statistics.h>
#include <osmocom/core/utils.h>
#include <osmocom/gsm/gsm_utils.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/rxlev_stat.h>
#include <osmocom/gsm/sysinfo.h>
#include <osmocom/gsm/meas_rep.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/protocol/gsm_08_58.h>
#include <osmocom/gsm/protocol/gsm_12_21.h>
#include <osmocom/abis/e1_input.h>
#include <osmocom/gsm/lapdm.h>
/* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1:
4-bit index is used (2#1111 = 10#15) */
#define SI2Q_MAX_NUM 16
/* length in bits (for single SI2quater message) */
#define SI2Q_MAX_LEN 160
#define SI2Q_MIN_LEN 18
/* Channel Request reason */
enum gsm_chreq_reason_t {
GSM_CHREQ_REASON_EMERG,
GSM_CHREQ_REASON_PAG,
GSM_CHREQ_REASON_CALL,
GSM_CHREQ_REASON_LOCATION_UPD,
GSM_CHREQ_REASON_OTHER,
GSM_CHREQ_REASON_PDCH,
};
/* lchans 0..3 are SDCCH in combined channel configuration,
use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
#define CCCH_LCHAN 4
#define TRX_NR_TS 8
#define TS_MAX_LCHAN 8
#define HARDCODED_ARFCN 123
#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */
/* for multi-drop config */
#define HARDCODED_BTS0_TS 1
#define HARDCODED_BTS1_TS 6
#define HARDCODED_BTS2_TS 11
#define MAX_VERSION_LENGTH 64
#define MAX_BTS_FEATURES 128
enum gsm_hooks {
GSM_HOOK_NM_SWLOAD,
GSM_HOOK_RR_PAGING,
GSM_HOOK_RR_SECURITY,
};
enum bts_gprs_mode {
BTS_GPRS_NONE = 0,
BTS_GPRS_GPRS = 1,
BTS_GPRS_EGPRS = 2,
};
struct gsm_lchan;
struct osmo_rtp_socket;
struct pcu_sock_state;
struct smscb_msg;
/* Network Management State */
struct gsm_nm_state {
uint8_t operational;
uint8_t administrative;
uint8_t availability;
};
struct gsm_abis_mo {
/* A-bis OML Object Class */
uint8_t obj_class;
/* is there still some procedure pending? */
uint8_t procedure_pending;
/* A-bis OML Object Instance */
struct abis_om_obj_inst obj_inst;
/* human-readable name */
const char *name;
/* NM State */
struct gsm_nm_state nm_state;
/* Attributes configured in this MO */
struct tlv_parsed *nm_attr;
/* BTS to which this MO belongs */
struct gsm_bts *bts;
};
#define MAX_A5_KEY_LEN (128/8)
#define A38_XOR_MIN_KEY_LEN 12
#define A38_XOR_MAX_KEY_LEN 16
#define A38_COMP128_KEY_LEN 16
#define RSL_ENC_ALG_A5(x) (x+1)
#define MAX_EARFCN_LIST 32
/* is the data link established? who established it? */
#define LCHAN_SAPI_UNUSED 0
#define LCHAN_SAPI_MS 1
#define LCHAN_SAPI_NET 2
#define LCHAN_SAPI_REL 3
/* state of a logical channel */
enum gsm_lchan_state {
LCHAN_S_NONE, /* channel is not active */
LCHAN_S_ACT_REQ, /* channel activation requested */
LCHAN_S_ACTIVE, /* channel is active and operational */
LCHAN_S_REL_REQ, /* channel release has been requested */
LCHAN_S_REL_ERR, /* channel is in an error state */
LCHAN_S_BROKEN, /* channel is somehow unusable */
LCHAN_S_INACTIVE, /* channel is set inactive */
};
/* BTS ONLY */
#define MAX_NUM_UL_MEAS 104
#define LC_UL_M_F_L1_VALID (1 << 0)
#define LC_UL_M_F_RES_VALID (1 << 1)
struct bts_ul_meas {
/* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */
uint16_t ber10k;
/* timing advance offset (in 1/256 bits) */
int16_t ta_offs_256bits;
/* C/I ratio in dB */
float c_i;
/* flags */
uint8_t is_sub:1;
/* RSSI in dBm * -1 */
uint8_t inv_rssi;
};
struct bts_codec_conf {
uint8_t hr;
uint8_t efr;
uint8_t amr;
};
struct amr_mode {
uint8_t mode;
uint8_t threshold;
uint8_t hysteresis;
};
struct amr_multirate_conf {
uint8_t gsm48_ie[2];
struct amr_mode ms_mode[4];
struct amr_mode bts_mode[4];
uint8_t num_modes;
};
/* /BTS ONLY */
enum lchan_csd_mode {
LCHAN_CSD_M_NT,
LCHAN_CSD_M_T_1200_75,
LCHAN_CSD_M_T_600,
LCHAN_CSD_M_T_1200,
LCHAN_CSD_M_T_2400,
LCHAN_CSD_M_T_9600,
LCHAN_CSD_M_T_14400,
LCHAN_CSD_M_T_29000,
LCHAN_CSD_M_T_32000,
};
/* State of the SAPIs in the lchan */
enum lchan_sapi_state {
LCHAN_SAPI_S_NONE,
LCHAN_SAPI_S_REQ,
LCHAN_SAPI_S_ASSIGNED,
LCHAN_SAPI_S_REL,
LCHAN_SAPI_S_ERROR,
};
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
/* The logical subslot number in the TS */
uint8_t nr;
/* The logical channel type */
enum gsm_chan_t type;
/* RSL channel mode */
enum rsl_cmod_spd rsl_cmode;
/* If TCH, traffic channel mode */
enum gsm48_chan_mode tch_mode;
enum lchan_csd_mode csd_mode;
/* State */
enum gsm_lchan_state state;
const char *broken_reason;
/* Power levels for MS and BTS */
uint8_t bs_power;
uint8_t ms_power;
/* Encryption information */
struct {
uint8_t alg_id;
uint8_t key_len;
uint8_t key[MAX_A5_KEY_LEN];
} encr;
/* AMR bits */
uint8_t mr_bts_lv[7];
/* Established data link layer services */
int sacch_deact;
struct {
uint32_t bound_ip;
uint32_t connect_ip;
uint16_t bound_port;
uint16_t connect_port;
uint16_t conn_id;
uint8_t rtp_payload;
uint8_t rtp_payload2;
uint8_t speech_mode;
struct osmo_rtp_socket *rtp_socket;
} abis_ip;
uint8_t rqd_ta;
char *name;
/* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23.
* Currently we don't share these headers so this is a magic number. */
struct llist_head sapi_cmds;
uint8_t sapis_dl[23];
uint8_t sapis_ul[23];
struct lapdm_channel lapdm_ch;
struct llist_head dl_tch_queue;
struct {
/* bitmask of all SI that are present/valid in si_buf */
uint32_t valid;
uint32_t last;
/* buffers where we put the pre-computed SI:
SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */
sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
} si;
struct {
uint8_t flags;
/* RSL measurment result number, 0 at lchan_act */
uint8_t res_nr;
/* current Tx power level of the BTS */
uint8_t bts_tx_pwr;
/* number of measurements stored in array below */
uint8_t num_ul_meas;
struct bts_ul_meas uplink[MAX_NUM_UL_MEAS];
/* last L1 header from the MS */
uint8_t l1_info[2];
struct gsm_meas_rep_unidir ul_res;
int16_t ms_toa256;
} meas;
struct {
struct amr_multirate_conf amr_mr;
struct {
struct osmo_fsm_inst *dl_amr_fsm;
/* TCH cache */
uint8_t cache[20];
/* FACCH cache */
uint8_t facch[GSM_MACBLOCK_LEN];
uint8_t len;
uint32_t fn;
bool is_update;
/* set for each SID frame to detect talkspurt for codecs
without explicit ONSET event */
bool ul_sid;
/* indicates if DTXd was active during DL measurement
period */
bool dl_active;
/* last UL SPEECH resume flag */
bool is_speech_resume;
} dtx;
uint8_t last_cmr;
uint32_t last_fn;
} tch;
/* 3GPP TS 48.058 § 9.3.37: [0; 255] ok, -1 means invalid*/
int16_t ms_t_offs;
/* 3GPP TS 45.010 § 1.2 round trip propagation delay (in symbols) or -1 */
int16_t p_offs;
/* BTS-side ciphering state (rx only, bi-directional, ...) */
uint8_t ciph_state;
uint8_t ciph_ns;
uint8_t loopback;
struct {
uint8_t active;
uint8_t ref;
/* T3105: PHYS INF retransmission */
struct osmo_timer_list t3105;
/* counts up to Ny1 */
unsigned int phys_info_count;
} ho;
/* S counter for link loss */
int s;
/* Kind of the release/activation. E.g. RSL or PCU */
int rel_act_kind;
/* RTP header Marker bit to indicate beginning of speech after pause */
bool rtp_tx_marker;
/* power handling */
struct {
uint8_t current;
uint8_t fixed;
} ms_power_ctrl;
struct msgb *pending_rel_ind_msg;
/* ECU (Error Concealment Unit) state */
union {
struct osmo_ecu_fr_state fr;
} ecu_state;
};
extern const struct value_string lchan_ciph_state_names[];
static inline const char *lchan_ciph_state_name(uint8_t state) {
return get_value_string(lchan_ciph_state_names, state);
}
enum {
TS_F_PDCH_ACTIVE = 0x1000,
TS_F_PDCH_ACT_PENDING = 0x2000,
TS_F_PDCH_DEACT_PENDING = 0x4000,
TS_F_PDCH_PENDING_MASK = 0x6000 /*<
TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */
} gsm_bts_trx_ts_flags;
/* One Timeslot in a TRX */
struct gsm_bts_trx_ts {
struct gsm_bts_trx *trx;
/* number of this timeslot at the TRX */
uint8_t nr;
enum gsm_phys_chan_config pchan;
struct {
enum gsm_phys_chan_config pchan_is;
enum gsm_phys_chan_config pchan_want;
struct msgb *pending_chan_activ;
} dyn;
unsigned int flags;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
uint8_t nm_chan_comb;
int tsc; /* -1 == use BTS TSC */
struct {
/* Parameters below are configured by VTY */
int enabled;
uint8_t maio;
uint8_t hsn;
struct bitvec arfcns;
uint8_t arfcns_data[1024/8];
/* This is the pre-computed MA for channel assignments */
struct bitvec ma;
uint8_t ma_len; /* part of ma_data that is used */
uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */
} hopping;
struct gsm_lchan lchan[TS_MAX_LCHAN];
};
/* One TRX in a BTS */
struct gsm_bts_trx {
/* list header in bts->trx_list */
struct llist_head list;
struct gsm_bts *bts;
/* number of this TRX in the BTS */
uint8_t nr;
/* human readable name / description */
char *description;
/* how do we talk RSL with this TRX? */
uint8_t rsl_tei;
struct e1inp_sign_link *rsl_link;
/* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */
struct e1inp_sign_link *oml_link;
struct gsm_abis_mo mo;
struct tlv_parsed nm_attr;
struct {
struct gsm_abis_mo mo;
} bb_transc;
uint16_t arfcn;
int nominal_power; /* in dBm */
unsigned int max_power_red; /* in actual dB */
struct trx_power_params power_params;
int ms_power_control;
struct {
void *l1h;
} role_bts;
union {
struct {
unsigned int test_state;
uint8_t test_nr;
struct rxlev_stats rxlev_stat;
} ipaccess;
};
struct gsm_bts_trx_ts ts[TRX_NR_TS];
};
#define GSM_BTS_SI2Q(bts, i) (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])
#define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i))
#define GSM_BTS_SI(bts, i) (void *)((bts)->si_buf[i][0])
#define GSM_LCHAN_SI(lchan, i) (void *)((lchan)->si.buf[i][0])
enum gsm_bts_type_variant {
BTS_UNKNOWN,
BTS_OSMO_LITECELL15,
BTS_OSMO_OC2G,
BTS_OSMO_OCTPHY,
BTS_OSMO_SYSMO,
BTS_OSMO_TRX,
BTS_OSMO_VIRTUAL,
BTS_OSMO_OMLDUMMY,
_NUM_BTS_VARIANT
};
/* Used by OML layer for BTS Attribute reporting */
enum bts_attribute {
BTS_TYPE_VARIANT,
BTS_SUB_MODEL,
TRX_PHY_VERSION,
};
struct vty;
/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility
with BTS compiled against earlier version of this header. Also make sure that the description strings
gsm_bts_features_descs[] in gsm_data_shared.c are also updated accordingly! */
enum gsm_bts_features {
BTS_FEAT_HSCSD,
BTS_FEAT_GPRS,
BTS_FEAT_EGPRS,
BTS_FEAT_ECSD,
BTS_FEAT_HOPPING,
BTS_FEAT_MULTI_TSC,
BTS_FEAT_OML_ALERTS,
BTS_FEAT_AGCH_PCH_PROP,
BTS_FEAT_CBCH,
BTS_FEAT_SPEECH_F_V1,
BTS_FEAT_SPEECH_H_V1,
BTS_FEAT_SPEECH_F_EFR,
BTS_FEAT_SPEECH_F_AMR,
BTS_FEAT_SPEECH_H_AMR,
_NUM_BTS_FEAT
};
extern const struct value_string gsm_bts_features_descs[];
struct gsm_bts_gprs_nsvc {
struct gsm_bts *bts;
/* data read via VTY config file, to configure the BTS
* via OML from BSC */
int id;
uint16_t nsvci;
uint16_t local_port; /* on the BTS */
uint16_t remote_port; /* on the SGSN */
uint32_t remote_ip; /* on the SGSN */
struct gsm_abis_mo mo;
};
enum gprs_rlc_par {
RLC_T3142,
RLC_T3169,
RLC_T3191,
RLC_T3193,
RLC_T3195,
RLC_N3101,
RLC_N3103,
RLC_N3105,
CV_COUNTDOWN,
T_DL_TBF_EXT, /* ms */
T_UL_TBF_EXT, /* ms */
_NUM_RLC_PAR
};
enum gprs_cs {
GPRS_CS1,
GPRS_CS2,
GPRS_CS3,
GPRS_CS4,
GPRS_MCS1,
GPRS_MCS2,
GPRS_MCS3,
GPRS_MCS4,
GPRS_MCS5,
GPRS_MCS6,
GPRS_MCS7,
GPRS_MCS8,
GPRS_MCS9,
_NUM_GRPS_CS
};
struct gprs_rlc_cfg {
uint16_t parameter[_NUM_RLC_PAR];
struct {
uint16_t repeat_time; /* ms */
uint8_t repeat_count;
} paging;
uint32_t cs_mask; /* bitmask of gprs_cs */
uint8_t initial_cs;
uint8_t initial_mcs;
};
/* One BTS */
struct gsm_bts {
/* list header in net->bts_list */
struct llist_head list;
/* Geographical location of the BTS */
struct llist_head loc_list;
/* number of ths BTS in network */
uint8_t nr;
/* human readable name / description */
char *description;
/* Cell Identity */
uint16_t cell_identity;
/* location area code of this BTS */
uint16_t location_area_code;
/* Base Station Identification Code (BSIC), lower 3 bits is BCC,
* which is used as TSC for the CCCH */
uint8_t bsic;
/* type of BTS */
enum gsm_bts_type_variant variant;
enum gsm_band band;
char version[MAX_VERSION_LENGTH];
char sub_model[MAX_VERSION_LENGTH];
/* features of a given BTS set/reported via OML */
struct bitvec features;
uint8_t _features_data[MAX_BTS_FEATURES/8];
/* Connected PCU version (if any) */
char pcu_version[MAX_VERSION_LENGTH];
/* maximum Tx power that the MS is permitted to use in this cell */
int ms_max_power;
/* how do we talk OML with this TRX? */
uint8_t oml_tei;
struct e1inp_sign_link *oml_link;
/* Abis network management O&M handle */
struct abis_nm_h *nmh;
struct gsm_abis_mo mo;
/* number of this BTS on given E1 link */
uint8_t bts_nr;
/* DTX features of this BTS */
enum gsm48_dtx_mode dtxu;
bool dtxd;
/* CCCH is on C0 */
struct gsm_bts_trx *c0;
struct {
struct gsm_abis_mo mo;
} site_mgr;
/* bitmask of all SI that are present/valid in si_buf */
uint32_t si_valid;
/* 3GPP TS 44.018 Table 10.5.2.33b.1 INDEX and COUNT for SI2quater */
uint8_t si2q_index; /* distinguish individual SI2quater messages */
uint8_t si2q_count; /* si2q_index for the last (highest indexed) individual SI2quater message */
/* buffers where we put the pre-computed SI */
sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM];
/* offsets used while generating SI2quater */
size_t e_offset;
size_t u_offset;
/* ip.accesss Unit ID's have Site/BTS/TRX layout */
union {
struct {
uint16_t site_id;
uint16_t bts_id;
uint32_t flags;
uint32_t rsl_ip;
} ip_access;
};
/* Not entirely sure how ip.access specific this is */
struct {
uint8_t supports_egprs_11bit_rach;
enum bts_gprs_mode mode;
struct {
struct gsm_abis_mo mo;
uint16_t nsei;
uint8_t timer[7];
} nse;
struct {
struct gsm_abis_mo mo;
uint16_t bvci;
uint8_t timer[11];
struct gprs_rlc_cfg rlc_cfg;
} cell;
struct gsm_bts_gprs_nsvc nsvc[2];
uint8_t rac;
uint8_t net_ctrl_ord;
bool ctrl_ack_type_use_block;
} gprs;
/* RACH NM values */
int rach_b_thresh;
int rach_ldavg_slots;
/* transceivers */
int num_trx;
struct llist_head trx_list;
/* SI related items */
int force_combined_si;
int bcch_change_mark;
struct rate_ctr_group *ctrs;
bool supp_meas_toa256;
struct {
/* Interference Boundaries for OML */
int16_t boundary[6];
uint8_t intave;
} interference;
unsigned int t200_ms[7];
unsigned int t3105_ms;
struct {
uint8_t overload_period;
struct {
/* Input parameters from OML */
uint8_t load_ind_thresh; /* percent */
uint8_t load_ind_period; /* seconds */
/* Internal data */
struct osmo_timer_list timer;
unsigned int pch_total;
unsigned int pch_used;
} ccch;
struct {
/* Input parameters from OML */
int16_t busy_thresh; /* in dBm */
uint16_t averaging_slots;
/* Internal data */
unsigned int total; /* total nr */
unsigned int busy; /* above busy_thresh */
unsigned int access; /* access bursts */
} rach;
} load;
uint8_t ny1;
uint8_t max_ta;
/* AGCH queuing */
struct {
struct llist_head queue;
int length;
int max_length;
int thresh_level; /* Cleanup threshold in percent of max len */
int low_level; /* Low water mark in percent of max len */
int high_level; /* High water mark in percent of max len */
/* TODO: Use a rate counter group instead */
uint64_t dropped_msgs;
uint64_t merged_msgs;
uint64_t rejected_msgs;
uint64_t agch_msgs;
uint64_t pch_msgs;
} agch_queue;
struct paging_state *paging_state;
char *bsc_oml_host;
struct llist_head oml_queue;
unsigned int rtp_jitter_buf_ms;
bool rtp_jitter_adaptive;
struct {
uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */
} support;
struct {
uint8_t tc4_ctr;
} si;
struct gsm_time gsm_time;
/* Radio Link Timeout counter. -1 disables timeout for
* lab/measurement purpose */
int radio_link_timeout;
int ul_power_target; /* Uplink Rx power target */
/* used by the sysmoBTS to adjust band */
uint8_t auto_band;
struct {
struct llist_head queue; /* list of struct smscb_msg */
struct smscb_msg *cur_msg; /* current SMS-CB */
} smscb_state;
float min_qual_rach; /* minimum quality for RACH bursts */
float min_qual_norm; /* minimum quality for normal daata */
uint16_t max_ber10k_rach; /* Maximum permitted RACH BER in 0.01% */
struct {
char *sock_path;
} pcu;
struct {
uint32_t last_fn;
struct timeval tv_clock;
struct osmo_timer_list fn_timer;
} vbts;
};
struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num);
struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts);
struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num);
enum bts_attribute str2btsattr(const char *s);
const char *btsatttr2str(enum bts_attribute v);
enum gsm_bts_type_variant str2btsvariant(const char *arg);
const char *btsvariant2str(enum gsm_bts_type_variant v);
extern const struct value_string gsm_chreq_descs[];
const struct value_string gsm_pchant_names[13];
const struct value_string gsm_pchant_descs[13];
const char *gsm_pchan_name(enum gsm_phys_chan_config c);
enum gsm_phys_chan_config gsm_pchan_parse(const char *name);
const char *gsm_lchant_name(enum gsm_chan_t c);
const char *gsm_chreq_name(enum gsm_chreq_reason_t c);
char *gsm_trx_name(const struct gsm_bts_trx *trx);
char *gsm_ts_name(const struct gsm_bts_trx_ts *ts);
char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts);
char *gsm_lchan_name_compute(const struct gsm_lchan *lchan);
const char *gsm_lchans_name(enum gsm_lchan_state s);
static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)
{
return lchan->name;
}
static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat)
{
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_set_bit_pos(&bts->features, feat, 1);
}
static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat)
{
OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
return bitvec_get_bit_pos(&bts->features, feat);
}
void gsm_abis_mo_reset(struct gsm_abis_mo *mo);
struct gsm_abis_mo *
gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class,
const struct abis_om_obj_inst *obj_inst);
struct gsm_nm_state *
gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class,
const struct abis_om_obj_inst *obj_inst);
void *
gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class,
const struct abis_om_obj_inst *obj_inst);
/* reset the state of all MO in the BTS */
void gsm_bts_mo_reset(struct gsm_bts *bts);
uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
uint8_t ts_nr, uint8_t lchan_nr);
uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan);
uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan,
enum gsm_phys_chan_config as_pchan);
/* return the gsm_lchan for the CBCH (if it exists at all) */
struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts);
/*
* help with parsing regexps
*/
int gsm_parse_reg(void *ctx, regex_t *reg, char **str,
int argc, const char **argv) __attribute__ ((warn_unused_result));
#define BSIC2BCC(bsic) ((bsic) & 0x3)
static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts)
{
if (ts->tsc != -1)
return ts->tsc;
else
return ts->trx->bts->bsic & 7;
}
struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr,
int *rc);
enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts);
uint8_t ts_subslots(struct gsm_bts_trx_ts *ts);
bool ts_is_tch(struct gsm_bts_trx_ts *ts);
const char *gsm_trx_unit_id(struct gsm_bts_trx *trx);
#endif

View File

@@ -1,12 +0,0 @@
#pragma once
enum {
HANDOVER_NONE = 0,
HANDOVER_ENABLED,
HANDOVER_WAIT_FRAME,
};
void handover_rach(struct gsm_lchan *lchan, uint8_t ra, uint8_t acc_delay);
void handover_frame(struct gsm_lchan *lchan);
void handover_reset(struct gsm_lchan *lchan);

View File

@@ -1,96 +0,0 @@
#ifndef L1SAP_H
#define L1SAP_H
#include <osmocom/gsm/protocol/gsm_04_08.h>
/* lchan link ID */
#define LID_SACCH 0x40
#define LID_DEDIC 0x00
/* timeslot and subslot from chan_nr */
#define L1SAP_CHAN2TS(chan_nr) (chan_nr & 7)
#define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1)
#define L1SAP_CHAN2SS_SDCCH4(chan_nr) ((chan_nr >> 3) & 3)
#define L1SAP_CHAN2SS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7)
/* logical channel from chan_nr + link_id */
#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH)
#define L1SAP_IS_CHAN_TCHF(chan_nr) ((chan_nr & 0xf8) == 0x08)
#define L1SAP_IS_CHAN_TCHH(chan_nr) ((chan_nr & 0xf0) == 0x10)
#define L1SAP_IS_CHAN_SDCCH4(chan_nr) ((chan_nr & 0xe0) == 0x20)
#define L1SAP_IS_CHAN_SDCCH8(chan_nr) ((chan_nr & 0xc0) == 0x40)
#define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80)
#define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88)
#define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90)
#define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0)
/* rach type from ra */
#define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f)
/* CCCH block from frame number */
#define L1SAP_FN2CCCHBLOCK(fn) ((fn % 51) / 5 - 1)
/* PTCH layout from frame number */
#define L1SAP_FN2MACBLOCK(fn) ((fn % 52) / 4)
#define L1SAP_FN2PTCCHBLOCK(fn) ((fn / 104) & 3)
/* Calculate PTCCH occurrence, See also 3GPP TS 05.02, Clause 7, Table 6 of 9 */
#define L1SAP_IS_PTCCH(fn) (((fn % 52) == 12) || ((fn % 52) == 38))
static const uint8_t fill_frame[GSM_MACBLOCK_LEN] = {
0x03, 0x03, 0x01, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B, 0x2B,
0x2B, 0x2B, 0x2B
};
/* subslot from any chan_nr */
static inline uint8_t l1sap_chan2ss(uint8_t chan_nr)
{
if (L1SAP_IS_CHAN_SDCCH8(chan_nr))
return L1SAP_CHAN2SS_SDCCH8(chan_nr);
if (L1SAP_IS_CHAN_SDCCH4(chan_nr))
return L1SAP_CHAN2SS_SDCCH4(chan_nr);
if (L1SAP_IS_CHAN_TCHH(chan_nr))
return L1SAP_CHAN2SS_TCHH(chan_nr);
return 0;
}
struct gsm_lchan *get_lchan_by_chan_nr(struct gsm_bts_trx *trx,
unsigned int chan_nr);
/* allocate a msgb containing a osmo_phsap_prim + optional l2 data */
struct msgb *l1sap_msgb_alloc(unsigned int l2_len);
/* any L1 prim received from bts model */
int l1sap_up(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap);
/* pcu (socket interface) sends us a data request primitive */
int l1sap_pdch_req(struct gsm_bts_trx_ts *ts, int is_ptcch, uint32_t fn,
uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len);
/* call-back function for incoming RTP */
void l1sap_rtp_rx_cb(struct osmo_rtp_socket *rs, const uint8_t *rtp_pl,
unsigned int rtp_pl_len, uint16_t seq_number,
uint32_t timestamp, bool marker);
/* channel control */
int l1sap_chan_act(struct gsm_bts_trx *trx, uint8_t chan_nr, struct tlv_parsed *tp);
int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_deact_sacch(struct gsm_bts_trx *trx, uint8_t chan_nr);
int l1sap_chan_modify(struct gsm_bts_trx *trx, uint8_t chan_nr);
extern const struct value_string gsmtap_sapi_names[];
extern struct gsmtap_inst *gsmtap;
extern uint32_t gsmtap_sapi_mask;
extern uint8_t gsmtap_sapi_acch;
int add_l1sap_header(struct gsm_bts_trx *trx, struct msgb *rmsg,
struct gsm_lchan *lchan, uint8_t chan_nr, uint32_t fn,
uint16_t ber10k, int16_t lqual_cb);
#define msgb_l1sap_prim(msg) ((struct osmo_phsap_prim *)(msg)->l1h)
int bts_check_for_first_ciphrd(struct gsm_lchan *lchan,
uint8_t *data, int len);
#endif /* L1SAP_H */

View File

@@ -1,40 +0,0 @@
#ifndef _LOGGING_H
#define _LOGGING_H
#define DEBUG
#include <osmocom/core/logging.h>
enum {
DRSL,
DOML,
DRLL,
DRR,
DMEAS,
DPAG,
DL1C,
DL1P,
DDSP,
DPCU,
DHO,
DTRX,
DLOOP,
DABIS,
DRTP,
DSUM,
};
extern const struct log_info bts_log_info;
/* LOGP with gsm_time prefix */
#define LOGPGT(ss, lvl, gt, fmt, args...) \
LOGP(ss, lvl, "%s " fmt, osmo_dump_gsmtime(gt), ## args)
#define DEBUGPGT(ss, gt, fmt, args...) \
LOGP(ss, LOGL_DEBUG, "%s " fmt, osmo_dump_gsmtime(gt), ## args)
/* LOGP with frame number prefix */
#define LOGPFN(ss, lvl, fn, fmt, args...) \
LOGP(ss, lvl, "%s " fmt, gsm_fn_as_gsmtime_str(fn), ## args)
#define DEBUGPFN(ss, fn, fmt, args...) \
LOGP(ss, LOGL_DEBUG, "%s " fmt, gsm_fn_as_gsmtime_str(fn), ## args)
#endif /* _LOGGING_H */

View File

@@ -1,11 +0,0 @@
#ifndef OSMO_BTS_MEAS_H
#define OSMO_BTS_MEAS_H
#define MEAS_MAX_TIMING_ADVANCE 63
#define MEAS_MIN_TIMING_ADVANCE 0
int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn);
int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn);
#endif

View File

@@ -1,48 +0,0 @@
/*
* Routines to check the structurally integrity of messages
*/
#pragma once
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/dtx_dl_amr_fsm.h>
#include <osmocom/codec/codec.h>
#include <stdbool.h>
struct msgb;
/* Access 1st part of msgb control buffer */
#define rtpmsg_marker_bit(x) ((x)->cb[0])
/* Access 2nd part of msgb control buffer */
#define rtpmsg_seq(x) ((x)->cb[1])
/* Access 3rd part of msgb control buffer */
#define rtpmsg_ts(x) ((x)->cb[2])
/**
* Classification of OML message. ETSI for plain GSM 12.21
* messages and IPA/Osmo for manufacturer messages.
*/
enum {
OML_MSG_TYPE_ETSI,
OML_MSG_TYPE_IPA,
OML_MSG_TYPE_OSMO,
};
void lchan_set_marker(bool t, struct gsm_lchan *lchan);
bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan);
void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e);
bool dtx_recursion(const struct gsm_lchan *lchan);
void dtx_int_signal(struct gsm_lchan *lchan);
bool dtx_is_first_p1(const struct gsm_lchan *lchan);
void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload,
size_t length, uint32_t fn, int update);
int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl,
size_t rtp_pl_len, uint32_t fn, uint8_t *l1_payload,
bool marker, uint8_t *len, uint8_t *ft_out);
uint8_t repeat_last_sid(struct gsm_lchan *lchan, uint8_t *dst, uint32_t fn);
int msg_verify_ipa_structure(struct msgb *msg);
int msg_verify_oml_structure(struct msgb *msg);

View File

@@ -1,50 +0,0 @@
#ifndef _OML_H
#define _OML_H
#include <osmocom/gsm/protocol/gsm_12_21.h>
struct gsm_bts;
struct gsm_abis_mo;
struct msgb;
struct gsm_lchan;
int oml_init(struct gsm_abis_mo *mo);
int down_oml(struct gsm_bts *bts, struct msgb *msg);
struct msgb *oml_msgb_alloc(void);
int oml_send_msg(struct msgb *msg, int is_mauf);
int oml_mo_send_msg(struct gsm_abis_mo *mo, struct msgb *msg, uint8_t msg_type);
int oml_mo_opstart_ack(struct gsm_abis_mo *mo);
int oml_mo_opstart_nack(struct gsm_abis_mo *mo, uint8_t nack_cause);
int oml_mo_statechg_ack(struct gsm_abis_mo *mo);
int oml_mo_statechg_nack(struct gsm_abis_mo *mo, uint8_t nack_cause);
/* Change the state and send STATE CHG REP */
int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state);
/* First initialization of MO, does _not_ generate state changes */
void oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state);
/* Update admin state and send ACK/NACK */
int oml_mo_rf_lock_chg(struct gsm_abis_mo *mo, uint8_t mute_state[8],
int success);
/* Transmit STATE CHG REP even if there was no state change */
int oml_tx_state_changed(struct gsm_abis_mo *mo);
int oml_mo_tx_sw_act_rep(struct gsm_abis_mo *mo);
int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause);
int oml_mo_fom_ack_nack(struct gsm_abis_mo *mo, uint8_t orig_msg_type,
uint8_t cause);
/* Configure LAPDm T200 timers for this lchan according to OML */
int oml_set_lchan_t200(struct gsm_lchan *lchan);
extern const unsigned int oml_default_t200_ms[7];
/* Transmit failure event report */
void oml_fail_rep(uint16_t cause_value, const char *fmt, ...);
#endif // _OML_H */

Some files were not shown because too many files have changed in this diff Show More