linux/drivers/net/ethernet/broadcom/bcm4908_enet.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2021 Rafał Miłecki <[email protected]>
 */

#include <linux/delay.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/string.h>

#include "bcm4908_enet.h"
#include "unimac.h"

#define ENET_DMA_CH_RX_CFG
#define ENET_DMA_CH_TX_CFG
#define ENET_DMA_CH_RX_STATE_RAM
#define ENET_DMA_CH_TX_STATE_RAM

#define ENET_TX_BDS_NUM
#define ENET_RX_BDS_NUM
#define ENET_RX_BDS_NUM_MAX

#define ENET_DMA_INT_DEFAULTS
#define ENET_DMA_MAX_BURST_LEN

#define ENET_MTU_MAX
#define BRCM_MAX_TAG_LEN
#define ENET_MAX_ETH_OVERHEAD

#define ENET_RX_SKB_BUF_SIZE
#define ENET_RX_SKB_BUF_ALLOC_SIZE
#define ENET_RX_BUF_DMA_OFFSET
#define ENET_RX_BUF_DMA_SIZE

struct bcm4908_enet_dma_ring_bd {} __packed;

struct bcm4908_enet_dma_ring_slot {};

struct bcm4908_enet_dma_ring {};

struct bcm4908_enet {};

/***
 * R/W ops
 */

static u32 enet_read(struct bcm4908_enet *enet, u16 offset)
{}

static void enet_write(struct bcm4908_enet *enet, u16 offset, u32 value)
{}

static void enet_maskset(struct bcm4908_enet *enet, u16 offset, u32 mask, u32 set)
{}

static void enet_set(struct bcm4908_enet *enet, u16 offset, u32 set)
{}

static u32 enet_umac_read(struct bcm4908_enet *enet, u16 offset)
{}

static void enet_umac_write(struct bcm4908_enet *enet, u16 offset, u32 value)
{}

static void enet_umac_set(struct bcm4908_enet *enet, u16 offset, u32 set)
{}

/***
 * Helpers
 */

static void bcm4908_enet_set_mtu(struct bcm4908_enet *enet, int mtu)
{}

/***
 * DMA ring ops
 */

static void bcm4908_enet_dma_ring_intrs_on(struct bcm4908_enet *enet,
					   struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_ring_intrs_off(struct bcm4908_enet *enet,
					    struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_ring_intrs_ack(struct bcm4908_enet *enet,
					    struct bcm4908_enet_dma_ring *ring)
{}

/***
 * DMA
 */

static int bcm4908_dma_alloc_buf_descs(struct bcm4908_enet *enet,
				       struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_free(struct bcm4908_enet *enet)
{}

static int bcm4908_enet_dma_alloc(struct bcm4908_enet *enet)
{}

static void bcm4908_enet_dma_reset(struct bcm4908_enet *enet)
{}

static int bcm4908_enet_dma_alloc_rx_buf(struct bcm4908_enet *enet, unsigned int idx)
{}

static void bcm4908_enet_dma_ring_init(struct bcm4908_enet *enet,
				       struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_uninit(struct bcm4908_enet *enet)
{}

static int bcm4908_enet_dma_init(struct bcm4908_enet *enet)
{}

static void bcm4908_enet_dma_tx_ring_enable(struct bcm4908_enet *enet,
					    struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_tx_ring_disable(struct bcm4908_enet *enet,
					     struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_rx_ring_enable(struct bcm4908_enet *enet,
					    struct bcm4908_enet_dma_ring *ring)
{}

static void bcm4908_enet_dma_rx_ring_disable(struct bcm4908_enet *enet,
					     struct bcm4908_enet_dma_ring *ring)
{}

/***
 * Ethernet driver
 */

static void bcm4908_enet_gmac_init(struct bcm4908_enet *enet)
{}

static irqreturn_t bcm4908_enet_irq_handler(int irq, void *dev_id)
{}

static int bcm4908_enet_open(struct net_device *netdev)
{}

static int bcm4908_enet_stop(struct net_device *netdev)
{}

static netdev_tx_t bcm4908_enet_start_xmit(struct sk_buff *skb, struct net_device *netdev)
{}

static int bcm4908_enet_poll_rx(struct napi_struct *napi, int weight)
{}

static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight)
{}

static int bcm4908_enet_change_mtu(struct net_device *netdev, int new_mtu)
{}

static const struct net_device_ops bcm4908_enet_netdev_ops =;

static int bcm4908_enet_probe(struct platform_device *pdev)
{}

static void bcm4908_enet_remove(struct platform_device *pdev)
{}

static const struct of_device_id bcm4908_enet_of_match[] =;

static struct platform_driver bcm4908_enet_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(of, bcm4908_enet_of_match);