linux/drivers/staging/octeon/ethernet.c

// SPDX-License-Identifier: GPL-2.0
/*
 * This file is based on code from OCTEON SDK by Cavium Networks.
 *
 * Copyright (c) 2003-2007 Cavium Networks
 */

#include <linux/platform_device.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/phy.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>

#include <net/dst.h>

#include "octeon-ethernet.h"
#include "ethernet-defines.h"
#include "ethernet-mem.h"
#include "ethernet-rx.h"
#include "ethernet-tx.h"
#include "ethernet-mdio.h"
#include "ethernet-util.h"

#define OCTEON_MAX_MTU

static int num_packet_buffers =;
module_param(num_packet_buffers, int, 0444);
MODULE_PARM_DESC();

static int pow_receive_group =;
module_param(pow_receive_group, int, 0444);
MODULE_PARM_DESC();

static int receive_group_order;
module_param(receive_group_order, int, 0444);
MODULE_PARM_DESC();

int pow_send_group =;
module_param(pow_send_group, int, 0644);
MODULE_PARM_DESC();

int always_use_pow;
module_param(always_use_pow, int, 0444);
MODULE_PARM_DESC();

char pow_send_list[128] =;
module_param_string();
MODULE_PARM_DESC();

int rx_napi_weight =;
module_param(rx_napi_weight, int, 0444);
MODULE_PARM_DESC();

/* Mask indicating which receive groups are in use. */
int pow_receive_groups;

/*
 * cvm_oct_poll_queue_stopping - flag to indicate polling should stop.
 *
 * Set to one right before cvm_oct_poll_queue is destroyed.
 */
atomic_t cvm_oct_poll_queue_stopping =;

/*
 * Array of every ethernet device owned by this driver indexed by
 * the ipd input port number.
 */
struct net_device *cvm_oct_device[TOTAL_NUMBER_OF_PORTS];

u64 cvm_oct_tx_poll_interval;

static void cvm_oct_rx_refill_worker(struct work_struct *work);
static DECLARE_DELAYED_WORK(cvm_oct_rx_refill_work, cvm_oct_rx_refill_worker);

static void cvm_oct_rx_refill_worker(struct work_struct *work)
{}

static void cvm_oct_periodic_worker(struct work_struct *work)
{}

static void cvm_oct_configure_common_hw(void)
{}

/**
 * cvm_oct_free_work- Free a work queue entry
 *
 * @work_queue_entry: Work queue entry to free
 *
 * Returns Zero on success, Negative on failure.
 */
int cvm_oct_free_work(void *work_queue_entry)
{}
EXPORT_SYMBOL();

/**
 * cvm_oct_common_get_stats - get the low level ethernet statistics
 * @dev:    Device to get the statistics from
 *
 * Returns Pointer to the statistics
 */
static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
{}

/**
 * cvm_oct_common_change_mtu - change the link MTU
 * @dev:     Device to change
 * @new_mtu: The new MTU
 *
 * Returns Zero on success
 */
static int cvm_oct_common_change_mtu(struct net_device *dev, int new_mtu)
{}

/**
 * cvm_oct_common_set_multicast_list - set the multicast list
 * @dev:    Device to work on
 */
static void cvm_oct_common_set_multicast_list(struct net_device *dev)
{}

static int cvm_oct_set_mac_filter(struct net_device *dev)
{}

/**
 * cvm_oct_common_set_mac_address - set the hardware MAC address for a device
 * @dev:    The device in question.
 * @addr:   Socket address.
 *
 * Returns Zero on success
 */
static int cvm_oct_common_set_mac_address(struct net_device *dev, void *addr)
{}

/**
 * cvm_oct_common_init - per network device initialization
 * @dev:    Device to initialize
 *
 * Returns Zero on success
 */
int cvm_oct_common_init(struct net_device *dev)
{}

void cvm_oct_common_uninit(struct net_device *dev)
{}

int cvm_oct_common_open(struct net_device *dev,
			void (*link_poll)(struct net_device *))
{}

void cvm_oct_link_poll(struct net_device *dev)
{}

static int cvm_oct_xaui_open(struct net_device *dev)
{}

static const struct net_device_ops cvm_oct_npi_netdev_ops =;

static const struct net_device_ops cvm_oct_xaui_netdev_ops =;

static const struct net_device_ops cvm_oct_sgmii_netdev_ops =;

static const struct net_device_ops cvm_oct_spi_netdev_ops =;

static const struct net_device_ops cvm_oct_rgmii_netdev_ops =;

static const struct net_device_ops cvm_oct_pow_netdev_ops =;

static struct device_node *cvm_oct_of_get_child
				(const struct device_node *parent, int reg_val)
{}

static struct device_node *cvm_oct_node_for_port(struct device_node *pip,
						 int interface, int port)
{}

static void cvm_set_rgmii_delay(struct octeon_ethernet *priv, int iface,
				int port)
{}

static int cvm_oct_probe(struct platform_device *pdev)
{}

static void cvm_oct_remove(struct platform_device *pdev)
{}

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

static struct platform_driver cvm_oct_driver =;

module_platform_driver();

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