Merge "Bluetooth: Allow headroom in ACL data packets from HCI socket" into msm-3.0

This commit is contained in:
Linux Build Service Account
2012-02-01 06:28:53 -08:00
committed by QuIC Gerrit Code Review

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;