The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/mdio/mdio_if.m

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # $FreeBSD$
    2 
    3 #include <sys/bus.h>
    4 
    5 INTERFACE mdio;
    6 
    7 CODE {
    8         #include <dev/mdio/mdio.h>
    9 
   10         static int
   11         mdio_null_readextreg(device_t dev, int phy, int devad, int reg)
   12         {
   13                 if (devad == MDIO_DEVADDR_NONE)
   14                         return (MDIO_READREG(dev, phy, reg));
   15                 return (~0U);
   16         }
   17 
   18         static int
   19         mdio_null_writeextreg(device_t dev, int phy, int devad, int reg,
   20             int val)
   21         {
   22                 if (devad == MDIO_DEVADDR_NONE)
   23                         return (MDIO_WRITEREG(dev, phy, reg, val));
   24 
   25                 return (EINVAL);
   26         }
   27 }
   28 
   29 /**
   30  * @brief Read register from device on MDIO bus.
   31  *
   32  * @param dev   MDIO bus device.
   33  * @param phy   PHY address.
   34  * @param reg   The PHY register offset.
   35  */
   36 METHOD int readreg {
   37         device_t                dev;
   38         int                     phy;
   39         int                     reg;
   40 };
   41 
   42 /**
   43  * @brief Read register from device on MDIO muxed bus.
   44  *
   45  * @param dev   MDIO bus device.
   46  * @param bus   MDIO bus mux position
   47  * @param phy   PHY address.
   48  * @param reg   The PHY register offset.
   49  */
   50 METHOD int readreg_mux {
   51         device_t                dev;
   52         int                     bus;
   53         int                     phy;
   54         int                     reg;
   55 };
   56 
   57 /**
   58  * @brief Write register to device on MDIO bus.
   59  *
   60  * @param dev   MDIO bus device.
   61  * @param phy   PHY address.
   62  * @param reg   The PHY register offset.
   63  * @param val   The value to write at offset @p reg.
   64  */
   65 METHOD int writereg {
   66         device_t                dev;
   67         int                     phy;
   68         int                     reg;
   69         int                     val;
   70 };
   71 
   72 /**
   73  * @brief Write register to device on MDIO muxed bus.
   74  *
   75  * @param dev   MDIO bus device.
   76  * @param bus   MDIO bus mux position
   77  * @param phy   PHY address.
   78  * @param reg   The PHY register offset.
   79  * @param val   The value to write at offset @p reg.
   80  */
   81 METHOD int writereg_mux {
   82         device_t                dev;
   83         int                     bus;
   84         int                     phy;
   85         int                     reg;
   86         int                     val;
   87 };
   88 
   89 
   90 /**
   91  * @brief Read extended register from device on MDIO bus.
   92  *
   93  * @param dev   MDIO bus device.
   94  * @param phy   PHY address.
   95  * @param devad The MDIO IEEE 802.3 Clause 45 device address, or
   96  *              MDIO_DEVADDR_NONE to request Clause 22 register addressing.
   97  * @param reg   The PHY register offset.
   98  */
   99 METHOD int readextreg {
  100         device_t                dev;
  101         int                     phy;
  102         int                     devad;
  103         int                     reg;
  104 } DEFAULT mdio_null_readextreg;
  105 
  106 
  107 /**
  108  * @brief Write extended register to device on MDIO bus.
  109  *
  110  * @param dev   MDIO bus device.
  111  * @param phy   PHY address.
  112  * @param devad The MDIO IEEE 802.3 Clause 45 device address, or
  113  *              MDIO_DEVADDR_NONE to request Clause 22 register addressing.
  114  * @param reg   The PHY register offset.
  115  * @param val   The value to write at offset @p reg.
  116  */
  117 METHOD int writeextreg {
  118         device_t                dev;
  119         int                     phy;
  120         int                     devad;
  121         int                     reg;
  122         int                     val;
  123 } DEFAULT mdio_null_writeextreg;

Cache object: 41b1262e5f70509561ffefa907513d50


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.