diff options
author | Andreas Eversberg <andreas@eversberg.eu> | 2009-05-25 03:50:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-25 03:51:35 -0400 |
commit | 5b277b8605f4c8fbd13302df33ab4570f844c1ff (patch) | |
tree | d8613c050f53bb694c1d59e2ee5f82b0564ad7b6 /drivers/isdn/mISDN/layer2.c | |
parent | bc138ec4ac58bb83e2d9d5c12328d5452294c1f0 (diff) |
mISDN: Fix TEI and SAPI handling
Added SAPI value to use SAPIs different than 0.
Now fixed TEIs work in NT mode. This allows PTP endpoint to be connected
to PTMP ports together with other PTMP endpoints.
New enhanced version, thanks to Sam Ravnborg <sam@ravnborg.org> for the
hints.
Signed-off-by: Andreas Eversberg <andreas@eversberg.eu>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn/mISDN/layer2.c')
-rw-r--r-- | drivers/isdn/mISDN/layer2.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c index d6e2863f224a..2d2f58195477 100644 --- a/drivers/isdn/mISDN/layer2.c +++ b/drivers/isdn/mISDN/layer2.c | |||
@@ -2068,7 +2068,8 @@ l2_ctrl(struct mISDNchannel *ch, u_int cmd, void *arg) | |||
2068 | } | 2068 | } |
2069 | 2069 | ||
2070 | struct layer2 * | 2070 | struct layer2 * |
2071 | create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg) | 2071 | create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, int tei, |
2072 | int sapi) | ||
2072 | { | 2073 | { |
2073 | struct layer2 *l2; | 2074 | struct layer2 *l2; |
2074 | struct channel_req rq; | 2075 | struct channel_req rq; |
@@ -2089,7 +2090,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg) | |||
2089 | test_and_set_bit(FLG_LAPD, &l2->flag); | 2090 | test_and_set_bit(FLG_LAPD, &l2->flag); |
2090 | test_and_set_bit(FLG_LAPD_NET, &l2->flag); | 2091 | test_and_set_bit(FLG_LAPD_NET, &l2->flag); |
2091 | test_and_set_bit(FLG_MOD128, &l2->flag); | 2092 | test_and_set_bit(FLG_MOD128, &l2->flag); |
2092 | l2->sapi = 0; | 2093 | l2->sapi = sapi; |
2093 | l2->maxlen = MAX_DFRAME_LEN; | 2094 | l2->maxlen = MAX_DFRAME_LEN; |
2094 | if (test_bit(OPTION_L2_PMX, &options)) | 2095 | if (test_bit(OPTION_L2_PMX, &options)) |
2095 | l2->window = 7; | 2096 | l2->window = 7; |
@@ -2099,7 +2100,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg) | |||
2099 | test_and_set_bit(FLG_PTP, &l2->flag); | 2100 | test_and_set_bit(FLG_PTP, &l2->flag); |
2100 | if (test_bit(OPTION_L2_FIXEDTEI, &options)) | 2101 | if (test_bit(OPTION_L2_FIXEDTEI, &options)) |
2101 | test_and_set_bit(FLG_FIXED_TEI, &l2->flag); | 2102 | test_and_set_bit(FLG_FIXED_TEI, &l2->flag); |
2102 | l2->tei = (u_int)arg; | 2103 | l2->tei = tei; |
2103 | l2->T200 = 1000; | 2104 | l2->T200 = 1000; |
2104 | l2->N200 = 3; | 2105 | l2->N200 = 3; |
2105 | l2->T203 = 10000; | 2106 | l2->T203 = 10000; |
@@ -2114,7 +2115,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg) | |||
2114 | test_and_set_bit(FLG_LAPD, &l2->flag); | 2115 | test_and_set_bit(FLG_LAPD, &l2->flag); |
2115 | test_and_set_bit(FLG_MOD128, &l2->flag); | 2116 | test_and_set_bit(FLG_MOD128, &l2->flag); |
2116 | test_and_set_bit(FLG_ORIG, &l2->flag); | 2117 | test_and_set_bit(FLG_ORIG, &l2->flag); |
2117 | l2->sapi = 0; | 2118 | l2->sapi = sapi; |
2118 | l2->maxlen = MAX_DFRAME_LEN; | 2119 | l2->maxlen = MAX_DFRAME_LEN; |
2119 | if (test_bit(OPTION_L2_PMX, &options)) | 2120 | if (test_bit(OPTION_L2_PMX, &options)) |
2120 | l2->window = 7; | 2121 | l2->window = 7; |
@@ -2124,7 +2125,7 @@ create_l2(struct mISDNchannel *ch, u_int protocol, u_long options, u_long arg) | |||
2124 | test_and_set_bit(FLG_PTP, &l2->flag); | 2125 | test_and_set_bit(FLG_PTP, &l2->flag); |
2125 | if (test_bit(OPTION_L2_FIXEDTEI, &options)) | 2126 | if (test_bit(OPTION_L2_FIXEDTEI, &options)) |
2126 | test_and_set_bit(FLG_FIXED_TEI, &l2->flag); | 2127 | test_and_set_bit(FLG_FIXED_TEI, &l2->flag); |
2127 | l2->tei = (u_int)arg; | 2128 | l2->tei = tei; |
2128 | l2->T200 = 1000; | 2129 | l2->T200 = 1000; |
2129 | l2->N200 = 3; | 2130 | l2->N200 = 3; |
2130 | l2->T203 = 10000; | 2131 | l2->T203 = 10000; |
@@ -2180,7 +2181,7 @@ x75create(struct channel_req *crq) | |||
2180 | 2181 | ||
2181 | if (crq->protocol != ISDN_P_B_X75SLP) | 2182 | if (crq->protocol != ISDN_P_B_X75SLP) |
2182 | return -EPROTONOSUPPORT; | 2183 | return -EPROTONOSUPPORT; |
2183 | l2 = create_l2(crq->ch, crq->protocol, 0, 0); | 2184 | l2 = create_l2(crq->ch, crq->protocol, 0, 0, 0); |
2184 | if (!l2) | 2185 | if (!l2) |
2185 | return -ENOMEM; | 2186 | return -ENOMEM; |
2186 | crq->ch = &l2->ch; | 2187 | crq->ch = &l2->ch; |