diff options
author | Giuseppe CAVALLARO <peppe.cavallaro@st.com> | 2014-11-18 03:47:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-19 15:04:58 -0500 |
commit | 732fdf0e5253e9d3687d332630e8468a701bebb2 (patch) | |
tree | e194b86f7a7efd43827bc72f69ede8338cbcd608 | |
parent | 915c199fc8cde9f9a5af19c1ea8c7c3c075d60e1 (diff) |
stmmac: review driver when run kernel-doc
When run ./scripts/kernel-doc several warnings are reported
so this patch fix them.
Also it reviews many comments and adds new ones.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 15 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 151 | ||||
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 43 |
4 files changed, 142 insertions, 69 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index ea4069276444..0e137751e76e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /** | 1 | /* |
2 | * dwmac-sti.c - STMicroelectronics DWMAC Specific Glue layer | 2 | * dwmac-sti.c - STMicroelectronics DWMAC Specific Glue layer |
3 | * | 3 | * |
4 | * Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited | 4 | * Copyright (C) 2003-2014 STMicroelectronics (R&D) Limited |
@@ -37,9 +37,8 @@ | |||
37 | #define IS_PHY_IF_MODE_GBIT(iface) (IS_PHY_IF_MODE_RGMII(iface) || \ | 37 | #define IS_PHY_IF_MODE_GBIT(iface) (IS_PHY_IF_MODE_RGMII(iface) || \ |
38 | iface == PHY_INTERFACE_MODE_GMII) | 38 | iface == PHY_INTERFACE_MODE_GMII) |
39 | 39 | ||
40 | /* STiH4xx register definitions (STiH415/STiH416/STiH407/STiH410 families) */ | 40 | /* STiH4xx register definitions (STiH415/STiH416/STiH407/STiH410 families) |
41 | 41 | * | |
42 | /** | ||
43 | * Below table summarizes the clock requirement and clock sources for | 42 | * Below table summarizes the clock requirement and clock sources for |
44 | * supported phy interface modes with link speeds. | 43 | * supported phy interface modes with link speeds. |
45 | * ________________________________________________ | 44 | * ________________________________________________ |
@@ -78,9 +77,7 @@ | |||
78 | #define STIH4XX_ETH_SEL_INTERNAL_NOTEXT_PHYCLK BIT(7) | 77 | #define STIH4XX_ETH_SEL_INTERNAL_NOTEXT_PHYCLK BIT(7) |
79 | #define STIH4XX_ETH_SEL_TXCLK_NOT_CLK125 BIT(6) | 78 | #define STIH4XX_ETH_SEL_TXCLK_NOT_CLK125 BIT(6) |
80 | 79 | ||
81 | /* STiD127 register definitions */ | 80 | /* STiD127 register definitions |
82 | |||
83 | /** | ||
84 | *----------------------- | 81 | *----------------------- |
85 | * src |BIT(6)| BIT(7)| | 82 | * src |BIT(6)| BIT(7)| |
86 | *----------------------- | 83 | *----------------------- |
@@ -106,13 +103,13 @@ | |||
106 | #define EN_MASK GENMASK(1, 1) | 103 | #define EN_MASK GENMASK(1, 1) |
107 | #define EN BIT(1) | 104 | #define EN BIT(1) |
108 | 105 | ||
109 | /** | 106 | /* |
110 | * 3 bits [4:2] | 107 | * 3 bits [4:2] |
111 | * 000-GMII/MII | 108 | * 000-GMII/MII |
112 | * 001-RGMII | 109 | * 001-RGMII |
113 | * 010-SGMII | 110 | * 010-SGMII |
114 | * 100-RMII | 111 | * 100-RMII |
115 | */ | 112 | */ |
116 | #define MII_PHY_SEL_MASK GENMASK(4, 2) | 113 | #define MII_PHY_SEL_MASK GENMASK(4, 2) |
117 | #define ETH_PHY_SEL_RMII BIT(4) | 114 | #define ETH_PHY_SEL_RMII BIT(4) |
118 | #define ETH_PHY_SEL_SGMII BIT(3) | 115 | #define ETH_PHY_SEL_SGMII BIT(3) |
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c index a26bda274c66..c5ea9ab75b03 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /** | 1 | /* |
2 | * dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer | 2 | * dwmac-sunxi.c - Allwinner sunxi DWMAC specific glue layer |
3 | * | 3 | * |
4 | * Copyright (C) 2013 Chen-Yu Tsai | 4 | * Copyright (C) 2013 Chen-Yu Tsai |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 0f1c146fcce1..118a427d1942 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | |||
@@ -125,8 +125,8 @@ static void stmmac_exit_fs(void); | |||
125 | 125 | ||
126 | /** | 126 | /** |
127 | * stmmac_verify_args - verify the driver parameters. | 127 | * stmmac_verify_args - verify the driver parameters. |
128 | * Description: it verifies if some wrong parameter is passed to the driver. | 128 | * Description: it checks the driver parameters and set a default in case of |
129 | * Note that wrong parameters are replaced with the default values. | 129 | * errors. |
130 | */ | 130 | */ |
131 | static void stmmac_verify_args(void) | 131 | static void stmmac_verify_args(void) |
132 | { | 132 | { |
@@ -204,7 +204,7 @@ static inline u32 stmmac_tx_avail(struct stmmac_priv *priv) | |||
204 | } | 204 | } |
205 | 205 | ||
206 | /** | 206 | /** |
207 | * stmmac_hw_fix_mac_speed: callback for speed selection | 207 | * stmmac_hw_fix_mac_speed - callback for speed selection |
208 | * @priv: driver private structure | 208 | * @priv: driver private structure |
209 | * Description: on some platforms (e.g. ST), some HW system configuraton | 209 | * Description: on some platforms (e.g. ST), some HW system configuraton |
210 | * registers have to be set according to the link speed negotiated. | 210 | * registers have to be set according to the link speed negotiated. |
@@ -218,9 +218,10 @@ static inline void stmmac_hw_fix_mac_speed(struct stmmac_priv *priv) | |||
218 | } | 218 | } |
219 | 219 | ||
220 | /** | 220 | /** |
221 | * stmmac_enable_eee_mode: Check and enter in LPI mode | 221 | * stmmac_enable_eee_mode - check and enter in LPI mode |
222 | * @priv: driver private structure | 222 | * @priv: driver private structure |
223 | * Description: this function is to verify and enter in LPI mode for EEE. | 223 | * Description: this function is to verify and enter in LPI mode in case of |
224 | * EEE. | ||
224 | */ | 225 | */ |
225 | static void stmmac_enable_eee_mode(struct stmmac_priv *priv) | 226 | static void stmmac_enable_eee_mode(struct stmmac_priv *priv) |
226 | { | 227 | { |
@@ -231,7 +232,7 @@ static void stmmac_enable_eee_mode(struct stmmac_priv *priv) | |||
231 | } | 232 | } |
232 | 233 | ||
233 | /** | 234 | /** |
234 | * stmmac_disable_eee_mode: disable/exit from EEE | 235 | * stmmac_disable_eee_mode - disable and exit from LPI mode |
235 | * @priv: driver private structure | 236 | * @priv: driver private structure |
236 | * Description: this function is to exit and disable EEE in case of | 237 | * Description: this function is to exit and disable EEE in case of |
237 | * LPI state is true. This is called by the xmit. | 238 | * LPI state is true. This is called by the xmit. |
@@ -244,7 +245,7 @@ void stmmac_disable_eee_mode(struct stmmac_priv *priv) | |||
244 | } | 245 | } |
245 | 246 | ||
246 | /** | 247 | /** |
247 | * stmmac_eee_ctrl_timer: EEE TX SW timer. | 248 | * stmmac_eee_ctrl_timer - EEE TX SW timer. |
248 | * @arg : data hook | 249 | * @arg : data hook |
249 | * Description: | 250 | * Description: |
250 | * if there is no data transfer and if we are not in LPI state, | 251 | * if there is no data transfer and if we are not in LPI state, |
@@ -259,13 +260,12 @@ static void stmmac_eee_ctrl_timer(unsigned long arg) | |||
259 | } | 260 | } |
260 | 261 | ||
261 | /** | 262 | /** |
262 | * stmmac_eee_init: init EEE | 263 | * stmmac_eee_init - init EEE |
263 | * @priv: driver private structure | 264 | * @priv: driver private structure |
264 | * Description: | 265 | * Description: |
265 | * If the EEE support has been enabled while configuring the driver, | 266 | * if the GMAC supports the EEE (from the HW cap reg) and the phy device |
266 | * if the GMAC actually supports the EEE (from the HW cap reg) and the | 267 | * can also manage EEE, this function enable the LPI state and start related |
267 | * phy can also manage EEE, so enable the LPI state and start the timer | 268 | * timer. |
268 | * to verify if the tx path can enter in LPI state. | ||
269 | */ | 269 | */ |
270 | bool stmmac_eee_init(struct stmmac_priv *priv) | 270 | bool stmmac_eee_init(struct stmmac_priv *priv) |
271 | { | 271 | { |
@@ -332,7 +332,7 @@ out: | |||
332 | return ret; | 332 | return ret; |
333 | } | 333 | } |
334 | 334 | ||
335 | /* stmmac_get_tx_hwtstamp: get HW TX timestamps | 335 | /* stmmac_get_tx_hwtstamp - get HW TX timestamps |
336 | * @priv: driver private structure | 336 | * @priv: driver private structure |
337 | * @entry : descriptor index to be used. | 337 | * @entry : descriptor index to be used. |
338 | * @skb : the socket buffer | 338 | * @skb : the socket buffer |
@@ -374,7 +374,7 @@ static void stmmac_get_tx_hwtstamp(struct stmmac_priv *priv, | |||
374 | return; | 374 | return; |
375 | } | 375 | } |
376 | 376 | ||
377 | /* stmmac_get_rx_hwtstamp: get HW RX timestamps | 377 | /* stmmac_get_rx_hwtstamp - get HW RX timestamps |
378 | * @priv: driver private structure | 378 | * @priv: driver private structure |
379 | * @entry : descriptor index to be used. | 379 | * @entry : descriptor index to be used. |
380 | * @skb : the socket buffer | 380 | * @skb : the socket buffer |
@@ -630,11 +630,11 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) | |||
630 | } | 630 | } |
631 | 631 | ||
632 | /** | 632 | /** |
633 | * stmmac_init_ptp: init PTP | 633 | * stmmac_init_ptp - init PTP |
634 | * @priv: driver private structure | 634 | * @priv: driver private structure |
635 | * Description: this is to verify if the HW supports the PTPv1 or v2. | 635 | * Description: this is to verify if the HW supports the PTPv1 or PTPv2. |
636 | * This is done by looking at the HW cap. register. | 636 | * This is done by looking at the HW cap. register. |
637 | * Also it registers the ptp driver. | 637 | * This function also registers the ptp driver. |
638 | */ | 638 | */ |
639 | static int stmmac_init_ptp(struct stmmac_priv *priv) | 639 | static int stmmac_init_ptp(struct stmmac_priv *priv) |
640 | { | 640 | { |
@@ -676,9 +676,13 @@ static void stmmac_release_ptp(struct stmmac_priv *priv) | |||
676 | } | 676 | } |
677 | 677 | ||
678 | /** | 678 | /** |
679 | * stmmac_adjust_link | 679 | * stmmac_adjust_link - adjusts the link parameters |
680 | * @dev: net device structure | 680 | * @dev: net device structure |
681 | * Description: it adjusts the link parameters. | 681 | * Description: this is the helper called by the physical abstraction layer |
682 | * drivers to communicate the phy link status. According the speed and duplex | ||
683 | * this driver can invoke registered glue-logic as well. | ||
684 | * It also invoke the eee initialization because it could happen when switch | ||
685 | * on different networks (that are eee capable). | ||
682 | */ | 686 | */ |
683 | static void stmmac_adjust_link(struct net_device *dev) | 687 | static void stmmac_adjust_link(struct net_device *dev) |
684 | { | 688 | { |
@@ -768,7 +772,7 @@ static void stmmac_adjust_link(struct net_device *dev) | |||
768 | } | 772 | } |
769 | 773 | ||
770 | /** | 774 | /** |
771 | * stmmac_check_pcs_mode: verify if RGMII/SGMII is supported | 775 | * stmmac_check_pcs_mode - verify if RGMII/SGMII is supported |
772 | * @priv: driver private structure | 776 | * @priv: driver private structure |
773 | * Description: this is to verify if the HW supports the PCS. | 777 | * Description: this is to verify if the HW supports the PCS. |
774 | * Physical Coding Sublayer (PCS) interface that can be used when the MAC is | 778 | * Physical Coding Sublayer (PCS) interface that can be used when the MAC is |
@@ -857,7 +861,7 @@ static int stmmac_init_phy(struct net_device *dev) | |||
857 | } | 861 | } |
858 | 862 | ||
859 | /** | 863 | /** |
860 | * stmmac_display_ring: display ring | 864 | * stmmac_display_ring - display ring |
861 | * @head: pointer to the head of the ring passed. | 865 | * @head: pointer to the head of the ring passed. |
862 | * @size: size of the ring. | 866 | * @size: size of the ring. |
863 | * @extend_desc: to verify if extended descriptors are used. | 867 | * @extend_desc: to verify if extended descriptors are used. |
@@ -925,7 +929,7 @@ static int stmmac_set_bfsize(int mtu, int bufsize) | |||
925 | } | 929 | } |
926 | 930 | ||
927 | /** | 931 | /** |
928 | * stmmac_clear_descriptors: clear descriptors | 932 | * stmmac_clear_descriptors - clear descriptors |
929 | * @priv: driver private structure | 933 | * @priv: driver private structure |
930 | * Description: this function is called to clear the tx and rx descriptors | 934 | * Description: this function is called to clear the tx and rx descriptors |
931 | * in case of both basic and extended descriptors are used. | 935 | * in case of both basic and extended descriptors are used. |
@@ -957,6 +961,15 @@ static void stmmac_clear_descriptors(struct stmmac_priv *priv) | |||
957 | (i == txsize - 1)); | 961 | (i == txsize - 1)); |
958 | } | 962 | } |
959 | 963 | ||
964 | /** | ||
965 | * stmmac_init_rx_buffers - init the RX descriptor buffer. | ||
966 | * @priv: driver private structure | ||
967 | * @p: descriptor pointer | ||
968 | * @i: descriptor index | ||
969 | * @flags: gfp flag. | ||
970 | * Description: this function is called to allocate a receive buffer, perform | ||
971 | * the DMA mapping and init the descriptor. | ||
972 | */ | ||
960 | static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p, | 973 | static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p, |
961 | int i, gfp_t flags) | 974 | int i, gfp_t flags) |
962 | { | 975 | { |
@@ -1001,7 +1014,8 @@ static void stmmac_free_rx_buffers(struct stmmac_priv *priv, int i) | |||
1001 | /** | 1014 | /** |
1002 | * init_dma_desc_rings - init the RX/TX descriptor rings | 1015 | * init_dma_desc_rings - init the RX/TX descriptor rings |
1003 | * @dev: net device structure | 1016 | * @dev: net device structure |
1004 | * Description: this function initializes the DMA RX/TX descriptors | 1017 | * @flags: gfp flag. |
1018 | * Description: this function initializes the DMA RX/TX descriptors | ||
1005 | * and allocates the socket buffers. It suppors the chained and ring | 1019 | * and allocates the socket buffers. It suppors the chained and ring |
1006 | * modes. | 1020 | * modes. |
1007 | */ | 1021 | */ |
@@ -1138,6 +1152,14 @@ static void dma_free_tx_skbufs(struct stmmac_priv *priv) | |||
1138 | } | 1152 | } |
1139 | } | 1153 | } |
1140 | 1154 | ||
1155 | /** | ||
1156 | * alloc_dma_desc_resources - alloc TX/RX resources. | ||
1157 | * @priv: private structure | ||
1158 | * Description: according to which descriptor can be used (extend or basic) | ||
1159 | * this function allocates the resources for TX and RX paths. In case of | ||
1160 | * reception, for example, it pre-allocated the RX socket buffer in order to | ||
1161 | * allow zero-copy mechanism. | ||
1162 | */ | ||
1141 | static int alloc_dma_desc_resources(struct stmmac_priv *priv) | 1163 | static int alloc_dma_desc_resources(struct stmmac_priv *priv) |
1142 | { | 1164 | { |
1143 | unsigned int txsize = priv->dma_tx_size; | 1165 | unsigned int txsize = priv->dma_tx_size; |
@@ -1249,8 +1271,8 @@ static void free_dma_desc_resources(struct stmmac_priv *priv) | |||
1249 | /** | 1271 | /** |
1250 | * stmmac_dma_operation_mode - HW DMA operation mode | 1272 | * stmmac_dma_operation_mode - HW DMA operation mode |
1251 | * @priv: driver private structure | 1273 | * @priv: driver private structure |
1252 | * Description: it sets the DMA operation mode: tx/rx DMA thresholds | 1274 | * Description: it is used for configuring the DMA operation mode register in |
1253 | * or Store-And-Forward capability. | 1275 | * order to program the tx/rx DMA thresholds or Store-And-Forward mode. |
1254 | */ | 1276 | */ |
1255 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | 1277 | static void stmmac_dma_operation_mode(struct stmmac_priv *priv) |
1256 | { | 1278 | { |
@@ -1271,9 +1293,9 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) | |||
1271 | } | 1293 | } |
1272 | 1294 | ||
1273 | /** | 1295 | /** |
1274 | * stmmac_tx_clean: | 1296 | * stmmac_tx_clean - to manage the transmission completion |
1275 | * @priv: driver private structure | 1297 | * @priv: driver private structure |
1276 | * Description: it reclaims resources after transmission completes. | 1298 | * Description: it reclaims the transmit resources after transmission completes. |
1277 | */ | 1299 | */ |
1278 | static void stmmac_tx_clean(struct stmmac_priv *priv) | 1300 | static void stmmac_tx_clean(struct stmmac_priv *priv) |
1279 | { | 1301 | { |
@@ -1372,10 +1394,10 @@ static inline void stmmac_disable_dma_irq(struct stmmac_priv *priv) | |||
1372 | } | 1394 | } |
1373 | 1395 | ||
1374 | /** | 1396 | /** |
1375 | * stmmac_tx_err: irq tx error mng function | 1397 | * stmmac_tx_err - to manage the tx error |
1376 | * @priv: driver private structure | 1398 | * @priv: driver private structure |
1377 | * Description: it cleans the descriptors and restarts the transmission | 1399 | * Description: it cleans the descriptors and restarts the transmission |
1378 | * in case of errors. | 1400 | * in case of transmission errors. |
1379 | */ | 1401 | */ |
1380 | static void stmmac_tx_err(struct stmmac_priv *priv) | 1402 | static void stmmac_tx_err(struct stmmac_priv *priv) |
1381 | { | 1403 | { |
@@ -1403,12 +1425,11 @@ static void stmmac_tx_err(struct stmmac_priv *priv) | |||
1403 | } | 1425 | } |
1404 | 1426 | ||
1405 | /** | 1427 | /** |
1406 | * stmmac_dma_interrupt: DMA ISR | 1428 | * stmmac_dma_interrupt - DMA ISR |
1407 | * @priv: driver private structure | 1429 | * @priv: driver private structure |
1408 | * Description: this is the DMA ISR. It is called by the main ISR. | 1430 | * Description: this is the DMA ISR. It is called by the main ISR. |
1409 | * It calls the dwmac dma routine to understand which type of interrupt | 1431 | * It calls the dwmac dma routine and schedule poll method in case of some |
1410 | * happened. In case of there is a Normal interrupt and either TX or RX | 1432 | * work can be done. |
1411 | * interrupt happened so the NAPI is scheduled. | ||
1412 | */ | 1433 | */ |
1413 | static void stmmac_dma_interrupt(struct stmmac_priv *priv) | 1434 | static void stmmac_dma_interrupt(struct stmmac_priv *priv) |
1414 | { | 1435 | { |
@@ -1451,6 +1472,12 @@ static void stmmac_mmc_setup(struct stmmac_priv *priv) | |||
1451 | pr_info(" No MAC Management Counters available\n"); | 1472 | pr_info(" No MAC Management Counters available\n"); |
1452 | } | 1473 | } |
1453 | 1474 | ||
1475 | /** | ||
1476 | * stmmac_get_synopsys_id - return the SYINID. | ||
1477 | * @priv: driver private structure | ||
1478 | * Description: this simple function is to decode and return the SYINID | ||
1479 | * starting from the HW core register. | ||
1480 | */ | ||
1454 | static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | 1481 | static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) |
1455 | { | 1482 | { |
1456 | u32 hwid = priv->hw->synopsys_uid; | 1483 | u32 hwid = priv->hw->synopsys_uid; |
@@ -1469,11 +1496,11 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv) | |||
1469 | } | 1496 | } |
1470 | 1497 | ||
1471 | /** | 1498 | /** |
1472 | * stmmac_selec_desc_mode: to select among: normal/alternate/extend descriptors | 1499 | * stmmac_selec_desc_mode - to select among: normal/alternate/extend descriptors |
1473 | * @priv: driver private structure | 1500 | * @priv: driver private structure |
1474 | * Description: select the Enhanced/Alternate or Normal descriptors. | 1501 | * Description: select the Enhanced/Alternate or Normal descriptors. |
1475 | * In case of Enhanced/Alternate, it looks at the extended descriptors are | 1502 | * In case of Enhanced/Alternate, it checks if the extended descriptors are |
1476 | * supported by the HW cap. register. | 1503 | * supported by the HW capability register. |
1477 | */ | 1504 | */ |
1478 | static void stmmac_selec_desc_mode(struct stmmac_priv *priv) | 1505 | static void stmmac_selec_desc_mode(struct stmmac_priv *priv) |
1479 | { | 1506 | { |
@@ -1495,7 +1522,7 @@ static void stmmac_selec_desc_mode(struct stmmac_priv *priv) | |||
1495 | } | 1522 | } |
1496 | 1523 | ||
1497 | /** | 1524 | /** |
1498 | * stmmac_get_hw_features: get MAC capabilities from the HW cap. register. | 1525 | * stmmac_get_hw_features - get MAC capabilities from the HW cap. register. |
1499 | * @priv: driver private structure | 1526 | * @priv: driver private structure |
1500 | * Description: | 1527 | * Description: |
1501 | * new GMAC chip generations have a new register to indicate the | 1528 | * new GMAC chip generations have a new register to indicate the |
@@ -1553,7 +1580,7 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv) | |||
1553 | } | 1580 | } |
1554 | 1581 | ||
1555 | /** | 1582 | /** |
1556 | * stmmac_check_ether_addr: check if the MAC addr is valid | 1583 | * stmmac_check_ether_addr - check if the MAC addr is valid |
1557 | * @priv: driver private structure | 1584 | * @priv: driver private structure |
1558 | * Description: | 1585 | * Description: |
1559 | * it is to verify if the MAC address is valid, in case of failures it | 1586 | * it is to verify if the MAC address is valid, in case of failures it |
@@ -1572,7 +1599,7 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv) | |||
1572 | } | 1599 | } |
1573 | 1600 | ||
1574 | /** | 1601 | /** |
1575 | * stmmac_init_dma_engine: DMA init. | 1602 | * stmmac_init_dma_engine - DMA init. |
1576 | * @priv: driver private structure | 1603 | * @priv: driver private structure |
1577 | * Description: | 1604 | * Description: |
1578 | * It inits the DMA invoking the specific MAC/GMAC callback. | 1605 | * It inits the DMA invoking the specific MAC/GMAC callback. |
@@ -1601,7 +1628,7 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv) | |||
1601 | } | 1628 | } |
1602 | 1629 | ||
1603 | /** | 1630 | /** |
1604 | * stmmac_tx_timer: mitigation sw timer for tx. | 1631 | * stmmac_tx_timer - mitigation sw timer for tx. |
1605 | * @data: data pointer | 1632 | * @data: data pointer |
1606 | * Description: | 1633 | * Description: |
1607 | * This is the timer handler to directly invoke the stmmac_tx_clean. | 1634 | * This is the timer handler to directly invoke the stmmac_tx_clean. |
@@ -1614,7 +1641,7 @@ static void stmmac_tx_timer(unsigned long data) | |||
1614 | } | 1641 | } |
1615 | 1642 | ||
1616 | /** | 1643 | /** |
1617 | * stmmac_init_tx_coalesce: init tx mitigation options. | 1644 | * stmmac_init_tx_coalesce - init tx mitigation options. |
1618 | * @priv: driver private structure | 1645 | * @priv: driver private structure |
1619 | * Description: | 1646 | * Description: |
1620 | * This inits the transmit coalesce parameters: i.e. timer rate, | 1647 | * This inits the transmit coalesce parameters: i.e. timer rate, |
@@ -1633,10 +1660,13 @@ static void stmmac_init_tx_coalesce(struct stmmac_priv *priv) | |||
1633 | } | 1660 | } |
1634 | 1661 | ||
1635 | /** | 1662 | /** |
1636 | * stmmac_hw_setup: setup mac in a usable state. | 1663 | * stmmac_hw_setup - setup mac in a usable state. |
1637 | * @dev : pointer to the device structure. | 1664 | * @dev : pointer to the device structure. |
1638 | * Description: | 1665 | * Description: |
1639 | * This function sets up the ip in a usable state. | 1666 | * this is the main function to setup the HW in a usable state because the |
1667 | * dma engine is reset, the core registers are configured (e.g. AXI, | ||
1668 | * Checksum features, timers). The DMA is ready to start receiving and | ||
1669 | * transmitting. | ||
1640 | * Return value: | 1670 | * Return value: |
1641 | * 0 on success and an appropriate (-)ve integer as defined in errno.h | 1671 | * 0 on success and an appropriate (-)ve integer as defined in errno.h |
1642 | * file on failure. | 1672 | * file on failure. |
@@ -1874,7 +1904,7 @@ static int stmmac_release(struct net_device *dev) | |||
1874 | } | 1904 | } |
1875 | 1905 | ||
1876 | /** | 1906 | /** |
1877 | * stmmac_xmit: Tx entry point of the driver | 1907 | * stmmac_xmit - Tx entry point of the driver |
1878 | * @skb : the socket buffer | 1908 | * @skb : the socket buffer |
1879 | * @dev : device pointer | 1909 | * @dev : device pointer |
1880 | * Description : this is the tx entry point of the driver. | 1910 | * Description : this is the tx entry point of the driver. |
@@ -2049,7 +2079,7 @@ static void stmmac_rx_vlan(struct net_device *dev, struct sk_buff *skb) | |||
2049 | 2079 | ||
2050 | 2080 | ||
2051 | /** | 2081 | /** |
2052 | * stmmac_rx_refill: refill used skb preallocated buffers | 2082 | * stmmac_rx_refill - refill used skb preallocated buffers |
2053 | * @priv: driver private structure | 2083 | * @priv: driver private structure |
2054 | * Description : this is to reallocate the skb for the reception process | 2084 | * Description : this is to reallocate the skb for the reception process |
2055 | * that is based on zero-copy. | 2085 | * that is based on zero-copy. |
@@ -2100,7 +2130,7 @@ static inline void stmmac_rx_refill(struct stmmac_priv *priv) | |||
2100 | } | 2130 | } |
2101 | 2131 | ||
2102 | /** | 2132 | /** |
2103 | * stmmac_rx_refill: refill used skb preallocated buffers | 2133 | * stmmac_rx - manage the receive process |
2104 | * @priv: driver private structure | 2134 | * @priv: driver private structure |
2105 | * @limit: napi bugget. | 2135 | * @limit: napi bugget. |
2106 | * Description : this the function called by the napi poll method. | 2136 | * Description : this the function called by the napi poll method. |
@@ -2369,8 +2399,11 @@ static int stmmac_set_features(struct net_device *netdev, | |||
2369 | * @irq: interrupt number. | 2399 | * @irq: interrupt number. |
2370 | * @dev_id: to pass the net device pointer. | 2400 | * @dev_id: to pass the net device pointer. |
2371 | * Description: this is the main driver interrupt service routine. | 2401 | * Description: this is the main driver interrupt service routine. |
2372 | * It calls the DMA ISR and also the core ISR to manage PMT, MMC, LPI | 2402 | * It can call: |
2373 | * interrupts. | 2403 | * o DMA service routine (to manage incoming frame reception and transmission |
2404 | * status) | ||
2405 | * o Core interrupts to manage: remote wake-up, management counter, LPI | ||
2406 | * interrupts. | ||
2374 | */ | 2407 | */ |
2375 | static irqreturn_t stmmac_interrupt(int irq, void *dev_id) | 2408 | static irqreturn_t stmmac_interrupt(int irq, void *dev_id) |
2376 | { | 2409 | { |
@@ -2657,11 +2690,10 @@ static const struct net_device_ops stmmac_netdev_ops = { | |||
2657 | /** | 2690 | /** |
2658 | * stmmac_hw_init - Init the MAC device | 2691 | * stmmac_hw_init - Init the MAC device |
2659 | * @priv: driver private structure | 2692 | * @priv: driver private structure |
2660 | * Description: this function detects which MAC device | 2693 | * Description: this function is to configure the MAC device according to |
2661 | * (GMAC/MAC10-100) has to attached, checks the HW capability | 2694 | * some platform parameters or the HW capability register. It prepares the |
2662 | * (if supported) and sets the driver's features (for example | 2695 | * driver to use either ring or chain modes and to setup either enhanced or |
2663 | * to use the ring or chaine mode or support the normal/enh | 2696 | * normal descriptors. |
2664 | * descriptor structure). | ||
2665 | */ | 2697 | */ |
2666 | static int stmmac_hw_init(struct stmmac_priv *priv) | 2698 | static int stmmac_hw_init(struct stmmac_priv *priv) |
2667 | { | 2699 | { |
@@ -2917,6 +2949,13 @@ int stmmac_dvr_remove(struct net_device *ndev) | |||
2917 | } | 2949 | } |
2918 | EXPORT_SYMBOL_GPL(stmmac_dvr_remove); | 2950 | EXPORT_SYMBOL_GPL(stmmac_dvr_remove); |
2919 | 2951 | ||
2952 | /** | ||
2953 | * stmmac_suspend - suspend callback | ||
2954 | * @ndev: net device pointer | ||
2955 | * Description: this is the function to suspend the device and it is called | ||
2956 | * by the platform driver to stop the network queue, release the resources, | ||
2957 | * program the PMT register (for WoL), clean and release driver resources. | ||
2958 | */ | ||
2920 | int stmmac_suspend(struct net_device *ndev) | 2959 | int stmmac_suspend(struct net_device *ndev) |
2921 | { | 2960 | { |
2922 | struct stmmac_priv *priv = netdev_priv(ndev); | 2961 | struct stmmac_priv *priv = netdev_priv(ndev); |
@@ -2960,6 +2999,12 @@ int stmmac_suspend(struct net_device *ndev) | |||
2960 | } | 2999 | } |
2961 | EXPORT_SYMBOL_GPL(stmmac_suspend); | 3000 | EXPORT_SYMBOL_GPL(stmmac_suspend); |
2962 | 3001 | ||
3002 | /** | ||
3003 | * stmmac_resume - resume callback | ||
3004 | * @ndev: net device pointer | ||
3005 | * Description: when resume this function is invoked to setup the DMA and CORE | ||
3006 | * in a usable state. | ||
3007 | */ | ||
2963 | int stmmac_resume(struct net_device *ndev) | 3008 | int stmmac_resume(struct net_device *ndev) |
2964 | { | 3009 | { |
2965 | struct stmmac_priv *priv = netdev_priv(ndev); | 3010 | struct stmmac_priv *priv = netdev_priv(ndev); |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index e22a960f8bd7..15814b79ff10 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | |||
@@ -51,7 +51,11 @@ MODULE_DEVICE_TABLE(of, stmmac_dt_ids); | |||
51 | 51 | ||
52 | #ifdef CONFIG_OF | 52 | #ifdef CONFIG_OF |
53 | 53 | ||
54 | /* This function validates the number of Multicast filtering bins specified | 54 | /** |
55 | * dwmac1000_validate_mcast_bins - validates the number of Multicast filter bins | ||
56 | * @mcast_bins: Multicast filtering bins | ||
57 | * Description: | ||
58 | * this function validates the number of Multicast filtering bins specified | ||
55 | * by the configuration through the device tree. The Synopsys GMAC supports | 59 | * by the configuration through the device tree. The Synopsys GMAC supports |
56 | * 64 bins, 128 bins, or 256 bins. "bins" refer to the division of CRC | 60 | * 64 bins, 128 bins, or 256 bins. "bins" refer to the division of CRC |
57 | * number space. 64 bins correspond to 6 bits of the CRC, 128 corresponds | 61 | * 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 | return x; | 81 | return x; |
78 | } | 82 | } |
79 | 83 | ||
80 | /* This function validates the number of Unicast address entries supported | 84 | /** |
85 | * dwmac1000_validate_ucast_entries - validate the Unicast address entries | ||
86 | * @ucast_entries: number of Unicast address entries | ||
87 | * Description: | ||
88 | * This function validates the number of Unicast address entries supported | ||
81 | * by a particular Synopsys 10/100/1000 controller. The Synopsys controller | 89 | * by a particular Synopsys 10/100/1000 controller. The Synopsys controller |
82 | * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter | 90 | * supports 1, 32, 64, or 128 Unicast filter entries for it's Unicast filter |
83 | * logic. This function validates a valid, supported configuration is | 91 | * logic. This function validates a valid, supported configuration is |
@@ -103,6 +111,15 @@ static int dwmac1000_validate_ucast_entries(int ucast_entries) | |||
103 | return x; | 111 | return x; |
104 | } | 112 | } |
105 | 113 | ||
114 | /** | ||
115 | * stmmac_probe_config_dt - parse device-tree driver parameters | ||
116 | * @pdev: platform_device structure | ||
117 | * @plat: driver data platform structure | ||
118 | * @mac: MAC address to use | ||
119 | * Description: | ||
120 | * this function is to read the driver parameters from device-tree and | ||
121 | * set some private fields that will be used by the main at runtime. | ||
122 | */ | ||
106 | static int stmmac_probe_config_dt(struct platform_device *pdev, | 123 | static int stmmac_probe_config_dt(struct platform_device *pdev, |
107 | struct plat_stmmacenet_data *plat, | 124 | struct plat_stmmacenet_data *plat, |
108 | const char **mac) | 125 | const char **mac) |
@@ -242,11 +259,11 @@ static int stmmac_probe_config_dt(struct platform_device *pdev, | |||
242 | #endif /* CONFIG_OF */ | 259 | #endif /* CONFIG_OF */ |
243 | 260 | ||
244 | /** | 261 | /** |
245 | * stmmac_pltfr_probe | 262 | * stmmac_pltfr_probe - platform driver probe. |
246 | * @pdev: platform device pointer | 263 | * @pdev: platform device pointer |
247 | * Description: platform_device probe function. It allocates | 264 | * Description: platform_device probe function. It is to allocate |
248 | * the necessary resources and invokes the main to init | 265 | * the necessary platform resources, invoke custom helper (if required) and |
249 | * the net device, register the mdio bus etc. | 266 | * invoke the main probe function. |
250 | */ | 267 | */ |
251 | static int stmmac_pltfr_probe(struct platform_device *pdev) | 268 | static int stmmac_pltfr_probe(struct platform_device *pdev) |
252 | { | 269 | { |
@@ -363,6 +380,13 @@ static int stmmac_pltfr_remove(struct platform_device *pdev) | |||
363 | } | 380 | } |
364 | 381 | ||
365 | #ifdef CONFIG_PM_SLEEP | 382 | #ifdef CONFIG_PM_SLEEP |
383 | /** | ||
384 | * stmmac_pltfr_suspend | ||
385 | * @dev: device pointer | ||
386 | * Description: this function is invoked when suspend the driver and it direcly | ||
387 | * call the main suspend function and then, if required, on some platform, it | ||
388 | * can call an exit helper. | ||
389 | */ | ||
366 | static int stmmac_pltfr_suspend(struct device *dev) | 390 | static int stmmac_pltfr_suspend(struct device *dev) |
367 | { | 391 | { |
368 | int ret; | 392 | int ret; |
@@ -377,6 +401,13 @@ static int stmmac_pltfr_suspend(struct device *dev) | |||
377 | return ret; | 401 | return ret; |
378 | } | 402 | } |
379 | 403 | ||
404 | /** | ||
405 | * stmmac_pltfr_resume | ||
406 | * @dev: device pointer | ||
407 | * Description: this function is invoked when resume the driver before calling | ||
408 | * the main resume function, on some platforms, it can call own init helper | ||
409 | * if required. | ||
410 | */ | ||
380 | static int stmmac_pltfr_resume(struct device *dev) | 411 | static int stmmac_pltfr_resume(struct device *dev) |
381 | { | 412 | { |
382 | struct net_device *ndev = dev_get_drvdata(dev); | 413 | struct net_device *ndev = dev_get_drvdata(dev); |