Commit 1e3531d2 authored by David S. Miller's avatar David S. Miller

Merge branch 'stmmac-next'

Giuseppe Cavallaro says:

====================
stmmac: update driver documentation

Recently many changes have been done inside the driver
so this patch updates the driver's doc for example reviewing
information for the rx and tx processes that are managed
by napi method, adding new information for missing glue-logic files
etc.
Also this reviews and fixes what is reported when run kernel-doc script.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 355a901e 732fdf0e
This diff is collapsed.
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#undef FRAME_FILTER_DEBUG #undef FRAME_FILTER_DEBUG
/* #define FRAME_FILTER_DEBUG */ /* #define FRAME_FILTER_DEBUG */
/* Extra statistic and debug information exposed by ethtool */
struct stmmac_extra_stats { struct stmmac_extra_stats {
/* Transmit errors */ /* Transmit errors */
unsigned long tx_underflow ____cacheline_aligned; unsigned long tx_underflow ____cacheline_aligned;
...@@ -220,6 +221,7 @@ enum dma_irq_status { ...@@ -220,6 +221,7 @@ enum dma_irq_status {
handle_tx = 0x8, handle_tx = 0x8,
}; };
/* EEE and LPI defines */
#define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 0) #define CORE_IRQ_TX_PATH_IN_LPI_MODE (1 << 0)
#define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 1) #define CORE_IRQ_TX_PATH_EXIT_LPI_MODE (1 << 1)
#define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 2) #define CORE_IRQ_RX_PATH_IN_LPI_MODE (1 << 2)
...@@ -229,6 +231,7 @@ enum dma_irq_status { ...@@ -229,6 +231,7 @@ enum dma_irq_status {
#define CORE_PCS_LINK_STATUS (1 << 6) #define CORE_PCS_LINK_STATUS (1 << 6)
#define CORE_RGMII_IRQ (1 << 7) #define CORE_RGMII_IRQ (1 << 7)
/* Physical Coding Sublayer */
struct rgmii_adv { struct rgmii_adv {
unsigned int pause; unsigned int pause;
unsigned int duplex; unsigned int duplex;
...@@ -294,6 +297,7 @@ struct dma_features { ...@@ -294,6 +297,7 @@ struct dma_features {
#define JUMBO_LEN 9000 #define JUMBO_LEN 9000
/* Descriptors helpers */
struct stmmac_desc_ops { struct stmmac_desc_ops {
/* DMA RX descriptor ring initialization */ /* DMA RX descriptor ring initialization */
void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode, void (*init_rx_desc) (struct dma_desc *p, int disable_rx_ic, int mode,
...@@ -344,6 +348,7 @@ struct stmmac_desc_ops { ...@@ -344,6 +348,7 @@ struct stmmac_desc_ops {
extern const struct stmmac_desc_ops enh_desc_ops; extern const struct stmmac_desc_ops enh_desc_ops;
extern const struct stmmac_desc_ops ndesc_ops; extern const struct stmmac_desc_ops ndesc_ops;
/* Specific DMA helpers */
struct stmmac_dma_ops { struct stmmac_dma_ops {
/* DMA core initialization */ /* DMA core initialization */
int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb, int (*init) (void __iomem *ioaddr, int pbl, int fb, int mb,
...@@ -373,6 +378,7 @@ struct stmmac_dma_ops { ...@@ -373,6 +378,7 @@ struct stmmac_dma_ops {
struct mac_device_info; struct mac_device_info;
/* Helpers to program the MAC core */
struct stmmac_ops { struct stmmac_ops {
/* MAC core initialization */ /* MAC core initialization */
void (*core_init)(struct mac_device_info *hw, int mtu); void (*core_init)(struct mac_device_info *hw, int mtu);
...@@ -403,6 +409,7 @@ struct stmmac_ops { ...@@ -403,6 +409,7 @@ struct stmmac_ops {
void (*get_adv)(struct mac_device_info *hw, struct rgmii_adv *adv); void (*get_adv)(struct mac_device_info *hw, struct rgmii_adv *adv);
}; };
/* PTP and HW Timer helpers */
struct stmmac_hwtimestamp { struct stmmac_hwtimestamp {
void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data); void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data);
void (*config_sub_second_increment) (void __iomem *ioaddr); void (*config_sub_second_increment) (void __iomem *ioaddr);
...@@ -426,6 +433,7 @@ struct mii_regs { ...@@ -426,6 +433,7 @@ struct mii_regs {
unsigned int data; /* MII Data */ unsigned int data; /* MII Data */
}; };
/* Helpers to manage the descriptors for chain and ring modes */
struct stmmac_mode_ops { struct stmmac_mode_ops {
void (*init) (void *des, dma_addr_t phy_addr, unsigned int size, void (*init) (void *des, dma_addr_t phy_addr, unsigned int size,
unsigned int extend_desc); unsigned int extend_desc);
......
/** /*
* dwmac-sti.c - STMicroelectronics DWMAC Specific Glue layer * dwmac-sti.c - STMicroelectronics DWMAC Specific Glue layer
* *
* Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited * Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited
...@@ -37,9 +37,8 @@ ...@@ -37,9 +37,8 @@
#define IS_PHY_IF_MODE_GBIT(iface) (IS_PHY_IF_MODE_RGMII(iface) || \ #define IS_PHY_IF_MODE_GBIT(iface) (IS_PHY_IF_MODE_RGMII(iface) || \
iface == PHY_INTERFACE_MODE_GMII) iface == PHY_INTERFACE_MODE_GMII)
/* STiH4xx register definitions (STiH415/STiH416/STiH407/STiH410 families) */ /* STiH4xx register definitions (STiH415/STiH416/STiH407/STiH410 families)
*
/**
* Below table summarizes the clock requirement and clock sources for * Below table summarizes the clock requirement and clock sources for
* supported phy interface modes with link speeds. * supported phy interface modes with link speeds.
* ________________________________________________ * ________________________________________________
...@@ -78,9 +77,7 @@ ...@@ -78,9 +77,7 @@
#define STIH4XX_ETH_SEL_INTERNAL_NOTEXT_PHYCLK BIT(7) #define STIH4XX_ETH_SEL_INTERNAL_NOTEXT_PHYCLK BIT(7)
#define STIH4XX_ETH_SEL_TXCLK_NOT_CLK125 BIT(6) #define STIH4XX_ETH_SEL_TXCLK_NOT_CLK125 BIT(6)
/* STiD127 register definitions */ /* STiD127 register definitions
/**
*----------------------- *-----------------------
* src |BIT(6)| BIT(7)| * src |BIT(6)| BIT(7)|
*----------------------- *-----------------------
...@@ -106,13 +103,13 @@ ...@@ -106,13 +103,13 @@
#define EN_MASK GENMASK(1, 1) #define EN_MASK GENMASK(1, 1)
#define EN BIT(1) #define EN BIT(1)
/** /*
* 3 bits [4:2] * 3 bits [4:2]
* 000-GMII/MII * 000-GMII/MII
* 001-RGMII * 001-RGMII
* 010-SGMII * 010-SGMII
* 100-RMII * 100-RMII
*/ */
#define MII_PHY_SEL_MASK GENMASK(4, 2) #define MII_PHY_SEL_MASK GENMASK(4, 2)
#define ETH_PHY_SEL_RMII BIT(4) #define ETH_PHY_SEL_RMII BIT(4)
#define ETH_PHY_SEL_SGMII BIT(3) #define ETH_PHY_SEL_SGMII BIT(3)
......
/** /*
* dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer * dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer
* *
* Copyright (C) 2013 Chen-Yu Tsai * Copyright (C) 2013 Chen-Yu Tsai
......
...@@ -51,7 +51,11 @@ MODULE_DEVICE_TABLE(of, stmmac_dt_ids); ...@@ -51,7 +51,11 @@ MODULE_DEVICE_TABLE(of, stmmac_dt_ids);
#ifdef CONFIG_OF #ifdef CONFIG_OF
/* This function validates the number of Multicast filtering bins specified /**
* dwmac1000_validate_mcast_bins - validates the number of Multicast filter bins
* @mcast_bins: Multicast filtering bins
* Description:
* this function validates the number of Multicast filtering bins specified
* by the configuration through the device tree. The Synopsys GMAC supports * by the configuration through the device tree. The Synopsys GMAC supports
* 64 bins, 128 bins, or 256 bins. "bins" refer to the division of CRC * 64 bins, 128 bins, or 256 bins. "bins" refer to the division of CRC
* number space. 64 bins correspond to 6 bits of the CRC, 128 corresponds * number space. 64 bins correspond to 6 bits of the CRC, 128 corresponds
...@@ -77,7 +81,11 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins) ...@@ -77,7 +81,11 @@ static int dwmac1000_validate_mcast_bins(int mcast_bins)
return x; return x;
} }
/* This function validates the number of Unicast address entries supported /**
* dwmac1000_validate_ucast_entries - validate the Unicast address entries
* @ucast_entries: number of Unicast address entries
* Description:
* This function validates the number of Unicast address entries supported
* by a particular Synopsys 10/100/1000 controller. The Synopsys controller * by a particular Synopsys 10/100/1000 controller. The Synopsys controller
* supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter
* logic. This function validates a valid, supported configuration is * logic. This function validates a valid, supported configuration is
...@@ -103,6 +111,15 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries) ...@@ -103,6 +111,15 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries)
return x; return x;
} }
/**
* stmmac_probe_config_dt - parse device-tree driver parameters
* @pdev: platform_device structure
* @plat: driver data platform structure
* @mac: MAC address to use
* Description:
* this function is to read the driver parameters from device-tree and
* set some private fields that will be used by the main at runtime.
*/
static int stmmac_probe_config_dt(struct platform_device *pdev, static int stmmac_probe_config_dt(struct platform_device *pdev,
struct plat_stmmacenet_data *plat, struct plat_stmmacenet_data *plat,
const char **mac) const char **mac)
...@@ -242,11 +259,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, ...@@ -242,11 +259,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
#endif /* CONFIG_OF */ #endif /* CONFIG_OF */
/** /**
* stmmac_pltfr_probe * stmmac_pltfr_probe - platform driver probe.
* @pdev: platform device pointer * @pdev: platform device pointer
* Description: platform_device probe function. It allocates * Description: platform_device probe function. It is to allocate
* the necessary resources and invokes the main to init * the necessary platform resources, invoke custom helper (if required) and
* the net device, register the mdio bus etc. * invoke the main probe function.
*/ */
static int stmmac_pltfr_probe(struct platform_device *pdev) static int stmmac_pltfr_probe(struct platform_device *pdev)
{ {
...@@ -363,6 +380,13 @@ static int stmmac_pltfr_remove(struct platform_device *pdev) ...@@ -363,6 +380,13 @@ static int stmmac_pltfr_remove(struct platform_device *pdev)
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
/**
* stmmac_pltfr_suspend
* @dev: device pointer
* Description: this function is invoked when suspend the driver and it direcly
* call the main suspend function and then, if required, on some platform, it
* can call an exit helper.
*/
static int stmmac_pltfr_suspend(struct device *dev) static int stmmac_pltfr_suspend(struct device *dev)
{ {
int ret; int ret;
...@@ -377,6 +401,13 @@ static int stmmac_pltfr_suspend(struct device *dev) ...@@ -377,6 +401,13 @@ static int stmmac_pltfr_suspend(struct device *dev)
return ret; return ret;
} }
/**
* stmmac_pltfr_resume
* @dev: device pointer
* Description: this function is invoked when resume the driver before calling
* the main resume function, on some platforms, it can call own init helper
* if required.
*/
static int stmmac_pltfr_resume(struct device *dev) static int stmmac_pltfr_resume(struct device *dev)
{ {
struct net_device *ndev = dev_get_drvdata(dev); struct net_device *ndev = dev_get_drvdata(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment