Return-Path: Subject: Re: [PATCH 3/9] Bluetooth: Get/set AMP policy socket option From: Marcel Holtmann To: Mat Martineau Cc: linux-bluetooth@vger.kernel.org, padovan@profusion.mobi, pkrystad@codeaurora.org, andrei.emeltchenko@intel.com Date: Thu, 13 Oct 2011 16:27:08 -0700 In-Reply-To: References: <1318543247-27130-1-git-send-email-mathewm@codeaurora.org> <1318543247-27130-4-git-send-email-mathewm@codeaurora.org> <1318545356.15441.39.camel@aeonflux> Content-Type: text/plain; charset="UTF-8" Message-ID: <1318548431.15441.40.camel@aeonflux> Mime-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Mat, > >> Checks for valid policy value and L2CAP mode. > >> > >> Signed-off-by: Mat Martineau > >> --- > >> net/bluetooth/l2cap_sock.c | 25 +++++++++++++++++++++++++ > >> 1 files changed, 25 insertions(+), 0 deletions(-) > >> > >> diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c > >> index 836d12e..9431e38 100644 > >> --- a/net/bluetooth/l2cap_sock.c > >> +++ b/net/bluetooth/l2cap_sock.c > >> @@ -467,6 +467,11 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ch > >> > >> break; > >> > >> + case BT_AMP_POLICY: > >> + if (put_user(chan->amp_policy, (u32 __user *) optval)) > >> + err = -EFAULT; > > > > I prefer to not just add such an option just yet. We only want to add > > socket option once they are functional. Otherwise we have problems to > > detect if such an option is working or not. So enabling this option > > should be the last patch after we have AMP implemented. > > My plan was to add checks for enable_hs before adding any code that > takes action based on amp_policy. Would it be acceptable to add those > enable_hs checks now so the code is in place, but disabled by default? > It would be helpful for development and testing. if it is protected enable_hs, then this is fine with me. Regards Marcel