Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756151AbYB0J5k (ORCPT ); Wed, 27 Feb 2008 04:57:40 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751457AbYB0J52 (ORCPT ); Wed, 27 Feb 2008 04:57:28 -0500 Received: from senator.holtmann.net ([87.106.208.187]:49767 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbYB0J51 (ORCPT ); Wed, 27 Feb 2008 04:57:27 -0500 Cc: Dave Young , linux-bluetooth@vger.kernel.org, Linux Kernel , bmidgley@gmail.com, David Miller , Netdev Message-Id: <2A7EF87C-1340-45D7-B457-F81799674B1E@holtmann.org> From: Marcel Holtmann To: Louis JANG In-Reply-To: <47C4C3D4.8010902@mizi.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Subject: Re: [Bluez-devel] forcing SCO connection patch Date: Wed, 27 Feb 2008 10:57:23 +0100 References: <47666E1F.2000902@mizi.com> <47C28A33.4070102@mizi.com> <47C2A7FA.2060902@mizi.com> <70692DDF-93B7-447E-ABEE-3CDBD94F15F1@holtmann.org> <47C38D40.3040809@mizi.com> <47C4C3D4.8010902@mizi.com> X-Mailer: Apple Mail (2.919.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3191 Lines: 118 Hi Louis, >>>>> --- linux-2.6.23/net/bluetooth/hci_event.c.orig 2008-02-25 >>>>> 17:17:11.000000000 +0900 >>>>> +++ linux-2.6.23/net/bluetooth/hci_event.c 2008-02-25 >>>>> 17:30:23.000000000 +0900 >>>>> @@ -1313,8 +1313,17 @@ >>>>> hci_dev_lock(hdev); >>>>> >>>>> conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); >>>>> - if (!conn) >>>>> - goto unlock; >>>>> + if (!conn) { >>>>> + if (ev->link_type != ACL_LINK) { >>>>> + __u8 link_type = (ev->link_type == ESCO_LINK) ? SCO_LINK : >>>>> ESCO_LINK; >>>>> + >>>>> + conn = hci_conn_hash_lookup_ba(hdev, link_type, &ev->bdaddr); >>>>> + if (conn) >>>>> + conn->type = ev->link_type; >>>>> + } >>>>> + if (!conn) >>>>> + goto unlock; >>>>> + } >>>> >>>> NAK. There is no need to check for ACL_LINK. The sync_complete will >>>> only be called for SCO or eSCO connections. >>> I see. I removed this check line in the patch. >>> >>> Thanks. >>> Louis JANG >>> Signed-off-by: Louis JANG >>> --- linux-2.6.23/net/bluetooth/hci_event.c.orig 2008-02-26 >>> 12:46:36.000000000 +0900 >>> +++ linux-2.6.23/net/bluetooth/hci_event.c 2008-02-26 >>> 12:47:23.000000000 +0900 >>> @@ -1313,8 +1313,15 @@ >>> hci_dev_lock(hdev); >>> >>> conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); >>> - if (!conn) >>> - goto unlock; >>> + if (!conn) { >>> + __u8 link_type = (ev->link_type == ESCO_LINK) ? SCO_LINK : >>> ESCO_LINK; >>> + >>> + conn = hci_conn_hash_lookup_ba(hdev, link_type, &ev->bdaddr); >>> + if (conn) >>> + conn->type = ev->link_type; >>> + else >>> + goto unlock; >>> + } >>> >>> if (!ev->status) { >>> conn->handle = __le16_to_cpu(ev->handle); >> >> do something like this: >> >> if (!conn) { >> .... >> >> conn = .... >> if (!conn) >> goto unlock; >> >> conn->type = ev->link_type; >> } >> >> And include a description when submitting a patch. >> >> Regards >> >> Marcel > I changed code with this style and included patch description. > Thanks > > Louis JANG > This patch is to handle different type of synchronous link is > estabilished with its request. > > Signed-off-by: Louis JANG > --- linux-2.6.23/net/bluetooth/hci_event.c.orig 2008-02-26 > 12:46:36.000000000 +0900 > +++ linux-2.6.23/net/bluetooth/hci_event.c 2008-02-27 > 10:48:29.000000000 +0900 > @@ -1313,8 +1313,15 @@ > hci_dev_lock(hdev); > > conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); > - if (!conn) > - goto unlock; > + if (!conn) { > + __u8 link_type = (ev->link_type == ESCO_LINK) ? SCO_LINK : > ESCO_LINK; > + > + conn = hci_conn_hash_lookup_ba(hdev, link_type, &ev->bdaddr); > + if (!conn) > + goto unlock; > + > + conn->type = ev->link_type; > + } > > if (!ev->status) { > conn->handle = __le16_to_cpu(ev->handle); so the patch is fine, but the description of what this patch is doing, why it is doing it this way and what it fixes is fully missing. Please update it with a proper description. Regards Marcel -- 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/