diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2011-09-28 02:46:16 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2011-09-29 01:31:20 +0200 |
commit | 3c46044cf1d2b352587266784eb064cb5d08260a (patch) | |
tree | 6afba331de1da0f27213a568819c8b5e87c63922 | |
parent | 3744b873e58008eaba359b52c7a07a9741c89cae (diff) |
Addition to last commit 2f5a3714075882ac946536709ac581453b6ad52a
-rw-r--r-- | include/osmocom/abis/lapd.h | 2 | ||||
-rw-r--r-- | src/input/lapd.c | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h index 03f8190..847a597 100644 --- a/include/osmocom/abis/lapd.h +++ b/include/osmocom/abis/lapd.h @@ -7,7 +7,7 @@ #include <osmocom/gsm/lapd_core.h> struct lapd_profile { - uint8_t k, k_sapi0; + uint8_t k[64]; int n200; int n201; int n202; diff --git a/src/input/lapd.c b/src/input/lapd.c index 22040cb..a19f0b1 100644 --- a/src/input/lapd.c +++ b/src/input/lapd.c @@ -68,8 +68,10 @@ #define LAPD_LEN(len) ((len << 2) | 0x1) #define LAPD_EL 0x1 +#define LAPD_SET_K(n, o) {n,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o} + const struct lapd_profile lapd_profile_isdn = { - 7, 0, + LAPD_SET_K(7,7), 3, 260, 3, @@ -80,10 +82,10 @@ const struct lapd_profile lapd_profile_isdn = { }; const struct lapd_profile lapd_profile_abis = { - 1, 2, + LAPD_SET_K(2,1), 3, 260, - 3, + 0, /* infinite */ 0,240000, 1,0, 10,0, @@ -91,12 +93,12 @@ const struct lapd_profile lapd_profile_abis = { }; const struct lapd_profile lapd_profile_sat = { - 15, 0, + LAPD_SET_K(15,15), 5, 260, 5, - 2,500000, - 2,500000, + 2,400000, + 2,400000, 20,0, 1 }; @@ -202,7 +204,7 @@ static struct lapd_sap *lapd_sap_alloc(struct lapd_tei *teip, uint8_t sapi) if (!sap) return NULL; - LOGP(DLLAPD, LOGL_INFO, "LAPD Allocating SAP for SAPI=%u / TEI=%u\n", + LOGP(DLLAPD, LOGL_NOTICE, "LAPD Allocating SAP for SAPI=%u / TEI=%u\n", sapi, teip->tei); sap->sapi = sapi; @@ -211,10 +213,10 @@ static struct lapd_sap *lapd_sap_alloc(struct lapd_tei *teip, uint8_t sapi) li = teip->li; profile = &li->profile; - if (sapi == 0 && profile->k_sapi0) - k = profile->k_sapi0; - else - k = profile->k; + k = profile->k[sapi & 0x3f]; + LOGP(DLLAPD, LOGL_NOTICE, "k=%d N200=%d N201=%d T200=%d.%d T203=%d.%d" + "\n", k, profile->n200, profile->n201, profile->t200_sec, + profile->t200_usec, profile->t203_sec, profile->t203_usec); lapd_dl_init(dl, k, 128, profile->n201); dl->use_sabme = 1; /* use SABME instead of SABM (GSM) */ dl->send_ph_data_req = send_ph_data_req; |