linux/drivers/net/wwan/t7xx/t7xx_state_monitor.h

/* SPDX-License-Identifier: GPL-2.0-only
 *
 * Copyright (c) 2021, MediaTek Inc.
 * Copyright (c) 2021-2022, Intel Corporation.
 *
 * Authors:
 *  Amir Hanania <[email protected]>
 *  Haijun Liu <[email protected]>
 *  Moises Veleta <[email protected]>
 *
 * Contributors:
 *  Eliot Lee <[email protected]>
 *  Ricardo Martinez <[email protected]>
 *  Sreehari Kancharla <[email protected]>
 */

#ifndef __T7XX_MONITOR_H__
#define __T7XX_MONITOR_H__

#include <linux/bits.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/wait.h>

#include "t7xx_modem_ops.h"

enum t7xx_fsm_state {};

enum t7xx_fsm_event_state {};

enum t7xx_fsm_cmd_state {};

enum t7xx_ex_reason {};

enum t7xx_md_irq_type {};

enum md_state {};

#define FSM_CMD_FLAG_WAIT_FOR_COMPLETION
#define FSM_CMD_FLAG_FLIGHT_MODE
#define FSM_CMD_FLAG_IN_INTERRUPT
#define FSM_CMD_EX_REASON

struct t7xx_fsm_ctl {};

struct t7xx_fsm_event {};

struct t7xx_fsm_command {};

struct t7xx_fsm_notifier {};

int t7xx_fsm_append_cmd(struct t7xx_fsm_ctl *ctl, enum t7xx_fsm_cmd_state cmd_id,
			unsigned int flag);
int t7xx_fsm_append_event(struct t7xx_fsm_ctl *ctl, enum t7xx_fsm_event_state event_id,
			  unsigned char *data, unsigned int length);
void t7xx_fsm_clr_event(struct t7xx_fsm_ctl *ctl, enum t7xx_fsm_event_state event_id);
void t7xx_fsm_broadcast_state(struct t7xx_fsm_ctl *ctl, enum md_state state);
void t7xx_fsm_reset(struct t7xx_modem *md);
int t7xx_fsm_init(struct t7xx_modem *md);
void t7xx_fsm_uninit(struct t7xx_modem *md);
int t7xx_fsm_recv_md_intr(struct t7xx_fsm_ctl *ctl, enum t7xx_md_irq_type type);
enum md_state t7xx_fsm_get_md_state(struct t7xx_fsm_ctl *ctl);
unsigned int t7xx_fsm_get_ctl_state(struct t7xx_fsm_ctl *ctl);
void t7xx_fsm_notifier_register(struct t7xx_modem *md, struct t7xx_fsm_notifier *notifier);
void t7xx_fsm_notifier_unregister(struct t7xx_modem *md, struct t7xx_fsm_notifier *notifier);

#endif /* __T7XX_MONITOR_H__ */