Thread (33 messages) flat view 33 messages, 9 authors, 2020-06-21

Re: [CFT 1/8] net: phylink: propagate resolved link config via mac_link_up()

From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Date: 2020-02-18 01:53:51
Also in: linux-arm-kernel, linux-doc, linux-mediatek

On Mon, Feb 17, 2020 at 01:54:19PM -0800, Florian Fainelli wrote:

On 2/17/2020 9:23 AM, Russell King wrote:
quoted
Propagate the resolved link parameters via the mac_link_up() call for
MACs that do not automatically track their PCS state.

Signed-off-by: Russell King <redacted>
---
[snip]

quoted
-static void macb_mac_link_up(struct phylink_config *config, unsigned int mode,
-			     phy_interface_t interface, struct phy_device *phy)
+static void macb_mac_link_up(struct phylink_config *config,
+			     struct phy_device *phy,
+			     unsigned int mode, phy_interface_t interface,
+			     int speed, int duplex,
+			     bool tx_pause, bool rx_pause)
I have not been able to find an answer so I will ask this question, why
not pass a const struct phylink_link_state reference here instead of
splitting those link settings as individual function parameters? Or
maybe introduce a phylink_link_settings comprised of all of those 4
settings and embed it within phylink_link_state as well?
History of mac_config() has shown that passing something like
struct phylink_link_state results in stuff that should not be used
being used inspite of documentation saying otherwise.  Passing
just the appropriate state ensures that stuff which should not
be used can't be got at.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help