From patchwork Tue Jul 6 00:19:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tilman Schmidt X-Patchwork-Id: 57952 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 78060B6EF0 for ; Tue, 6 Jul 2010 10:21:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756942Ab0GFATZ (ORCPT ); Mon, 5 Jul 2010 20:19:25 -0400 Received: from mail.pxnet.com ([89.1.7.7]:41983 "EHLO mail.pxnet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756913Ab0GFATV (ORCPT ); Mon, 5 Jul 2010 20:19:21 -0400 Received: from xenon.ts.pxnet.com (pD9E860E3.dip.t-dialin.net [217.232.96.227]) (user=ts author=<> mech=DIGEST-MD5 bits=0) by mail.pxnet.com (8.13.8/8.13.8) with ESMTP id o660J9OA007235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 6 Jul 2010 02:19:12 +0200 Received: by xenon.ts.pxnet.com (Postfix, from userid 1000) id 37C644013F; Tue, 6 Jul 2010 02:19:04 +0200 (CEST) Subject: [PATCH 06/11] isdn/gigaset: handle Supplementary Service Listen From: Tilman Schmidt To: Karsten Keil , David Miller CC: Hansjoerg Lipp , Karsten Keil , i4ldeveloper@listserv.isdn4linux.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20100705-patch-gigaset-06.tilman@imap.cc> In-Reply-To: <20100705-patch-gigaset-00.tilman@imap.cc> References: <20100705-patch-gigaset-00.tilman@imap.cc> Date: Tue, 6 Jul 2010 02:19:04 +0200 (CEST) X-Spam-Score: -1.98 () AWL,BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.70 on 89.1.7.7 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add minimal handling for the non-optional CAPI FACILITY_REQ Supplementary Service function Listen. Impact: bugfix Signed-off-by: Tilman Schmidt --- drivers/isdn/gigaset/capi.c | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/drivers/isdn/gigaset/capi.c b/drivers/isdn/gigaset/capi.c index ff074e9..3714aef 100644 --- a/drivers/isdn/gigaset/capi.c +++ b/drivers/isdn/gigaset/capi.c @@ -45,6 +45,7 @@ #define CAPI_FACILITY_LI 0x0005 #define CAPI_SUPPSVC_GETSUPPORTED 0x0000 +#define CAPI_SUPPSVC_LISTEN 0x0001 /* missing from capiutil.h */ #define CAPIMSG_PLCI_PART(m) CAPIMSG_U8(m, 9) @@ -1151,7 +1152,7 @@ static void do_facility_req(struct gigaset_capi_ctr *iif, case CAPI_FACILITY_SUPPSVC: /* decode Function parameter */ pparam = cmsg->FacilityRequestParameter; - if (pparam == NULL || *pparam < 2) { + if (pparam == NULL || pparam[0] < 2) { dev_notice(cs->dev, "%s: %s missing\n", "FACILITY_REQ", "Facility Request Parameter"); send_conf(iif, ap, skb, CapiIllMessageParmCoding); @@ -1168,8 +1169,32 @@ static void do_facility_req(struct gigaset_capi_ctr *iif, /* Supported Services: none */ capimsg_setu32(confparam, 6, 0); break; + case CAPI_SUPPSVC_LISTEN: + if (pparam[0] < 7 || pparam[3] < 4) { + dev_notice(cs->dev, "%s: %s missing\n", + "FACILITY_REQ", "Notification Mask"); + send_conf(iif, ap, skb, + CapiIllMessageParmCoding); + return; + } + if (CAPIMSG_U32(pparam, 4) != 0) { + dev_notice(cs->dev, + "%s: unsupported supplementary service notification mask 0x%x\n", + "FACILITY_REQ", CAPIMSG_U32(pparam, 4)); + info = CapiFacilitySpecificFunctionNotSupported; + confparam[3] = 2; /* length */ + capimsg_setu16(confparam, 4, + CapiSupplementaryServiceNotSupported); + } + info = CapiSuccess; + confparam[3] = 2; /* length */ + capimsg_setu16(confparam, 4, CapiSuccess); + break; /* ToDo: add supported services */ default: + dev_notice(cs->dev, + "%s: unsupported supplementary service function 0x%04x\n", + "FACILITY_REQ", function); info = CapiFacilitySpecificFunctionNotSupported; /* Supplementary Service specific parameter */ confparam[3] = 2; /* length */