aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-05 20:20:50 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-05 20:26:27 +0100
commit4ee2eaf3c49018872c57ebb12cd44c33ed04eec4 (patch)
treeda43a7242f73924856d3104390ef5701e12eefd7 /openbsc
parent8fc66a0c4d683f3b4de16f7306235d88112451d6 (diff)
[DAHDI] make sure LAPD transmits with correct SAPI
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/input/dahdi.c3
-rw-r--r--openbsc/src/input/lapd.c7
-rw-r--r--openbsc/src/input/lapd.h3
3 files changed, 7 insertions, 6 deletions
diff --git a/openbsc/src/input/dahdi.c b/openbsc/src/input/dahdi.c
index 08bd1e01c..c086954c3 100644
--- a/openbsc/src/input/dahdi.c
+++ b/openbsc/src/input/dahdi.c
@@ -169,7 +169,8 @@ static int handle_ts1_write(struct bsc_fd *bfd)
return 0;
}
- lapd_transmit(e1i_ts->driver.dahdi.lapd, sign_link->tei, msg->data, msg->len);
+ lapd_transmit(e1i_ts->driver.dahdi.lapd, sign_link->tei,
+ sign_link->sapi, msg->data, msg->len);
msgb_free(msg);
/* set tx delay timer for next event */
diff --git a/openbsc/src/input/lapd.c b/openbsc/src/input/lapd.c
index de0d5a546..8aa71e2f5 100644
--- a/openbsc/src/input/lapd.c
+++ b/openbsc/src/input/lapd.c
@@ -97,7 +97,6 @@ struct lapd_tei {
struct llist_head list;
uint8_t tei;
- uint8_t sapi;
/* A valid N(R) value is one that is in the range V(A) ≤ N(R) ≤ V(S). */
int vs; /* next to be transmitted */
int va; /* last acked by peer */
@@ -456,7 +455,7 @@ uint8_t *lapd_receive(struct lapd_instance *li, uint8_t * data, unsigned int len
return NULL;
};
-void lapd_transmit(struct lapd_instance *li, uint8_t tei,
+void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t sapi,
uint8_t *data, unsigned int len)
{
//printf("lapd_transmit %d, %d\n", tei, len);
@@ -475,8 +474,8 @@ void lapd_transmit(struct lapd_instance *li, uint8_t tei,
memmove(buf + 4, data, len);
len += 4;
- buf[0] = (teip->sapi << 2) | (li->network_side ? 2 : 0);
- buf[1] = (teip->tei << 1) | 1;
+ buf[0] = (sapi << 2) | (li->network_side ? 2 : 0);
+ buf[1] = (tei << 1) | 1;
buf[2] = (LAPD_NS(teip) << 1);
buf[3] = (LAPD_NR(teip) << 1) | 0;
diff --git a/openbsc/src/input/lapd.h b/openbsc/src/input/lapd.h
index f79d84f14..1661af781 100644
--- a/openbsc/src/input/lapd.h
+++ b/openbsc/src/input/lapd.h
@@ -29,7 +29,8 @@ struct lapd_instance {
extern uint8_t *lapd_receive(struct lapd_instance *li, uint8_t *data, unsigned int len,
int *ilen, lapd_mph_type *prim);
-extern void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t *data, unsigned int len);
+extern void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t sapi,
+ uint8_t *data, unsigned int len);
struct lapd_instance *lapd_instance_alloc(void (*tx_cb)(uint8_t *data, int len,
void *cbdata), void *cbdata);