Return-Path: MIME-Version: 1.0 In-Reply-To: <20110530221141.GI2556@joana> References: <1306199164-28310-1-git-send-email-jaikumar@google.com> <20110530221141.GI2556@joana> From: Jaikumar Ganesh Date: Tue, 31 May 2011 18:53:51 -0700 Message-ID: Subject: Re: [PATCH] Bluetooth: Add BT_POWER L2CAP socket option. To: padovan@profusion.mobi Cc: linux-bluetooth@vger.kernel.org Content-Type: multipart/mixed; boundary=bcaec51dd161291b7d04a49cccb7 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: --bcaec51dd161291b7d04a49cccb7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Gustavo, On Mon, May 30, 2011 at 3:11 PM, Gustavo F. Padovan wrote: > Hi Jaikumar, > > * Jaikumar Ganesh [2011-05-23 18:06:04 -0700]: > >> Add BT_POWER socket option used to control the power >> characteristics of the underlying ACL link. When the remote end >> has put the link in sniff mode and the host stack wants to send >> data we need need to explicitly exit sniff mode to work well with >> certain devices (For example, A2DP on Plantronics Voyager 855). >> However, this causes problems with HID devices. >> >> Hence, moving into active mode when sending data, irrespective >> of who set the sniff mode has been made as a socket option. By >> default, we will move into active mode. HID devices can set the >> L2CAP socket option to prevent this from happening. >> >> Currently, this has been implemented for L2CAP sockets. This has been >> tested with incoming and outgoing L2CAP sockets for HID and A2DP. >> >> Based on discussions on linux-bluetooth and patches submitted by >> Andrei Emeltchenko. >> >> Signed-off-by: Jaikumar Ganesh >> --- >> =A0include/net/bluetooth/bluetooth.h | =A0 =A08 ++++++++ >> =A0include/net/bluetooth/hci_core.h =A0| =A0 =A02 +- >> =A0include/net/bluetooth/l2cap.h =A0 =A0 | =A0 =A01 + >> =A0net/bluetooth/hci_conn.c =A0 =A0 =A0 =A0 =A0| =A0 =A09 ++++++--- >> =A0net/bluetooth/hci_core.c =A0 =A0 =A0 =A0 =A0| =A0 =A04 ++-- >> =A0net/bluetooth/l2cap_core.c =A0 =A0 =A0 =A0| =A0 =A05 +++++ >> =A0net/bluetooth/l2cap_sock.c =A0 =A0 =A0 =A0| =A0 36 ++++++++++++++++++= ++++++++++++++++++ >> =A07 files changed, 59 insertions(+), 6 deletions(-) >> >> diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/b= luetooth.h >> index 4375043..af930a3 100644 >> --- a/include/net/bluetooth/bluetooth.h >> +++ b/include/net/bluetooth/bluetooth.h >> @@ -69,6 +69,13 @@ struct bt_security { >> =A0#define BT_FLUSHABLE_OFF =A0 =A0 0 >> =A0#define BT_FLUSHABLE_ON =A0 =A0 =A0 =A0 =A0 =A0 =A01 >> >> +#define BT_POWER =A0 =A0 9 >> +struct bt_power { >> + =A0 =A0 __u8 force_active; >> +}; >> +#define BT_POWER_FORCE_ACTIVE_OFF 0 >> +#define BT_POWER_FORCE_ACTIVE_ON =A01 >> + >> =A0#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" = , ## arg) >> =A0#define BT_ERR(fmt, arg...) =A0printk(KERN_ERR "%s: " fmt "\n" , __fu= nc__ , ## arg) >> =A0#define BT_DBG(fmt, arg...) =A0pr_debug("%s: " fmt "\n" , __func__ , = ## arg) >> @@ -150,6 +157,7 @@ struct bt_skb_cb { >> =A0 =A0 =A0 __u8 retries; >> =A0 =A0 =A0 __u8 sar; >> =A0 =A0 =A0 unsigned short channel; >> + =A0 =A0 __u8 force_active; >> =A0}; >> =A0#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) >> >> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hc= i_core.h >> index 6c994c0..0747841 100644 >> --- a/include/net/bluetooth/hci_core.h >> +++ b/include/net/bluetooth/hci_core.h >> @@ -427,7 +427,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 se= c_level, __u8 auth_type); >> =A0int hci_conn_change_link_key(struct hci_conn *conn); >> =A0int hci_conn_switch_role(struct hci_conn *conn, __u8 role); >> >> -void hci_conn_enter_active_mode(struct hci_conn *conn); >> +void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_activ= e); >> =A0void hci_conn_enter_sniff_mode(struct hci_conn *conn); >> >> =A0void hci_conn_hold_device(struct hci_conn *conn); >> diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap= .h >> index d09c9b1..942970d 100644 >> --- a/include/net/bluetooth/l2cap.h >> +++ b/include/net/bluetooth/l2cap.h >> @@ -302,6 +302,7 @@ struct l2cap_chan { >> =A0 =A0 =A0 __u8 =A0 =A0 =A0 =A0 =A0 =A0role_switch; >> =A0 =A0 =A0 __u8 =A0 =A0 =A0 =A0 =A0 =A0force_reliable; >> =A0 =A0 =A0 __u8 =A0 =A0 =A0 =A0 =A0 =A0flushable; >> + =A0 =A0 __u8 =A0 =A0 =A0 =A0 =A0 =A0force_active; >> >> =A0 =A0 =A0 __u8 =A0 =A0 =A0 =A0 =A0 =A0ident; >> >> diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c >> index 3163330..5195715 100644 >> --- a/net/bluetooth/hci_conn.c >> +++ b/net/bluetooth/hci_conn.c >> @@ -497,7 +497,7 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, i= nt type, bdaddr_t *dst, __u8 >> =A0 =A0 =A0 if (acl->state =3D=3D BT_CONNECTED && >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (sco->state =3D=3D BT_OPEN |= | sco->state =3D=3D BT_CLOSED)) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 acl->power_save =3D 1; >> - =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(acl); >> + =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(acl, BT_POWER_FORCE= _ACTIVE_ON); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl= ->pend)) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* defer SCO setup until mod= e change completed */ >> @@ -676,7 +676,7 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8= role) >> =A0EXPORT_SYMBOL(hci_conn_switch_role); >> >> =A0/* Enter active mode */ >> -void hci_conn_enter_active_mode(struct hci_conn *conn) >> +void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_activ= e) >> =A0{ >> =A0 =A0 =A0 struct hci_dev *hdev =3D conn->hdev; >> >> @@ -685,7 +685,10 @@ void hci_conn_enter_active_mode(struct hci_conn *co= nn) >> =A0 =A0 =A0 if (test_bit(HCI_RAW, &hdev->flags)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 return; >> >> - =A0 =A0 if (conn->mode !=3D HCI_CM_SNIFF || !conn->power_save) >> + =A0 =A0 if (conn->mode !=3D HCI_CM_SNIFF) >> + =A0 =A0 =A0 =A0 =A0 =A0 goto timer; >> + >> + =A0 =A0 if (!conn->power_save && !force_active) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto timer; >> >> =A0 =A0 =A0 if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend= )) { >> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c >> index b6bda3f..be68e7d 100644 >> --- a/net/bluetooth/hci_core.c >> +++ b/net/bluetooth/hci_core.c >> @@ -1893,7 +1893,7 @@ static inline void hci_sched_acl(struct hci_dev *h= dev) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 while (quote-- && (skb =3D skb_dequeue(&conn= ->data_q))) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BT_DBG("skb %p len %d", skb,= skb->len); >> >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(con= n); >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(con= n, bt_cb(skb)->force_active); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hci_send_frame(skb); >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 hdev->acl_last_tx =3D jiffie= s; >> @@ -2032,7 +2032,7 @@ static inline void hci_acldata_packet(struct hci_d= ev *hdev, struct sk_buff *skb) >> =A0 =A0 =A0 if (conn) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 register struct hci_proto *hp; >> >> - =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(conn); >> + =A0 =A0 =A0 =A0 =A0 =A0 hci_conn_enter_active_mode(conn, bt_cb(skb)->f= orce_active); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Send to upper protocol */ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 hp =3D hci_proto[HCI_PROTO_L2CAP]; >> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c >> index 7c0e571..2a80a91 100644 >> --- a/net/bluetooth/l2cap_core.c >> +++ b/net/bluetooth/l2cap_core.c >> @@ -408,6 +408,8 @@ void l2cap_send_cmd(struct l2cap_conn *conn, u8 iden= t, u8 code, u16 len, void *d >> =A0 =A0 =A0 else >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 flags =3D ACL_START; >> >> + =A0 =A0 bt_cb(skb)->force_active =3D BT_POWER_FORCE_ACTIVE_ON; >> + >> =A0 =A0 =A0 hci_send_acl(conn->hcon, skb, flags); >> =A0} >> >> @@ -461,6 +463,8 @@ static inline void l2cap_send_sframe(struct l2cap_ch= an *chan, u16 control) >> =A0 =A0 =A0 else >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 flags =3D ACL_START; >> >> + =A0 =A0 bt_cb(skb)->force_active =3D chan->force_active; >> + >> =A0 =A0 =A0 hci_send_acl(chan->conn->hcon, skb, flags); >> =A0} >> >> @@ -1089,6 +1093,7 @@ void l2cap_do_send(struct l2cap_chan *chan, struct= sk_buff *skb) >> =A0 =A0 =A0 else >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 flags =3D ACL_START; >> >> + =A0 =A0 bt_cb(skb)->force_active =3D chan->force_active; >> =A0 =A0 =A0 hci_send_acl(hcon, skb, flags); >> =A0} >> >> diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c >> index c98360d..9f99e1d 100644 >> --- a/net/bluetooth/l2cap_sock.c >> +++ b/net/bluetooth/l2cap_sock.c >> @@ -436,6 +436,7 @@ static int l2cap_sock_getsockopt(struct socket *sock= , int level, int optname, ch >> =A0 =A0 =A0 struct sock *sk =3D sock->sk; >> =A0 =A0 =A0 struct l2cap_chan *chan =3D l2cap_pi(sk)->chan; >> =A0 =A0 =A0 struct bt_security sec; >> + =A0 =A0 struct bt_power pwr; >> =A0 =A0 =A0 int len, err =3D 0; >> >> =A0 =A0 =A0 BT_DBG("sk %p", sk); >> @@ -484,6 +485,21 @@ static int l2cap_sock_getsockopt(struct socket *soc= k, int level, int optname, ch >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> >> + =A0 =A0 case BT_POWER: >> + =A0 =A0 =A0 =A0 =A0 =A0 if (sk->sk_type !=3D SOCK_SEQPACKET && sk->sk_= type !=3D SOCK_STREAM >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && sk->sk_type= !=3D SOCK_RAW) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -EINVAL; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> + =A0 =A0 =A0 =A0 =A0 =A0 } >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 pwr.force_active =3D chan->force_active; >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 len =3D min_t(unsigned int, len, sizeof(pwr)); >> + =A0 =A0 =A0 =A0 =A0 =A0 if (copy_to_user(optval, (char *) &pwr, len)) >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -EFAULT; >> + >> + =A0 =A0 =A0 =A0 =A0 =A0 break; >> + >> =A0 =A0 =A0 default: >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -ENOPROTOOPT; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> @@ -584,6 +600,7 @@ static int l2cap_sock_setsockopt(struct socket *sock= , int level, int optname, ch >> =A0 =A0 =A0 struct sock *sk =3D sock->sk; >> =A0 =A0 =A0 struct l2cap_chan *chan =3D l2cap_pi(sk)->chan; >> =A0 =A0 =A0 struct bt_security sec; >> + =A0 =A0 struct bt_power pwr; >> =A0 =A0 =A0 int len, err =3D 0; >> =A0 =A0 =A0 u32 opt; >> >> @@ -660,6 +677,23 @@ static int l2cap_sock_setsockopt(struct socket *soc= k, int level, int optname, ch >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 chan->flushable =3D opt; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> >> + =A0 =A0 case BT_POWER: >> + =A0 =A0 =A0 =A0 =A0 =A0 if (sk->sk_type !=3D SOCK_SEQPACKET && sk->sk_= type !=3D SOCK_STREAM >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 && sk->sk_type= !=3D SOCK_RAW) { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D -EINVAL; > > This need to be rebased against bluetooth-next. Not sure, but this seems = to be > the only place of conflict. Rebased patch attached. Thanks > > -- > Gustavo F. Padovan > http://profusion.mobi > -- > To unsubscribe from this list: send the line "unsubscribe linux-bluetooth= " in > the body of a message to majordomo@vger.kernel.org > More majordomo info at =A0http://vger.kernel.org/majordomo-info.html > --bcaec51dd161291b7d04a49cccb7 Content-Type: text/x-patch; charset=US-ASCII; name="0001-Bluetooth-Add-BT_POWER-L2CAP-socket-option.patch" Content-Disposition: attachment; filename="0001-Bluetooth-Add-BT_POWER-L2CAP-socket-option.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_godmgneu0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