Changeset 85698 in vbox for trunk/src/VBox/HostDrivers/VBoxNetAdp/linux
- Timestamp:
- Aug 11, 2020 5:05:29 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139838
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetAdp/linux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
r82968 r85698 76 76 static int VBoxNetAdpLinuxOpen(struct inode *pInode, struct file *pFilp); 77 77 static int VBoxNetAdpLinuxClose(struct inode *pInode, struct file *pFilp); 78 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,36)78 #if RTLNX_VER_MAX(2,6,36) 79 79 static int VBoxNetAdpLinuxIOCtl(struct inode *pInode, struct file *pFilp, 80 80 unsigned int uCmd, unsigned long ulArg); 81 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)*/81 #else /* >= 2,6,36 */ 82 82 static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp, 83 83 unsigned int uCmd, unsigned long ulArg); 84 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)*/84 #endif /* >= 2,6,36 */ 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)87 #if RTLNX_VER_MIN(4,20,0) 88 88 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings); 89 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)*/89 #else /* < 4,20,0 */ 90 90 static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd); 91 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)*/91 #endif /* < 4,20,0 */ 92 92 93 93 … … 113 113 open: VBoxNetAdpLinuxOpen, 114 114 release: VBoxNetAdpLinuxClose, 115 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,36)115 #if RTLNX_VER_MAX(2,6,36) 116 116 ioctl: VBoxNetAdpLinuxIOCtl, 117 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,36) */117 #else /* RTLNX_VER_MIN(2,6,36) */ 118 118 unlocked_ioctl: VBoxNetAdpLinuxIOCtlUnlocked, 119 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,36) */119 #endif /* RTLNX_VER_MIN(2,6,36) */ 120 120 }; 121 121 … … 126 126 name: VBOXNETADP_CTL_DEV_NAME, 127 127 fops: &gFileOpsVBoxNetAdp, 128 # if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17)128 # if RTLNX_VER_MAX(2,6,18) 129 129 devfs_name: VBOXNETADP_CTL_DEV_NAME 130 130 # endif 131 131 }; 132 132 133 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,19)133 # if RTLNX_VER_MIN(2,6,19) 134 134 static const struct ethtool_ops gEthToolOpsVBoxNetAdp = 135 135 # else … … 138 138 { 139 139 .get_drvinfo = vboxNetAdpEthGetDrvinfo, 140 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20,0)140 # if RTLNX_VER_MIN(4,20,0) 141 141 .get_link_ksettings = vboxNetAdpEthGetLinkSettings, 142 # else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */142 # else 143 143 .get_settings = vboxNetAdpEthGetSettings, 144 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) */144 # endif 145 145 .get_link = ethtool_op_get_link, 146 146 }; … … 174 174 pPriv->Stats.tx_packets++; 175 175 pPriv->Stats.tx_bytes += pSkb->len; 176 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,31)176 #if RTLNX_VER_MAX(2,6,31) 177 177 /* Update transmission time stamp. */ 178 178 pNetDev->trans_start = jiffies; … … 214 214 215 215 216 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20,0)216 # if RTLNX_VER_MIN(4,20,0) 217 217 /* ethtool_ops::get_link_ksettings */ 218 218 static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *pLinkSettings) … … 230 230 return 0; 231 231 } 232 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20,0) */232 #else /* RTLNX_VER_MAX(4,20,0) */ 233 233 /* ethtool_ops::get_settings */ 234 234 static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd) … … 236 236 cmd->supported = 0; 237 237 cmd->advertising = 0; 238 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27)238 #if RTLNX_VER_MIN(2,6,27) 239 239 ethtool_cmd_speed_set(cmd, SPEED_10); 240 240 #else … … 250 250 return 0; 251 251 } 252 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 20,0) */253 254 255 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29)252 #endif /* RTLNX_VER_MAX(4,20,0) */ 253 254 255 #if RTLNX_VER_MIN(2,6,29) 256 256 static const struct net_device_ops vboxNetAdpNetdevOps = { 257 257 .ndo_open = vboxNetAdpLinuxOpen, … … 267 267 268 268 ether_setup(pNetDev); 269 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29)269 #if RTLNX_VER_MIN(2,6,29) 270 270 pNetDev->netdev_ops = &vboxNetAdpNetdevOps; 271 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29) */271 #else /* RTLNX_VER_MAX(2,6,29) */ 272 272 pNetDev->open = vboxNetAdpLinuxOpen; 273 273 pNetDev->stop = vboxNetAdpLinuxStop; 274 274 pNetDev->hard_start_xmit = vboxNetAdpLinuxXmit; 275 275 pNetDev->get_stats = vboxNetAdpLinuxGetStats; 276 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29) */276 #endif /* RTLNX_VER_MAX(2,6,29) */ 277 277 278 278 pNetDev->ethtool_ops = &gEthToolOpsVBoxNetAdp; … … 291 291 pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), 292 292 pThis->szName[0] ? pThis->szName : VBOXNETADP_LINUX_NAME, 293 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17,0)293 #if RTLNX_VER_MIN(3,17,0) 294 294 NET_NAME_UNKNOWN, 295 295 #endif … … 391 391 * @param ulArg The argument specified to ioctl(). 392 392 */ 393 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,36)393 #if RTLNX_VER_MAX(2,6,36) 394 394 static int VBoxNetAdpLinuxIOCtl(struct inode *pInode, struct file *pFilp, 395 395 unsigned int uCmd, unsigned long ulArg) 396 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,36) */396 #else /* RTLNX_VER_MIN(2,6,36) */ 397 397 static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp, 398 398 unsigned int uCmd, unsigned long ulArg) 399 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,36) */399 #endif /* RTLNX_VER_MIN(2,6,36) */ 400 400 { 401 401 VBOXNETADPREQ Req; -
trunk/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp
r82968 r85698 66 66 ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ 67 67 ${PATH_ROOT}/include/iprt/x86.h=>include/iprt/x86.h \ 68 ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \ 68 69 ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ 69 70 ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Note:
See TracChangeset
for help on using the changeset viewer.