• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/staging/et131x/
1/*
2 * Merged from files
3 *
4 * Copyright �� 2005 Agere Systems Inc.
5 * All rights reserved.
6 *   http://www.agere.com
7 *
8 * SOFTWARE LICENSE
9 *
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.
14 *
15 * Copyright �� 2005 Agere Systems Inc.
16 * All rights reserved.
17 *
18 * Redistribution and use in source or binary forms, with or without
19 * modifications, are permitted provided that the following conditions are met:
20 *
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.
25 *
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.
29 *
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.
33 *
34 * Disclaimer
35 *
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.
48 *
49 */
50
51/* et131x_eeprom.c */
52int et131x_init_eeprom(struct et131x_adapter *etdev);
53
54/* et131x_initpci.c */
55void ConfigGlobalRegs(struct et131x_adapter *pAdapter);
56void ConfigMMCRegs(struct et131x_adapter *pAdapter);
57void et131x_enable_interrupts(struct et131x_adapter *adapter);
58void et131x_disable_interrupts(struct et131x_adapter *adapter);
59void et131x_align_allocated_memory(struct et131x_adapter *adapter,
60				   u64 *phys_addr,
61				   u64 *offset, u64 mask);
62
63int et131x_adapter_setup(struct et131x_adapter *adapter);
64int et131x_adapter_memory_alloc(struct et131x_adapter *adapter);
65void et131x_adapter_memory_free(struct et131x_adapter *adapter);
66void et131x_hwaddr_init(struct et131x_adapter *adapter);
67void et131x_soft_reset(struct et131x_adapter *adapter);
68
69/* et131x_isr.c */
70irqreturn_t et131x_isr(int irq, void *dev_id);
71void et131x_isr_handler(struct work_struct *work);
72
73/* et1310_mac.c */
74void ConfigMACRegs1(struct et131x_adapter *adapter);
75void ConfigMACRegs2(struct et131x_adapter *adapter);
76void ConfigRxMacRegs(struct et131x_adapter *adapter);
77void ConfigTxMacRegs(struct et131x_adapter *adapter);
78void ConfigMacStatRegs(struct et131x_adapter *adapter);
79void ConfigFlowControl(struct et131x_adapter *adapter);
80void UpdateMacStatHostCounters(struct et131x_adapter *adapter);
81void HandleMacStatInterrupt(struct et131x_adapter *adapter);
82void SetupDeviceForMulticast(struct et131x_adapter *adapter);
83void SetupDeviceForUnicast(struct et131x_adapter *adapter);
84
85/* et131x_netdev.c */
86struct net_device *et131x_device_alloc(void);
87
88/* et131x_pm.c */
89void EnablePhyComa(struct et131x_adapter *adapter);
90void DisablePhyComa(struct et131x_adapter *adapter);
91
92/* et131x_phy.c */
93void ET1310_PhyInit(struct et131x_adapter *adapter);
94void ET1310_PhyReset(struct et131x_adapter *adapter);
95void ET1310_PhyPowerDown(struct et131x_adapter *adapter, bool down);
96void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *adapter,
97				  u16 duplex);
98void ET1310_PhyAccessMiBit(struct et131x_adapter *adapter,
99			   u16 action,
100			   u16 regnum, u16 bitnum, u8 *value);
101
102int et131x_xcvr_find(struct et131x_adapter *adapter);
103void et131x_setphy_normal(struct et131x_adapter *adapter);
104
105/* static inline function does not work because et131x_adapter is not always
106 * defined
107 */
108int 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))
112
113int32_t MiWrite(struct et131x_adapter *adapter,
114		u8 xcvReg, u16 value);
115void et131x_Mii_check(struct et131x_adapter *pAdapter,
116		      MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints);
117
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.
121 */
122void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter);
123
124
125/* et1310_rx.c */
126int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter);
127void et131x_rx_dma_memory_free(struct et131x_adapter *adapter);
128int et131x_rfd_resources_alloc(struct et131x_adapter *adapter,
129			       struct _MP_RFD *pMpRfd);
130void et131x_rfd_resources_free(struct et131x_adapter *adapter,
131			       struct _MP_RFD *pMpRfd);
132int et131x_init_recv(struct et131x_adapter *adapter);
133
134void ConfigRxDmaRegs(struct et131x_adapter *adapter);
135void SetRxDmaTimer(struct et131x_adapter *adapter);
136void et131x_rx_dma_disable(struct et131x_adapter *adapter);
137void et131x_rx_dma_enable(struct et131x_adapter *adapter);
138
139void et131x_reset_recv(struct et131x_adapter *adapter);
140
141void et131x_handle_recv_interrupt(struct et131x_adapter *adapter);
142
143/* et131x_tx.c */
144int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
145void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
146void ConfigTxDmaRegs(struct et131x_adapter *adapter);
147void et131x_init_send(struct et131x_adapter *adapter);
148void et131x_tx_dma_disable(struct et131x_adapter *adapter);
149void et131x_tx_dma_enable(struct et131x_adapter *adapter);
150void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
151void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
152int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);
153