|
Lines 50-59
Link Here
|
| 50 |
#define VBOXNETADP_LINUX_NAME "vboxnet%d" |
50 |
#define VBOXNETADP_LINUX_NAME "vboxnet%d" |
| 51 |
#define VBOXNETADP_CTL_DEV_NAME "vboxnetctl" |
51 |
#define VBOXNETADP_CTL_DEV_NAME "vboxnetctl" |
| 52 |
|
52 |
|
| 53 |
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface)) |
53 |
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface)) |
| 54 |
|
54 |
|
|
|
55 |
/******************************* |
| 56 |
source for the 4th parameter alloc_netdev fix for kernel 3.17-rc1 is: |
| 57 |
https://github.com/proski/madwifi/commit/c5246021b7b8580c2aeb0a145903acc07d246ac1 |
| 58 |
*/ |
| 59 |
#ifndef NET_NAME_UNKNOWN |
| 60 |
#undef alloc_netdev |
| 61 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) |
| 62 |
#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ |
| 63 |
alloc_netdev(sizeof_priv, name, setup) |
| 64 |
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) |
| 65 |
#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ |
| 66 |
alloc_netdev_mq(sizeof_priv, name, setup, 1) |
| 67 |
#else |
| 68 |
#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \ |
| 69 |
alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1) |
| 70 |
#endif |
| 71 |
#endif |
| 72 |
/*******************************/ |
| 73 |
|
| 55 |
/******************************************************************************* |
74 |
/******************************************************************************* |
| 56 |
* Internal Functions * |
75 |
* Internal Functions * |
| 57 |
*******************************************************************************/ |
76 |
*******************************************************************************/ |
| 58 |
static int VBoxNetAdpLinuxInit(void); |
77 |
static int VBoxNetAdpLinuxInit(void); |
| 59 |
static void VBoxNetAdpLinuxUnload(void); |
78 |
static void VBoxNetAdpLinuxUnload(void); |
|
Lines 181-190
int vboxNetAdpOsCreate(PVBOXNETADP pThis
Link Here
|
| 181 |
struct net_device *pNetDev; |
200 |
struct net_device *pNetDev; |
| 182 |
|
201 |
|
| 183 |
/* No need for private data. */ |
202 |
/* No need for private data. */ |
| 184 |
pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), |
203 |
pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), |
| 185 |
pThis->szName[0] ? pThis->szName : VBOXNETADP_LINUX_NAME, |
204 |
pThis->szName[0] ? pThis->szName : VBOXNETADP_LINUX_NAME, |
|
|
205 |
NET_NAME_UNKNOWN, |
| 186 |
vboxNetAdpNetDevInit); |
206 |
vboxNetAdpNetDevInit); |
| 187 |
if (pNetDev) |
207 |
if (pNetDev) |
| 188 |
{ |
208 |
{ |
| 189 |
int err; |
209 |
int err; |
| 190 |
|
210 |
|