From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759134AbbFBPHj (ORCPT ); Tue, 2 Jun 2015 11:07:39 -0400 Received: from senator.holtmann.net ([87.106.208.187]:35745 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674AbbFBPH3 convert rfc822-to-8bit (ORCPT ); Tue, 2 Jun 2015 11:07:29 -0400 Content-Type: text/plain; charset=US-ASCII Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: [PATCH 1/2] Bluetooth: Add reset_resume function From: Marcel Holtmann In-Reply-To: Date: Tue, 2 Jun 2015 17:07:25 +0200 Cc: Laura Abbott , Alan Stern , Takashi Iwai , Oliver Neukum , Ming Lei , "David S. Miller" , Johan Hedberg , "Rafael J. Wysocki" , "Gustavo F. Padovan" , BlueZ development , Linux Kernel Mailing List , USB list , netdev Content-Transfer-Encoding: 7BIT Message-Id: <1AD01E7E-4D71-444A-AB0F-F8261C925542@holtmann.org> References: <1433207682-15064-1-git-send-email-labbott@fedoraproject.org> To: Josh Boyer X-Mailer: Apple Mail (2.2098) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Josh, >>> Bluetooth devices off of some buses such as USB may lose power across >>> suspend/resume. When this happens, drivers may need to have the setup >>> function called again and behave differently than a cold power on. >>> Add a reset_resume function for drivers to call. During the >>> reset_resume case, the flag HCI_RESET_RESUME will be set to allow >>> drivers to differentate. >>> >>> Signed-off-by: Laura Abbott >>> --- >>> This matches with what hci_reset_dev does and also ensures >>> the setup function gets called again. >>> --- >>> include/net/bluetooth/hci.h | 1 + >>> include/net/bluetooth/hci_core.h | 1 + >>> net/bluetooth/hci_core.c | 16 ++++++++++++++++ >>> 3 files changed, 18 insertions(+) >>> >>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h >>> index d95da83..6285410 100644 >>> --- a/include/net/bluetooth/hci.h >>> +++ b/include/net/bluetooth/hci.h >>> @@ -185,6 +185,7 @@ enum { >>> HCI_RAW, >>> >>> HCI_RESET, >>> + HCI_RESET_RESUME, >>> }; >> >> no more addition to this list of flags please. These are userspace exposed flags and with that ABI that we are never ever touching again. If you need flags on a per device basis, then use the second list. > > It would be helpful for other developers if you added a comment to > that effect above the enum definition. Otherwise you're going to wind > up repeating yourself over time. nobody has done that so far ;) > Also, if they're exposed to userspace, should this file be using the > uapi mechanism? I'm confused how they're exposed today, given that > they aren't installed via 'make headers_install'. Is this manually > synced with some other .h file in a userspace package? This code is from 2.4.6 and with that pretty much ancient and predates UAPI. The BlueZ userspace library provides userspace versions of these defines etc. Regards Marcel