Projects
osmocom:master
osmo-bts
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 226
View file
commit_6064911ef278e98c5ef0e14dc8cd2fbb2e356285.txt
Added
View file
commit_ee01aa0640469dcea72e4c8b80f2a88ef660cbb8.txt
Deleted
View file
osmo-bts_1.10.0.9.ee01.dsc -> osmo-bts_1.10.0.12.6064.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-bts Binary: osmo-bts, osmo-bts-trx, osmo-bts-trx-dbg, osmo-bts-virtual, osmo-bts-virtual-dbg, osmo-bts-doc Architecture: any all -Version: 1.10.0.9.ee01 +Version: 1.10.0.12.6064 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmobts Standards-Version: 3.9.8 @@ -17,8 +17,8 @@ osmo-bts-virtual deb net optional arch=any osmo-bts-virtual-dbg deb debug extra arch=any Checksums-Sha1: - 59004fcf1e5da8aeb71fe82a4a8d612e0c2ec92e 518540 osmo-bts_1.10.0.9.ee01.tar.xz + ac7380d7d9fe7cc34412b075bedb103f9dae48f0 518264 osmo-bts_1.10.0.12.6064.tar.xz Checksums-Sha256: - 60bce1b1334371a1be525f479ec0cc20836b02ac7caa478de70581a804da046d 518540 osmo-bts_1.10.0.9.ee01.tar.xz + 27f3fd56da8ebba341141213a37accf1bba37928ae7ff43f5515c127c8f4e9ce 518264 osmo-bts_1.10.0.12.6064.tar.xz Files: - 4bf3fa044c6f6113c39ca773d590e413 518540 osmo-bts_1.10.0.9.ee01.tar.xz + 22313306735c106005db756f0a0ac949 518264 osmo-bts_1.10.0.12.6064.tar.xz
View file
osmo-bts_1.10.0.9.ee01.tar.xz/.tarball-version -> osmo-bts_1.10.0.12.6064.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.10.0.9-ee01 +1.10.0.12-6064
View file
osmo-bts_1.10.0.9.ee01.tar.xz/debian/changelog -> osmo-bts_1.10.0.12.6064.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-bts (1.10.0.9.ee01) unstable; urgency=medium +osmo-bts (1.10.0.12.6064) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Mon, 15 Dec 2025 10:16:09 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Mon, 15 Dec 2025 12:04:44 +0000 osmo-bts (1.10.0) unstable; urgency=medium
View file
osmo-bts_1.10.0.9.ee01.tar.xz/src/common/pcu_sock.c -> osmo-bts_1.10.0.12.6064.tar.xz/src/common/pcu_sock.c
Changed
@@ -34,6 +34,9 @@ #include <osmocom/core/write_queue.h> #include <osmocom/gsm/gsm23003.h> #include <osmocom/gsm/abis_nm.h> + +#include <osmocom/netif/stream.h> + #include <osmo-bts/logging.h> #include <osmo-bts/gsm_data.h> #include <osmo-bts/pcu_if.h> @@ -1012,18 +1015,14 @@ */ struct pcu_sock_state { - struct osmo_fd listen_bfd; /* fd for listen socket */ - struct osmo_wqueue upqueue; /* For sending messages; has fd for conn. to PCU */ + struct osmo_stream_srv_link *srv_link; /* fd for listen socket */ + struct osmo_stream_srv *conn; }; -static void pcu_sock_close(struct pcu_sock_state *state); - int pcu_sock_send(struct msgb *msg) { struct pcu_sock_state *state = g_bts_sm->gprs.pcu_state; - struct osmo_fd *conn_bfd; struct gsm_pcu_if *pcu_prim = (struct gsm_pcu_if *) msg->data; - int rc; if (!state) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND && @@ -1033,8 +1032,7 @@ msgb_free(msg); return -EINVAL; } - conn_bfd = &state->upqueue.bfd; - if (conn_bfd->fd <= 0) { + if (!state->conn) { if (pcu_prim->msg_type != PCU_IF_MSG_TIME_IND && pcu_prim->msg_type != PCU_IF_MSG_INTERF_IND) LOGP(DPCU, LOGL_NOTICE, "PCU socket not connected, " @@ -1043,21 +1041,12 @@ return -EIO; } - rc = osmo_wqueue_enqueue(&state->upqueue, msg); - if (rc < 0) { - if (rc == -ENOSPC) - LOGP(DPCU, LOGL_NOTICE, "PCU not reacting (more than %u messages waiting). Closing connection\n", - state->upqueue.max_length); - pcu_sock_close(state); - msgb_free(msg); - return rc; - } + osmo_stream_srv_send(state->conn, msg); return 0; } static void pcu_sock_close(struct pcu_sock_state *state) { - struct osmo_fd *bfd = &state->upqueue.bfd; struct gsm_bts *bts; struct gsm_bts_trx *trx; unsigned int tn; @@ -1071,17 +1060,13 @@ bts->pcu_version0 = '\0'; - osmo_fd_unregister(bfd); - close(bfd->fd); - bfd->fd = -1; + osmo_stream_srv_destroy(state->conn); + state->conn = NULL; /* patch SI3 to remove GPRS indicator */ regenerate_si3_restoctets(bts); regenerate_si4_restoctets(bts); - /* re-enable the generation of ACCEPT for new connections */ - osmo_fd_read_enable(&state->listen_bfd); - #if 0 /* remove si13, ... */ bts->si_valid &= ~(1 << SYSINFO_TYPE_13); @@ -1102,28 +1087,27 @@ l1sap_chan_rel(trx, gsm_lchan2chan_nr(&ts->lchan0)); } } +} - osmo_wqueue_clear(&state->upqueue); +static int pcu_sock_conn_closed_cb(struct osmo_stream_srv *conn) +{ + struct pcu_sock_state *state = osmo_stream_srv_get_data(conn); + LOGP(DPCU, LOGL_ERROR, "PCUIF connection closed\n"); + state->conn = NULL; + pcu_sock_close(state); + return 0; } -static int pcu_sock_read(struct osmo_fd *bfd) +static int pcu_sock_conn_read_cb(struct osmo_stream_srv *conn, int res, struct msgb *msg) { - struct pcu_sock_state *state = (struct pcu_sock_state *)bfd->data; + struct pcu_sock_state *state = osmo_stream_srv_get_data(conn); struct gsm_pcu_if *pcu_prim; - struct msgb *msg; int rc; - msg = msgb_alloc(sizeof(*pcu_prim) + 1000, "pcu_sock_rx"); - if (!msg) - return -ENOMEM; - - pcu_prim = (struct gsm_pcu_if *) msg->tail; - - rc = recv(bfd->fd, msg->tail, msgb_tailroom(msg), 0); - if (rc == 0) + if (res == 0) goto close; - if (rc < 0) { + if (res < 0) { if (errno == EAGAIN) { msgb_free(msg); return 0; @@ -1131,14 +1115,15 @@ goto close; } - if (rc < PCUIF_HDR_SIZE) { + if (res < PCUIF_HDR_SIZE) { LOGP(DPCU, LOGL_ERROR, "Received %d bytes on PCU Socket, but primitive hdr size " - "is %zu, discarding\n", rc, PCUIF_HDR_SIZE); + "is %zu, discarding\n", res, PCUIF_HDR_SIZE); msgb_free(msg); return 0; } - rc = pcu_rx(pcu_prim->msg_type, pcu_prim, rc); + pcu_prim = (struct gsm_pcu_if *) msgb_data(msg); + rc = pcu_rx(pcu_prim->msg_type, pcu_prim, msgb_length(msg)); /* as we always synchronously process the message in pcu_rx() and * its callbacks, we can free the message here. */ @@ -1152,61 +1137,20 @@ return -1; } -static int pcu_sock_write(struct osmo_fd *bfd, struct msgb *msg) -{ - struct pcu_sock_state *state = bfd->data; - int rc; - - /* bug hunter 8-): maybe someone forgot msgb_put(...) ? */ - OSMO_ASSERT(msgb_length(msg) > 0); - /* try to send it over the socket */ - rc = write(bfd->fd, msgb_data(msg), msgb_length(msg)); - if (OSMO_UNLIKELY(rc == 0)) - goto close; - if (OSMO_UNLIKELY(rc < 0)) { - if (errno == EAGAIN) - return -EAGAIN; - return -1; - } - return 0; - -close: - pcu_sock_close(state); - return -1; -} - /* accept connection coming from PCU */ -static int pcu_sock_accept(struct osmo_fd *bfd, unsigned int flags) +static int pcu_sock_accept(struct osmo_stream_srv_link *link, int fd) { - struct pcu_sock_state *state = (struct pcu_sock_state *)bfd->data; - struct osmo_fd *conn_bfd = &state->upqueue.bfd; - struct sockaddr_un un_addr; - socklen_t len; - int fd; - - len = sizeof(un_addr); - fd = accept(bfd->fd, (struct sockaddr *)&un_addr, &len); - if (fd < 0) { - LOGP(DPCU, LOGL_ERROR, "Failed to accept a new connection\n"); - return -1; - } + struct pcu_sock_state *state = osmo_stream_srv_link_get_data(link); - if (conn_bfd->fd >= 0) { + if (state->conn) { LOGP(DPCU, LOGL_NOTICE, "PCU connects but we already have another active connection ?!?\n"); - /* We already have one PCU connected, this is all we support */ - osmo_fd_read_disable(&state->listen_bfd); close(fd); return 0; } - osmo_fd_setup(conn_bfd, fd, OSMO_FD_READ, osmo_wqueue_bfd_cb, state, 0); - - if (osmo_fd_register(conn_bfd) != 0) { - LOGP(DPCU, LOGL_ERROR, "Failed to register new connection fd\n"); - close(conn_bfd->fd); - conn_bfd->fd = -1; - return -1; - } + state->conn = osmo_stream_srv_create2(state, link, fd, state); + osmo_stream_srv_set_read_cb(state->conn, pcu_sock_conn_read_cb); + osmo_stream_srv_set_closed_cb(state->conn, pcu_sock_conn_closed_cb); LOGP(DPCU, LOGL_NOTICE, "PCU socket connected to external PCU\n"); @@ -1216,45 +1160,58 @@ return 0; } +static struct pcu_sock_state *pcu_sock_state_alloc(struct gsm_bts_sm *bts_sm, const char *path, int qlength_max) +{ + struct pcu_sock_state *state; + state = talloc_zero(bts_sm, struct pcu_sock_state); + OSMO_ASSERT(state); + + state->srv_link = osmo_stream_srv_link_create(state); + OSMO_ASSERT(state->srv_link); + osmo_stream_srv_link_set_domain(state->srv_link, AF_UNIX); + osmo_stream_srv_link_set_type(state->srv_link, SOCK_SEQPACKET); + osmo_stream_srv_link_set_name(state->srv_link, "PCUIF"); + osmo_stream_srv_link_set_data(state->srv_link, state); + osmo_stream_srv_link_set_accept_cb(state->srv_link, pcu_sock_accept); + osmo_stream_srv_link_set_msgb_alloc_info(state->srv_link, sizeof(struct gsm_pcu_if) + 1000, 0); + osmo_stream_srv_link_set_tx_queue_max_length(state->srv_link, qlength_max); + osmo_stream_srv_link_set_addr(state->srv_link, path); + + return state; +} + +static void pcu_sock_state_free(struct pcu_sock_state *state) +{ + if (!state) + return; + + if (state->conn) + pcu_sock_close(state); + + osmo_stream_srv_link_destroy(state->srv_link); + state->srv_link = NULL; + talloc_free(state); +} + int pcu_sock_init(const char *path, int qlength_max) { struct pcu_sock_state *state; - struct osmo_fd *bfd; int rc; - state = talloc_zero(g_bts_sm, struct pcu_sock_state); + state = pcu_sock_state_alloc(g_bts_sm, path, qlength_max); if (!state) return -ENOMEM; - osmo_wqueue_init(&state->upqueue, qlength_max); - state->upqueue.read_cb = pcu_sock_read; - state->upqueue.write_cb = pcu_sock_write; - state->upqueue.bfd.fd = -1; - - bfd = &state->listen_bfd; - - rc = osmo_sock_unix_init(SOCK_SEQPACKET, 0, path, OSMO_SOCK_F_BIND); + rc = osmo_stream_srv_link_open(state->srv_link); if (rc < 0) { LOGP(DPCU, LOGL_ERROR, "Could not create %s unix socket: %s\n", path, strerror(errno)); - talloc_free(state); + pcu_sock_state_free(state); return -1; } - osmo_fd_setup(bfd, rc, OSMO_FD_READ, pcu_sock_accept, state, 0); - - rc = osmo_fd_register(bfd); - if (rc < 0) { - LOGP(DPCU, LOGL_ERROR, "Could not register listen fd: %d\n", - rc); - close(bfd->fd); - talloc_free(state); - return rc; - } - - osmo_signal_register_handler(SS_GLOBAL, pcu_if_signal_cb, NULL); - g_bts_sm->gprs.pcu_state = state; + osmo_signal_register_handler(SS_GLOBAL, pcu_if_signal_cb, NULL); LOGP(DPCU, LOGL_INFO, "Started listening on PCU socket (PCU IF v%u): %s\n", PCU_IF_VERSION, path); @@ -1263,20 +1220,11 @@ void pcu_sock_exit(void) { - struct pcu_sock_state *state = g_bts_sm->gprs.pcu_state; - struct osmo_fd *bfd, *conn_bfd; - - if (!state) + if (!g_bts_sm->gprs.pcu_state) return; osmo_signal_unregister_handler(SS_GLOBAL, pcu_if_signal_cb, NULL); - conn_bfd = &state->upqueue.bfd; - if (conn_bfd->fd > 0) - pcu_sock_close(state); - bfd = &state->listen_bfd; - close(bfd->fd); - osmo_fd_unregister(bfd); - talloc_free(state); + pcu_sock_state_free(g_bts_sm->gprs.pcu_state); g_bts_sm->gprs.pcu_state = NULL; } @@ -1285,7 +1233,7 @@ if (!state) return false; - if (state->upqueue.bfd.fd <= 0) + if (!state->conn) return false; return true; }
View file
osmo-bts_1.10.0.9.ee01.tar.xz/src/osmo-bts-trx/trx_if.c -> osmo-bts_1.10.0.12.6064.tar.xz/src/osmo-bts-trx/trx_if.c
Changed
@@ -755,18 +755,11 @@ * TRX burst data socket */ -/* Uplink TRXDv0 header length: TDMA TN + FN + RSSI + ToA256 */ -#define TRX_UL_V0HDR_LEN (1 + 4 + 1 + 2) -/* Uplink TRXDv1 header length: additional MTS + C/I */ -#define TRX_UL_V1HDR_LEN (TRX_UL_V0HDR_LEN + 1 + 2) -/* Uplink TRXDv2 header length: TDMA TN + TRXN + MTS + RSSI + ToA256 + C/I */ -#define TRX_UL_V2HDR_LEN (1 + 1 + 1 + 1 + 2 + 2) - /* Minimum Uplink TRXD header length for all PDU versions */ static const uint8_t trx_data_rx_hdr_len = { - TRX_UL_V0HDR_LEN, /* TRXDv0 */ - TRX_UL_V1HDR_LEN, /* TRXDv1 */ - TRX_UL_V2HDR_LEN, /* TRXDv2 */ + TRXD_UL_V0HDR_LEN, /* TRXDv0 */ + TRXD_UL_V1HDR_LEN, /* TRXDv1 */ + TRXD_UL_V2HDR_LEN, /* TRXDv2 */ }; static const uint8_t trx_data_mod_val = { @@ -792,7 +785,7 @@ { /* Parse TRXDv0 specific header part */ trx_data_handle_hdr_v0_part(bi, buf); - buf_len -= TRX_UL_V0HDR_LEN; + buf_len -= TRXD_UL_V0HDR_LEN; /* Guess modulation and burst length by the rest octets. * NOTE: a legacy transceiver may append two garbage bytes. */ @@ -811,7 +804,7 @@ return -EINVAL; } - return TRX_UL_V0HDR_LEN; + return TRXD_UL_V0HDR_LEN; } /* Parser for MTS (Modulation and Training Sequence) */ @@ -862,7 +855,7 @@ /* Parse TRXDv0 specific header part */ trx_data_handle_hdr_v0_part(bi, buf); - buf += TRX_UL_V0HDR_LEN; + buf += TRXD_UL_V0HDR_LEN; /* MTS (Modulation and Training Sequence) */ rc = trx_data_parse_mts(phy_inst, bi, buf0); @@ -873,7 +866,7 @@ bi->ci_cb = (int16_t) osmo_load16be(buf + 1); bi->flags |= TRX_BI_F_CI_CB; - return TRX_UL_V1HDR_LEN; + return TRXD_UL_V1HDR_LEN; } /* TRXD header dissector for version 0x01 */ @@ -907,18 +900,18 @@ /* TDMA frame number is absent in batched PDUs */ if (bi->_num_pdus == 0) { - if (OSMO_UNLIKELY(buf_len < sizeof(bi->fn) + TRX_UL_V2HDR_LEN)) { + if (OSMO_UNLIKELY(buf_len < sizeof(bi->fn) + TRXD_UL_V2HDR_LEN)) { LOGPPHI(phy_inst, DTRX, LOGL_ERROR, "Rx malformed TRXDv2 PDU: not enough bytes " "to parse TDMA frame number\n"); return -EINVAL; } - bi->fn = osmo_load32be(buf + TRX_UL_V2HDR_LEN); - return TRX_UL_V2HDR_LEN + sizeof(bi->fn); + bi->fn = osmo_load32be(buf + TRXD_UL_V2HDR_LEN); + return TRXD_UL_V2HDR_LEN + sizeof(bi->fn); } - return TRX_UL_V2HDR_LEN; + return TRXD_UL_V2HDR_LEN; } /* TRXD burst handler (version independent) */ @@ -1132,7 +1125,7 @@ } if (l1h->data.sndbuf == NULL) { - l1h->data.sndbuf = msgb_alloc_c(l1h, TRXD_MSG_BUF_SIZE, "tx_trxd"); + l1h->data.sndbuf = msgb_alloc_c(l1h, TRXD_DL_MSG_BUF_SIZE, "tx_trxd"); OSMO_ASSERT(l1h->data.sndbuf); } sndbuf = l1h->data.sndbuf; @@ -1329,7 +1322,7 @@ close(rc); goto ret_close_trxc; } - osmo_iofd_set_alloc_info(l1h->trx_data_iofd, TRXD_MSG_BUF_SIZE, 0); + osmo_iofd_set_alloc_info(l1h->trx_data_iofd, TRXD_UL_MSG_BUF_SIZE, 0); /* register sockets */ osmo_iofd_register(l1h->trx_ctrl_iofd, -1);
View file
osmo-bts_1.10.0.9.ee01.tar.xz/src/osmo-bts-trx/trx_if.h -> osmo-bts_1.10.0.12.6064.tar.xz/src/osmo-bts-trx/trx_if.h
Changed
@@ -1,9 +1,37 @@ #pragma once +#include <osmocom/core/utils.h> +#include <osmo-bts/scheduler.h> + +/* NOTE: (2*GSM_BURST_LEN = VAMOS) + * This ends up being EGPRS_BURST_LEN, 444 */ +#define TRXD_BURST_SIZE_MAX OSMO_MAX(2 * GSM_BURST_LEN, EGPRS_BURST_LEN) + +/* Uplink TRXDv0 header length: TDMA TN + FN + RSSI + ToA256 */ +#define TRXD_UL_V0HDR_LEN (1 + 4 + 1 + 2) +/* Uplink TRXDv1 header length: additional MTS + C/I */ +#define TRXD_UL_V1HDR_LEN (TRXD_UL_V0HDR_LEN + 1 + 2) +/* Uplink TRXDv2 header length: TDMA TN + TRXN + MTS + RSSI + ToA256 + C/I */ +#define TRXD_UL_V2HDR_LEN (1 + 1 + 1 + 1 + 2 + 2) +/* NOTE: TRXDv0: a legacy transceiver may append two garbage bytes: + * NOTE: TRXDv2: 4+ to account for optional TDMA Fn field: */ +#define TRXD_UL_MAX_HDR_LEN OSMO_MAX(TRXD_UL_V0HDR_LEN + 2, OSMO_MAX(TRXD_UL_V1HDR_LEN, 4 + TRXD_UL_V2HDR_LEN)) +/* Note (OS#5827): once we support TRX batching, we miss here "* PCU_IF_NUM_TRX" */ +#define TRXD_UL_MSG_BUF_SIZE ((TRXD_UL_MAX_HDR_LEN + TRXD_BURST_SIZE_MAX) * TRX_NR_TS) + + +/* Downlink TRXDv0/1 header length: TDMA TN + FN + Att */ +#define TRXD_DL_V0HDR_LEN (1 + 4 + 1) +#define TRXD_DL_V1HDR_LEN TRXD_DL_V0HDR_LEN +/* Downlink TRXDv2 header length: TDMA TN + TRXN + MTS + Att + SCPIR + spare3 + FN (on first PDU) */ +#define TRXD_DL_V2HDR_LEN (1 + 1 + 1 + 1 + 1 + 3 + 4) +#define TRXD_DL_MAX_HDR_LEN OSMO_MAX(TRXD_DL_V0HDR_LEN, OSMO_MAX(TRXD_DL_V1HDR_LEN, TRXD_DL_V2HDR_LEN)) + +/* Note (OS#5827): once we support TRX batching, we miss here "* PCU_IF_NUM_TRX" */ +#define TRXD_DL_MSG_BUF_SIZE ((TRXD_DL_MAX_HDR_LEN + TRXD_BURST_SIZE_MAX) * TRX_NR_TS) + /* TRXC read/send buffer size */ #define TRXC_MSG_BUF_SIZE 1500 -/* TRXD read/send buffer size (max. IPv4 MTU) */ -#define TRXD_MSG_BUF_SIZE 65535U struct trx_dl_burst_req; struct trx_l1h;
View file
osmo-bts_1.10.0.9.ee01.tar.xz/src/osmo-bts-trx/trx_provision_fsm.c -> osmo-bts_1.10.0.12.6064.tar.xz/src/osmo-bts-trx/trx_provision_fsm.c
Changed
@@ -400,7 +400,7 @@ switch (event) { case TRX_PROV_EV_CLOSE: /* In this state, we didn't for sure send a POWERON yet, hence we - are save directly applying the close as if we received a + are safe directly applying the close as if we received a POWEROFF RSP: */ if (pinst->num == 0) trx_prov_fsm_apply_close(pinst->phy_link, 0);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.