16 Mar, 2020
2 commits
-
Add a helper to convert a linkmode advertisement to a clause 37
advertisement value for 1000base-x and 2500base-x.Signed-off-by: Russell King
Reviewed-by: Andrew Lunn
Signed-off-by: David S. Miller -
Add a LPA to linkmode decoder for 1000BASE-X protocols; this decoder
only provides the modify semantics similar to other such decoders.
This replaces the unused mii_lpa_to_ethtool_lpa_x() helper.Signed-off-by: Russell King
Reviewed-by: Andrew Lunn
Signed-off-by: David S. Miller
06 Jan, 2020
1 commit
-
Typically a MAC PCS auto-configures itself after it receives the
negotiated copper-side link settings from the PHY, but some MAC devices
are more special and need manual interpretation of the SGMII AN result.In other cases, the PCS exposes the entire tx_config_reg base page as it
is transmitted on the wire during auto-negotiation, so it makes sense to
be able to decode the equivalent lp_advertised bit mask from the raw u16
(of course, "lp" considering the PCS to be the local PHY).Therefore, add the bit definitions for the SGMII registers 4 and 5
(local device ability, link partner ability), as well as a link_mode
conversion helper that can be used to feed the AN results into
phy_resolve_aneg_linkmode.Signed-off-by: Vladimir Oltean
Signed-off-by: David S. Miller
05 Oct, 2019
1 commit
-
When userspace writes to the MII_ADVERTISE register, we update phylib's
advertising mask and trigger a renegotiation. However, writing to the
MII_CTRL1000 register, which contains the gigabit advertisement, does
neither. This can lead to phylib's copy of the advertisement becoming
de-synced with the values in the PHY register set, which can result in
incorrect negotiation resolution.Fixes: 5502b218e001 ("net: phy: use phy_resolve_aneg_linkmode in genphy_read_status")
Reviewed-by: Andrew Lunn
Signed-off-by: Russell King
Signed-off-by: David S. Miller
28 Mar, 2019
1 commit
-
With a recent link mode advertisement code update this helper
providing local pause capability translation used for flow
control link mode negotiation got broken.
For eth drivers using this helper, the issue is apparent only
if either PAUSE or ASYM_PAUSE is being advertised.Fixes: 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode")
Signed-off-by: Claudiu Manoil
Signed-off-by: David S. Miller
06 Dec, 2018
4 commits
-
Replace the if else code structure with a call to the helper
linkmode_mod_bit.Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller -
Add a _mod_ variant of mii_lpa_to_linkmode_lpa_t. Use this to fix the
genphy_read_status() where the 1G link partner features are getting
lost.Fixes: c0ec3c273677 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Reported-by: Heiner Kallweit
Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller -
Rename mii_stat1000_to_linkmode_lpa_t to
mii_stat1000_mod_linkmode_lpa_t to indicate it modifies the passed
linkmode bitmap, without clearing any other bits.Add a helper to set/clear bits in a linkmode.
Use this helper to ensure bit are clear which the stat1000 indicates
should not be set.Fixes: c0ec3c273677 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Suggested-by: Heiner Kallweit
Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller -
mii_adv_to_linkmode_adv_t() clears all bits before setting it needs to
set. This means the freshly set Autoneg gets cleared.Change the order, and add comments about it clearing the old content
of the bitmap.Fixes: c0ec3c273677 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Reported-by: Heiner Kallweit
Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller
12 Nov, 2018
3 commits
-
Add missing markup for function parameters
Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller -
Convert phy drivers to report the link partner advertised modes using
a linkmode bitmap. This allows them to report the higher speeds which
don't fit in a u32.Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller -
There are a few MAC/PHYs combinations which now support > 1Gbps. These
may need to make use of link modes with bits > 31. Thus their
supported PHY features or advertised features cannot be implemented
using the current bitmap in a u32. Convert to using a linkmode bitmap,
which can support all the currently devices link modes, and is future
proof as more modes are added.Signed-off-by: Andrew Lunn
Signed-off-by: David S. Miller
02 Oct, 2018
4 commits
-
Add helpers which take a linkmode rather than a u32 ethtool for
advertising settings.Signed-off-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Reviewed-by: Maxime Chevallier
Signed-off-by: David S. Miller -
Add a helper to convert the local advertising to an LCL capabilities,
which is then used to resolve pause flow control settings.Signed-off-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Reviewed-by: Maxime Chevallier
Signed-off-by: David S. Miller -
The phy_mii_ioctl can be used to write a value into the MII_ADVERTISE
register in the PHY. Since this changes the state of the PHY, we need
to make the same change to phydev->advertising. Add a helper which can
convert the register value to a linkmode.Signed-off-by: Andrew Lunn
Reviewed-by: Florian Fainelli
Reviewed-by: Maxime Chevallier
Signed-off-by: David S. Miller -
phylink has some useful helpers to working with linkmode bitmaps.
Move them to there own header so other code can use them.Signed-off-by: Andrew Lunn
Acked-by: Florian Fainelli
Reviewed-by: Maxime Chevallier
Signed-off-by: David S. Miller
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
05 Jun, 2017
1 commit
-
Make return value void since functions never returns meaningfull value.
Signed-off-by: Yuval Shaia
Signed-off-by: David S. Miller
03 Nov, 2016
1 commit
-
The old ethtool api (get_setting and set_setting) has generic mii
functions mii_ethtool_sset and mii_ethtool_gset.To support the new ethtool api ({get|set}_link_ksettings), we add
two generics mii function mii_ethtool_{get|set}_link_ksettings_get.Signed-off-by: Philippe Reynes
Signed-off-by: David S. Miller
13 Oct, 2012
1 commit
-
Signed-off-by: David Howells
Acked-by: Arnd Bergmann
Acked-by: Thomas Gleixner
Acked-by: Michael Kerrisk
Acked-by: Paul E. McKenney
Acked-by: Dave Jones
01 Jul, 2012
1 commit
-
This patch adds the support for the Energy-Efficient Ethernet (EEE)
to the Physical Abstraction Layer.
To support the EEE we have to access to the MMD registers 3.20 and
7.60/61. So two new functions have been added to read/write the MMD
registers (clause 45).An Ethernet driver (I tested the stmmac) can invoke the phy_init_eee to properly
check if the EEE is supported by the PHYs and it can also set the clock
stop enable bit in the 3.0 register.
The phy_get_eee_err can be used for reporting the number of time where
the PHY failed to complete its normal wake sequence.In the end, this patch also adds the EEE ethtool support implementing:
o phy_ethtool_set_eee
o phy_ethtool_get_eeev1: initial patch
v2: fixed some errors especially on naming convention
v3: renamed again the mmd read/write functions thank to Ben's feedback
v4: moved file to phy.c and added the ethtool support.
v5: fixed phy_adv_to_eee, phy_eee_to_supported, phy_eee_to_adv return
values according to ethtool API (thanks to Ben's feedback).
Renamed some macros to avoid too long names.
v6: fixed kernel-doc comments to be properly parsed.
Fixed the phy_init_eee function: we need to check which link mode
was autonegotiated and then the corresponding bits in 7.60 and 7.61
registers.
v7: reviewed the way to get the negotiated settings.
v8: fixed a problem in the phy_init_eee return value erroneously added
when included the phy_read_status call.
v9: do not remove the MDIO_AN_EEE_ADV_100TX and MDIO_AN_EEE_ADV_1000T
and fixed the eee_{cap,lp,adv} declaration as "int" instead of u16.Signed-off-by: Giuseppe Cavallaro
Reviewed-by: Ben Hutchings
Signed-off-by: David S. Miller
22 Nov, 2011
1 commit
-
This patch implements advice by Ben Hutchings to change the mii side of
the function names to look more like the register whose values they
convert. New LPA translation functions have been added as well.Signed-off-by: Matt Carlson
Signed-off-by: Michael Chan
Signed-off-by: David S. Miller
17 Nov, 2011
1 commit
-
Translating between ethtool advertisement settings and MII
advertisements are common operations for ethernet drivers. This patch
adds a set of helper functions that implements the conversion. The
patch then modifies a couple of the drivers to use the new functions.Signed-off-by: Matt Carlson
Signed-off-by: Michael Chan
Signed-off-by: David S. Miller
16 Sep, 2011
2 commits
-
There are references to this PHY chip in the generic mii.h header, so removing them.
Re-jiggle the changed comments, in response to points raised by Ben Hutchings.Signed-off-by: Mark Einon
Signed-off-by: David S. Miller -
Whitespace changes - spaces converted to tabs after each define name and value
Signed-off-by: Mark Einon
Signed-off-by: David S. Miller
15 Jun, 2011
1 commit
-
This patch changes to code to use some of the preprocessor
definitions from mii.h over its homegrown equivalents.Signed-off-by: Matt Carlson
Reviewed-by: Michael Chan
Reviewed-by: Benjamin Li
Signed-off-by: David S. Miller
30 Apr, 2009
2 commits
-
This converts flow control capabilites to an advertising mask and can
be useful in combination with mii_resolve_flowctrl_fdx().Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller -
This is a shorter and more comprehensible formulation of the
conditions for each flow control mode.Signed-off-by: Ben Hutchings
Signed-off-by: David S. Miller
16 Dec, 2008
2 commits
-
These 4 drivers have identical full duplex flow control resolution
functions. This patch changes them all to use one common function.The function in question decides whether a device should enable TX and
RX flow control in a standard way (IEEE 802.3-2005 table 28B-3), so this
should also be useful for other drivers.Signed-off-by: Steve Glendinning
Signed-off-by: David S. Miller -
flags used within drivers for indicating tx and rx flow control are
defined in 4 drivers (and probably more), move these constants to mii.h.The 3 SMSC drivers use the same constants (FLOW_CTRL_TX), but TG3 uses
TG3_FLOW_CTRL_TX, so this patch also renames the constants within TG3.Signed-off-by: Steve Glendinning
Signed-off-by: David S. Miller
18 May, 2007
1 commit
-
Noticed by Matvejchikov Ilya.
Signed-off-by: David S. Miller
29 Apr, 2006
1 commit
-
They shouldn't be using 'u32' et al in structures which are used for
communication with userspace. Switch to the proper types (__u32 etc).Signed-off-by: David Woodhouse
14 Sep, 2005
1 commit
-
Signed-off-by: Dale Farnsworth
Signed-off-by: Jeff Garzik
31 Jul, 2005
1 commit
-
ethernet drivers to remain as ignorant as is reasonable of the connected
PHY's design and operation details.Signed-off-by: Andy Fleming
Signed-off-by: Jeff Garzik
27 May, 2005
1 commit
-
A new driver bnx2 for Broadcom bcm5706 is available.
The patch also includes new 1000BASE-X advertisement bit definitions in
mii.hThanks to David Miller and Jeff Garzik for reviewing and their valuable
feedback.Signed-off-by: Michael Chan
Signed-off-by: David S. Miller
17 Apr, 2005
1 commit
-
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.Let it rip!