summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/layer1
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-01-26 18:56:16 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-28 13:13:38 +0100
commitc4701d420479f45c2fdf1526945edd707ed32a55 (patch)
tree2e5a4efad5f3a94f61deee7ea52e14454f132cd9 /src/target/firmware/layer1
parent9dd1f00e836044d9378350882e54c8c7442b3e60 (diff)
Added callback function to forward L1CTL packets to rather than SERCOM
This is experimental, maybe there should be a better way to do that.
Diffstat (limited to 'src/target/firmware/layer1')
-rw-r--r--src/target/firmware/layer1/l23_api.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index ed43e142..f8152c5c 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -49,8 +49,14 @@
#define L3_MSG_HEAD 4
#define L3_MSG_SIZE (sizeof(struct l1ctl_hdr)+sizeof(struct l1ctl_info_dl)+sizeof(struct l1ctl_traffic_ind) + L3_MSG_HEAD)
+void (*l1a_l23_tx_cb)(struct msgb *msg) = NULL;
+
void l1_queue_for_l2(struct msgb *msg)
{
+ if (l1a_l23_tx_cb) {
+ l1a_l23_tx_cb(msg);
+ return;
+ }
/* forward via serial for now */
sercomm_sendmsg(SC_DLCI_L1A_L23, msg);
}
@@ -574,7 +580,7 @@ static void l1ctl_sim_req(struct msgb *msg)
}
/* callback from SERCOMM when L2 sends a message to L1 */
-static void l1a_l23_rx_cb(uint8_t dlci, struct msgb *msg)
+void l1a_l23_rx(uint8_t dlci, struct msgb *msg)
{
struct l1ctl_hdr *l1h = (struct l1ctl_hdr *) msg->data;
@@ -653,5 +659,6 @@ exit_nofree:
void l1a_l23api_init(void)
{
- sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx_cb);
+ sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx);
}
+