Changeset 75684 in vbox
- Timestamp:
- Nov 23, 2018 11:17:22 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
r75599 r75684 85 85 86 86 static void vboxNetAdpEthGetDrvinfo(struct net_device *dev, struct ethtool_drvinfo *info); 87 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) 88 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings); 89 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 87 90 static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd); 91 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 88 92 89 93 … … 134 138 { 135 139 .get_drvinfo = vboxNetAdpEthGetDrvinfo, 140 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) 141 .get_link_ksettings = vboxNetAdpEthGetLinkSettings, 142 # else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 136 143 .get_settings = vboxNetAdpEthGetSettings, 144 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 137 145 .get_link = ethtool_op_get_link, 138 146 }; … … 206 214 207 215 216 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) 217 /* ethtool_ops::get_link_ksettings */ 218 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings) 219 { 220 /* We just need to set field we care for, the rest is done by ethtool_get_link_ksettings() helper in ethtool. */ 221 ethtool_link_ksettings_zero_link_mode(pLinkSettings, supported); 222 ethtool_link_ksettings_zero_link_mode(pLinkSettings, advertising); 223 ethtool_link_ksettings_zero_link_mode(pLinkSettings, lp_advertising); 224 pLinkSettings->base.speed = SPEED_10; 225 pLinkSettings->base.duplex = DUPLEX_FULL; 226 pLinkSettings->base.port = PORT_TP; 227 pLinkSettings->base.phy_address = 0; 228 pLinkSettings->base.transceiver = XCVR_INTERNAL; 229 pLinkSettings->base.autoneg = AUTONEG_DISABLE; 230 return 0; 231 } 232 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 208 233 /* ethtool_ops::get_settings */ 209 234 static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd) … … 225 250 return 0; 226 251 } 252 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */ 227 253 228 254
Note:
See TracChangeset
for help on using the changeset viewer.