Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756092AbZJAJx0 (ORCPT ); Thu, 1 Oct 2009 05:53:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756076AbZJAJxZ (ORCPT ); Thu, 1 Oct 2009 05:53:25 -0400 Received: from gimli.pxnet.com ([195.227.45.7]:50862 "EHLO mail.pxnet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756075AbZJAJxY (ORCPT ); Thu, 1 Oct 2009 05:53:24 -0400 From: Tilman Schmidt Subject: [PATCH] gigaset/CAPI: accept any number type/plan To: Karsten Keil , Karsten Keil CC: Hansjoerg Lipp , davem@davemloft.net, i4ldeveloper@listserv.isdn4linux.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20090930-patch-gigaset-14.tilman@imap.cc> Date: Thu, 1 Oct 2009 11:53:13 +0200 (CEST) X-Spam-Score: -2.212 () BAYES_00,RDNS_NONE Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3177 Lines: 94 Be more liberal in accepting CAPI CONNECT_REQ message parameters Called Party Number and Calling Party Number: * Accept Numbering plan "ISDN/Telephony" as supported. * Ignore unsupported values for Type of number, Numbering plan, Presentation indicator and Screening indicator with a warning instead of rejecting the entire request. Signed-off-by: Tilman Schmidt --- A second small fix to the new Gigaset CAPI interface resulting from testing with more applications. Please tell me if you'd prefer me to reissue "[PATCH 12/12] gigaset: add Kernel CAPI interface" with both fixes folded in. drivers/isdn/gigaset/capi.c | 29 ++++++++++++++++------------- 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c index 8afff37..c276a92 100644 --- a/drivers/isdn/gigaset/capi.c +++ b/drivers/isdn/gigaset/capi.c @@ -1236,12 +1236,14 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, goto error; } l = *pp++; - /* check number type/numbering plan byte */ - if (*pp != 0x80) { + /* check type of number/numbering plan byte */ + switch (*pp) { + case 0x80: /* unknown type / unknown numbering plan */ + case 0x81: /* unknown type / ISDN/Telephony numbering plan */ + break; + default: /* others: warn about potential misinterpretation */ dev_notice(cs->dev, "%s: %s type/plan 0x%02x unsupported\n", "CONNECT_REQ", "Called party number", *pp); - info = CapiIllMessageParmCoding; - goto error; } pp++; l--; @@ -1266,26 +1268,28 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, if (pp != NULL && *pp > 0) { l = *pp++; - /* check number type/numbering plan byte */ - if (*pp) { - /* ToDo: allow for Ext=1? */ + /* check type of number/numbering plan byte */ + /* ToDo: handle Ext=1? */ + switch (*pp) { + case 0x00: /* unknown type / unknown numbering plan */ + case 0x01: /* unknown type / ISDN/Telephony num. plan */ + break; + default: dev_notice(cs->dev, "%s: %s type/plan 0x%02x unsupported\n", "CONNECT_REQ", "Calling party number", *pp); - info = CapiIllMessageParmCoding; - goto error; } pp++; l--; - /* check presentation/screening indicator */ + /* check presentation indicator */ if (!l) { dev_notice(cs->dev, "%s: %s IE truncated\n", "CONNECT_REQ", "Calling party number"); info = CapiIllMessageParmCoding; goto error; } - switch (*pp) { + switch (*pp & 0xfc) { /* ignore Screening indicator */ case 0x80: /* Presentation allowed */ s = "^SCLIP=1\r"; break; @@ -1297,8 +1301,7 @@ static void do_connect_req(struct gigaset_capi_ctr *iif, "CONNECT_REQ", "Presentation/Screening indicator", *pp); - info = CapiIllMessageParmCoding; - goto error; + s = "^SCLIP=1\r"; } commands[AT_CLIP] = kstrdup(s, GFP_KERNEL); if (!commands[AT_CLIP]) -- 1.6.2.1.214.ge986c -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/