diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2014-11-18 03:47:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-19 15:04:57 -0500 |
commit | 915c199fc8cde9f9a5af19c1ea8c7c3c075d60e1 (patch) | |
tree | afba59c951ccb1b65a1294372a977f8233c5118c /drivers/net/ethernet/stmicro | |
parent | 233b36cf1f83ef4a7b3670ffa5eeac1ed9d41889 (diff) |
stmmac: document common header file
This patch adds some useful comments inside the common header
file to provide information about the APIs exposed by the driver.
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')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h index 12a174e01d56..cd77289c3cfe 100644 --- a/drivers/net/ethernet/stmicro/stmmac/common.h +++ b/drivers/net/ethernet/stmicro/stmmac/common.h | |||
@@ -44,6 +44,7 @@ | |||
44 | #undef FRAME_FILTER_DEBUG | 44 | #undef FRAME_FILTER_DEBUG |
45 | /* #define FRAME_FILTER_DEBUG */ | 45 | /* #define FRAME_FILTER_DEBUG */ |
46 | 46 | ||
47 | /* Extra statistic and debug information exposed by ethtool */ | ||
47 | struct stmmac_extra_stats { | 48 | struct stmmac_extra_stats { |
48 | /* Transmit errors */ | 49 | /* Transmit errors */ |
49 | unsigned long tx_underflow ____cacheline_aligned; | 50 | unsigned long tx_underflow ____cacheline_aligned; |
@@ -220,6 +221,7 @@ enum dma_irq_status { | |||
220 | handle_tx = 0x8, | 221 | handle_tx = 0x8, |
221 | }; | 222 | }; |
222 | 223 | ||
224 | /* EEE and LPI defines */ | ||
223 | #define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 0) | 225 | #define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 0) |
224 | #define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 1) | 226 | #define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 1) |
225 | #define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 2) | 227 | #define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 2) |
@@ -229,6 +231,7 @@ enum dma_irq_status { | |||
229 | #define CORE_PCS_LINK_STATUS (1 << 6) | 231 | #define CORE_PCS_LINK_STATUS (1 << 6) |
230 | #define CORE_RGMII_IRQ (1 << 7) | 232 | #define CORE_RGMII_IRQ (1 << 7) |
231 | 233 | ||
234 | /* Physical Coding Sublayer */ | ||
232 | struct rgmii_adv { | 235 | struct rgmii_adv { |
233 | unsigned int pause; | 236 | unsigned int pause; |
234 | unsigned int duplex; | 237 | unsigned int duplex; |
@@ -294,6 +297,7 @@ struct dma_features { | |||
294 | 297 | ||
295 | #define JUMBO_LEN 9000 | 298 | #define JUMBO_LEN 9000 |
296 | 299 | ||
300 | /* Descriptors helpers */ | ||
297 | struct stmmac_desc_ops { | 301 | struct stmmac_desc_ops { |
298 | /* DMA RX descriptor ring initialization */ | 302 | /* DMA RX descriptor ring initialization */ |
299 | void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode, | 303 | void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode, |
@@ -344,6 +348,7 @@ struct stmmac_desc_ops { | |||
344 | extern const struct stmmac_desc_ops enh_desc_ops; | 348 | extern const struct stmmac_desc_ops enh_desc_ops; |
345 | extern const struct stmmac_desc_ops ndesc_ops; | 349 | extern const struct stmmac_desc_ops ndesc_ops; |
346 | 350 | ||
351 | /* Specific DMA helpers */ | ||
347 | struct stmmac_dma_ops { | 352 | struct stmmac_dma_ops { |
348 | /* DMA core initialization */ | 353 | /* DMA core initialization */ |
349 | int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb, | 354 | int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb, |
@@ -373,6 +378,7 @@ struct stmmac_dma_ops { | |||
373 | 378 | ||
374 | struct mac_device_info; | 379 | struct mac_device_info; |
375 | 380 | ||
381 | /* Helpers to program the MAC core */ | ||
376 | struct stmmac_ops { | 382 | struct stmmac_ops { |
377 | /* MAC core initialization */ | 383 | /* MAC core initialization */ |
378 | void (*core_init)(struct mac_device_info *hw, int mtu); | 384 | void (*core_init)(struct mac_device_info *hw, int mtu); |
@@ -403,6 +409,7 @@ struct stmmac_ops { | |||
403 | void (*get_adv)(struct mac_device_info *hw, struct rgmii_adv *adv); | 409 | void (*get_adv)(struct mac_device_info *hw, struct rgmii_adv *adv); |
404 | }; | 410 | }; |
405 | 411 | ||
412 | /* PTP and HW Timer helpers */ | ||
406 | struct stmmac_hwtimestamp { | 413 | struct stmmac_hwtimestamp { |
407 | void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data); | 414 | void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data); |
408 | void (*config_sub_second_increment) (void __iomem *ioaddr); | 415 | void (*config_sub_second_increment) (void __iomem *ioaddr); |
@@ -426,6 +433,7 @@ struct mii_regs { | |||
426 | unsigned int data; /* MII Data */ | 433 | unsigned int data; /* MII Data */ |
427 | }; | 434 | }; |
428 | 435 | ||
436 | /* Helpers to manage the descriptors for chain and ring modes */ | ||
429 | struct stmmac_mode_ops { | 437 | struct stmmac_mode_ops { |
430 | void (*init) (void *des, dma_addr_t phy_addr, unsigned int size, | 438 | void (*init) (void *des, dma_addr_t phy_addr, unsigned int size, |
431 | unsigned int extend_desc); | 439 | unsigned int extend_desc); |