Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5dcd2461 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'for-upstream' of...

Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next



Johan Hedberg says:

====================
pull request: bluetooth-next 2015-09-18

Here's the first bluetooth-next pull request for the 4.4 kernel:

 - ieee802154 cleanups & fixes
 - debugfs support for the at86rf230 driver
 - Support for quirky (seemingly counterfeit) CSR Bluetooth controllers
 - Power management and device config improvements for Intel controllers
 - Fix for devices with incorrect advertising data length
 - Fix for closing HCI user channel socket

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a1ef48e1 6818375e
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -7,11 +7,11 @@ Introduction
The IEEE 802.15.4 working group focuses on standardization of bottom
The IEEE 802.15.4 working group focuses on standardization of bottom
two layers: Medium Access Control (MAC) and Physical (PHY). And there
two layers: Medium Access Control (MAC) and Physical (PHY). And there
are mainly two options available for upper layers:
are mainly two options available for upper layers:
 - ZigBee - proprietary protocol from ZigBee Alliance
 - ZigBee - proprietary protocol from the ZigBee Alliance
 - 6LowPAN - IPv6 networking over low rate personal area networks
 - 6LoWPAN - IPv6 networking over low rate personal area networks


The Linux-ZigBee project goal is to provide complete implementation
The linux-wpan project goal is to provide a complete implementation
of IEEE 802.15.4 and 6LoWPAN protocols. IEEE 802.15.4 is a stack
of the IEEE 802.15.4 and 6LoWPAN protocols. IEEE 802.15.4 is a stack
of protocols for organizing Low-Rate Wireless Personal Area Networks.
of protocols for organizing Low-Rate Wireless Personal Area Networks.


The stack is composed of three main parts:
The stack is composed of three main parts:
+8 −4
Original line number Original line Diff line number Diff line
@@ -453,7 +453,8 @@ static int bt3c_load_firmware(struct bt3c_info *info,
{
{
	char *ptr = (char *) firmware;
	char *ptr = (char *) firmware;
	char b[9];
	char b[9];
	unsigned int iobase, size, addr, fcs, tmp;
	unsigned int iobase, tmp;
	unsigned long size, addr, fcs;
	int i, err = 0;
	int i, err = 0;


	iobase = info->p_dev->resource[0]->start;
	iobase = info->p_dev->resource[0]->start;
@@ -478,15 +479,18 @@ static int bt3c_load_firmware(struct bt3c_info *info,


		memset(b, 0, sizeof(b));
		memset(b, 0, sizeof(b));
		memcpy(b, ptr + 2, 2);
		memcpy(b, ptr + 2, 2);
		size = simple_strtoul(b, NULL, 16);
		if (kstrtoul(b, 16, &size) < 0)
			return -EINVAL;


		memset(b, 0, sizeof(b));
		memset(b, 0, sizeof(b));
		memcpy(b, ptr + 4, 8);
		memcpy(b, ptr + 4, 8);
		addr = simple_strtoul(b, NULL, 16);
		if (kstrtoul(b, 16, &addr) < 0)
			return -EINVAL;


		memset(b, 0, sizeof(b));
		memset(b, 0, sizeof(b));
		memcpy(b, ptr + (size * 2) + 2, 2);
		memcpy(b, ptr + (size * 2) + 2, 2);
		fcs = simple_strtoul(b, NULL, 16);
		if (kstrtoul(b, 16, &fcs) < 0)
			return -EINVAL;


		memset(b, 0, sizeof(b));
		memset(b, 0, sizeof(b));
		for (tmp = 0, i = 0; i < size; i++) {
		for (tmp = 0, i = 0; i < size; i++) {
+46 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@
 */
 */


#include <linux/module.h>
#include <linux/module.h>
#include <linux/firmware.h>


#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci_core.h>
@@ -169,6 +170,51 @@ int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
}
}
EXPORT_SYMBOL_GPL(btintel_secure_send);
EXPORT_SYMBOL_GPL(btintel_secure_send);


int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name)
{
	const struct firmware *fw;
	struct sk_buff *skb;
	const u8 *fw_ptr;
	int err;

	err = request_firmware_direct(&fw, ddc_name, &hdev->dev);
	if (err < 0) {
		bt_dev_err(hdev, "Failed to load Intel DDC file %s (%d)",
			   ddc_name, err);
		return err;
	}

	bt_dev_info(hdev, "Found Intel DDC parameters: %s", ddc_name);

	fw_ptr = fw->data;

	/* DDC file contains one or more DDC structure which has
	 * Length (1 byte), DDC ID (2 bytes), and DDC value (Length - 2).
	 */
	while (fw->size > fw_ptr - fw->data) {
		u8 cmd_plen = fw_ptr[0] + sizeof(u8);

		skb = __hci_cmd_sync(hdev, 0xfc8b, cmd_plen, fw_ptr,
				     HCI_INIT_TIMEOUT);
		if (IS_ERR(skb)) {
			bt_dev_err(hdev, "Failed to send Intel_Write_DDC (%ld)",
				   PTR_ERR(skb));
			release_firmware(fw);
			return PTR_ERR(skb);
		}

		fw_ptr += cmd_plen;
		kfree_skb(skb);
	}

	release_firmware(fw);

	bt_dev_info(hdev, "Applying Intel DDC parameters completed");

	return 0;
}
EXPORT_SYMBOL_GPL(btintel_load_ddc_config);

MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_VERSION(VERSION);
+9 −1
Original line number Original line Diff line number Diff line
@@ -78,6 +78,7 @@ void btintel_hw_error(struct hci_dev *hdev, u8 code);
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
			const void *param);
			const void *param);
int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name);


#else
#else


@@ -95,7 +96,8 @@ static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
{
{
}
}


static void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver)
static inline void btintel_version_info(struct hci_dev *hdev,
					struct intel_version *ver)
{
{
}
}


@@ -105,4 +107,10 @@ static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type,
	return -EOPNOTSUPP;
	return -EOPNOTSUPP;
}
}


static inline int btintel_load_ddc_config(struct hci_dev *hdev,
					  const char *ddc_name)
{
	return -EOPNOTSUPP;
}

#endif
#endif
+0 −14
Original line number Original line Diff line number Diff line
@@ -377,20 +377,6 @@ static int btmrvl_tx_pkt(struct btmrvl_private *priv, struct sk_buff *skb)
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (skb_headroom(skb) < BTM_HEADER_LEN) {
		struct sk_buff *tmp = skb;

		skb = skb_realloc_headroom(skb, BTM_HEADER_LEN);
		if (!skb) {
			BT_ERR("Tx Error: realloc_headroom failed %d",
				BTM_HEADER_LEN);
			skb = tmp;
			return -EINVAL;
		}

		kfree_skb(tmp);
	}

	skb_push(skb, BTM_HEADER_LEN);
	skb_push(skb, BTM_HEADER_LEN);


	/* header type: byte[3]
	/* header type: byte[3]
Loading