staging:iio:dac:ad5791: Allow asymmetrical reference voltages
[zen-stable.git] / drivers / staging / et131x / et131x.h
blob24570ca8039505881f3707c84b94fdf3beb444ed
1 /*
2 * Merged from files
4 * Copyright © 2005 Agere Systems Inc.
5 * All rights reserved.
6 * http://www.agere.com
8 * SOFTWARE LICENSE
10 * This software is provided subject to the following terms and conditions,
11 * which you should read carefully before using the software. Using this
12 * software indicates your acceptance of these terms and conditions. If you do
13 * not agree with these terms and conditions, do not use the software.
15 * Copyright © 2005 Agere Systems Inc.
16 * All rights reserved.
18 * Redistribution and use in source or binary forms, with or without
19 * modifications, are permitted provided that the following conditions are met:
21 * . Redistributions of source code must retain the above copyright notice, this
22 * list of conditions and the following Disclaimer as comments in the code as
23 * well as in the documentation and/or other materials provided with the
24 * distribution.
26 * . Redistributions in binary form must reproduce the above copyright notice,
27 * this list of conditions and the following Disclaimer in the documentation
28 * and/or other materials provided with the distribution.
30 * . Neither the name of Agere Systems Inc. nor the names of the contributors
31 * may be used to endorse or promote products derived from this software
32 * without specific prior written permission.
34 * Disclaimer
36 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
37 * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
38 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
39 * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
40 * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
41 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
42 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
43 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44 * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
45 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
47 * DAMAGE.
51 #define DRIVER_NAME "et131x"
52 #define DRIVER_VERSION "v2.0"
54 /* et131x_eeprom.c */
55 int et131x_init_eeprom(struct et131x_adapter *adapter);
57 /* et131x_initpci.c */
58 void et131x_error_timer_handler(unsigned long data);
59 void et131x_configure_global_regs(struct et131x_adapter *adapter);
60 void et131x_enable_interrupts(struct et131x_adapter *adapter);
61 void et131x_disable_interrupts(struct et131x_adapter *adapter);
62 void et131x_align_allocated_memory(struct et131x_adapter *adapter,
63 u64 *phys_addr,
64 u64 *offset, u64 mask);
66 void et131x_adapter_setup(struct et131x_adapter *adapter);
67 int et131x_adapter_memory_alloc(struct et131x_adapter *adapter);
68 void et131x_adapter_memory_free(struct et131x_adapter *adapter);
69 void et131x_hwaddr_init(struct et131x_adapter *adapter);
70 void et131x_soft_reset(struct et131x_adapter *adapter);
72 /* et131x_isr.c */
73 irqreturn_t et131x_isr(int irq, void *dev_id);
74 void et131x_isr_handler(struct work_struct *work);
76 /* et1310_mac.c */
77 void et1310_config_mac_regs1(struct et131x_adapter *adapter);
78 void et1310_config_mac_regs2(struct et131x_adapter *adapter);
79 void et1310_config_rxmac_regs(struct et131x_adapter *adapter);
80 void et1310_config_txmac_regs(struct et131x_adapter *adapter);
81 void et1310_config_macstat_regs(struct et131x_adapter *adapter);
82 void et1310_config_flow_control(struct et131x_adapter *adapter);
83 void et1310_update_macstat_host_counters(struct et131x_adapter *adapter);
84 void et1310_handle_macstat_interrupt(struct et131x_adapter *adapter);
85 void et1310_setup_device_for_multicast(struct et131x_adapter *adapter);
86 void et1310_setup_device_for_unicast(struct et131x_adapter *adapter);
88 /* et131x_netdev.c */
89 int et131x_open(struct net_device *netdev);
90 int et131x_close(struct net_device *netdev);
91 void et131x_up(struct net_device *netdev);
92 void et131x_down(struct net_device *netdev);
93 struct net_device *et131x_device_alloc(void);
94 void et131x_enable_txrx(struct net_device *netdev);
95 void et131x_disable_txrx(struct net_device *netdev);
97 /* et1310_pm.c */
98 int et1310_in_phy_coma(struct et131x_adapter *adapter);
99 void et1310_enable_phy_coma(struct et131x_adapter *adapter);
100 void et1310_disable_phy_coma(struct et131x_adapter *adapter);
102 /* et1310_phy.c */
103 void et1310_phy_power_down(struct et131x_adapter *adapter, bool down);
104 void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
105 u16 action,
106 u16 regnum, u16 bitnum, u8 *value);
108 void et131x_xcvr_init(struct et131x_adapter *adapter);
110 /* static inline function does not work because et131x_adapter is not always
111 * defined
113 int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
114 u8 reg, u16 *value);
115 int32_t et131x_mii_read(struct et131x_adapter *adapter,
116 u8 reg, u16 *value);
117 int32_t et131x_mii_write(struct et131x_adapter *adapter,
118 u8 reg, u16 value);
120 int et131x_mdio_read(struct mii_bus *bus, int phy_addr, int reg);
121 int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 value);
122 int et131x_mdio_reset(struct mii_bus *bus);
124 /* et1310_rx.c */
125 int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter);
126 void et131x_rx_dma_memory_free(struct et131x_adapter *adapter);
127 int et131x_rfd_resources_alloc(struct et131x_adapter *adapter,
128 struct rfd *rfd);
129 void et131x_rfd_resources_free(struct et131x_adapter *adapter,
130 struct rfd *rfd);
131 int et131x_init_recv(struct et131x_adapter *adapter);
133 void et131x_config_rx_dma_regs(struct et131x_adapter *adapter);
134 void et131x_set_rx_dma_timer(struct et131x_adapter *adapter);
135 void et131x_rx_dma_disable(struct et131x_adapter *adapter);
136 void et131x_rx_dma_enable(struct et131x_adapter *adapter);
138 void et131x_reset_recv(struct et131x_adapter *adapter);
140 void et131x_handle_recv_interrupt(struct et131x_adapter *adapter);
142 /* et131x_tx.c */
143 int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
144 void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
145 void et131x_config_tx_dma_regs(struct et131x_adapter *adapter);
146 void et131x_init_send(struct et131x_adapter *adapter);
147 void et131x_tx_dma_disable(struct et131x_adapter *adapter);
148 void et131x_tx_dma_enable(struct et131x_adapter *adapter);
149 void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
150 void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
151 int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);
153 /* et131x_ethtool.c */
154 void et131x_set_ethtool_ops(struct net_device *netdev);