staging: octeon-ethernet: move cvm_oct_xaui_open()
[deliverable/linux.git] / drivers / staging / octeon / octeon-ethernet.h
CommitLineData
67620987
AK
1/*
2 * This file is based on code from OCTEON SDK by Cavium Networks.
80ff0fd3 3 *
4898c560 4 * Copyright (c) 2003-2010 Cavium Networks
80ff0fd3
DD
5 *
6 * This file is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License, Version 2, as
8 * published by the Free Software Foundation.
67620987 9 */
80ff0fd3
DD
10
11/*
12 * External interface for the Cavium Octeon ethernet driver.
13 */
14#ifndef OCTEON_ETHERNET_H
15#define OCTEON_ETHERNET_H
16
df9244c5
DD
17#include <linux/of.h>
18
2638f713
AK
19#include <asm/octeon/cvmx-helper-board.h>
20
80ff0fd3
DD
21/**
22 * This is the definition of the Ethernet driver's private
23 * driver state stored in netdev_priv(dev).
24 */
25struct octeon_ethernet {
26 /* PKO hardware output port */
27 int port;
28 /* PKO hardware queue for the port */
29 int queue;
30 /* Hardware fetch and add to count outstanding tx buffers */
31 int fau;
ec3a2207
DD
32 /* My netdev. */
33 struct net_device *netdev;
80ff0fd3
DD
34 /*
35 * Type of port. This is one of the enums in
36 * cvmx_helper_interface_mode_t
37 */
38 int imode;
39 /* List of outstanding tx buffers per queue */
40 struct sk_buff_head tx_free_list[16];
41 /* Device statistics */
f6ed1b3b
DD
42 struct net_device_stats stats;
43 struct phy_device *phydev;
44 unsigned int last_link;
80ff0fd3 45 /* Last negotiated link state */
ec2c398e 46 u64 link_info;
80ff0fd3 47 /* Called periodically to check link status */
3661cdf1 48 void (*poll)(struct net_device *dev);
4898c560 49 struct delayed_work port_periodic_work;
f8c26486 50 struct work_struct port_work; /* may be unused. */
df9244c5 51 struct device_node *of_node;
80ff0fd3
DD
52};
53
80ff0fd3
DD
54int cvm_oct_free_work(void *work_queue_entry);
55
b239904d
JP
56int cvm_oct_rgmii_init(struct net_device *dev);
57void cvm_oct_rgmii_uninit(struct net_device *dev);
58int cvm_oct_rgmii_open(struct net_device *dev);
f696a108 59
b239904d
JP
60int cvm_oct_sgmii_init(struct net_device *dev);
61int cvm_oct_sgmii_open(struct net_device *dev);
f696a108 62
b239904d
JP
63int cvm_oct_spi_init(struct net_device *dev);
64void cvm_oct_spi_uninit(struct net_device *dev);
f696a108 65
b239904d
JP
66int cvm_oct_common_init(struct net_device *dev);
67void cvm_oct_common_uninit(struct net_device *dev);
ec3a2207
DD
68void cvm_oct_adjust_link(struct net_device *dev);
69int cvm_oct_common_stop(struct net_device *dev);
9e3ae4f9 70int cvm_oct_common_open(struct net_device *dev,
2c265f74 71 void (*link_poll)(struct net_device *));
2638f713
AK
72void cvm_oct_note_carrier(struct octeon_ethernet *priv,
73 cvmx_helper_link_info_t li);
a8d2e817 74void cvm_oct_link_poll(struct net_device *dev);
80ff0fd3
DD
75
76extern int always_use_pow;
77extern int pow_send_group;
78extern int pow_receive_group;
79extern char pow_send_list[];
80extern struct net_device *cvm_oct_device[];
f8c26486
DD
81extern struct workqueue_struct *cvm_oct_poll_queue;
82extern atomic_t cvm_oct_poll_queue_stopping;
4898c560 83extern u64 cvm_oct_tx_poll_interval;
80ff0fd3 84
3368c784
DD
85extern int rx_napi_weight;
86
80ff0fd3 87#endif
This page took 0.878653 seconds and 5 git commands to generate.