1 /* SPDX-License-Identifier: GPL-2.0 */
3 * This file is based on code from OCTEON SDK by Cavium Networks.
5 * Copyright (c) 2003-2010 Cavium Networks
9 * External interface for the Cavium Octeon ethernet driver.
11 #ifndef OCTEON_ETHERNET_H
12 #define OCTEON_ETHERNET_H
16 #include <asm/octeon/cvmx-helper-board.h>
19 * This is the definition of the Ethernet driver's private
20 * driver state stored in netdev_priv(dev).
22 struct octeon_ethernet
{
23 /* PKO hardware output port */
25 /* PKO hardware queue for the port */
27 /* Hardware fetch and add to count outstanding tx buffers */
30 struct net_device
*netdev
;
32 * Type of port. This is one of the enums in
33 * cvmx_helper_interface_mode_t
36 /* List of outstanding tx buffers per queue */
37 struct sk_buff_head tx_free_list
[16];
38 unsigned int last_speed
;
39 unsigned int last_link
;
40 /* Last negotiated link state */
42 /* Called periodically to check link status */
43 void (*poll
)(struct net_device
*dev
);
44 struct delayed_work port_periodic_work
;
45 struct device_node
*of_node
;
48 int cvm_oct_free_work(void *work_queue_entry
);
50 int cvm_oct_rgmii_open(struct net_device
*dev
);
52 int cvm_oct_sgmii_init(struct net_device
*dev
);
53 int cvm_oct_sgmii_open(struct net_device
*dev
);
55 int cvm_oct_spi_init(struct net_device
*dev
);
56 void cvm_oct_spi_uninit(struct net_device
*dev
);
58 int cvm_oct_common_init(struct net_device
*dev
);
59 void cvm_oct_common_uninit(struct net_device
*dev
);
60 void cvm_oct_adjust_link(struct net_device
*dev
);
61 int cvm_oct_common_stop(struct net_device
*dev
);
62 int cvm_oct_common_open(struct net_device
*dev
,
63 void (*link_poll
)(struct net_device
*));
64 void cvm_oct_note_carrier(struct octeon_ethernet
*priv
,
65 cvmx_helper_link_info_t li
);
66 void cvm_oct_link_poll(struct net_device
*dev
);
68 extern int always_use_pow
;
69 extern int pow_send_group
;
70 extern int pow_receive_groups
;
71 extern char pow_send_list
[];
72 extern struct net_device
*cvm_oct_device
[];
73 extern atomic_t cvm_oct_poll_queue_stopping
;
74 extern u64 cvm_oct_tx_poll_interval
;
76 extern int rx_napi_weight
;