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

Commit a7fca0cc authored by David S. Miller's avatar David S. Miller
Browse files
parents 424eff97 2861453b
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ struct btmrvl_debugfs_data {
	struct dentry *root_dir, *config_dir, *status_dir;

	/* config */
	struct dentry *drvdbg;
	struct dentry *psmode;
	struct dentry *pscmd;
	struct dentry *hsmode;
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ void btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb);
int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb);

int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd);
int btmrvl_enable_ps(struct btmrvl_private *priv);
int btmrvl_prepare_command(struct btmrvl_private *priv);

#ifdef CONFIG_DEBUG_FS
+33 −22
Original line number Diff line number Diff line
@@ -189,6 +189,38 @@ int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, int subcmd)
}
EXPORT_SYMBOL_GPL(btmrvl_send_module_cfg_cmd);

int btmrvl_enable_ps(struct btmrvl_private *priv)
{
	struct sk_buff *skb;
	struct btmrvl_cmd *cmd;

	skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
	if (skb == NULL) {
		BT_ERR("No free skb");
		return -ENOMEM;
	}

	cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
	cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF,
					BT_CMD_AUTO_SLEEP_MODE));
	cmd->length = 1;

	if (priv->btmrvl_dev.psmode)
		cmd->data[0] = BT_PS_ENABLE;
	else
		cmd->data[0] = BT_PS_DISABLE;

	bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;

	skb->dev = (void *) priv->btmrvl_dev.hcidev;
	skb_queue_head(&priv->adapter->tx_queue, skb);

	BT_DBG("Queue PSMODE Command:%d", cmd->data[0]);

	return 0;
}
EXPORT_SYMBOL_GPL(btmrvl_enable_ps);

static int btmrvl_enable_hs(struct btmrvl_private *priv)
{
	struct sk_buff *skb;
@@ -258,28 +290,7 @@ int btmrvl_prepare_command(struct btmrvl_private *priv)

	if (priv->btmrvl_dev.pscmd) {
		priv->btmrvl_dev.pscmd = 0;

		skb = bt_skb_alloc(sizeof(*cmd), GFP_ATOMIC);
		if (skb == NULL) {
			BT_ERR("No free skb");
			return -ENOMEM;
		}

		cmd = (struct btmrvl_cmd *) skb_put(skb, sizeof(*cmd));
		cmd->ocf_ogf = cpu_to_le16(hci_opcode_pack(OGF, BT_CMD_AUTO_SLEEP_MODE));
		cmd->length = 1;

		if (priv->btmrvl_dev.psmode)
			cmd->data[0] = BT_PS_ENABLE;
		else
			cmd->data[0] = BT_PS_DISABLE;

		bt_cb(skb)->pkt_type = MRVL_VENDOR_PKT;

		skb->dev = (void *) priv->btmrvl_dev.hcidev;
		skb_queue_head(&priv->adapter->tx_queue, skb);

		BT_DBG("Queue PSMODE Command:%d", cmd->data[0]);
		btmrvl_enable_ps(priv);
	}

	if (priv->btmrvl_dev.hscmd) {
+4 −0
Original line number Diff line number Diff line
@@ -930,6 +930,8 @@ static int btmrvl_sdio_probe(struct sdio_func *func,
	priv->hw_wakeup_firmware = btmrvl_sdio_wakeup_fw;

	btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
	priv->btmrvl_dev.psmode = 1;
	btmrvl_enable_ps(priv);

	return 0;

@@ -1001,3 +1003,5 @@ MODULE_AUTHOR("Marvell International Ltd.");
MODULE_DESCRIPTION("Marvell BT-over-SDIO driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL v2");
MODULE_FIRMWARE("sd8688_helper.bin");
MODULE_FIRMWARE("sd8688.bin");
+3 −17
Original line number Diff line number Diff line
@@ -41,8 +41,6 @@

#define VERSION "1.3"

static int minor = MISC_DYNAMIC_MINOR;

struct vhci_data {
	struct hci_dev *hdev;

@@ -218,12 +216,6 @@ static unsigned int vhci_poll(struct file *file, poll_table *wait)
	return POLLOUT | POLLWRNORM;
}

static int vhci_ioctl(struct inode *inode, struct file *file,
					unsigned int cmd, unsigned long arg)
{
	return -EINVAL;
}

static int vhci_open(struct inode *inode, struct file *file)
{
	struct vhci_data *data;
@@ -284,10 +276,10 @@ static int vhci_release(struct inode *inode, struct file *file)
}

static const struct file_operations vhci_fops = {
	.owner		= THIS_MODULE,
	.read		= vhci_read,
	.write		= vhci_write,
	.poll		= vhci_poll,
	.ioctl		= vhci_ioctl,
	.open		= vhci_open,
	.release	= vhci_release,
};
@@ -302,18 +294,12 @@ static int __init vhci_init(void)
{
	BT_INFO("Virtual HCI driver ver %s", VERSION);

	if (misc_register(&vhci_miscdev) < 0) {
		BT_ERR("Can't register misc device with minor %d", minor);
		return -EIO;
	}

	return 0;
	return misc_register(&vhci_miscdev);
}

static void __exit vhci_exit(void)
{
	if (misc_deregister(&vhci_miscdev) < 0)
		BT_ERR("Can't unregister misc device with minor %d", minor);
	misc_deregister(&vhci_miscdev);
}

module_init(vhci_init);
Loading