Lines Matching +full:mdio +full:- +full:bus

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/mdio.h: definitions for MDIO (clause 45) transceivers
4 * Copyright 2006-2009 Solarflare Communications Inc.
9 #include <uapi/linux/mdio.h>
31 struct mii_bus *bus; member
38 /* Bus address of the MDIO device (0-31) */
53 /* struct mdio_driver_common: Common to all MDIO drivers */
63 /* struct mdio_driver: Generic MDIO driver */
69 * up device-specific structures, if any
84 static inline void mdiodev_set_drvdata(struct mdio_device *mdio, void *data) in mdiodev_set_drvdata() argument
86 dev_set_drvdata(&mdio->dev, data); in mdiodev_set_drvdata()
89 static inline void *mdiodev_get_drvdata(struct mdio_device *mdio) in mdiodev_get_drvdata() argument
91 return dev_get_drvdata(&mdio->dev); in mdiodev_get_drvdata()
95 struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr);
105 get_device(&mdiodev->dev); in mdio_device_get()
129 * struct mdio_if_info - Ethernet controller MDIO interface
132 * non-zero unless @prtad = %MDIO_PRTAD_NONE.
133 * @mode_support: MDIO modes supported. If %MDIO_SUPPORTS_C22 is set then
154 #define MDIO_PRTAD_NONE (-1)
155 #define MDIO_DEVAD_NONE (-1)
162 extern int mdio45_probe(struct mdio_if_info *mdio, int prtad);
163 extern int mdio_set_flag(const struct mdio_if_info *mdio,
166 extern int mdio45_links_ok(const struct mdio_if_info *mdio, u32 mmds);
167 extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
168 extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
172 mdio45_ethtool_ksettings_get_npage(const struct mdio_if_info *mdio,
177 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET
178 * @mdio: MDIO interface
181 * Since the CSRs for auto-negotiation using next pages are not fully
186 static inline void mdio45_ethtool_gset(const struct mdio_if_info *mdio, in mdio45_ethtool_gset() argument
189 mdio45_ethtool_gset_npage(mdio, ecmd, 0, 0); in mdio45_ethtool_gset()
193 * mdio45_ethtool_ksettings_get - get settings for ETHTOOL_GLINKSETTINGS
194 * @mdio: MDIO interface
197 * Since the CSRs for auto-negotiation using next pages are not fully
203 mdio45_ethtool_ksettings_get(const struct mdio_if_info *mdio, in mdio45_ethtool_ksettings_get() argument
206 mdio45_ethtool_ksettings_get_npage(mdio, cmd, 0, 0); in mdio45_ethtool_ksettings_get()
209 extern int mdio_mii_ioctl(const struct mdio_if_info *mdio,
301 * 10GBASE-T AN CONTROL (7.32) register.
323 * @lpa: value of the C45 10GBASE-T AN STATUS register
325 * A small helper function that translates C45 10GBASE-T AN STATUS register bits
342 * @lpa: value of the BASE-T1 Autonegotiation Advertisement [15:0] Register
344 * A small helper function that translates BASE-T1 Autonegotiation
359 * @lpa: value of the BASE-T1 Autonegotiation Advertisement [31:16] Register
361 * A small helper function that translates BASE-T1 Autonegotiation
381 * BASE-T1 Autonegotiation Advertisement [15:0] Register.
401 * BASE-T1 Autonegotiation Advertisement [31:16] Register.
423 * IEEE 802.3-2018 45.2.3.10 "EEE control and capability 1" register (3.20)
424 * IEEE 802.3-2018 45.2.7.13 "EEE advertisement 1" register (7.60)
425 * IEEE 802.3-2018 45.2.7.14 "EEE link partner ability 1" register (7.61)
449 * IEEE 802.3-2022 45.2.3.11 "EEE control and capability 2" register (3.21)
465 * IEEE 802.3-2022 45.2.7.16 "EEE advertisement 2" register (7.62)
466 * IEEE 802.3-2022 45.2.7.17 "EEE link partner ability 2" register (7.63)
483 * A function that translates linkmode to value for IEEE 802.3-2018 45.2.7.13
510 * A function that translates linkmode to value for IEEE 802.3-2022 45.2.7.16
530 * A function that translates IEEE 802.3cg-2019 45.2.7.26 "10BASE-T1 AN status"
543 * A function that translates the linkmode to IEEE 802.3cg-2019 45.2.7.25
544 * "10BASE-T1 AN control" register (7.526) value.
557 * mii_c73_mod_linkmode - convert a Clause 73 advertisement to linkmodes
595 int __mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
596 int __mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
597 int __mdiobus_modify(struct mii_bus *bus, int addr, u32 regnum, u16 mask,
599 int __mdiobus_modify_changed(struct mii_bus *bus, int addr, u32 regnum,
602 int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum);
603 int mdiobus_read_nested(struct mii_bus *bus, int addr, u32 regnum);
604 int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
605 int mdiobus_write_nested(struct mii_bus *bus, int addr, u32 regnum, u16 val);
606 int mdiobus_modify(struct mii_bus *bus, int addr, u32 regnum, u16 mask,
608 int mdiobus_modify_changed(struct mii_bus *bus, int addr, u32 regnum,
610 int __mdiobus_c45_read(struct mii_bus *bus, int addr, int devad, u32 regnum);
611 int mdiobus_c45_read(struct mii_bus *bus, int addr, int devad, u32 regnum);
612 int mdiobus_c45_read_nested(struct mii_bus *bus, int addr, int devad,
614 int __mdiobus_c45_write(struct mii_bus *bus, int addr, int devad, u32 regnum,
616 int mdiobus_c45_write(struct mii_bus *bus, int addr, int devad, u32 regnum,
618 int mdiobus_c45_write_nested(struct mii_bus *bus, int addr, int devad,
620 int mdiobus_c45_modify(struct mii_bus *bus, int addr, int devad, u32 regnum,
623 int mdiobus_c45_modify_changed(struct mii_bus *bus, int addr, int devad,
628 return __mdiobus_read(mdiodev->bus, mdiodev->addr, regnum); in __mdiodev_read()
634 return __mdiobus_write(mdiodev->bus, mdiodev->addr, regnum, val); in __mdiodev_write()
640 return __mdiobus_modify(mdiodev->bus, mdiodev->addr, regnum, mask, set); in __mdiodev_modify()
646 return __mdiobus_modify_changed(mdiodev->bus, mdiodev->addr, regnum, in __mdiodev_modify_changed()
652 return mdiobus_read(mdiodev->bus, mdiodev->addr, regnum); in mdiodev_read()
658 return mdiobus_write(mdiodev->bus, mdiodev->addr, regnum, val); in mdiodev_write()
664 return mdiobus_modify(mdiodev->bus, mdiodev->addr, regnum, mask, set); in mdiodev_modify()
670 return mdiobus_modify_changed(mdiodev->bus, mdiodev->addr, regnum, in mdiodev_modify_changed()
677 return mdiobus_c45_modify(mdiodev->bus, mdiodev->addr, devad, regnum, in mdiodev_c45_modify()
685 return mdiobus_c45_modify_changed(mdiodev->bus, mdiodev->addr, devad, in mdiodev_c45_modify_changed()
692 return mdiobus_c45_read(mdiodev->bus, mdiodev->addr, devad, regnum); in mdiodev_c45_read()
698 return mdiobus_c45_write(mdiodev->bus, mdiodev->addr, devad, regnum, in mdiodev_c45_write()
704 bool mdiobus_is_registered_device(struct mii_bus *bus, int addr);
705 struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr);
708 * mdio_module_driver() - Helper macro for registering mdio drivers
711 * Helper macro for MDIO drivers which do not do anything special in module