Changeset 18706 in vbox for trunk/src/VBox
- Timestamp:
- Apr 3, 2009 5:25:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r18541 r18706 159 159 160 160 /* 161 * TAP-related part162 */ 163 164 #define VBOX_ TAP_NAME "vboxnet%d"161 * NetAdp-related part 162 */ 163 164 #define VBOX_NETADP_NAME "vboxnet%d" 165 165 166 166 struct net_device *g_pNetDev; 167 167 168 struct VBox TapPriv168 struct VBoxNetAdpPriv 169 169 { 170 170 struct net_device_stats Stats; 171 171 }; 172 typedef struct VBox TapPriv VBOXTAPPRIV;173 typedef VBOX TAPPRIV *PVBOXTAPPRIV;174 175 static int vbox TapOpen(struct net_device *pNetDev)172 typedef struct VBoxNetAdpPriv VBOXNETADPPRIV; 173 typedef VBOXNETADPPRIV *PVBOXNETADPPRIV; 174 175 static int vboxNetAdpOpen(struct net_device *pNetDev) 176 176 { 177 177 netif_start_queue(pNetDev); 178 printk("vbox TapOpen returns 0\n");178 printk("vboxNetAdpOpen returns 0\n"); 179 179 return 0; 180 180 } 181 181 182 static int vbox TapStop(struct net_device *pNetDev)182 static int vboxNetAdpStop(struct net_device *pNetDev) 183 183 { 184 184 netif_stop_queue(pNetDev); … … 186 186 } 187 187 188 static int vbox TapXmit(struct sk_buff *pSkb, struct net_device *pNetDev)189 { 190 PVBOX TAPPRIV pPriv = netdev_priv(pNetDev);188 static int vboxNetAdpXmit(struct sk_buff *pSkb, struct net_device *pNetDev) 189 { 190 PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev); 191 191 192 192 /* Update the stats. */ … … 200 200 } 201 201 202 struct net_device_stats *vbox TapGetStats(struct net_device *pNetDev)203 { 204 PVBOX TAPPRIV pPriv = netdev_priv(pNetDev);202 struct net_device_stats *vboxNetAdpGetStats(struct net_device *pNetDev) 203 { 204 PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev); 205 205 return &pPriv->Stats; 206 206 } 207 207 208 /* Currently not referenced in vbox TapNetDevInit209 static int vbox TapValidateAddr(struct net_device *dev)210 { 211 Log(("vbox TapValidateAddr: %02x:%02x:%02x:%02x:%02x:%02x\n",208 /* Currently not referenced in vboxNetAdpNetDevInit 209 static int vboxNetAdpValidateAddr(struct net_device *dev) 210 { 211 Log(("vboxNetAdpValidateAddr: %02x:%02x:%02x:%02x:%02x:%02x\n", 212 212 dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], 213 213 dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5])); … … 215 215 } */ 216 216 217 static void vbox TapNetDevInit(struct net_device *pNetDev)218 { 219 PVBOX TAPPRIV pPriv;217 static void vboxNetAdpNetDevInit(struct net_device *pNetDev) 218 { 219 PVBOXNETADPPRIV pPriv; 220 220 221 221 ether_setup(pNetDev); 222 222 /// @todo Use Sun vendor id 223 223 memcpy(pNetDev->dev_addr, "\0vbnet", ETH_ALEN); 224 Log(("vbox TapNetDevInit: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr));225 pNetDev->open = vbox TapOpen;226 pNetDev->stop = vbox TapStop;227 pNetDev->hard_start_xmit = vbox TapXmit;228 pNetDev->get_stats = vbox TapGetStats;229 //pNetDev->validate_addr = vbox TapValidateAddr;230 /* pNetDev-> = vbox Tap;231 pNetDev-> = vbox Tap;232 pNetDev-> = vbox Tap;233 pNetDev-> = vbox Tap;234 pNetDev-> = vbox Tap;*/224 Log(("vboxNetAdpNetDevInit: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr)); 225 pNetDev->open = vboxNetAdpOpen; 226 pNetDev->stop = vboxNetAdpStop; 227 pNetDev->hard_start_xmit = vboxNetAdpXmit; 228 pNetDev->get_stats = vboxNetAdpGetStats; 229 //pNetDev->validate_addr = vboxNetAdpValidateAddr; 230 /* pNetDev-> = vboxNetAdp; 231 pNetDev-> = vboxNetAdp; 232 pNetDev-> = vboxNetAdp; 233 pNetDev-> = vboxNetAdp; 234 pNetDev-> = vboxNetAdp;*/ 235 235 236 236 pPriv = netdev_priv(pNetDev); … … 238 238 } 239 239 240 static int vbox TapRegisterNetDev(void)240 static int vboxNetAdpRegisterNetDev(void) 241 241 { 242 242 int rc = VINF_SUCCESS; … … 244 244 245 245 /* No need for private data. */ 246 pNetDev = alloc_netdev(sizeof(VBOX TAPPRIV), VBOX_TAP_NAME, vboxTapNetDevInit);246 pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), VBOX_NETADP_NAME, vboxNetAdpNetDevInit); 247 247 if (pNetDev) 248 248 { … … 259 259 } 260 260 261 static int vbox TapUnregisterNetDev(void)261 static int vboxNetAdpUnregisterNetDev(void) 262 262 { 263 263 unregister_netdev(g_pNetDev); … … 301 301 if (RT_SUCCESS(rc)) 302 302 { 303 rc = vbox TapRegisterNetDev();303 rc = vboxNetAdpRegisterNetDev(); 304 304 if (RT_SUCCESS(rc)) 305 305 { … … 336 336 * Undo the work done during start (in reverse order). 337 337 */ 338 rc = vbox TapUnregisterNetDev();338 rc = vboxNetAdpUnregisterNetDev(); 339 339 AssertRC(rc); 340 340 rc = vboxNetFltTryDeleteIdcAndGlobals(&g_VBoxNetFltGlobals);
Note:
See TracChangeset
for help on using the changeset viewer.