~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/um/drivers/vde_kern.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/um/drivers/vde_kern.c (Architecture alpha) and /arch/mips/drivers/vde_kern.c (Architecture mips)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * Copyright (C) 2007 Luca Bigliardi (shammash    
  4  *                                                
  5  * Transport usage:                               
  6  *  ethN=vde,<vde_switch>,<mac addr>,<port>,<g    
  7  *                                                
  8  */                                               
  9                                                   
 10 #include <linux/init.h>                           
 11 #include <linux/netdevice.h>                      
 12 #include <net_kern.h>                             
 13 #include <net_user.h>                             
 14 #include "vde.h"                                  
 15                                                   
 16 static void vde_init(struct net_device *dev, v    
 17 {                                                 
 18         struct vde_init *init = data;             
 19         struct uml_net_private *pri;              
 20         struct vde_data *vpri;                    
 21                                                   
 22         pri = netdev_priv(dev);                   
 23         vpri = (struct vde_data *) pri->user;     
 24                                                   
 25         vpri->vde_switch = init->vde_switch;      
 26         vpri->descr = init->descr ? init->desc    
 27         vpri->args = NULL;                        
 28         vpri->conn = NULL;                        
 29         vpri->dev = dev;                          
 30                                                   
 31         printk("vde backend - %s, ", vpri->vde    
 32                vpri->vde_switch : "(default so    
 33                                                   
 34         vde_init_libstuff(vpri, init);            
 35                                                   
 36         printk("\n");                             
 37 }                                                 
 38                                                   
 39 static int vde_read(int fd, struct sk_buff *sk    
 40 {                                                 
 41         struct vde_data *pri = (struct vde_dat    
 42                                                   
 43         if (pri->conn != NULL)                    
 44                 return vde_user_read(pri->conn    
 45                                      skb->dev-    
 46                                                   
 47         printk(KERN_ERR "vde_read - we have no    
 48         return -EBADF;                            
 49 }                                                 
 50                                                   
 51 static int vde_write(int fd, struct sk_buff *s    
 52 {                                                 
 53         struct vde_data *pri = (struct vde_dat    
 54                                                   
 55         if (pri->conn != NULL)                    
 56                 return vde_user_write((void *)    
 57                                       skb->len    
 58                                                   
 59         printk(KERN_ERR "vde_write - we have n    
 60         return -EBADF;                            
 61 }                                                 
 62                                                   
 63 static const struct net_kern_info vde_kern_inf    
 64         .init                   = vde_init,       
 65         .protocol               = eth_protocol    
 66         .read                   = vde_read,       
 67         .write                  = vde_write,      
 68 };                                                
 69                                                   
 70 static int vde_setup(char *str, char **mac_out    
 71 {                                                 
 72         struct vde_init *init = data;             
 73         char *remain, *port_str = NULL, *mode_    
 74                                                   
 75         *init = ((struct vde_init)                
 76                 { .vde_switch           = NULL    
 77                   .descr                = NULL    
 78                   .port                 = 0,      
 79                   .group                = NULL    
 80                   .mode                 = 0 })    
 81                                                   
 82         remain = split_if_spec(str, &init->vde    
 83                                 &init->group,     
 84                                                   
 85         if (remain != NULL)                       
 86                 printk(KERN_WARNING "vde_setup    
 87                        "'%s'\n", remain);         
 88                                                   
 89         if (port_str != NULL) {                   
 90                 init->port = simple_strtoul(po    
 91                 if ((*last != '\0') || (last =    
 92                         printk(KERN_ERR "vde_s    
 93                                                   
 94                         return 0;                 
 95                 }                                 
 96         }                                         
 97                                                   
 98         if (mode_str != NULL) {                   
 99                 init->mode = simple_strtoul(mo    
100                 if ((*last != '\0') || (last =    
101                         printk(KERN_ERR "vde_s    
102                                                   
103                         return 0;                 
104                 }                                 
105         }                                         
106                                                   
107         printk(KERN_INFO "Configured vde devic    
108                init->vde_switch : "(default so    
109                                                   
110         return 1;                                 
111 }                                                 
112                                                   
113 static struct transport vde_transport = {         
114         .list           = LIST_HEAD_INIT(vde_t    
115         .name           = "vde",                  
116         .setup          = vde_setup,              
117         .user           = &vde_user_info,         
118         .kern           = &vde_kern_info,         
119         .private_size   = sizeof(struct vde_da    
120         .setup_size     = sizeof(struct vde_in    
121 };                                                
122                                                   
123 static int register_vde(void)                     
124 {                                                 
125         register_transport(&vde_transport);       
126         return 0;                                 
127 }                                                 
128                                                   
129 late_initcall(register_vde);                      
130                                                   

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php