Linux Audio

Check our new training course

Loading...
v3.15
  1/**********************************************************************
  2 * Author: Cavium Networks
  3 *
  4 * Contact: support@caviumnetworks.com
  5 * This file is part of the OCTEON SDK
  6 *
  7 * Copyright (c) 2003-2010 Cavium Networks
  8 *
  9 * This file is free software; you can redistribute it and/or modify
 10 * it under the terms of the GNU General Public License, Version 2, as
 11 * published by the Free Software Foundation.
 12 *
 13 * This file is distributed in the hope that it will be useful, but
 14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
 15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
 16 * NONINFRINGEMENT.  See the GNU General Public License for more
 17 * details.
 18 *
 19 * You should have received a copy of the GNU General Public License
 20 * along with this file; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 22 * or visit http://www.gnu.org/licenses/.
 23 *
 24 * This file may also be available under a different license from Cavium.
 25 * Contact Cavium Networks for more information
 26**********************************************************************/
 27
 28/*
 29 * External interface for the Cavium Octeon ethernet driver.
 30 */
 31#ifndef OCTEON_ETHERNET_H
 32#define OCTEON_ETHERNET_H
 33
 34#include <linux/of.h>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 35
 36/**
 37 * This is the definition of the Ethernet driver's private
 38 * driver state stored in netdev_priv(dev).
 39 */
 40struct octeon_ethernet {
 41	/* PKO hardware output port */
 42	int port;
 43	/* PKO hardware queue for the port */
 44	int queue;
 45	/* Hardware fetch and add to count outstanding tx buffers */
 46	int fau;
 
 
 47	/*
 48	 * Type of port. This is one of the enums in
 49	 * cvmx_helper_interface_mode_t
 50	 */
 51	int imode;
 
 
 52	/* List of outstanding tx buffers per queue */
 53	struct sk_buff_head tx_free_list[16];
 54	/* Device statistics */
 55	struct net_device_stats stats;
 56	struct phy_device *phydev;
 57	unsigned int last_link;
 58	/* Last negotiated link state */
 59	uint64_t link_info;
 60	/* Called periodically to check link status */
 61	void (*poll)(struct net_device *dev);
 62	struct delayed_work	port_periodic_work;
 63	struct work_struct	port_work;	/* may be unused. */
 64	struct device_node	*of_node;
 65};
 66
 67int cvm_oct_free_work(void *work_queue_entry);
 68
 69extern int cvm_oct_rgmii_init(struct net_device *dev);
 70extern void cvm_oct_rgmii_uninit(struct net_device *dev);
 71extern int cvm_oct_rgmii_open(struct net_device *dev);
 72extern int cvm_oct_rgmii_stop(struct net_device *dev);
 73
 74extern int cvm_oct_sgmii_init(struct net_device *dev);
 75extern void cvm_oct_sgmii_uninit(struct net_device *dev);
 76extern int cvm_oct_sgmii_open(struct net_device *dev);
 77extern int cvm_oct_sgmii_stop(struct net_device *dev);
 78
 79extern int cvm_oct_spi_init(struct net_device *dev);
 80extern void cvm_oct_spi_uninit(struct net_device *dev);
 81extern int cvm_oct_xaui_init(struct net_device *dev);
 82extern void cvm_oct_xaui_uninit(struct net_device *dev);
 83extern int cvm_oct_xaui_open(struct net_device *dev);
 84extern int cvm_oct_xaui_stop(struct net_device *dev);
 85
 86extern int cvm_oct_common_init(struct net_device *dev);
 87extern void cvm_oct_common_uninit(struct net_device *dev);
 
 
 
 
 
 
 
 88
 89extern int always_use_pow;
 90extern int pow_send_group;
 91extern int pow_receive_group;
 92extern char pow_send_list[];
 93extern struct net_device *cvm_oct_device[];
 94extern struct workqueue_struct *cvm_oct_poll_queue;
 95extern atomic_t cvm_oct_poll_queue_stopping;
 96extern u64 cvm_oct_tx_poll_interval;
 97
 98extern int max_rx_cpus;
 99extern int rx_napi_weight;
100
101#endif
v5.14.15
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * This file is based on code from OCTEON SDK by Cavium Networks.
 
 
  4 *
  5 * Copyright (c) 2003-2010 Cavium Networks
  6 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  7
  8/*
  9 * External interface for the Cavium Octeon ethernet driver.
 10 */
 11#ifndef OCTEON_ETHERNET_H
 12#define OCTEON_ETHERNET_H
 13
 14#include <linux/of.h>
 15#include <linux/phy.h>
 16
 17#ifdef CONFIG_CAVIUM_OCTEON_SOC
 18
 19#include <asm/octeon/octeon.h>
 20
 21#include <asm/octeon/cvmx-asxx-defs.h>
 22#include <asm/octeon/cvmx-config.h>
 23#include <asm/octeon/cvmx-fau.h>
 24#include <asm/octeon/cvmx-gmxx-defs.h>
 25#include <asm/octeon/cvmx-helper.h>
 26#include <asm/octeon/cvmx-helper-util.h>
 27#include <asm/octeon/cvmx-ipd.h>
 28#include <asm/octeon/cvmx-ipd-defs.h>
 29#include <asm/octeon/cvmx-npi-defs.h>
 30#include <asm/octeon/cvmx-pip.h>
 31#include <asm/octeon/cvmx-pko.h>
 32#include <asm/octeon/cvmx-pow.h>
 33#include <asm/octeon/cvmx-scratch.h>
 34#include <asm/octeon/cvmx-spi.h>
 35#include <asm/octeon/cvmx-spxx-defs.h>
 36#include <asm/octeon/cvmx-stxx-defs.h>
 37#include <asm/octeon/cvmx-wqe.h>
 38
 39#else
 40
 41#include "octeon-stubs.h"
 42
 43#endif
 44
 45/**
 46 * This is the definition of the Ethernet driver's private
 47 * driver state stored in netdev_priv(dev).
 48 */
 49struct octeon_ethernet {
 50	/* PKO hardware output port */
 51	int port;
 52	/* PKO hardware queue for the port */
 53	int queue;
 54	/* Hardware fetch and add to count outstanding tx buffers */
 55	int fau;
 56	/* My netdev. */
 57	struct net_device *netdev;
 58	/*
 59	 * Type of port. This is one of the enums in
 60	 * cvmx_helper_interface_mode_t
 61	 */
 62	int imode;
 63	/* PHY mode */
 64	phy_interface_t phy_mode;
 65	/* List of outstanding tx buffers per queue */
 66	struct sk_buff_head tx_free_list[16];
 67	unsigned int last_speed;
 
 
 68	unsigned int last_link;
 69	/* Last negotiated link state */
 70	u64 link_info;
 71	/* Called periodically to check link status */
 72	void (*poll)(struct net_device *dev);
 73	struct delayed_work	port_periodic_work;
 
 74	struct device_node	*of_node;
 75};
 76
 77int cvm_oct_free_work(void *work_queue_entry);
 78
 79int cvm_oct_rgmii_open(struct net_device *dev);
 80
 81int cvm_oct_sgmii_init(struct net_device *dev);
 82int cvm_oct_sgmii_open(struct net_device *dev);
 83
 84int cvm_oct_spi_init(struct net_device *dev);
 85void cvm_oct_spi_uninit(struct net_device *dev);
 
 
 
 
 
 
 
 
 
 86
 87int cvm_oct_common_init(struct net_device *dev);
 88void cvm_oct_common_uninit(struct net_device *dev);
 89void cvm_oct_adjust_link(struct net_device *dev);
 90int cvm_oct_common_stop(struct net_device *dev);
 91int cvm_oct_common_open(struct net_device *dev,
 92			void (*link_poll)(struct net_device *));
 93void cvm_oct_note_carrier(struct octeon_ethernet *priv,
 94			  union cvmx_helper_link_info li);
 95void cvm_oct_link_poll(struct net_device *dev);
 96
 97extern int always_use_pow;
 98extern int pow_send_group;
 99extern int pow_receive_groups;
100extern char pow_send_list[];
101extern struct net_device *cvm_oct_device[];
 
102extern atomic_t cvm_oct_poll_queue_stopping;
103extern u64 cvm_oct_tx_poll_interval;
104
 
105extern int rx_napi_weight;
106
107#endif