linux/drivers/net/ethernet/qualcomm/qca_7k_common.h

/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
/*
 *   Copyright (c) 2011, 2012, Atheros Communications Inc.
 *   Copyright (c) 2014, I2SE GmbH
 */

/*   Atheros Ethernet framing. Every Ethernet frame is surrounded by an atheros
 *   frame while transmitted over a serial channel.
 */

#ifndef _QCA_FRAMING_H
#define _QCA_FRAMING_H

#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/types.h>

/* Frame is currently being received */
#define QCAFRM_GATHER

/*  No header byte while expecting it */
#define QCAFRM_NOHEAD

/* No tailer byte while expecting it */
#define QCAFRM_NOTAIL

/* Frame length is invalid */
#define QCAFRM_INVLEN

/* Frame length is invalid */
#define QCAFRM_INVFRAME

/* Min/Max Ethernet MTU: 46/1500 */
#define QCAFRM_MIN_MTU
#define QCAFRM_MAX_MTU

/* Min/Max frame lengths */
#define QCAFRM_MIN_LEN
#define QCAFRM_MAX_LEN

/* QCA7K header len */
#define QCAFRM_HEADER_LEN

/* QCA7K footer len */
#define QCAFRM_FOOTER_LEN

/* QCA7K Framing. */
#define QCAFRM_ERR_BASE

enum qcafrm_state {};

/*   Structure to maintain the frame decoding during reception. */

struct qcafrm_handle {};

u16 qcafrm_create_header(u8 *buf, u16 len);

u16 qcafrm_create_footer(u8 *buf);

static inline void qcafrm_fsm_init_spi(struct qcafrm_handle *handle)
{}

static inline void qcafrm_fsm_init_uart(struct qcafrm_handle *handle)
{}

s32 qcafrm_fsm_decode(struct qcafrm_handle *handle, u8 *buf, u16 buf_len, u8 recv_byte);

#endif /* _QCA_FRAMING_H */