0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef OCTEON_ETHERNET_H
0012 #define OCTEON_ETHERNET_H
0013
0014 #include <linux/of.h>
0015 #include <linux/phy.h>
0016
0017 #ifdef CONFIG_CAVIUM_OCTEON_SOC
0018
0019 #include <asm/octeon/octeon.h>
0020
0021 #include <asm/octeon/cvmx-asxx-defs.h>
0022 #include <asm/octeon/cvmx-config.h>
0023 #include <asm/octeon/cvmx-fau.h>
0024 #include <asm/octeon/cvmx-gmxx-defs.h>
0025 #include <asm/octeon/cvmx-helper.h>
0026 #include <asm/octeon/cvmx-helper-util.h>
0027 #include <asm/octeon/cvmx-ipd.h>
0028 #include <asm/octeon/cvmx-ipd-defs.h>
0029 #include <asm/octeon/cvmx-npi-defs.h>
0030 #include <asm/octeon/cvmx-pip.h>
0031 #include <asm/octeon/cvmx-pko.h>
0032 #include <asm/octeon/cvmx-pow.h>
0033 #include <asm/octeon/cvmx-scratch.h>
0034 #include <asm/octeon/cvmx-spi.h>
0035 #include <asm/octeon/cvmx-spxx-defs.h>
0036 #include <asm/octeon/cvmx-stxx-defs.h>
0037 #include <asm/octeon/cvmx-wqe.h>
0038
0039 #else
0040
0041 #include "octeon-stubs.h"
0042
0043 #endif
0044
0045
0046
0047
0048
0049 struct octeon_ethernet {
0050
0051 int port;
0052
0053 int queue;
0054
0055 int fau;
0056
0057 struct net_device *netdev;
0058
0059
0060
0061
0062 int imode;
0063
0064 phy_interface_t phy_mode;
0065
0066 struct sk_buff_head tx_free_list[16];
0067 unsigned int last_speed;
0068 unsigned int last_link;
0069
0070 u64 link_info;
0071
0072 void (*poll)(struct net_device *dev);
0073 struct delayed_work port_periodic_work;
0074 struct device_node *of_node;
0075 };
0076
0077 int cvm_oct_free_work(void *work_queue_entry);
0078
0079 int cvm_oct_rgmii_open(struct net_device *dev);
0080
0081 int cvm_oct_sgmii_init(struct net_device *dev);
0082 int cvm_oct_sgmii_open(struct net_device *dev);
0083
0084 int cvm_oct_spi_init(struct net_device *dev);
0085 void cvm_oct_spi_uninit(struct net_device *dev);
0086
0087 int cvm_oct_common_init(struct net_device *dev);
0088 void cvm_oct_common_uninit(struct net_device *dev);
0089 void cvm_oct_adjust_link(struct net_device *dev);
0090 int cvm_oct_common_stop(struct net_device *dev);
0091 int cvm_oct_common_open(struct net_device *dev,
0092 void (*link_poll)(struct net_device *));
0093 void cvm_oct_note_carrier(struct octeon_ethernet *priv,
0094 union cvmx_helper_link_info li);
0095 void cvm_oct_link_poll(struct net_device *dev);
0096
0097 extern int always_use_pow;
0098 extern int pow_send_group;
0099 extern int pow_receive_groups;
0100 extern char pow_send_list[];
0101 extern struct net_device *cvm_oct_device[];
0102 extern atomic_t cvm_oct_poll_queue_stopping;
0103 extern u64 cvm_oct_tx_poll_interval;
0104
0105 extern int rx_napi_weight;
0106
0107 #endif