fw/layer1: Introduce prim_utils.c for shared helper betwee primitives
Currently only share the idle frame pattern. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
aef1e05d9a
commit
1b6c2593eb
|
@ -7,6 +7,9 @@
|
|||
|
||||
struct l1ctl_fbsb_req;
|
||||
|
||||
/* Utils */
|
||||
const uint8_t *pu_get_idle_frame(void);
|
||||
|
||||
/* Primitives tests/requests */
|
||||
void l1s_fb_test(uint8_t base_fn, uint8_t fb_mode);
|
||||
void l1s_sb_test(uint8_t base_fn);
|
||||
|
|
|
@ -5,5 +5,5 @@ layer1_SRCS=avg.c agc.c afc.c sync.c tdma_sched.c tpu_window.c init.c l23_api.c
|
|||
mframe_sched.c sched_gsmtime.c async.c rfch.c apc.c
|
||||
|
||||
layer1_SRCS += prim_pm.c prim_rach.c prim_tx_nb.c prim_rx_nb.c prim_fbsb.c \
|
||||
prim_freq.c
|
||||
prim_freq.c prim_utils.c
|
||||
|
||||
|
|
|
@ -53,8 +53,6 @@
|
|||
|
||||
static uint32_t last_txnb_fn;
|
||||
|
||||
static const uint8_t ubUui[23] = { 0x01, 0x03, 0x01, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b };
|
||||
|
||||
/* p1: type of operation (0: one NB, 1: one RACH burst, 2: four NB */
|
||||
static int l1s_tx_resp(__unused uint8_t p1, __unused uint8_t burst_id,
|
||||
__unused uint16_t p3)
|
||||
|
@ -103,7 +101,7 @@ static int l1s_tx_cmd(uint8_t p1, uint8_t burst_id, uint16_t p3)
|
|||
/* If the TX queue is empty, send idle pattern */
|
||||
if (!msg) {
|
||||
puts("TX idle pattern\n");
|
||||
data = ubUui;
|
||||
data = pu_get_idle_frame();
|
||||
} else {
|
||||
puts("TX uplink msg\n");
|
||||
data = msg->l3h;
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
/* Layer 1 Various primitive utilities */
|
||||
|
||||
/* (C) 2010 by Sylvain Munaut <tnt@246tNt.com>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* 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 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, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <layer1/sync.h>
|
||||
|
||||
|
||||
static const uint8_t ubUui[23] = {
|
||||
/* dummy lapdm header */
|
||||
0x01, 0x03, 0x01,
|
||||
|
||||
/* fill bytes */
|
||||
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
|
||||
0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b, 0x2b,
|
||||
0x2b, 0x2b, 0x2b, 0x2b
|
||||
};
|
||||
|
||||
|
||||
const uint8_t *pu_get_idle_frame(void)
|
||||
{
|
||||
return ubUui;
|
||||
}
|
Loading…
Reference in New Issue