summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/layer1/sync.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-03-21 12:57:28 +0800
committerHarald Welte <laforge@gnumonks.org>2010-03-21 12:57:28 +0800
commitbee63154c4b763b5a6893a4f654ecb8b795325cc (patch)
treefa8c2e4bd332cc9acd603cef97bd3aff6e81ed84 /src/target/firmware/layer1/sync.c
parent7c8ed1a2300147e39437a6e5579b55b389784ff7 (diff)
L1A/L23 interface (L1CTL) cleanup
* introduce a new 'l1ctl_hdr' structure common to all messages on this interface * use struct l1ctl_hdr in both the firmware and layer23 * add a new L1CTL_PM_REQ request for performing layer23-initiated power measurements (firmware does not implement them yet)
Diffstat (limited to 'src/target/firmware/layer1/sync.c')
-rw-r--r--src/target/firmware/layer1/sync.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/target/firmware/layer1/sync.c b/src/target/firmware/layer1/sync.c
index 38794158..e80756a5 100644
--- a/src/target/firmware/layer1/sync.c
+++ b/src/target/firmware/layer1/sync.c
@@ -840,8 +840,9 @@ static int l1s_nb_resp(__unused uint8_t p1, uint8_t burst_id, uint16_t p3)
/* 4th burst, get frame data */
if (dsp_api.db_r->d_burst_d == 3) {
+ struct l1ctl_hdr *l1h;
struct l1ctl_info_dl *dl;
- struct l1ctl_data_ind *l1;
+ struct l1ctl_data_ind *di;
uint32_t avg_snr = 0;
int32_t avg_dbm8 = 0;
uint8_t i, j;
@@ -863,8 +864,9 @@ static int l1s_nb_resp(__unused uint8_t p1, uint8_t burst_id, uint16_t p3)
/* place it in the queue for the layer2 */
msg = l1_create_l2_msg(L1CTL_DATA_IND, l1s.current_time.fn-4, last_fb->snr, rf_arfcn);
- dl = (struct l1ctl_info_dl *) msg->data;
- l1 = (struct l1ctl_data_ind *) msgb_put(msg, sizeof(*l1));
+ l1h = (struct l1ctl_hdr *) msg->l1h;
+ dl = (struct l1ctl_info_dl *) l1h->data;
+ di = (struct l1ctl_data_ind *) msgb_put(msg, sizeof(*di));
/* Set Channel Number depending on MFrame Task ID */
dl->chan_nr = mframe_task2chan_nr(mf_task_id, 0); /* FIXME: TS */
@@ -885,7 +887,7 @@ static int l1s_nb_resp(__unused uint8_t p1, uint8_t burst_id, uint16_t p3)
/* copy the actual payload data */
for (i = 0; i < 23; ++i)
- l1->data[i] = sig->nb.frame[i];
+ di->data[i] = sig->nb.frame[i];
l1_queue_for_l2(msg);
/* clear downlink task */