diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2013-04-07 22:10:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-08 16:55:27 -0400 |
commit | ceb694997e1b5d45627553ac7b1f88ff16cb9507 (patch) | |
tree | 3ecfaa81fef92cee3b7665f2dc5ea996d4342162 /drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | |
parent | 32ceabcad3c8abd46de033778497c2e77a097554 (diff) |
stmmac: code tidy-up
This patch tidies up the code. I have run Linden (and verified with checkpatch)
many part of the driver trying to reorganize some sections respecting the
codying-style rules in the points where it was not done.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/dwmac1000.h')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h index 57f4e8f607e9..c12aabb8cf93 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | |||
@@ -99,18 +99,18 @@ enum power_event { | |||
99 | #define GMAC_S_R_GMII 0x000000d8 /* SGMII RGMII status */ | 99 | #define GMAC_S_R_GMII 0x000000d8 /* SGMII RGMII status */ |
100 | 100 | ||
101 | /* AN Configuration defines */ | 101 | /* AN Configuration defines */ |
102 | #define GMAC_AN_CTRL_RAN 0x00000200 /* Restart Auto-Negotiation */ | 102 | #define GMAC_AN_CTRL_RAN 0x00000200 /* Restart Auto-Negotiation */ |
103 | #define GMAC_AN_CTRL_ANE 0x00001000 /* Auto-Negotiation Enable */ | 103 | #define GMAC_AN_CTRL_ANE 0x00001000 /* Auto-Negotiation Enable */ |
104 | #define GMAC_AN_CTRL_ELE 0x00004000 /* External Loopback Enable */ | 104 | #define GMAC_AN_CTRL_ELE 0x00004000 /* External Loopback Enable */ |
105 | #define GMAC_AN_CTRL_ECD 0x00010000 /* Enable Comma Detect */ | 105 | #define GMAC_AN_CTRL_ECD 0x00010000 /* Enable Comma Detect */ |
106 | #define GMAC_AN_CTRL_LR 0x00020000 /* Lock to Reference */ | 106 | #define GMAC_AN_CTRL_LR 0x00020000 /* Lock to Reference */ |
107 | #define GMAC_AN_CTRL_SGMRAL 0x00040000 /* SGMII RAL Control */ | 107 | #define GMAC_AN_CTRL_SGMRAL 0x00040000 /* SGMII RAL Control */ |
108 | 108 | ||
109 | /* AN Status defines */ | 109 | /* AN Status defines */ |
110 | #define GMAC_AN_STATUS_LS 0x00000004 /* Link Status 0:down 1:up */ | 110 | #define GMAC_AN_STATUS_LS 0x00000004 /* Link Status 0:down 1:up */ |
111 | #define GMAC_AN_STATUS_ANA 0x00000008 /* Auto-Negotiation Ability */ | 111 | #define GMAC_AN_STATUS_ANA 0x00000008 /* Auto-Negotiation Ability */ |
112 | #define GMAC_AN_STATUS_ANC 0x00000020 /* Auto-Negotiation Complete */ | 112 | #define GMAC_AN_STATUS_ANC 0x00000020 /* Auto-Negotiation Complete */ |
113 | #define GMAC_AN_STATUS_ES 0x00000100 /* Extended Status */ | 113 | #define GMAC_AN_STATUS_ES 0x00000100 /* Extended Status */ |
114 | 114 | ||
115 | /* Register 54 (SGMII/RGMII status register) */ | 115 | /* Register 54 (SGMII/RGMII status register) */ |
116 | #define GMAC_S_R_GMII_LINK 0x8 | 116 | #define GMAC_S_R_GMII_LINK 0x8 |
@@ -127,8 +127,8 @@ enum power_event { | |||
127 | #define GMAC_ANE_PSE_SHIFT 7 | 127 | #define GMAC_ANE_PSE_SHIFT 7 |
128 | 128 | ||
129 | /* GMAC Configuration defines */ | 129 | /* GMAC Configuration defines */ |
130 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ | 130 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ |
131 | #define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */ | 131 | #define GMAC_CONTROL_WD 0x00800000 /* Disable Watchdog on receive */ |
132 | 132 | ||
133 | /* GMAC Configuration defines */ | 133 | /* GMAC Configuration defines */ |
134 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ | 134 | #define GMAC_CONTROL_TC 0x01000000 /* Transmit Conf. in RGMII/SGMII */ |
@@ -141,19 +141,19 @@ enum inter_frame_gap { | |||
141 | GMAC_CONTROL_IFG_80 = 0x00020000, | 141 | GMAC_CONTROL_IFG_80 = 0x00020000, |
142 | GMAC_CONTROL_IFG_40 = 0x000e0000, | 142 | GMAC_CONTROL_IFG_40 = 0x000e0000, |
143 | }; | 143 | }; |
144 | #define GMAC_CONTROL_DCRS 0x00010000 /* Disable carrier sense during tx */ | 144 | #define GMAC_CONTROL_DCRS 0x00010000 /* Disable carrier sense */ |
145 | #define GMAC_CONTROL_PS 0x00008000 /* Port Select 0:GMI 1:MII */ | 145 | #define GMAC_CONTROL_PS 0x00008000 /* Port Select 0:GMI 1:MII */ |
146 | #define GMAC_CONTROL_FES 0x00004000 /* Speed 0:10 1:100 */ | 146 | #define GMAC_CONTROL_FES 0x00004000 /* Speed 0:10 1:100 */ |
147 | #define GMAC_CONTROL_DO 0x00002000 /* Disable Rx Own */ | 147 | #define GMAC_CONTROL_DO 0x00002000 /* Disable Rx Own */ |
148 | #define GMAC_CONTROL_LM 0x00001000 /* Loop-back mode */ | 148 | #define GMAC_CONTROL_LM 0x00001000 /* Loop-back mode */ |
149 | #define GMAC_CONTROL_DM 0x00000800 /* Duplex Mode */ | 149 | #define GMAC_CONTROL_DM 0x00000800 /* Duplex Mode */ |
150 | #define GMAC_CONTROL_IPC 0x00000400 /* Checksum Offload */ | 150 | #define GMAC_CONTROL_IPC 0x00000400 /* Checksum Offload */ |
151 | #define GMAC_CONTROL_DR 0x00000200 /* Disable Retry */ | 151 | #define GMAC_CONTROL_DR 0x00000200 /* Disable Retry */ |
152 | #define GMAC_CONTROL_LUD 0x00000100 /* Link up/down */ | 152 | #define GMAC_CONTROL_LUD 0x00000100 /* Link up/down */ |
153 | #define GMAC_CONTROL_ACS 0x00000080 /* Automatic Pad/FCS Stripping */ | 153 | #define GMAC_CONTROL_ACS 0x00000080 /* Auto Pad/FCS Stripping */ |
154 | #define GMAC_CONTROL_DC 0x00000010 /* Deferral Check */ | 154 | #define GMAC_CONTROL_DC 0x00000010 /* Deferral Check */ |
155 | #define GMAC_CONTROL_TE 0x00000008 /* Transmitter Enable */ | 155 | #define GMAC_CONTROL_TE 0x00000008 /* Transmitter Enable */ |
156 | #define GMAC_CONTROL_RE 0x00000004 /* Receiver Enable */ | 156 | #define GMAC_CONTROL_RE 0x00000004 /* Receiver Enable */ |
157 | 157 | ||
158 | #define GMAC_CORE_INIT (GMAC_CONTROL_JD | GMAC_CONTROL_PS | GMAC_CONTROL_ACS | \ | 158 | #define GMAC_CORE_INIT (GMAC_CONTROL_JD | GMAC_CONTROL_PS | GMAC_CONTROL_ACS | \ |
159 | GMAC_CONTROL_JE | GMAC_CONTROL_BE) | 159 | GMAC_CONTROL_JE | GMAC_CONTROL_BE) |
@@ -184,16 +184,16 @@ enum inter_frame_gap { | |||
184 | #define DMA_BUS_MODE_SFT_RESET 0x00000001 /* Software Reset */ | 184 | #define DMA_BUS_MODE_SFT_RESET 0x00000001 /* Software Reset */ |
185 | #define DMA_BUS_MODE_DA 0x00000002 /* Arbitration scheme */ | 185 | #define DMA_BUS_MODE_DA 0x00000002 /* Arbitration scheme */ |
186 | #define DMA_BUS_MODE_DSL_MASK 0x0000007c /* Descriptor Skip Length */ | 186 | #define DMA_BUS_MODE_DSL_MASK 0x0000007c /* Descriptor Skip Length */ |
187 | #define DMA_BUS_MODE_DSL_SHIFT 2 /* (in DWORDS) */ | 187 | #define DMA_BUS_MODE_DSL_SHIFT 2 /* (in DWORDS) */ |
188 | /* Programmable burst length (passed thorugh platform)*/ | 188 | /* Programmable burst length (passed thorugh platform)*/ |
189 | #define DMA_BUS_MODE_PBL_MASK 0x00003f00 /* Programmable Burst Len */ | 189 | #define DMA_BUS_MODE_PBL_MASK 0x00003f00 /* Programmable Burst Len */ |
190 | #define DMA_BUS_MODE_PBL_SHIFT 8 | 190 | #define DMA_BUS_MODE_PBL_SHIFT 8 |
191 | #define DMA_BUS_MODE_ATDS 0x00000080 /* Alternate Descriptor Size */ | 191 | #define DMA_BUS_MODE_ATDS 0x00000080 /* Alternate Descriptor Size */ |
192 | 192 | ||
193 | enum rx_tx_priority_ratio { | 193 | enum rx_tx_priority_ratio { |
194 | double_ratio = 0x00004000, /*2:1 */ | 194 | double_ratio = 0x00004000, /* 2:1 */ |
195 | triple_ratio = 0x00008000, /*3:1 */ | 195 | triple_ratio = 0x00008000, /* 3:1 */ |
196 | quadruple_ratio = 0x0000c000, /*4:1 */ | 196 | quadruple_ratio = 0x0000c000, /* 4:1 */ |
197 | }; | 197 | }; |
198 | 198 | ||
199 | #define DMA_BUS_MODE_FB 0x00010000 /* Fixed burst */ | 199 | #define DMA_BUS_MODE_FB 0x00010000 /* Fixed burst */ |
@@ -213,9 +213,10 @@ enum rx_tx_priority_ratio { | |||
213 | #define DMA_BUS_FB 0x00010000 /* Fixed Burst */ | 213 | #define DMA_BUS_FB 0x00010000 /* Fixed Burst */ |
214 | 214 | ||
215 | /* DMA operation mode defines (start/stop tx/rx are placed in common header)*/ | 215 | /* DMA operation mode defines (start/stop tx/rx are placed in common header)*/ |
216 | #define DMA_CONTROL_DT 0x04000000 /* Disable Drop TCP/IP csum error */ | 216 | /* Disable Drop TCP/IP csum error */ |
217 | #define DMA_CONTROL_RSF 0x02000000 /* Receive Store and Forward */ | 217 | #define DMA_CONTROL_DT 0x04000000 |
218 | #define DMA_CONTROL_DFF 0x01000000 /* Disaable flushing */ | 218 | #define DMA_CONTROL_RSF 0x02000000 /* Receive Store and Forward */ |
219 | #define DMA_CONTROL_DFF 0x01000000 /* Disaable flushing */ | ||
219 | /* Threshold for Activating the FC */ | 220 | /* Threshold for Activating the FC */ |
220 | enum rfa { | 221 | enum rfa { |
221 | act_full_minus_1 = 0x00800000, | 222 | act_full_minus_1 = 0x00800000, |
@@ -230,7 +231,7 @@ enum rfd { | |||
230 | deac_full_minus_3 = 0x00401000, | 231 | deac_full_minus_3 = 0x00401000, |
231 | deac_full_minus_4 = 0x00401800, | 232 | deac_full_minus_4 = 0x00401800, |
232 | }; | 233 | }; |
233 | #define DMA_CONTROL_TSF 0x00200000 /* Transmit Store and Forward */ | 234 | #define DMA_CONTROL_TSF 0x00200000 /* Transmit Store and Forward */ |
234 | 235 | ||
235 | enum ttc_control { | 236 | enum ttc_control { |
236 | DMA_CONTROL_TTC_64 = 0x00000000, | 237 | DMA_CONTROL_TTC_64 = 0x00000000, |
@@ -264,7 +265,5 @@ enum rtc_control { | |||
264 | #define GMAC_MMC_TX_INTR 0x108 | 265 | #define GMAC_MMC_TX_INTR 0x108 |
265 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 | 266 | #define GMAC_MMC_RX_CSUM_OFFLOAD 0x208 |
266 | 267 | ||
267 | |||
268 | |||
269 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; | 268 | extern const struct stmmac_dma_ops dwmac1000_dma_ops; |
270 | #endif /* __DWMAC1000_H__ */ | 269 | #endif /* __DWMAC1000_H__ */ |