(for reference).
aboutsummaryrefslogblamecommitdiffstats
path: root/drivers/net/iseries_veth.c
blob: 41b1d08fd57b02a066686aaa8973b7e75fef6fb5 (plain) (tree)
1
2
3
4
5
6
7





                                                                      
                                                             


















































                                                                      
                         










                              
                           

                         
                           

                        
                                     
                                 
                                    


                      

            



                                                      



                                   



                                    
                         





                                                            
                             


                                         
                      









                          
                     

                                    


                                                            



            


                                      



























                                                            
                                     
                  
                   








                                           
                                        
 
                               

                                    




                                      



                                
                                                     



                                                
                                         

                        








                                        


                                                                  
 
                                                                      

                            

                                       

                               







                                                                               

                                                               
                                                                               
                                                             

                                                
 



                    
                                 
                                                    

                                  
                                                          


                                  
                                                     


                                                
 
                                                                      


                                                                    

                                        

 
                                                                      

                                                                               

                             


                                                                
 


                   





                                                                       










































                                                                              
                                                                






                                                            









































































                                                                             























































                                                                         
  








                                                                           
                                                     










                                                                             
                                                                            











                                                                        
                                                         




                                                
                                                                                










                                                                   
                                                             



                                             
                                                                 







                                                                         


                                                  
                                                       






                                                         
                            

                                              
                                


                                                  

                                                                 


          
                                                       



                                                         
                         



                                             
                            

                                          
                                


                                                                      
                                   
                                                     
 


                                                                       
                                                       
                                                                          


                                                      
                 
 
                                
                                                    

                                              
 
                                                          
                      
                               


                                         

                                                                       




                                                                            
                                                                       
 
                                    
                                            
            




                                                              
                                                              








                                                                    

                                                                                















                                                                                

                                                                          



















                                                                            



                                                                                




                                                                       








                                                                             

                                

                                                                     
                 
 
                                        
                                      


                                                                       
                                            

                                                

                                                  
                                          
 

                                                  





                                                                             





















                                                                                     
                                                              








                                                                    

                                                                               










                                                                    
                                                          









                                                                         


                                                                            







                                                                    
                                                                      





























                                                                             

                                                                                











                                                                     

                                                                                







                                          
                  












                                                                         
 


                                                  





                                                                  



                                                                     







                                                                          

                                                                              
                                                                         




                                                                   








                                                                         
                                                                               









                                                      
                                                                  
 
                 






                                                             








                                                                       
                                                
                               

 
                                                                     
 
                 
                       
 









                                                                

                         
                                        
                   







                                                                       










































                                                                      

                                                                        
                                      



                                                       

                                      




















                                                                                  
                                                                  
                                                      

                                                                       























                                                                              
                                       




                                          

                                                          


                               
                                            
                  








                                                                              








                                                                         
                                          
                                       
                              











                                                               
                                                  


                                
                                                    









                                                          



                                  
                                                                                



                                 






                                                                               

                                                                         













                                                                   
                                    

                            
                  
                         


                                             
                                              
                              
 
                                                 


                                  
                  
                          
 
                        
                                
 

                                                                
 
                                                 

                                      
                             
                                    
                                                
 
                                                                             



                                      






                                                                           


                                      
          



                                                  

                                   
                                                  
                 

 
                                                      



                                                                 


                              




                                                   



                                                      

         



                                        


                                                 





                                                                       















                                                        
                                                
 
                           



                 
                                                                      




                                                              

                                


                                                


                                                                           







                                                         



                                                                          

 
                                                              

              
 












                                                             







                                                                         
                 





























                                                                              


         






























                                                                               












                                                                               

                                                    
                                


































                                                                              
                                          




                                                                        
                                                         









                                                             
                                                        


                                                    

                                                                          





                                                                    
                                                    
 
                                                                  

























                                                                             



                                                                           

















                                                                               


                                                                          















                                                                            

                                                                          







                                                    









                                                                              
                                 
                 





















































                                                                               
                                         
                               

                               
 













                                                                           
         

                                            

                                    


                               






                                                                           
                               
 
                                      





                                  
















                                                                            








                                                                 
                                           
                  



                                            

                                      


                                 
                                     
         








                                     
                                         
 
                                                                             

                                                               
                                                                              

                               




                                                   
 

                                                      


                                                                   
 


                                                                           











                                                   

                                   




                                                            



                                               












                                                                           



                                                   
                                                     


                  

                              
/* File veth.c created by Kyle A. Lucke on Mon Aug  7 2000. */
/*
 * IBM eServer iSeries Virtual Ethernet Device Driver
 * Copyright (C) 2001 Kyle A. Lucke (klucke@us.ibm.com), IBM Corp.
 * Substantially cleaned up by:
 * Copyright (C) 2003 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
 * Copyright (C) 2004-2005 Michael Ellerman, IBM Corporation.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 * USA
 *
 *
 * This module implements the virtual ethernet device for iSeries LPAR
 * Linux.  It uses hypervisor message passing to implement an
 * ethernet-like network device communicating between partitions on
 * the iSeries.
 *
 * The iSeries LPAR hypervisor currently allows for up to 16 different
 * virtual ethernets.  These are all dynamically configurable on
 * OS/400 partitions, but dynamic configuration is not supported under
 * Linux yet.  An ethXX network device will be created for each
 * virtual ethernet this partition is connected to.
 *
 * - This driver is responsible for routing packets to and from other
 *   partitions.  The MAC addresses used by the virtual ethernets
 *   contains meaning and must not be modified.
 *
 * - Having 2 virtual ethernets to the same remote partition DOES NOT
 *   double the available bandwidth.  The 2 devices will share the
 *   available hypervisor bandwidth.
 *
 * - If you send a packet to your own mac address, it will just be
 *   dropped, you won't get it on the receive side.
 *
 * - Multicast is implemented by sending the frame frame to every
 *   other partition.  It is the responsibility of the receiving
 *   partition to filter the addresses desired.
 *
 * Tunable parameters:
 *
 * VETH_NUMBUFFERS: This compile time option defaults to 120.  It
 * controls how much memory Linux will allocate per remote partition
 * it is communicating with.  It can be thought of as the maximum
 * number of packets outstanding to a remote partition at a time.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/ethtool.h>
#include <linux/if_ether.h>

#include <asm/abs_addr.h>