Add linux-next specific files for 20110831
[linux-2.6/next.git] / drivers / staging / et131x / et131x.h
blob9dee7bce073dc13b74b90e2ceb39a7852717da55
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 /* et131x_eeprom.c */
52 int et131x_init_eeprom(struct et131x_adapter *adapter);
54 /* et131x_initpci.c */
55 void et131x_configure_global_regs(struct et131x_adapter *adapter);
56 void et131x_enable_interrupts(struct et131x_adapter *adapter);
57 void et131x_disable_interrupts(struct et131x_adapter *adapter);
58 void et131x_align_allocated_memory(struct et131x_adapter *adapter,
59 u64 *phys_addr,
60 u64 *offset, u64 mask);
62 int et131x_adapter_setup(struct et131x_adapter *adapter);
63 int et131x_adapter_memory_alloc(struct et131x_adapter *adapter);
64 void et131x_adapter_memory_free(struct et131x_adapter *adapter);
65 void et131x_hwaddr_init(struct et131x_adapter *adapter);
66 void et131x_soft_reset(struct et131x_adapter *adapter);
68 /* et131x_isr.c */
69 irqreturn_t et131x_isr(int irq, void *dev_id);
70 void et131x_isr_handler(struct work_struct *work);
72 /* et1310_mac.c */
73 void et1310_config_mac_regs1(struct et131x_adapter *adapter);
74 void et1310_config_mac_regs2(struct et131x_adapter *adapter);
75 void et1310_config_rxmac_regs(struct et131x_adapter *adapter);
76 void et1310_config_txmac_regs(struct et131x_adapter *adapter);
77 void et1310_config_macstat_regs(struct et131x_adapter *adapter);
78 void et1310_config_flow_control(struct et131x_adapter *adapter);
79 void et1310_update_macstat_host_counters(struct et131x_adapter *adapter);
80 void et1310_handle_macstat_interrupt(struct et131x_adapter *adapter);
81 void et1310_setup_device_for_multicast(struct et131x_adapter *adapter);
82 void et1310_setup_device_for_unicast(struct et131x_adapter *adapter);
84 /* et131x_netdev.c */
85 struct net_device *et131x_device_alloc(void);
87 /* et1310_pm.c */
88 void et1310_enable_phy_coma(struct et131x_adapter *adapter);
89 void et1310_disable_phy_coma(struct et131x_adapter *adapter);
91 /* et1310_phy.c */
92 void et1310_phy_init(struct et131x_adapter *adapter);
93 void et1310_phy_reset(struct et131x_adapter *adapter);
94 void et1310_phy_power_down(struct et131x_adapter *adapter, bool down);
95 void et1310_phy_advertise_1000BaseT(struct et131x_adapter *adapter,
96 u16 duplex);
97 void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
98 u16 action,
99 u16 regnum, u16 bitnum, u8 *value);
101 int et131x_xcvr_find(struct et131x_adapter *adapter);
102 void et131x_setphy_normal(struct et131x_adapter *adapter);
104 /* static inline function does not work because et131x_adapter is not always
105 * defined
107 int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 xcvrAddr,
108 u8 xcvrReg, u16 *value);
109 #define et131x_mii_read(adapter, xcvrReg, value) \
110 et131x_phy_mii_read((adapter), \
111 (adapter)->stats.xcvr_addr, \
112 (xcvrReg), (value))
114 int32_t et131x_mii_write(struct et131x_adapter *adapter,
115 u8 xcvReg, u16 value);
116 void et131x_mii_check(struct et131x_adapter *pAdapter,
117 u16 bmsr, u16 bmsr_ints);
119 int et131x_mdio_read(struct mii_bus *bus, int phy_addr, int reg);
120 int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 value);
121 int et131x_mdio_reset(struct mii_bus *bus);
123 /* et1310_rx.c */
124 int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter);
125 void et131x_rx_dma_memory_free(struct et131x_adapter *adapter);
126 int et131x_rfd_resources_alloc(struct et131x_adapter *adapter,
127 struct rfd *rfd);
128 void et131x_rfd_resources_free(struct et131x_adapter *adapter,
129 struct rfd *rfd);
130 int et131x_init_recv(struct et131x_adapter *adapter);
132 void et131x_config_rx_dma_regs(struct et131x_adapter *adapter);
133 void et131x_set_rx_dma_timer(struct et131x_adapter *adapter);
134 void et131x_rx_dma_disable(struct et131x_adapter *adapter);
135 void et131x_rx_dma_enable(struct et131x_adapter *adapter);
137 void et131x_reset_recv(struct et131x_adapter *adapter);
139 void et131x_handle_recv_interrupt(struct et131x_adapter *adapter);
141 /* et131x_tx.c */
142 int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
143 void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
144 void et131x_config_tx_dma_regs(struct et131x_adapter *adapter);
145 void et131x_init_send(struct et131x_adapter *adapter);
146 void et131x_tx_dma_disable(struct et131x_adapter *adapter);
147 void et131x_tx_dma_enable(struct et131x_adapter *adapter);
148 void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
149 void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
150 int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);
152 /* et131x_ethtool.c */
153 void et131x_set_ethtool_ops(struct net_device *netdev);