#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/skbuff.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/wait.h>
#include <linux/tty.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/acpi.h>
#include <linux/interrupt.h>
#include <linux/pm_runtime.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include "hci_uart.h"
#include "btintel.h"
#define STATE_BOOTLOADER …
#define STATE_DOWNLOADING …
#define STATE_FIRMWARE_LOADED …
#define STATE_FIRMWARE_FAILED …
#define STATE_BOOTING …
#define STATE_LPM_ENABLED …
#define STATE_TX_ACTIVE …
#define STATE_SUSPENDED …
#define STATE_LPM_TRANSACTION …
#define HCI_LPM_WAKE_PKT …
#define HCI_LPM_PKT …
#define HCI_LPM_MAX_SIZE …
#define HCI_LPM_HDR_SIZE …
#define LPM_OP_TX_NOTIFY …
#define LPM_OP_SUSPEND_ACK …
#define LPM_OP_RESUME_ACK …
#define LPM_SUSPEND_DELAY_MS …
struct hci_lpm_pkt { … } __packed;
struct intel_device { … };
static LIST_HEAD(intel_device_list);
static DEFINE_MUTEX(intel_device_list_lock);
struct intel_data { … };
static u8 intel_convert_speed(unsigned int speed)
{ … }
static int intel_wait_booting(struct hci_uart *hu)
{ … }
#ifdef CONFIG_PM
static int intel_wait_lpm_transaction(struct hci_uart *hu)
{ … }
static int intel_lpm_suspend(struct hci_uart *hu)
{ … }
static int intel_lpm_resume(struct hci_uart *hu)
{ … }
#endif
static int intel_lpm_host_wake(struct hci_uart *hu)
{ … }
static irqreturn_t intel_irq(int irq, void *dev_id)
{ … }
static int intel_set_power(struct hci_uart *hu, bool powered)
{ … }
static void intel_busy_work(struct work_struct *work)
{ … }
static int intel_open(struct hci_uart *hu)
{ … }
static int intel_close(struct hci_uart *hu)
{ … }
static int intel_flush(struct hci_uart *hu)
{ … }
static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode)
{ … }
static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed)
{ … }
static int intel_setup(struct hci_uart *hu)
{ … }
static int intel_recv_event(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static void intel_recv_lpm_notify(struct hci_dev *hdev, int value)
{ … }
static int intel_recv_lpm(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
#define INTEL_RECV_LPM …
static const struct h4_recv_pkt intel_recv_pkts[] = …;
static int intel_recv(struct hci_uart *hu, const void *data, int count)
{ … }
static int intel_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{ … }
static struct sk_buff *intel_dequeue(struct hci_uart *hu)
{ … }
static const struct hci_uart_proto intel_proto = …;
#ifdef CONFIG_ACPI
static const struct acpi_device_id intel_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, intel_acpi_match);
#endif
#ifdef CONFIG_PM
static int intel_suspend_device(struct device *dev)
{ … }
static int intel_resume_device(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM_SLEEP
static int intel_suspend(struct device *dev)
{ … }
static int intel_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops intel_pm_ops = …;
static const struct acpi_gpio_params reset_gpios = …;
static const struct acpi_gpio_params host_wake_gpios = …;
static const struct acpi_gpio_mapping acpi_hci_intel_gpios[] = …;
static int intel_probe(struct platform_device *pdev)
{ … }
static void intel_remove(struct platform_device *pdev)
{ … }
static struct platform_driver intel_driver = …;
int __init intel_init(void)
{ … }
int __exit intel_deinit(void)
{ … }