Merge remote-tracking branch 'cleancache/linux-next'
[linux-2.6/next.git] / drivers / staging / et131x / et131x.h
blob8aa3365b83cf1a3e0be4cfba72d5d146b123839f
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 *etdev);
54 /* et131x_initpci.c */
55 void ConfigGlobalRegs(struct et131x_adapter *pAdapter);
56 void ConfigMMCRegs(struct et131x_adapter *pAdapter);
57 void et131x_enable_interrupts(struct et131x_adapter *adapter);
58 void et131x_disable_interrupts(struct et131x_adapter *adapter);
59 void et131x_align_allocated_memory(struct et131x_adapter *adapter,
60 u64 *phys_addr,
61 u64 *offset, u64 mask);
63 int et131x_adapter_setup(struct et131x_adapter *adapter);
64 int et131x_adapter_memory_alloc(struct et131x_adapter *adapter);
65 void et131x_adapter_memory_free(struct et131x_adapter *adapter);
66 void et131x_hwaddr_init(struct et131x_adapter *adapter);
67 void et131x_soft_reset(struct et131x_adapter *adapter);
69 /* et131x_isr.c */
70 irqreturn_t et131x_isr(int irq, void *dev_id);
71 void et131x_isr_handler(struct work_struct *work);
73 /* et1310_mac.c */
74 void ConfigMACRegs1(struct et131x_adapter *adapter);
75 void ConfigMACRegs2(struct et131x_adapter *adapter);
76 void ConfigRxMacRegs(struct et131x_adapter *adapter);
77 void ConfigTxMacRegs(struct et131x_adapter *adapter);
78 void ConfigMacStatRegs(struct et131x_adapter *adapter);
79 void ConfigFlowControl(struct et131x_adapter *adapter);
80 void UpdateMacStatHostCounters(struct et131x_adapter *adapter);
81 void HandleMacStatInterrupt(struct et131x_adapter *adapter);
82 void SetupDeviceForMulticast(struct et131x_adapter *adapter);
83 void SetupDeviceForUnicast(struct et131x_adapter *adapter);
85 /* et131x_netdev.c */
86 struct net_device *et131x_device_alloc(void);
88 /* et131x_pm.c */
89 void EnablePhyComa(struct et131x_adapter *adapter);
90 void DisablePhyComa(struct et131x_adapter *adapter);
92 /* et131x_phy.c */
93 void ET1310_PhyInit(struct et131x_adapter *adapter);
94 void ET1310_PhyReset(struct et131x_adapter *adapter);
95 void ET1310_PhyPowerDown(struct et131x_adapter *adapter, bool down);
96 void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *adapter,
97 u16 duplex);
98 void ET1310_PhyAccessMiBit(struct et131x_adapter *adapter,
99 u16 action,
100 u16 regnum, u16 bitnum, u8 *value);
102 int et131x_xcvr_find(struct et131x_adapter *adapter);
103 void et131x_setphy_normal(struct et131x_adapter *adapter);
105 /* static inline function does not work because et131x_adapter is not always
106 * defined
108 int PhyMiRead(struct et131x_adapter *adapter, u8 xcvrAddr,
109 u8 xcvrReg, u16 *value);
110 #define MiRead(adapter, xcvrReg, value) \
111 PhyMiRead((adapter), (adapter)->Stats.xcvr_addr, (xcvrReg), (value))
113 int32_t MiWrite(struct et131x_adapter *adapter,
114 u8 xcvReg, u16 value);
115 void et131x_Mii_check(struct et131x_adapter *pAdapter,
116 MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints);
118 /* This last is not strictly required (the driver could call the TPAL
119 * version instead), but this sets the adapter up correctly, and calls the
120 * access routine indirectly. This protects the driver from changes in TPAL.
122 void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter);
125 /* et1310_rx.c */
126 int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter);
127 void et131x_rx_dma_memory_free(struct et131x_adapter *adapter);
128 int et131x_rfd_resources_alloc(struct et131x_adapter *adapter,
129 struct rfd *rfd);
130 void et131x_rfd_resources_free(struct et131x_adapter *adapter,
131 struct rfd *rfd);
132 int et131x_init_recv(struct et131x_adapter *adapter);
134 void ConfigRxDmaRegs(struct et131x_adapter *adapter);
135 void SetRxDmaTimer(struct et131x_adapter *adapter);
136 void et131x_rx_dma_disable(struct et131x_adapter *adapter);
137 void et131x_rx_dma_enable(struct et131x_adapter *adapter);
139 void et131x_reset_recv(struct et131x_adapter *adapter);
141 void et131x_handle_recv_interrupt(struct et131x_adapter *adapter);
143 /* et131x_tx.c */
144 int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
145 void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
146 void ConfigTxDmaRegs(struct et131x_adapter *adapter);
147 void et131x_init_send(struct et131x_adapter *adapter);
148 void et131x_tx_dma_disable(struct et131x_adapter *adapter);
149 void et131x_tx_dma_enable(struct et131x_adapter *adapter);
150 void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
151 void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
152 int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);