Bluetooth: Allow headroom in ACL data packets from HCI socket

Need to allocate headroom in ACL data packets destined for the
Qualcomm PAL that are be transmitted via an HCI socket.

The Qualcomm PAL uses extra headroom in skbs to be transmitted to
save a copy when passing to the WLAN driver. This headroom is
allocated by L2CAP. This same headroom must be added for skbs to
be transmitted directly by HCI socket layer. HCI sockets are used
to transmit data during Bluetooth qualification testing.

CRs-fixed: 332866
Change-Id: I173a16c6cb3882bf4155be051e3b3375ea240369
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
This commit is contained in:
Peter Krystad
2012-01-24 12:42:43 -08:00
parent 41aa92fb22
commit fc60bda779

View File

@@ -523,6 +523,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
struct sock *sk = sock->sk;
struct hci_dev *hdev;
struct sk_buff *skb;
int reserve = 0;
int err;
BT_DBG("sock %p sk %p", sock, sk);
@@ -560,10 +561,18 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
goto done;
}
skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err);
/* Allocate extra headroom for Qualcomm PAL */
if (hdev->dev_type == HCI_AMP && hdev->manufacturer == 0x001d)
reserve = BT_SKB_RESERVE_80211;
skb = bt_skb_send_alloc(sk, len + reserve,
msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb)
goto done;
if (reserve)
skb_reserve(skb, reserve);
if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
err = -EFAULT;
goto drop;