Commit | Line | Data |
---|---|---|
47dd7a54 GC |
1 | /******************************************************************************* |
2 | Copyright (C) 2007-2009 STMicroelectronics Ltd | |
3 | ||
4 | This program is free software; you can redistribute it and/or modify it | |
5 | under the terms and conditions of the GNU General Public License, | |
6 | version 2, as published by the Free Software Foundation. | |
7 | ||
8 | This program is distributed in the hope it will be useful, but WITHOUT | |
9 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
10 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
11 | more details. | |
12 | ||
13 | You should have received a copy of the GNU General Public License along with | |
14 | this program; if not, write to the Free Software Foundation, Inc., | |
15 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | ||
17 | The full GNU General Public License is included in this distribution in | |
18 | the file called "COPYING". | |
19 | ||
20 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | |
21 | *******************************************************************************/ | |
22 | ||
bfab27a1 | 23 | #define STMMAC_RESOURCE_NAME "stmmaceth" |
78a5249f | 24 | #define DRV_MODULE_VERSION "Feb_2012" |
ee7946a7 | 25 | #include <linux/stmmac.h> |
286a8372 | 26 | #include <linux/phy.h> |
47dd7a54 GC |
27 | #include "common.h" |
28 | #ifdef CONFIG_STMMAC_TIMER | |
29 | #include "stmmac_timer.h" | |
30 | #endif | |
31 | ||
32 | struct stmmac_priv { | |
33 | /* Frequently used values are kept adjacent for cache effect */ | |
34 | struct dma_desc *dma_tx ____cacheline_aligned; | |
35 | dma_addr_t dma_tx_phy; | |
36 | struct sk_buff **tx_skbuff; | |
37 | unsigned int cur_tx; | |
38 | unsigned int dirty_tx; | |
39 | unsigned int dma_tx_size; | |
47dd7a54 GC |
40 | int tx_coalesce; |
41 | ||
42 | struct dma_desc *dma_rx ; | |
43 | unsigned int cur_rx; | |
44 | unsigned int dirty_rx; | |
45 | struct sk_buff **rx_skbuff; | |
46 | dma_addr_t *rx_skbuff_dma; | |
47 | struct sk_buff_head rx_recycle; | |
48 | ||
49 | struct net_device *dev; | |
47dd7a54 GC |
50 | dma_addr_t dma_rx_phy; |
51 | unsigned int dma_rx_size; | |
47dd7a54 GC |
52 | unsigned int dma_buf_sz; |
53 | struct device *device; | |
db98a0b0 | 54 | struct mac_device_info *hw; |
ad01b7d4 | 55 | void __iomem *ioaddr; |
47dd7a54 GC |
56 | |
57 | struct stmmac_extra_stats xstats; | |
58 | struct napi_struct napi; | |
9dfeb4d9 | 59 | int no_csum_insertion; |
47dd7a54 | 60 | |
47dd7a54 GC |
61 | struct phy_device *phydev; |
62 | int oldlink; | |
63 | int speed; | |
64 | int oldduplex; | |
65 | unsigned int flow_ctrl; | |
66 | unsigned int pause; | |
67 | struct mii_bus *mii; | |
36bcfe7d | 68 | int mii_irq[PHY_MAX_ADDR]; |
47dd7a54 GC |
69 | |
70 | u32 msg_enable; | |
71 | spinlock_t lock; | |
a9097a96 | 72 | spinlock_t tx_lock; |
47dd7a54 | 73 | int wolopts; |
3172d3af | 74 | int wol_irq; |
47dd7a54 GC |
75 | #ifdef CONFIG_STMMAC_TIMER |
76 | struct stmmac_timer *tm; | |
47dd7a54 | 77 | #endif |
9dfeb4d9 | 78 | struct plat_stmmacenet_data *plat; |
1c901a46 | 79 | struct stmmac_counters mmc; |
e7434821 | 80 | struct dma_features dma_cap; |
19e30c14 | 81 | int hw_cap_support; |
47dd7a54 GC |
82 | }; |
83 | ||
bfab27a1 GC |
84 | extern int phyaddr; |
85 | ||
47dd7a54 GC |
86 | extern int stmmac_mdio_unregister(struct net_device *ndev); |
87 | extern int stmmac_mdio_register(struct net_device *ndev); | |
88 | extern void stmmac_set_ethtool_ops(struct net_device *netdev); | |
cadb7924 | 89 | extern const struct stmmac_desc_ops enh_desc_ops; |
90 | extern const struct stmmac_desc_ops ndesc_ops; | |
bfab27a1 GC |
91 | |
92 | int stmmac_freeze(struct net_device *ndev); | |
93 | int stmmac_restore(struct net_device *ndev); | |
94 | int stmmac_resume(struct net_device *ndev); | |
95 | int stmmac_suspend(struct net_device *ndev); | |
96 | int stmmac_dvr_remove(struct net_device *ndev); | |
97 | struct stmmac_priv *stmmac_dvr_probe(struct device *device, | |
cf3f047b GC |
98 | struct plat_stmmacenet_data *plat_dat, |
99 | void __iomem *addr); |