linux/net/bluetooth/coredump.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2023 Google Corporation
 */

#include <linux/devcoredump.h>

#include <asm/unaligned.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>

enum hci_devcoredump_pkt_type {};

struct hci_devcoredump_skb_cb {};

struct hci_devcoredump_skb_pattern {} __packed;

#define hci_dmp_cb(skb)

#define DBG_UNEXPECTED_STATE()

#define MAX_DEVCOREDUMP_HDR_SIZE

static int hci_devcd_update_hdr_state(char *buf, size_t size, int state)
{}

/* Call with hci_dev_lock only. */
static int hci_devcd_update_state(struct hci_dev *hdev, int state)
{}

static int hci_devcd_mkheader(struct hci_dev *hdev, struct sk_buff *skb)
{}

/* Do not call with hci_dev_lock since this calls driver code. */
static void hci_devcd_notify(struct hci_dev *hdev, int state)
{}

/* Call with hci_dev_lock only. */
void hci_devcd_reset(struct hci_dev *hdev)
{}

/* Call with hci_dev_lock only. */
static void hci_devcd_free(struct hci_dev *hdev)
{}

/* Call with hci_dev_lock only. */
static int hci_devcd_alloc(struct hci_dev *hdev, u32 size)
{}

/* Call with hci_dev_lock only. */
static bool hci_devcd_copy(struct hci_dev *hdev, char *buf, u32 size)
{}

/* Call with hci_dev_lock only. */
static bool hci_devcd_memset(struct hci_dev *hdev, u8 pattern, u32 len)
{}

/* Call with hci_dev_lock only. */
static int hci_devcd_prepare(struct hci_dev *hdev, u32 dump_size)
{}

static void hci_devcd_handle_pkt_init(struct hci_dev *hdev, struct sk_buff *skb)
{}

static void hci_devcd_handle_pkt_skb(struct hci_dev *hdev, struct sk_buff *skb)
{}

static void hci_devcd_handle_pkt_pattern(struct hci_dev *hdev,
					 struct sk_buff *skb)
{}

static void hci_devcd_handle_pkt_complete(struct hci_dev *hdev,
					  struct sk_buff *skb)
{}

static void hci_devcd_handle_pkt_abort(struct hci_dev *hdev,
				       struct sk_buff *skb)
{}

/* Bluetooth devcoredump state machine.
 *
 * Devcoredump states:
 *
 *      HCI_DEVCOREDUMP_IDLE: The default state.
 *
 *      HCI_DEVCOREDUMP_ACTIVE: A devcoredump will be in this state once it has
 *              been initialized using hci_devcd_init(). Once active, the driver
 *              can append data using hci_devcd_append() or insert a pattern
 *              using hci_devcd_append_pattern().
 *
 *      HCI_DEVCOREDUMP_DONE: Once the dump collection is complete, the drive
 *              can signal the completion using hci_devcd_complete(). A
 *              devcoredump is generated indicating the completion event and
 *              then the state machine is reset to the default state.
 *
 *      HCI_DEVCOREDUMP_ABORT: The driver can cancel ongoing dump collection in
 *              case of any error using hci_devcd_abort(). A devcoredump is
 *              still generated with the available data indicating the abort
 *              event and then the state machine is reset to the default state.
 *
 *      HCI_DEVCOREDUMP_TIMEOUT: A timeout timer for HCI_DEVCOREDUMP_TIMEOUT sec
 *              is started during devcoredump initialization. Once the timeout
 *              occurs, the driver is notified, a devcoredump is generated with
 *              the available data indicating the timeout event and then the
 *              state machine is reset to the default state.
 *
 * The driver must register using hci_devcd_register() before using the hci
 * devcoredump APIs.
 */
void hci_devcd_rx(struct work_struct *work)
{}
EXPORT_SYMBOL();

void hci_devcd_timeout(struct work_struct *work)
{}
EXPORT_SYMBOL();

int hci_devcd_register(struct hci_dev *hdev, coredump_t coredump,
		       dmp_hdr_t dmp_hdr, notify_change_t notify_change)
{}
EXPORT_SYMBOL();

static inline bool hci_devcd_enabled(struct hci_dev *hdev)
{}

int hci_devcd_init(struct hci_dev *hdev, u32 dump_size)
{}
EXPORT_SYMBOL();

int hci_devcd_append(struct hci_dev *hdev, struct sk_buff *skb)
{}
EXPORT_SYMBOL();

int hci_devcd_append_pattern(struct hci_dev *hdev, u8 pattern, u32 len)
{}
EXPORT_SYMBOL();

int hci_devcd_complete(struct hci_dev *hdev)
{}
EXPORT_SYMBOL();

int hci_devcd_abort(struct hci_dev *hdev)
{}
EXPORT_SYMBOL();