Changeset 58220 in vbox for trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
- Timestamp:
- Oct 13, 2015 4:27:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
r58207 r58220 23 23 #include "version-generated.h" 24 24 #include "product-generated.h" 25 #include <linux/ethtool.h> 25 26 #include <linux/netdevice.h> 26 27 #include <linux/etherdevice.h> … … 33 34 #include <iprt/initterm.h> 34 35 #include <iprt/mem.h> 36 #include <iprt/string.h> 35 37 36 38 /* … … 72 74 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */ 73 75 76 static void vboxNetAdpEthGetDrvinfo(struct net_device *dev, struct ethtool_drvinfo *info); 77 static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd); 78 74 79 75 80 /********************************************************************************************************************************* … … 112 117 }; 113 118 119 static const struct ethtool_ops gEthToolOpsVBoxNetAdp = 120 { 121 .get_drvinfo = vboxNetAdpEthGetDrvinfo, 122 .get_settings = vboxNetAdpEthGetSettings, 123 .get_link = ethtool_op_get_link, 124 }; 125 126 114 127 struct VBoxNetAdpPriv 115 128 { … … 151 164 return &pPriv->Stats; 152 165 } 166 167 168 /* ethtool_ops::get_drvinfo */ 169 static void vboxNetAdpEthGetDrvinfo(struct net_device *pNetDev, struct ethtool_drvinfo *info) 170 { 171 PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev); 172 173 RTStrPrintf(info->driver, sizeof(info->driver), 174 "%s", VBOXNETADP_NAME); 175 176 /* 177 * Would be nice to include VBOX_SVN_REV, but it's not available 178 * here. Use file's svn revision via svn keyword? 179 */ 180 RTStrPrintf(info->version, sizeof(info->version), 181 "%s", VBOX_VERSION_STRING); 182 183 RTStrPrintf(info->fw_version, sizeof(info->fw_version), 184 "0x%08X", INTNETTRUNKIFPORT_VERSION); 185 186 RTStrPrintf(info->bus_info, sizeof(info->driver), 187 "N/A"); 188 } 189 190 191 /* ethtool_ops::get_settings */ 192 static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd) 193 { 194 cmd->supported = 0; 195 cmd->advertising = 0; 196 ethtool_cmd_speed_set(cmd, SPEED_10); 197 cmd->duplex = DUPLEX_FULL; 198 cmd->port = PORT_TP; 199 cmd->phy_address = 0; 200 cmd->transceiver = XCVR_INTERNAL; 201 cmd->autoneg = AUTONEG_DISABLE; 202 cmd->maxtxpkt = 0; 203 cmd->maxrxpkt = 0; 204 return 0; 205 } 206 153 207 154 208 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) … … 174 228 pNetDev->get_stats = vboxNetAdpLinuxGetStats; 175 229 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */ 230 231 pNetDev->ethtool_ops = &gEthToolOpsVBoxNetAdp; 176 232 177 233 pPriv = netdev_priv(pNetDev);
Note:
See TracChangeset
for help on using the changeset viewer.