et131x.h 6.4 KB

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