aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii
Commit message (Collapse)AuthorAgeFilesLines
* bus: Document special ranges of IVARsJohn Baldwin2026-02-171-1/+1
| | | | | | | | | | | | | Some IVAR indices are special in that they have global meaning across multiple buses where as other IVARs are always private to the local bus. Try to document this a bit and add constants for the various ranges to avoid future conflicts. This is a no-op, but IVAR indices are now generally defined as enums as that makes it easier to define them in terms of ranges. Reviewed by: imp, royger, andrew Differential Revision: https://reviews.freebsd.org/D54159
* sys: RealTek -> Realtekykla2025-11-275-18/+18
| | | | | | | | | | | Realtek changed how it styled its name 25 or so years ago, but the old style persisted in many places. These products use the new styling in their datasheets. Signed-off-by: ykla yklaxds@gmail.com Sponsored by: Chinese FreeBSD Community Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1901
* mv88e151x: fix potential attach and autonegotiation issuesRyan Libby2025-10-151-3/+5
| | | | | | Reported by: GCC -Wmaybe-uninitialized, -Wtautological-compare Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D45919
* mccomphy: Guard the definition of mcommphy_yt8531_setup_delay()Mark Johnston2025-05-061-0/+2
| | | | | | | | Otherwise I get an unused function warning during amd64 kernel builds. Fixes: a592b5fd9d9c ("mccomphy: add support for YT8531") Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D50191
* mccomphy: add support for YT8531Jari Sihvola2025-05-012-25/+251
| | | | | | | | | Reapply e69623451ea6, this time with proper conditions for code requiring FDT. Co-authored-by: mhorne MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D50074
* mii: Change e1000phy (Marvell 88E1000) PHYs to disable power down / isolateAdrian Chadd2025-05-011-0/+7
| | | | | | | | | | | | | | | The reset sequence doesn't clear the power down / isolate bits during power up and configuration. Change that to make sure things are consistent. If the PHY is initialised by something external (eg a bootloader, config EEPROM driving a switch chip, etc) which sets the power down and/or isolate bits in E1000_CR, then the reset path wouldn't undo it and the PHY will look permanently down. Even when we configure autonegotiate or statically nail the port up, it's still not coming out of the power mode. Differential Revision: https://reviews.freebsd.org/D50045
* Revert "mccomphy: add support for YT8531"Mitchell Horne2025-04-032-235/+25
| | | | | | | | | The new code makes use of FDT/OFW types and interfaces, and obviously fails to build on amd64. Revert to fix. Pointy-hat-to: mhorne This reverts commit e69623451ea62d2c3c76e0d0e775aa3f7317f2eb.
* mccomphy: add support for YT8531Jari Sihvola2025-04-022-25/+235
| | | | | | | Reviewed by: mhorne Tested by: mhorne MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45600
* Replace calls to bus_generic_attach with bus_attach_childrenJohn Baldwin2024-12-061-7/+4
| | | | | Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47675
* mii_fdt: Search for the "ethernet-ports" subnodeMark Johnston2024-11-191-0/+2
| | | | | | | | This is a more common name for the parent of the port nodes. PR: 280770 MFC after: 2 weeks Reported by: Mike Belanger <mibelanger@qnx.com>
* miibus: Use a bus_child_deleted method to free ivars for childrenJohn Baldwin2024-11-011-3/+3
| | | | | | | | | | If a device was detached (e.g. via devctl) and then re-attached, the ivars would be freed by the previous bus_child_detached method during detach, but device_get_ivars during the subsequent attach would return a stale pointer resulting in a use after free. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47371
* newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANYWarner Losh2024-07-251-2/+2
| | | | Sponsored by: Netflix
* mii: Add support for Realtek RTL8211F-VD PHYPeter Jeremy2024-05-083-2/+6
| | | | | | | | | | | | The RTL8211F-VD is a replacement/upgrade for the RTL8211F. Based on https://github.com/torvalds/linux/commit/bb726b753f75a4eeda291438f89dfd9b94783569, the only difference is the lack of the PCR2 register, which FreeBSD doesn't use. This fixes autonegotiation problems using the RTL8211F with ukphy(4). Reviewed by: manu, bz MFC after: 1 month Differential Revision: <https://reviews.freebsd.org/D45109
* sys/dev/mii/mcommphy.c: remove an extra semicolonrilysh2024-02-031-1/+1
| | | | | | Signed-off-by: rilysh <nightquick@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/959
* mii: Fix memory leak in micphy.Jiahao LI2024-01-081-0/+2
| | | | | PR: 270040 MFC after: 1 week
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-274-4/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* mii: add Vitesse/Microsemi VSC8514Bjoern A. Zeeb2023-11-172-0/+2
| | | | | | | | | | | The VSC8514 Quad-Port 10/100/1000BASE-T PHY seems to match the handling for the VSC8504 (for the little we support of what we could) and while it works with our generic ukphy add it as vscphy for porper display of names in the system message buffer and the like (or in case we decide to implement some extra features). Tested on: Ten64 MFC after: 3 days
* mii: resort VSC8641 entry in miidevsBjoern A. Zeeb2023-11-171-1/+1
| | | | | | | VSC8641 is a ciphy not a vscphy. Sort it with the other entries of ciphy to avoid confusion. MFC after: 3 days
* sys: Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1637-74/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-163-3/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1622-44/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* mii: Add the Broadcom BCM54616S ID to the listJustin Hibbits2023-08-022-0/+2
| | | | | Obtained from: Juniper Networks, Inc. Sponsored by: Juniper Networks, Inc.
* spdx: Simplify BSD-2-Clause AND BSD-2-ClauseWarner Losh2023-05-124-4/+4
| | | | | | | | | After removing the -FreeBSD and -NetBSD, we're left with a nuber of BSD-2-Clause AND BSD-2-Clause, so tidy that up. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-1224-24/+24
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1216-16/+16
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* Add driver for Motorcomm YT8511 GbE PHYSøren Schmidt2022-12-132-0/+188
| | | | Partially from: https://reviews.freebsd.org/D36093
* mv88e151x: Remove unused devclass argument from DRIVER_MODULE.John Baldwin2022-08-231-3/+1
|
* Add the PHY driver for the Marvell 88E1512.Luiz Souza2022-08-093-0/+318
| | | | | | | | | | This driver supports the auto negotiation mode between the copper and fiber ports. This PHY has two independent PHYs (one for copper and other for fiber) but in this case the functionality is presented as a single PHY for easy management. Sponsored by: Rubicon Communications, LLC ("Netgate")
* mii: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-0632-92/+32
|
* Remove unused miibus_devclass and miibus_fdt_devclass.John Baldwin2022-05-063-4/+0
|
* Add a new RDC phyKevin Lo2022-04-252-0/+2
| | | | | | Reviewed by: jhb Obtained from: NetBSD via Andrius V Differential Revision: https://reviews.freebsd.org/D35034
* mii_fdt: fix a set-but-not-used warningMitchell Horne2022-04-031-2/+0
|
* Extend device_get_property APIKornel Duleba2022-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | In order to support various types of data stored in device tree properties or ACPI _DSD packages, create a new enum so the caller can specify the expected type of a property they want to read, according to the binding. The bus logic will use that information to process the underlying data. For example in DT all integer properties are stored in BE format. In order to get constant results across different platforms we need to convert its endianness to match the host. Another example are ACPI_TYPE_INTEGER properties stored as uint64_t. Before this patch the ACPI logic would refuse to read them if the provided buffer was smaller than 8 bytes. Now this can be handled by using DEVICE_PROP_UINT32 type. Modify the existing consumers of this API to reflect the changes and update the man pages accordingly. Reviewed by: mw Obtained from: Semihalf MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33457
* bus_if: Add a default implementation of get_propertyKornel Duleba2022-03-101-15/+0
| | | | | | | | | | | | | | There are multiple buses that pretend to be ofw compatible, e.g ofw_pci, mii_fdt. We now need to provide an implementation of BUS_GET_PROPERTY for every one of them. Instead of modifying them one by one it's better to just provide a default implementation that simply traverses up the device tree. Remove the now unneeded BUS_GET_PROPERTY implementation in mii_fdt. Reviewed by: andrew, bz Obtained from: Semihalf MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34031
* dp83822phy: Add missing MII_PHY_END to avoid buffer overread on probeJessica Clarke2022-01-251-1/+2
| | | | | Found by: CHERI Fixes: 0c9156faeccb ("Introduce DP83822 PHY driver")
* dp83867phy: Add missing MII_PHY_END to avoid buffer overread on attachJessica Clarke2022-01-251-1/+2
| | | | | Found by: CHERI Fixes: e85c94b8d6ca ("Introduce DP83867 PHY driver")
* newbus: add bus_topo_assertWarner Losh2021-12-101-0/+2
| | | | | | | | | | Add bus_topo_assert() and implmement it as GIANT_REQUIRED for the moment. This will allow us to change more easily to a newbus-specific lock int he future. Sponsored by: Netflix Reviewed by: wulf, mav, jhb Differential Revision: https://reviews.freebsd.org/D31833
* mii/dp83822phy: Remove a declaration for a non-existent functionMark Johnston2021-11-291-1/+0
| | | | Fixes: 0c9156faeccb ("Introduce DP83822 PHY driver")
* vscphy: Add support for PHY interruptsKornel Duleba2021-11-242-1/+75
| | | | | | | | | | | They're allocated using standard newbus API, which means that we rely on miibus to handle the allocation. Add VSC8504 to the list of supported PHYs, as it is similar enough to the VSC8501 that is already supported by this driver. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32816
* Introduce DP83822 PHY driverKornel Duleba2021-11-242-0/+221
| | | | | | | | | | | DP83822 is a 10/100 Texas Instruments PHY. Link status change interrupts are supported by the driver, however not all boards have the PHY interrupt wired. Because of that if failure to allocate an IRQ is not treated as an error. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32815
* Introduce DP83867 PHY driverKornel Duleba2021-11-242-0/+296
| | | | | | | | | | | DP83867 is a 10/100/1000 Texas Instruments PHY. Only SGMII mode is supported. Link status changes can be checked through an interrupt generated by the PHY, if available Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32813
* miibus: Add support for mapping OFW nodes to PHY devicesKornel Duleba2021-11-243-9/+155
| | | | | | | | | | | | Create a new miibus OFW specific layer leveraging miibus_fdt.c code. PHY drivers can than read the properties using device_get_property(9) API. Resource(interrupt) allocation is also supported. In order to enable this each NIC/switch driver will have to be modified, because of how miibus is attached to the parent driver. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32812
* vscphy: Fill in new mii_maxspeed fieldKornel Duleba2021-11-241-0/+1
| | | | | | | | | It is used to limit the max advertised speed. The value is read from DT by mii_fdt code. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32816
* mii_physubr: Add support for limiting PHY max speedKornel Duleba2021-11-242-0/+37
| | | | | | | | | | | | | | | In some cases we might want to limit the max speed advertised below of what the PHY is capable of. This is usually the case when we connect 1G capable PHY to 100M MAC, or when some exotic physical connection is used. Add a new mii_maxspeed field to mii_softc and parse it in mii_phy_dev_attach. Speed limit is normally located in DT. The property is already parsed in mii_fdt.c, but its value still has to be passed by the PHY driver. Obtained from: Semihalf Sponsored by: Alstom Group Differential revision: https://reviews.freebsd.org/D32727
* mii: update URL for OUIsBjoern A. Zeeb2021-11-091-1/+1
| | | | Update the URL for OUIs as the old one is 404 not even 301 anymore.
* mii_fdt: Add support for switch PHY node lookupKornel Duleba2021-11-061-1/+42
| | | | | | | | | | | | | | | | Previously we would only search for a PHY xref in node of the miibus parent. That didn't work very well with switches. Fix that by searching through "ports" subnode, checking if any of its children have a valid PHY xref. Since switches tend to have multiple ports we also have multiple candidates. Use the PHY address read from mii_attach_args to find the right one. Obtained from: Semihalf Sponsored by: Alstom Group Reviewed by: mw Differential revision: https://reviews.freebsd.org/D32690
* Fix some common typos in source code commentsGordon Bergling2021-08-281-1/+1
| | | | | | | | | - s/priviledged/privileged/ - s/funtion/function/ - s/doens't/doesn't/ - s/sychronization/synchronization/ MFC after: 3 days