~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/phy_link_topology.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/phy_link_topology.h (Architecture ppc) and /include/linux/phy_link_topology.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*                                                  2 /*
  3  * PHY device list allow maintaining a list of      3  * PHY device list allow maintaining a list of PHY devices that are
  4  * part of a netdevice's link topology. PHYs c      4  * part of a netdevice's link topology. PHYs can for example be chained,
  5  * as is the case when using a PHY that expose      5  * as is the case when using a PHY that exposes an SFP module, on which an
  6  * SFP transceiver that embeds a PHY is connec      6  * SFP transceiver that embeds a PHY is connected.
  7  *                                                  7  *
  8  * This list can then be used by userspace to       8  * This list can then be used by userspace to leverage individual PHY
  9  * capabilities.                                    9  * capabilities.
 10  */                                                10  */
 11 #ifndef __PHY_LINK_TOPOLOGY_H                      11 #ifndef __PHY_LINK_TOPOLOGY_H
 12 #define __PHY_LINK_TOPOLOGY_H                      12 #define __PHY_LINK_TOPOLOGY_H
 13                                                    13 
 14 #include <linux/ethtool.h>                         14 #include <linux/ethtool.h>
 15 #include <linux/netdevice.h>                       15 #include <linux/netdevice.h>
 16                                                    16 
 17 struct xarray;                                     17 struct xarray;
 18 struct phy_device;                                 18 struct phy_device;
 19 struct sfp_bus;                                    19 struct sfp_bus;
 20                                                    20 
 21 struct phy_link_topology {                         21 struct phy_link_topology {
 22         struct xarray phys;                        22         struct xarray phys;
 23         u32 next_phy_index;                        23         u32 next_phy_index;
 24 };                                                 24 };
 25                                                    25 
 26 struct phy_device_node {                           26 struct phy_device_node {
 27         enum phy_upstream upstream_type;           27         enum phy_upstream upstream_type;
 28                                                    28 
 29         union {                                    29         union {
 30                 struct net_device       *netde     30                 struct net_device       *netdev;
 31                 struct phy_device       *phyde     31                 struct phy_device       *phydev;
 32         } upstream;                                32         } upstream;
 33                                                    33 
 34         struct sfp_bus *parent_sfp_bus;            34         struct sfp_bus *parent_sfp_bus;
 35                                                    35 
 36         struct phy_device *phy;                    36         struct phy_device *phy;
 37 };                                                 37 };
 38                                                    38 
 39 #if IS_ENABLED(CONFIG_PHYLIB)                      39 #if IS_ENABLED(CONFIG_PHYLIB)
 40 int phy_link_topo_add_phy(struct net_device *d     40 int phy_link_topo_add_phy(struct net_device *dev,
 41                           struct phy_device *p     41                           struct phy_device *phy,
 42                           enum phy_upstream up     42                           enum phy_upstream upt, void *upstream);
 43                                                    43 
 44 void phy_link_topo_del_phy(struct net_device *     44 void phy_link_topo_del_phy(struct net_device *dev, struct phy_device *phy);
 45                                                    45 
 46 static inline struct phy_device *                  46 static inline struct phy_device *
 47 phy_link_topo_get_phy(struct net_device *dev,      47 phy_link_topo_get_phy(struct net_device *dev, u32 phyindex)
 48 {                                                  48 {
 49         struct phy_link_topology *topo = dev->     49         struct phy_link_topology *topo = dev->link_topo;
 50         struct phy_device_node *pdn;               50         struct phy_device_node *pdn;
 51                                                    51 
 52         if (!topo)                                 52         if (!topo)
 53                 return NULL;                       53                 return NULL;
 54                                                    54 
 55         pdn = xa_load(&topo->phys, phyindex);      55         pdn = xa_load(&topo->phys, phyindex);
 56         if (pdn)                                   56         if (pdn)
 57                 return pdn->phy;                   57                 return pdn->phy;
 58                                                    58 
 59         return NULL;                               59         return NULL;
 60 }                                                  60 }
 61                                                    61 
 62 #else                                              62 #else
 63 static inline int phy_link_topo_add_phy(struct     63 static inline int phy_link_topo_add_phy(struct net_device *dev,
 64                                         struct     64                                         struct phy_device *phy,
 65                                         enum p     65                                         enum phy_upstream upt, void *upstream)
 66 {                                                  66 {
 67         return 0;                                  67         return 0;
 68 }                                                  68 }
 69                                                    69 
 70 static inline void phy_link_topo_del_phy(struc     70 static inline void phy_link_topo_del_phy(struct net_device *dev,
 71                                          struc     71                                          struct phy_device *phy)
 72 {                                                  72 {
 73 }                                                  73 }
 74                                                    74 
 75 static inline struct phy_device *                  75 static inline struct phy_device *
 76 phy_link_topo_get_phy(struct net_device *dev,      76 phy_link_topo_get_phy(struct net_device *dev, u32 phyindex)
 77 {                                                  77 {
 78         return NULL;                               78         return NULL;
 79 }                                                  79 }
 80 #endif                                             80 #endif
 81                                                    81 
 82 #endif /* __PHY_LINK_TOPOLOGY_H */                 82 #endif /* __PHY_LINK_TOPOLOGY_H */
 83                                                    83 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php