linux/drivers/net/ieee802154/mcr20a.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for NXP MCR20A 802.15.4 Wireless-PAN Networking controller
 *
 * Copyright (C) 2018 Xue Liu <[email protected]>
 */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio/consumer.h>
#include <linux/spi/spi.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/skbuff.h>
#include <linux/regmap.h>
#include <linux/ieee802154.h>
#include <linux/debugfs.h>

#include <net/mac802154.h>
#include <net/cfg802154.h>

#include <linux/device.h>

#include "mcr20a.h"

#define SPI_COMMAND_BUFFER

#define REGISTER_READ
#define REGISTER_WRITE
#define REGISTER_ACCESS
#define PACKET_BUFF_BURST_ACCESS
#define PACKET_BUFF_BYTE_ACCESS

#define MCR20A_WRITE_REG(x)
#define MCR20A_READ_REG(x)
#define MCR20A_BURST_READ_PACKET_BUF
#define MCR20A_BURST_WRITE_PACKET_BUF

#define MCR20A_CMD_REG
#define MCR20A_CMD_REG_MASK
#define MCR20A_CMD_WRITE
#define MCR20A_CMD_FB

/* Number of Interrupt Request Status Register */
#define MCR20A_IRQSTS_NUM

/* MCR20A CCA Type */
enum {};

enum {};

/* IEEE-802.15.4 defined constants (2.4 GHz logical channels) */
#define MCR20A_MIN_CHANNEL
#define MCR20A_MAX_CHANNEL
#define MCR20A_CHANNEL_SPACING

/* MCR20A CCA Threshold constans */
#define MCR20A_MIN_CCA_THRESHOLD
#define MCR20A_MAX_CCA_THRESHOLD

/* version 0C */
#define MCR20A_OVERWRITE_VERSION

/* MCR20A PLL configurations */
static const u8  PLL_INT[16] =;

static const u8 PLL_FRAC[16] =;

static const struct reg_sequence mar20a_iar_overwrites[] =;

#define MCR20A_VALID_CHANNELS
#define MCR20A_MAX_BUF

#define printdev(X)

/* regmap information for Direct Access Register (DAR) access */
#define MCR20A_DAR_WRITE
#define MCR20A_DAR_READ
#define MCR20A_DAR_NUMREGS

/* regmap information for Indirect Access Register (IAR) access */
#define MCR20A_IAR_ACCESS
#define MCR20A_IAR_NUMREGS

/* Read/Write SPI Commands for DAR and IAR registers. */
#define MCR20A_READSHORT(reg)
#define MCR20A_WRITESHORT(reg)
#define MCR20A_READLONG(reg)
#define MCR20A_WRITELONG(reg)

/* Type definitions for link configuration of instantiable layers  */
#define MCR20A_PHY_INDIRECT_QUEUE_SIZE

static bool
mcr20a_dar_writeable(struct device *dev, unsigned int reg)
{}

static bool
mcr20a_dar_readable(struct device *dev, unsigned int reg)
{}

static bool
mcr20a_dar_volatile(struct device *dev, unsigned int reg)
{}

static bool
mcr20a_dar_precious(struct device *dev, unsigned int reg)
{}

static const struct regmap_config mcr20a_dar_regmap =;

static bool
mcr20a_iar_writeable(struct device *dev, unsigned int reg)
{}

static bool
mcr20a_iar_readable(struct device *dev, unsigned int reg)
{}

static bool
mcr20a_iar_volatile(struct device *dev, unsigned int reg)
{}

static const struct regmap_config mcr20a_iar_regmap =;

struct mcr20a_local {};

static void
mcr20a_write_tx_buf_complete(void *context)
{}

static int
mcr20a_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
{}

static int
mcr20a_ed(struct ieee802154_hw *hw, u8 *level)
{}

static int
mcr20a_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
{}

static int
mcr20a_start(struct ieee802154_hw *hw)
{}

static void
mcr20a_stop(struct ieee802154_hw *hw)
{}

static int
mcr20a_set_hw_addr_filt(struct ieee802154_hw *hw,
			struct ieee802154_hw_addr_filt *filt,
			unsigned long changed)
{}

/* -30 dBm to 10 dBm */
#define MCR20A_MAX_TX_POWERS
static const s32 mcr20a_powers[MCR20A_MAX_TX_POWERS + 1] =;

static int
mcr20a_set_txpower(struct ieee802154_hw *hw, s32 mbm)
{}

#define MCR20A_MAX_ED_LEVELS
static s32 mcr20a_ed_levels[MCR20A_MAX_ED_LEVELS + 1];

static int
mcr20a_set_cca_mode(struct ieee802154_hw *hw,
		    const struct wpan_phy_cca *cca)
{}

static int
mcr20a_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
{}

static int
mcr20a_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
{}

static const struct ieee802154_ops mcr20a_hw_ops =;

static int
mcr20a_request_rx(struct mcr20a_local *lp)
{}

static void
mcr20a_handle_rx_read_buf_complete(void *context)
{}

static void
mcr20a_handle_rx_read_len_complete(void *context)
{}

static int
mcr20a_handle_rx(struct mcr20a_local *lp)
{}

static int
mcr20a_handle_tx_complete(struct mcr20a_local *lp)
{}

static int
mcr20a_handle_tx(struct mcr20a_local *lp)
{}

static void
mcr20a_irq_clean_complete(void *context)
{}

static void mcr20a_irq_status_complete(void *context)
{}

static irqreturn_t mcr20a_irq_isr(int irq, void *data)
{}

static void mcr20a_hw_setup(struct mcr20a_local *lp)
{}

static void
mcr20a_setup_tx_spi_messages(struct mcr20a_local *lp)
{}

static void
mcr20a_setup_rx_spi_messages(struct mcr20a_local *lp)
{}

static void
mcr20a_setup_irq_spi_messages(struct mcr20a_local *lp)
{}

static int
mcr20a_phy_init(struct mcr20a_local *lp)
{}

static int
mcr20a_probe(struct spi_device *spi)
{}

static void mcr20a_remove(struct spi_device *spi)
{}

static const struct of_device_id mcr20a_of_match[] =;
MODULE_DEVICE_TABLE(of, mcr20a_of_match);

static const struct spi_device_id mcr20a_device_id[] =;
MODULE_DEVICE_TABLE(spi, mcr20a_device_id);

static struct spi_driver mcr20a_driver =;

module_spi_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();