a name='generator' content='cgit v1.2.2'/>
aboutsummaryrefslogblamecommitdiffstats
path: root/drivers/net/bnx2x_main.c
blob: ad5ef25add3e0dde70a1ab8c7f2d01c5116dd81d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                 
  
                                               




                                                                       

                                                        


                                                
                                                    


   






















                                               
                          


                         
                             

                            
                         

                           

                     
 

                       
                       
 

                                            
                                        
 

                                                               
 
                                     
                                                                

                                                                             
                               
                                                                         

                                   
 

                                 
                                                    
 
                       
                                  
                                                                




                                                                     
                
                           
                                                   




                                                                      
                 
                            


                                                          
 
                                         


                       

                      

  
                                  
               

                                


                                                 

  
 


                                                          



                                                           



















                                                                             










                                                                   


















                                                                            

                                                                        



                                          

                                                                          
 
                                                   
                                             











                                                                               










                                                                 

                                                                           






                                                                   
                                       
 
                                                 





                                                                     
                                                                 

                                                               


                     
                                                   

                  



                                                                
                           
                                                     

                              
                      




                                                     
         

                                      

 
                                                               
 
                                                   
                                             













                                                                               











                                                                 

                                                                           






                                                                   
                                       
 
                                                 





                                                                     


                     
                                                   

                  


                                           
                           
                                                     

                              
                      




                                                     
         
                                                                 

                                                               











                                                                          
 
 










                                                 

                                            
                      















































































































                                                                       

                 
 

                  
 


                                           
                       


                                                         

                                                                          





                                                                             
                                                     





                                                                             
                                                     








                                                     


                                                        

                                                          









                                                                             
                                                       
 
                                                                

                                                                  
                                                            

                                                                            
                                                                   




                                                                             
 



                                                                  
 
                                                                  


                                                                                
                                                             



                                                                            
 



                                                       


                                                                 
                                                             


                                                                     

                                                                          

                 

                                                
                                                              


                                                                          

                                                                             

                 

                                                      
                                                              

                                                               

                                                                        


                 








                                                                     

                                                                     






                                                                 

                                                                                

                 
 
                          

                                                        

 
                                              
 
                               


                                                            
                                                       

                   

                                                          

                                                           




                                                           

                                                         
                                                           

                                                       
 

                                                                     


                                      


                                                          

                                                                       

                              



                                                
                                                                   
                                         

                                                                    





                                                                 

 
                                               
 
                               










                                                             


                                          


                                                                  
 

 
                                                                    
 
                                                         
                      
 
                                        
                                  


                                                            


                                         

                                                          
                                     
                                                                           



                                               

                                          

 
               

  
                            

   
                                                           

                                                                      

                                                            



                                           
                                                                            



                                                                          


                                                           


















                                                                       

                                          


                                                            
 

                                                            
 







                              






                                                               







                                                                     

 








                                                                         
                                                       











                                                                
                                          

                                        
                                        

































                                                                           
                      



                             
                        

 
                                                           
 


                 
 
                                                                    


                              


                                                       
 
                          


                                                              
      
 
                                                  

 
                                                   

                                  
                                 







                                                       
                                                      









                                                              
                                                                              

                                               
                                                      






                                                                            




                                  
                                
                                                    
 
                                                         
 







                                                                              
                                                    
                                                      
                                                              
                                                 
 
                                       


         
 






                                                                    
                        
                                                                      
                                              
                                           


                       
                        














                                                                           


                                                                           
                 
                                                                       

                       
 











                                                                             
                                                                          
                                                                               
                                                                 

                      
 
                                                            
                                                            
                                                           
                                        

                      
                                                                          
                                                                 

                      
                
                                                                        
                                              
                      
         
                                                               

 











                                                                          
                                                                        


























                                                                               
                                                                              
                                                   
                                                                   












                                                        











                                                                          
                                                                      
                                                     
                                                                   




























                                                                            
                                                                           






                                                                 


























                                                                       
                                                                   
                                                                       
                                     



















































                                                                                

                                                                       
















                                                                         
                                                                      































                                                                            





                                                             
                                                            


                                                                  
                                                                   


                                                                               

                                                                              














                                                                             
                                                                              
                                                   





                                                                           
                                                              




                                                                             
                                                                               


























                                                                               
                                                              
 
                              

                                                          






                                                                           



                                                



















                                                                     





                                                                              






                                                                         

                                                                 











                                                                               




                                                  
                                                                         

                                                                      
                                                      









                                                                      
                                                      






                                         









                                                                            

                                                                      
                                                                            

                                              

                                                 
                               

                                                                       

 


                                                              
                                                         







                                                     

                                                                   





                                                                  
                             









                                                                  
                                                  

                                              
                                               

                                      

                                





                                                        
                                                                   
 
                                                                        

                                                                           
                                                                   

                                                            

                                             
                                                       






                                                           


                                                                      




                                                                           
                                                                           




































                                                                               







                                                                            
                                                                          
                                                    

                                                                     
                                                                     













                                                                      
                                                                   
                                                                         
                                                                              















                                                                              
                                                                 





                                                                     
                                                                   
                                                         
                                                                      







                                                                              
                                          

                                                                              
                                    
                                                                      
                         

                 
                                                    
               
                                                                           

                                                                       



                                                                          
                                               
 





                                               

                                                     


                                                          
 
                                     



                                 
                                    


                                        


                                                              










                                                              
                              
 





                                                                             
                                                                      

                                                                      










                                                                     
                                                  
 




                                                               
                                                     
                                       
                 
 
                                                                    



                                                           
                                                                      
 
                                                  




                                                                             




                                   

                                      






                                                                             
                                                      
 
                                

         
 
                                     
                                                              





                                           


                                                                             
 
                           

 
                      
 
                                                                               
 




                            
 
                                                                


                                           

                                
                
 






                                                                         
 






                                                                           
                                                               
                                                      




                                                                         
 

                                          
                                             

                                                                  

                                               
 
                          
         


                                      
 
                                                                


                                           

                                
 







                                                                         






                                                                           
                                                             
                                                      



                                                                         

         
                                                      



                                       
                                                    
 
                                        
 

                                                                 
 
 
                                                    
 

                                                                 
 
                                          
 
 





























                                                                           
                                                                     


                                                                           
                                                                    



                                                                         
 



                                                         
 
                                                         

                                                                           
 







                                                                            
 






                                                                             
 
                                            




                                                                         
 

                      

         
                                            
                                                         
 
                 

 













































                                                                            
                                                                   
 

                                        
 



                                                         

         
                                                         

                                                                           
 
                       
                                            




                                                                            
 
                                             




                                                                             
 




                                                                         
 

                      

         
                                            
                                                         
 


                 
                                               
 

                                                           
                                                      
                                                                 

                                                            
 
                                                      
                                                                

                                                           
 
                                                            
                                                              
                      
 
                
                                                                 



                                                            
 





                                                                           
 
                                                             
 



                                                        
 

                                                                           
                                                     

                                                             






                                                              
 


                                                                            
         

 
                                                                 
 

                            
 
                                                                    


                                                                       
                                                                               
                                             
                                                                             
                    
                                                                               
 
                                           



                                                                         
                                                                      
 
                                           
 

                                      

                                                                    
                                              
                 
 

                          
                                                                     
                       

 
                                            
 
                            
                                           
                                                                 
                                           
 

                                      
                                                                      
 
 

                                               
                            
                                           
                                                                      
                                           
              
                                                                        
 
 


                                           
 
                                   
                                                               
                                   
 

                  
 
                                                    
 


                                                   
 


                                                                                
 

                                                                            
 



                                                                       

                                                                             



                                                             
 

                                                                              
 





                                                                             

 
                                                            














                                                                      
                                                                            
                                                             
                                                             
                                                            




                                                                    


                                                                         










                                                                             
                                

                                                                          


                                                                           
                                           


                                                                           



                                                                    











                                                                            
 


                                                 


                                                                      
                                                            
 

                                    












                                                                         












                                                                    

                                  

                           
                                       
                         
                       




                                                       
                                                  





                                                                             
 




                                                                     
 
                                                             








                                                                               
         
 
 



                                                       
 
                                                                   
 




                                                            

                                  
 
 











                                                         

                                                

 
                 










                                                                              
                               
 

                                                                          








                                                                        
                                    


                                                   
                                              


                              
 























                                                                        
                                                                     

                                 
                                      



                                            
                                              
 
                      
                   











                                                     
                                  
                                                                       





                            

                                               











                                                                  




























                                                                              
                               

                                                     

                                                             

                                                                     
                     
                         
 


                                         


                                                                          
                                                            


                                                    
 

                                                                          
 
                                                            
                                   
                                                           


                                                   
 

                                                   
                                                     
                                                                 
                                                         
 
                                            












































                                                                             


                                                                  

                                   
                                           
                                                        

                                           

 
                                                                         
 
                               


                       

                                                                
 
                                                






                                                   

                                                                            

                                                   
                                                                   
                                                                 

                                                                             
                                                                 
                                                                             
                                              
                                                         
                                                                            
                                                         



                                                                              
                                                                 











                                                                          
 






                                                                 









                                                                 





                                                                         
                                                                 






                                                             
















                                                                        






















                                                                         
















                                                                        



                                                                         

                

                                                  









                                                                             











                                                                    
                                          





                                                                            










                                                                          
                                                                 




                                                                       

                                     
                               
                  

                     
                     


                                                                    
                              




                                                                              

                                                               




                                                                 


                                                                            
 







                                                                         

                                                              




                                                                        
                                                                               


                 
                              
 
                                                                              

                          

                                                                  
                                  
 
                                         
                                         



                                                         






                                                                          
 

                                                                          








                                                            



                                                                               










                                                                     
                                                   










                                                          
                                                                          

                   
 

                                                        
                                                                             



                                          

                                                               
 
                                                                              
 

                           
                                   
 
                                                                               








                                                                          
 








                                                                 
                                                                             


                                   
                                                                      





                                   
                                                      











                                                                             



                                        
                                                         




                                                     

                                         
                                             
                                         
                                                       

                                                                      
                                  
                                                    


                                           

                                            
                                            


                                           
                                                    

                                                     



                           
                             
              





                                                                           

                   
                                 
              



                                                             








                                             
                               
              


                                                          

                   
                                   
              

                                                                               







                                                                               



                                   

                                                                               


















                                                                               





















                                         



                                                               
                          

                                                              
                                                                

                                                                            














                                                                       
              
 
                              












                                                                          

                                                                           





                                                                     











                                                                              
                                                                    












                                                                  

                                 














































                                                                          




                                                                          
                          
















































                                                                         



                                                                     










                                                                              

                                  
                               
                              
                   
                                        
                     






                                                      

                             




                                                           
                   
                                                
     
                                              
      

                                                              
 
                                


                                                              


                                                                             
                                      



                                                                    

         











                                                                             

         
                 







                                                           

                                                              
 
                                                      


























                                                                            
                                                                              
                                                                            
                                                                              





                                                                    
                                                             






















                                                                              
                                                                              
                                                                            
                                                                              











                                                                              
                                                                            
                                                                            
                                                                            







                                                                    

























                                                                        







                                                                 



                                                                        
                              









                                                                        

 
                                                   
 

                                                    
 




                                    
 

                                                     
 

















                                                                           
 

                        
 




























                                                                    
                                                        



                       






                                                                      
                                                                       
                                                               
                                                       



















                                                                              









                                                                          





                                                                    
                                                        































                                                                         

















                                                                             







                                                                  



                       
                          







                                                         
                                                                       

                          
 

                                                               

                                                                       
 


                                                                              
 
                                                   
 



                                                                            
 
                                                                      
 





                                                                          
                 

 
                                                     

                                                               
                                             
                                                                              

                                                                  









                                                               
 
















                                                                               
                                                                            





                                                                              
                                                                            











                                                                              
 

                                                 
                                                                         

                                                 
                                                                         
 
                                                 
                                                                         
                                                 
                                                                         
 

























                                                                          
                                                                          
                                                    

                                                                          






























































                                                                               



                                                               














                                                                       
                                                                         

                                                                      

                                                                      
 

                              


                 
                                                    
 
                                                        
                                                          
              










                                                                             
                                                                        
 
                                                                           
 




                                                                            


                               
                                                                         
 
                            
                                                                     

                                  








                                                                         





                                                              

                                                     
 
                                   



                                                                             




                                                       




















                                                                               

 
                                                
 
                                                   
 



                                         
                                          
 



                                                                         

         


                                   
                                             


                                                                             
                                                                
                                                                  
                      




                                                                    
                                                                             

                                                                    


                                                                             




                                                                         
                                                                 
                                                                            


                                                                         
                                                                  



                                                                                
                                                               








                                                                     


                                   
 





                                                   
 
                             
 


                                                           
                   
                                                
     
                                              
      












                                                                             
                                      










                                                                            
 

                                        

         













                                                                              
         














                                                          
 




                                                  


         


































                                                                              







                                                 
                                   




                                                       
                                 


                                            

                                       






                                                              
                                                                    
 
                                                                       











                                                                              


                                                           
 
              










                                                              
                                                      
 

                               
                                                
                                                                           
                                                              
                                                
                                                                           
                                                              

 

                                                                         

                               
                               
                  
                    



                                                                     
                                                   

                                       
                                                                            
                                       
                                                                  
                                

                                                                       


                                                                  
                                                                             



                                                                     
                                                   

                                       
                                                                            
                                       
                                                                  
                                

                                                                       


                                                                  







                                                                             
 



                                                                        

                                                                        
                                                

                                                                        
                                                

                                                                        



                                                                   
                                                            
 

                               





                                                                         
                                                           
 

                           


                                                                
                                                                 









                                                                              








                                                                      
                     




                                                                         
                                                           

                                       
                                                                         
                                       
                                                               
                                
                                                           
                                                                    


                                                                      
                                                                          



                                                                         
                                                           

                                       
                                                                         
                                       
                                                               
                                
                                                           
                                                                    


                                                                      
                                                                          



                                                                         
                                                           

                                       
                                                                         
                                       
                                                               
                                
                                                           
                                                                    


                                                                      
                                                                          



                                                                         
                                                           

                                       
                                                                         
                                       
                                                               
                                
                                                           
                                                                    


                                                                      
                                                                          
 
                              
                                
 
                                                                 



                                                   
                               


                               
                                            


                                                
                                                                
                                                                          
                                         
                                                 
                                                                 

                                                                           


                                                
                                                                
                                                                          
                                         
                                                 
                                                                 
                                                                           
                                               


         
















                                                                              
                                                                              





                                   

                                                 
                               


                                                                             
                 
 
                                                                       

                                                                      
 
                                          
 
                                          
                                                               
 
                                                              


















                                                                              
                                  



                                                       
















                                                                               
 
                                





                                                                        
                                                                               

                                                                        
                                                                               

                 
                             






                                                                        
                                                                               

                                                                        
                                                                               

                 


                                                                    
 





                                                                              
                                                                            








                                                            
                                     
                                              


                                                                        

                                                                             


                                                           
                                                                    
                                                

                 



                                                                         

                                              





                                                                         



                                               
                                                                  

                                                    
                                                                      







                                                    
                                  







                                                                        
                                                                               

                                                                        
                                                                               












                                                   
                               




                                       



                                                            
                                                                            
                                        

                                                                            

                                        
                                                                       









                                                                           
                                     
                                     
 

                                                                      
                                                                   

                                                                          



                                                                           
                                                                         
                                                                     
                                                                
                                                                
                                                                   
                                                                            
                                                                   
                                                                            




                                                                               

                                                                          





                                                                            












                                                                             
                                                                     
                                                                         
                                                            
                                                                     
                                                                   




                                                                        




                                                  
                               

              
                                                    

                       

                                                                              
                                                           
                                                
                                                                  
                                                                 

 

                                                     
                                                            

                               
 
                                         
                                    

                                                                             
               
                                                                        
                                             
                                                                         


                                                             
 

                                                   
                                                                            








                                                                         
                               

                                                                      
                                               
                                                                          

                                                   
                                                                              


                                                   

                                                                   

 

                                                     
                                                                    


                                      

              
                                                                  


                                            


                                                        
                      
 
                                  
                                                          
                      
 
                                    

                                                          
                      
 
                                   


                                                          
                      
 
                

                                                      



                                                                             
                                                                     

                                                       
                                                                        

                                                      
 

                                            

 



                                                        










                                                                            
















                                                                               








































                                                                               
                                                      
 

                                                                     

                               

                   
                         

                           
                                                             

                                                           


                                                                               
 

                                                      
                                       
                                                          

                                         
                                                                      

                                    






















                                                                         


                                             
                                    
 
                                                                        
                                         
                                                                            

                                         
                                                                        
                                         
                                                                            

                                         




                                                                            
                                                                        
                                         
                                                                            

                                         












                                                            
 






                                                            









                                                                             

                                                                            

         




                                                                                
                                  
                                                       

                                               
                                                                    

                                                    
                                                                        

                                                    
                                                 
                                                                     

                                       
 































                                                                               





































                                                                              

 





















                                                                            





                                                       
                            
                                                  
                              


                                            

                                                                         
                                                                         
                                         
                                          

         



                                                   


                                                                             




                                  
                                           
                                 








                                                        
                             




































                                                                     
                                                   


























                                                                              
                                           



































                                                                             
                            




                                           
                        

                                                       

                                 
                                                 
                                                              

                             

                                 
                                                                 
                                                              











                                               
                                 
                             


                                      
                           






                                                      
                                               










                                                                 
 

                                                                














                                                            











                                                           
                                                                          
                   
                                                                        









                                                                 
                                               











                                                              
 

                                                                


















































                                                                          
                                               
















                                                     

                                                   


                                                

                                                   



                                                        





                                                               


                                                

                                                   

                                              

                                                                            

 
 







                                                                            
                                              
 
                   
 
                                                                          
 
                               

                                                                              
 


                                                                 
 


                                                     
 





                                                                
 

                                                                 

                   




                                                

                                               





                                                    

      
                                              
                


                                              

      

                                                         
 












                                                   
 

                                                  
 
                                                                 
 


                                                 
 



                                                               
 








                                                             

                
                                                                     
      
 





                                                             
 
                                                                 
                                                               
                                           

                                        

                                                             
 



                                                                 
 



                                                                          
 



                                                                 
 




                                                                   
 


                                                               
 




                                                                     
                                                                 
                                        
 



                                                                               
 







                                                                 
 

                                                               




                                                          
 

                                                                         
 



                                         
 






























                                                                 
 










                                                                       
                                                                    





                                                   
                                                   






                                                               
                                                                             
                                                   
 




                                                         
 


                      
 

                                                
 
                                    
 






                                                                             

                 
 


                                            
                      
                
 


                                                                 


                                  
























                                                                     
                                

                                                                        

                                







                                                                            

























                                                                           
                                 



                                  
 







                                                                        
 
                                 



                                                                      

                                                          
                                                        

                              
                                                             
                                
                                                                       

                           
                                                
                  
                                                
















                                                                  








                                                                    
                                                         







                                                                             




                                   
 





                                                                      



                                                                  







                                                                           

         


                                  
                                                                    






























                                                                       
                                                   









                                                                    
                              
 
































                                                                      
                      



                                                                 





                                                          




























                                                                             
                                         

                                       
 





                                                         
 

                                                        
 


                                    
 



























                                                                            

                                         
                                                                           
                                                     




                                                                       
 








                                                     

 
                                                          

                                                          
                               

                               

                                                   
 
                                                                   
                                                                            
 


                                                  
 
                                                              
 




                                                                             



                                                   
 





                                                     
 

























                                                                    
                    

                               
                                   



                                                                   


                                  
 
                                                               








                                                                     
 
                              
                                                          



                                                                 








                                                                     


                                                                      
                                                             

                                                          
                                                      






                                                               
                                                                


























                                                              
                    


                                         
                                   



                                                                     


                                  
 
                                                               










                                                                      





                                                                        
         
















                                                                          

























                                                                             
                                                                             

























                                                                             
                                  





                                                       










                                                                            
                                  

                                                       








                                                                         
                                                                              



                                           
                                     

                                                                           
                                                                            










                                                  
                          

                                                    
                                                      


                                     
                                                                        
                                                                      

                                           
                                                                        
         



                                            
                                          

                                           

                                              




                                                 





                                                 

                              
 

                                                                             
 
                               
                                                   


                                                               

         
                                                          
                                                            
                 

                                                                           
         
 


                                     

 

                                                
                              
 

                                                                        





                                                     


                                                               
                                                                   
                                                                     
                         
                                                                               



                                                 
                                               

         











                                                                             
                 

 













                                                              

                                          
                            
               
 





                                                               
                                                 



                                                            

 



                                               
                                






                                                    
                                






                                                     

                                              

                                                                  



                 
                                                              
 
                                               
                               

                                                                

 



                         
                                                            

                                                                        
                               




                                               
                               
                                           
                                              








                                                                              
                                                                    



                                                                     


                                                                 

                                                       




                                                             


                                                                                
                                                                    

                                                                  
                                                                        

                                                        







                                                                   
                                                             



                                                                             
                                                     







                                                                          
                               
                                         
                                              











                                                                              




                                                                        
 

                                                                          








                                                                         



                                                                  
                       
 

                                                                     

                      
                       

                                                 

                                                           
                                                      



                                                               
 
                                                                



                                                                           
                                 
                 
 
                          

         
                      

                                                            


                          
 
                      



                                                
               
 
                             
                                                                           



                                                                    

                                                                         
 
                  



                                                         

                                                   
                             
                                                                     
 
                          


                                                                   


                                                                
                                                  

 
                                                            
 
                                                
 
                       
 


                           




                                                               



                           


                                                                  
                    





                                                                  



                                                                           
                                            
                                                    






                                                                          
                 
                      
         
                                                        

















                                                               
 


                                
                                


                                                                             
                                



                                                               
                                  










                                                       



                                                   
                                         

                 

                                                                   


                                       
                                                                               

                                                          
                                         
                 




                                                                       

         



















                                                                        
                                                                            


                                                                
                                                                            














                                                                  
 
                           

                                          
                                                        
                                 

         
                                                       
                                      

                                           
                            

                                                                         
                                                                      
                                    
                                         




                                                   

                                     
                                                     
                                 
         
 

                                                                
                                                                         

                                                         
 



                                                      
                                                 
                 
 
                           
                                             
            
                                              

                         
                                                      

                             


                                                       
                                                  
                                                    



                                           
                                                   
                                                    
                                           
                      
 
                       
                                                    
                                           




                                             

         


                                              


                                                              
 

                 






                                                                      

                                                            
                                
                                                                    
            

                           

                               
                                
                                                       

                           
                  



                                                        
                                                   

               
                                 

                                                                          
 
                                 
                                                                
                                                
                             




                                                                     

                                                                
                                                
                  

 
                                               
 
                               
                                                 
                                         

                      




                                                 
                                                                          
 



                                                            
                          
 
                                           
 
                                     

                                                                  
                                                                


                                                       
                                                     






                                                                            
                                    


                              
                          
                                                    


                                                     

                  

 









                                                       


























                                                                       
                                                                       



                                        



















                                                              
 





                                                                              
                                   
                                                              
 
                               
                           
                       


                                                   

                                         
 
                                
 


                                                                     
                                                 
 


                           

                                                   

                                                       
                           
                                                      
 
                                         










                                                                            
                                  
                 
         

                                                     
 





                                                                           
                                                        

                                                                
                                       



                                                                             
                                                      






                                                                             

                                                             





                                                             


























                                                                      
 

                                                                        

                                            
                                          
 

                                    
                                                    
                          
                              

                                  
      


             
                          
                                                              
              
                                                                              

                                                                
                                       
                                                                              


                                                                   
                                                   



                                                                     
 


                                                            

                            
                                         

                                       
                          
                                                               
 
                         
 
                                                            
                            
                                
                                                                    
                                
                                                       


                                       
 




                                   






















                                                                        







                            

























































                                                                                









                                                                            
                                                                 


                                                                         
                                           
                                               

                                     
 


                                                              



                                                                         


                                                                               
                                                                      



                                                                          



                                                                               
                                             





                                                                               

                         


                                                                         
                                                         



















                                                                               


                                                                               
                                           


                                                                               














                                                                               


                                                                         





                                                               
                








                                                                
                                           




                                                     






                                                                            























                                                                              
                                                                   




                                                                       








                                                                             








                                                                     








                                                                              
                                                                











                                                                     
 
                               

                         



                                                                     

                                                                            




                                                                      










                                                                         





                                                                    









                                                                         




                                                                     
                                                                  


                               


                                                                              




                                                                      

                                                                          




                                                                      











                                                                          

                              

                                                                    
                                                     
 
                                                                          
                                                                         
                                                                
                                                                  

                                                                     

                              

                                                                    

                                                     
                                                                          
                                                                         

                                                                         










                                                                          

                                                                     

                              

                                                                    

                                                     


                                                                          

                                                                     

                              

                                                                    

                                                     
                                                                          
                                                                         
                                                                  
                                                                

                                                                     

                              



                                                                       




                                                                          

                              















                                                                          




                                                                     


                                                                   
                                                                  


                               


                                                                            
 



                                                              
                                                

                       
                                                     

                                                              

                                                                          
                                                              
 

                                                                          
                                                              
 

                                                                           
                                                               
 

                                                                           
                                                               
 

                                                                            

                                                                  
 

                                                                              
                                                                
 

                                                                             
                                                                 
 
                                                               

 
                                                                     
 
                                                 
 
                                                                      
                                          
                                                             
                                                                        
                                                                  
                        






                                                                              
                                                      
                                                                             
                                                      






                                                                             
                                                        




                                              
                                                                  
                                                                  

                                                                         



                                                            
                                                       
                                                                  




                                              
                                                                  

                                                                  

                                                                         



                                                            
                                                       
                                                                  




                                               
                                                                   
                                                                   

                                                                          



                                                            
                                                       
                                                                  




                                               
                                                                   

                                                                   

                                                                          



                                                            
                                                       
                                                                  




                                        
                                                                    
                                                                    

                                                                           



                                                            
                                                       
                                                                  




                                          
                                                                    
                                                                    

                                                                           



                                                            
                                                       
                                                                  






                                             
                                                                     
                                                                     

                                                                            



                                                            
                                                       
                                                                  






                                                              
                                                
                                                                
                                                          

                      
 

                                                                         
                                                                      
                                                      
                                                                     
 
                                                                             
                                              

                                                      
                                                                            

 
                                                             
 

                               
                   
              
 
                                
                                    
 
                                     
                                                                        
                                        

                                                                            
                                        


                                                                              
                              

                                                                             












                                                                               







                                                                          





                                                                           

                                                                       

                                                      
                                                                             
 
                                                            

                                                                          










                                                                     

                                                                      






                                                       
 
                                    
 




                                                                         
 

                                                                            
                                                           
 





                                                                          
                                                                 






                                                                            
 






















                                                                           
                 

                          

         

                                                               
                                                                    


                                                                        
 





                                                    
                           

               


                                                                
                                        
 
                                                       














                                                                      
                                  

                                                                          
                                   
                                                                                




                                                   








                                                  
                        
 



                                        



                          

                                                              






                                                           











                                                                              

                                                

                                    

                                                      
                

                                                            
         







                                                                           
 


                                                                          


                                                          
                                                           
                                                           


                                                           



                                                           
                                                           


                                            




                                                                     

                                                                            

                                                           

                 
                                    
 
                                             

                                         
                                                             
                                              
            
                                               



















                                                                              


                         







                                                                            
                                             

                                                                      
                                       
                 

                                                                           
                                                       
 

                                                                

                                                             





                                                                           
                                                          


                                                                       
                                                       
                                 



                                                                        
                                                          


                                                                       
                                                       
                                 







                                                                        
                                                          


                                                                           
                                                       
                                 



                                                                         
                                                          


                                                                           
                                                       
                                 






                                                                         

                                                                              
                                               
                         
 
                                                                               
                                                                              
                                               
                         





                                                                  


                                                                
                                               
                         
 
                                                                               

                                                                
                                               
                         
 
                                                                  



                                                      

                                                                               
                                               
                         
 
                                                                                
                                                                               
                                               
                         





                                                                   
                                                                  


                                       

                                                            
                                                   

         
                                                
                                                          
                                                                      
                                 
 
                                 
                                                         

                                   



                 

                                          



                                                           
                                      


                                                  

                             
                           
                                           


                                                                               
                                           
         
 




                                                                       


                                                   
                                                 


                              













































































                                                                                




























                                                                              
              
                            
 





















                                                                 

                          
 
                                 
                                                         

                                   







                                                       
                                     



                                                     
                               




















                                                             
                                                                            







                                                     
                               




















                                                                
                                                                             





























                                                         
                                                                                

                                                
                         




























                                                                    


                                                                       
                                                    












                                                                      
                   

                                                                      
                                 
                                                                     



                                     

                                                                      
                                                                           
                                                            










































                                                                         


                                
                                                    













                                                                         
                         



































                                                                    
                                                             






                                                                         
                   
 

                                                                      
                                                                           
                                                            






















                                                                       


















                                                                        
                                             
                                                                          

                                                                      
                                 
                                                                     



                                     

                                                                      
                                                                           
                                                            





















                                                               






















                                                                         


                                
                                                    





                                                                      
                                                                        


                                        
                                                   



                                                                               

                                                                  
                                                                        
                                                                          

                                                                      
                         
                                                   



                                                            
                                                                               












                                                            
















                                                            
                               

























                                                                
                   








                                                     


                                                     

         
                  






                                                                   

                                                           

                                                                             



                                                                             










                                                                             


                         



                                                                             
                                                             
 
                             
                                                                    
 
                             
                                                                    
 

                                                                     
 
                              
                                                                
                                                                      

                                       
 
                                                                     
                                                                             
         
 

                                                                  

                                 
                                                         

                                   



                 



























                                                            









                                                              
                   

                           









                                                                    



                                                          
                   
                                                                 

                                              
                                                                  


                                               


                 
                     

                                          





                                      
                                 






                                                        



                                                 
                               
































































                                                                           












































                                                                              

                             
                        







                                                                          












                                                            

                                                                           











                                                                  


























                                                                              






                                                                      
                                                              
                                                                 

                      
                               
         
 


                                                                     










                                                            
                                      





















                                                                     

              
                                                    
                                                                            
                                                        
                                   



































                                                                          








                                                                      








                                                            
                        



                                             
                                
                                   
 



                                                                              

         



                                                                              

         
                                   






















                                                        
                              





                                              
                                                                      















                                                                     
                                                                       























                                                                           
                               



                                                            
                                              


















                                                                        



                                                                 


                                                      
                                
                       
 
                                                        






















                                                           
 






                                                       

                                                   








                                                           



                             

 


                     

























                                                                               
                  

                                         
                                                                             
                                   
                                      

                                                                  
                                                  
                                                                        
                                                            
                                                                          
                                                              
                                                                          
                                                              
                                                                          
                                                        
                                                                       
                                                              
                                                                         








































                                                                                
                                                                    
                                                                              
                                                                      
                                                                             
                                                                    
                                                                     
                                                                  
                                                                              
                                                             
                                                                            
                                                          
                                                                             
                                                            
                                                                            
                                                                       
                                                                           
                                                                        
                                                                            
                                                                        
                                                                            
                                                                         
                                                                             
                                                                  
                                                                              
                                                          
                                                                              

                                                                        

  




                                                                             
 

                                                                             
                                            
                    
 

                            




















                                                                                
                 









                                                                              
                                            
                         
 











                                                                     
         
 
                         





                                                                          

                               
 






































                                                                              
                 



















                                                                        
                            
                 





                                                          
                               

              





                                



                                          
                                 
                                                                          


                                                                  
                                                                


                                                                  




                                            
                                  
                                                      


                                                          




                                               


                                                     

                                                     

                                                















                                                         
                                                            



                                                       


                                                        

                                                    

                                                        
                                                          















                                                                             
                                                                         



                                                                          
                                                                           
                                   
                      
 


                                                 
 

                                                        
 

                                                                         
 








                                                               

 











                                                                



                               








                                                                             
                                







                                                                             
                                  
                                 
 
                                    
                                                     
 



                                                                  
 










                                                                              
 
                                  
                          
           
      
                                    
 
                                                      
                                                                        
                                                      

                                                                           
 
           


                         

                                                  
                                                     




































































                                                                           
                                                         



















                                                                  
                                       


                                                                     














                                                                              
                                                        









































                                                                               
















                                                                         
      

                            
                                                                    
                     




                                                                        
                                 



                                           
                          
                           



                                                 





                                      


                                                 
                               
 
                                                                             
                                              
                                         



                                                                   




                                                                              
                                       


                                                                          






                                                                             
                                            

                 
      
 
          
                                                                          
                                                       
                                                      

                                                        
                                                               


                                     
                                        
 
                                       





                                                               

                                                               
 


                                                 




                                                              


                                                              



                                                                        
      
                                                    
 
                        
                                                  

                                                         





                                                                            

                                                          


                                                                               
 



                                                             
 

                                                    
 


                                                                        
                                                      









                                                                            
                                                                       
                                                 
 












                                                                              


                                                     
                                                                     


                                                      
                                                                  



                                                                    



                                                                          
 
                                   







                                                                             


                                                                      


                                                                      




                                                             


                                                                              






                                                                              


                                                                          

                                                              
 

                                                      
 

                                                                               
 




                                                              
 



                                                                            

         
                                                    




                                                              

                                              
                                                       










                                                                          
                                                                    
 
                                                                           
 








                                                                             
                                                      
                                                                            
                                                        
                                   


                 
                              


                                                               


                                                                       
                                         
                                              
                                                            
                                                 





                            
                           



                                             

                               

                                          
                                             

 
                           

                                              


                                             



                                                             



                 
                                                

























































                                                                             
                                                 



                                                                              
                                                                         












                                                                         
                                               
                                                    
                                                              


















                                                                              

                                                                             


















                                                                               




                                                                 
                                                        


                                                            

                                   
                                                     
                    
                                                      
         



                 
                           



                                                                          
                               



                         
                                                 
 
                                 
 
                           
                               
 

                                        
 
                                                
                                                                     


                                                                           
                                                  






                                            


                                        
                                                
                                                                      

                                                                             
                                                  









                                
                           


                                                                
                   





                                                         
                                           




                                       

                                                     
         

                  














                                                                              
                           





                                                            









                                                              
                               
                                            
 
 












                                                                        



                                                       
                                                    












                                                                        

                                                           






                                        

                        
                      
                                         




















                                                                            






                                                                          
 


                                     
















                                                                         
                                                            
                                            
                                                                               





                                                                         
                                                                   





                                                                  


                                                     


                             
                                               





                                                                             


                                                                          







                                                                             






                                                                
 
                                         
 
                                            
                                              





                                                                   
                                                         

                                                         
                                      







                                     





                                       

                                                








                                    
















                                                                   





                                                                    
               




                                                
                                                          

                                                                    
                               
         
 


                              
                                       




                                 

                                   
                               



                                   
                 
                                                                    


                                   
                                                                       
                                                                         
                                                                 


                                                                          
                                                           
 
                 
















                                                




                                                            


                         


                                                                            
                              
 








                                       



                                                






                                                                  

                         




                                                                            
 
                    
 
                             
 



                                  

                                 
 
                                           
 
                                                                 
 

                      





                                                       
                         

               



                                                                            
                              
 

                    
                                





                                  


                                          
                                           
 


                      

 




















                                                                           
                                                        




                                                                
                                
                                                                    
                                
                                                       






































                                                                              


















                                                                          
                                         





















































                                                                       

                              
                               
                                                







                                                      

                                              

  
                                             






                                                     



                                  





                                                                 





                                                      

                                    




                           
/* bnx2x_main.c: Broadcom Everest network driver.
 *
 * Copyright (c) 2007-2009 Broadcom 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.
 *
 * Maintained by: Eilon Greenstein <eilong@broadcom.com>
 * Written by: Eliezer Tamir
 * Based on code from Michael Chan's bnx2 driver
 * UDP CSUM errata workaround by Arik Gendelman
 * Slowpath rework by Vladislav Zolotarov
 * Statistics and Link management by Yitchak Gertner
 *
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/device.h>  /* for dev_info() */
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/dma-mapping.h>
#include <linux/bitops.h>
#include <linux/irq.h>
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <linux/time.h>
#include <linux/ethtool.h>
#include <linux/mii.h>
#include <linux/if_vlan.h>
#include <net/ip.h>
#include <net/tcp.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
#include <linux/workqueue.h>
#include <linux/crc32.h>
#include <linux/crc32c.h>
#include <linux/prefetch.h>
#include <linux/zlib.h>
#include <linux/io.h>


#include "bnx2x.h"
#include "bnx2x_init.h"
#include "bnx2x_dump.h"

#define DRV_MODULE_VERSION	"1.48.105"
#define DRV_MODULE_RELDATE	"2009/03/02"
#define BNX2X_BC_VER		0x040200

/* Time in jiffies before concluding the transmitter is hung */
#define TX_TIMEOUT		(5*HZ)

static char version[] __devinitdata =
	"Broadcom NetXtreme II 5771x 10Gigabit Ethernet Driver "
	DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";

MODULE_AUTHOR("Eliezer Tamir");
MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);

static int multi_mode = 1;
module_param(multi_mode, int, 0);
MODULE_PARM_DESC(multi_mode, " Use per-CPU queues");

static int disable_tpa;
module_param(disable_tpa, int, 0);
MODULE_PARM_DESC(disable_tpa, " Disable the TPA (LRO) feature");

static int int_mode;
module_param(int_mode, int, 0);
MODULE_PARM_DESC(int_mode, " Force interrupt mode (1 INT#x; 2 MSI)");

static int poll;
module_param(poll, int, 0);
MODULE_PARM_DESC(poll, " Use polling (for debug)");

static int mrrs = -1;
module_param(mrrs, int, 0);
MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");

static int debug;
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, " Default debug msglevel");

static int load_count[3]; /* 0-common, 1-port0, 2-port1 */

static struct workqueue_struct *bnx2x_wq;

enum bnx2x_board_type {
	BCM57710 = 0,
	BCM57711 = 1,
	BCM57711E = 2,
};

/* indexed by board_type, above */
static struct {
	char *name;
} board_info[] __devinitdata = {
	{ "Broadcom NetXtreme II BCM57710 XGb" },
	{ "Broadcom NetXtreme II BCM57711 XGb" },
	{ "Broadcom NetXtreme II BCM57711E XGb" }
};


static const struct pci_device_id bnx2x_pci_tbl[] = {
	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57710,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM57710 },
	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57711,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM57711 },
	{ PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_NX2_57711E,
		PCI_ANY_ID, PCI_ANY_ID, 0, 0, BCM57711E },
	{ 0 }
};

MODULE_DEVICE_TABLE(pci, bnx2x_pci_tbl);

/****************************************************************************
* General service functions
****************************************************************************/

/* used only at init
 * locking is done by mcp
 */
static void bnx2x_reg_wr_ind(struct bnx2x *bp, u32 addr, u32 val)
{
	pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, addr);
	pci_write_config_dword(bp->pdev, PCICFG_GRC_DATA, val);
	pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS,
			       PCICFG_VENDOR_ID_OFFSET);
}

static u32 bnx2x_reg_rd_ind(struct bnx2x *bp, u32 addr)
{
	u32 val;

	pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS, addr);
	pci_read_config_dword(bp->pdev, PCICFG_GRC_DATA, &val);
	pci_write_config_dword(bp->pdev, PCICFG_GRC_ADDRESS,
			       PCICFG_VENDOR_ID_OFFSET);

	return val;
}

static const u32 dmae_reg_go_c[] = {
	DMAE_REG_GO_C0, DMAE_REG_GO_C1, DMAE_REG_GO_C2, DMAE_REG_GO_C3,
	DMAE_REG_GO_C4, DMAE_REG_GO_C5, DMAE_REG_GO_C6, DMAE_REG_GO_C7,
	DMAE_REG_GO_C8, DMAE_REG_GO_C9, DMAE_REG_GO_C10, DMAE_REG_GO_C11,
	DMAE_REG_GO_C12, DMAE_REG_GO_C13, DMAE_REG_GO_C14, DMAE_REG_GO_C15
};

/* copy command into DMAE command memory and set DMAE command go */
static void bnx2x_post_dmae(struct bnx2x *bp, struct dmae_command *dmae,
			    int idx)
{
	u32 cmd_offset;
	int i;

	cmd_offset = (DMAE_REG_CMD_MEM + sizeof(struct dmae_command) * idx);
	for (i = 0; i < (sizeof(struct dmae_command)/4); i++) {
		REG_WR(bp, cmd_offset + i*4, *(((u32 *)dmae) + i));

		DP(BNX2X_MSG_OFF, "DMAE cmd[%d].%d (0x%08x) : 0x%08x\n",
		   idx, i, cmd_offset + i*4, *(((u32 *)dmae) + i));
	}
	REG_WR(bp, dmae_reg_go_c[idx], 1);
}

void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr,
		      u32 len32)
{
	struct dmae_command *dmae = &bp->init_dmae;
	u32 *wb_comp = bnx2x_sp(bp, wb_comp);
	int cnt = 200;

	if (!bp->dmae_ready) {
		u32 *data = bnx2x_sp(bp, wb_data[0]);

		DP(BNX2X_MSG_OFF, "DMAE is not ready (dst_addr %08x  len32 %d)"
		   "  using indirect\n", dst_addr, len32);
		bnx2x_init_ind_wr(bp, dst_addr, data, len32);
		return;
	}

	mutex_lock(&bp->dmae_mutex);

	memset(dmae, 0, sizeof(struct dmae_command));

	dmae->opcode = (DMAE_CMD_SRC_PCI | DMAE_CMD_DST_GRC |
			DMAE_CMD_C_DST_PCI | DMAE_CMD_C_ENABLE |
			DMAE_CMD_SRC_RESET | DMAE_CMD_DST_RESET |
#ifdef __BIG_ENDIAN
			DMAE_CMD_ENDIANITY_B_DW_SWAP |
#else
			DMAE_CMD_ENDIANITY_DW_SWAP |
#endif
			(BP_PORT(bp) ? DMAE_CMD_PORT_1 : DMAE_CMD_PORT_0) |
			(BP_E1HVN(bp) << DMAE_CMD_E1HVN_SHIFT));
	dmae->src_addr_lo = U64_LO(dma_addr);
	dmae->src_addr_hi = U64_HI(dma_addr);
	dmae->dst_addr_lo = dst_addr >> 2;
	dmae->dst_addr_hi = 0;
	dmae->len = len32;
	dmae->comp_addr_lo = U64_LO(bnx2x_sp_mapping(bp, wb_comp));
	dmae->comp_addr_hi = U64_HI(bnx2x_sp_mapping(bp, wb_comp));
	dmae->comp_val = DMAE_COMP_VAL;

	DP(BNX2X_MSG_OFF, "DMAE: opcode 0x%08x\n"
	   DP_LEVEL "src_addr  [%x:%08x]  len [%d *4]  "
		    "dst_addr [%x:%08x (%08x)]\n"
	   DP_LEVEL "comp_addr [%x:%08x]  comp_val 0x%08x\n",
	   dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
	   dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, dst_addr,
	   dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val);
	DP(BNX2X_MSG_OFF, "data [0x%08x 0x%08x 0x%08x 0x%08x]\n",
	   bp->slowpath->wb_data[0], bp->slowpath->wb_data[1],
	   bp->slowpath->wb_data[2], bp->slowpath->wb_data[3]);

	*wb_comp = 0;

	bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));

	udelay(5);

	while (*wb_comp != DMAE_COMP_VAL) {
		DP(BNX2X_MSG_OFF, "wb_comp 0x%08x\n", *wb_comp);

		if (!cnt) {
			BNX2X_ERR("DMAE timeout!\n");
			break;
		}
		cnt--;
		/* adjust delay for emulation/FPGA */
		if (CHIP_REV_IS_SLOW(bp))
			msleep(100);
		else
			udelay(5);
	}

	mutex_unlock(&bp->dmae_mutex);
}

void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32)
{
	struct dmae_command *dmae = &bp->init_dmae;
	u32 *wb_comp = bnx2x_sp(bp, wb_comp);
	int cnt = 200;

	if (!bp->dmae_ready) {
		u32 *data = bnx2x_sp(bp, wb_data[0]);
		int i;

		DP(BNX2X_MSG_OFF, "DMAE is not ready (src_addr %08x  len32 %d)"
		   "  using indirect\n", src_addr, len32);
		for (i = 0; i < len32; i++)
			data[i] = bnx2x_reg_rd_ind(bp, src_addr + i*4);
		return;
	}

	mutex_lock(&bp->dmae_mutex);

	memset(bnx2x_sp(bp, wb_data[0]), 0, sizeof(u32) * 4);
	memset(dmae, 0, sizeof(struct dmae_command));

	dmae->opcode = (DMAE_CMD_SRC_GRC | DMAE_CMD_DST_PCI |
			DMAE_CMD_C_DST_PCI | DMAE_CMD_C_ENABLE |
			DMAE_CMD_SRC_RESET | DMAE_CMD_DST_RESET |
#ifdef __BIG_ENDIAN
			DMAE_CMD_ENDIANITY_B_DW_SWAP |
#else
			DMAE_CMD_ENDIANITY_DW_SWAP |
#endif
			(BP_PORT(bp) ? DMAE_CMD_PORT_1 : DMAE_CMD_PORT_0) |
			(BP_E1HVN(bp) << DMAE_CMD_E1HVN_SHIFT));
	dmae->src_addr_lo = src_addr >> 2;
	dmae->src_addr_hi = 0;
	dmae->dst_addr_lo = U64_LO(bnx2x_sp_mapping(bp, wb_data));
	dmae->dst_addr_hi = U64_HI(bnx2x_sp_mapping(bp, wb_data));
	dmae->len = len32;
	dmae->comp_addr_lo = U64_LO(bnx2x_sp_mapping(bp, wb_comp));
	dmae->comp_addr_hi = U64_HI(bnx2x_sp_mapping(bp, wb_comp));
	dmae->comp_val = DMAE_COMP_VAL;

	DP(BNX2X_MSG_OFF, "DMAE: opcode 0x%08x\n"
	   DP_LEVEL "src_addr  [%x:%08x]  len [%d *4]  "
		    "dst_addr [%x:%08x (%08x)]\n"
	   DP_LEVEL "comp_addr [%x:%08x]  comp_val 0x%08x\n",
	   dmae->opcode, dmae->src_addr_hi, dmae->src_addr_lo,
	   dmae->len, dmae->dst_addr_hi, dmae->dst_addr_lo, src_addr,
	   dmae->comp_addr_hi, dmae->comp_addr_lo, dmae->comp_val);

	*wb_comp = 0;

	bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp));

	udelay(5);

	while (*wb_comp != DMAE_COMP_VAL) {

		if (!cnt) {
			BNX2X_ERR("DMAE timeout!\n");
			break;
		}
		cnt--;
		/* adjust delay for emulation/FPGA */
		if (CHIP_REV_IS_SLOW(bp))
			msleep(100);
		else
			udelay(5);
	}
	DP(BNX2X_MSG_OFF, "data [0x%08x 0x%08x 0x%08x 0x%08x]\n",
	   bp->slowpath->wb_data[0], bp->slowpath->wb_data[1],
	   bp->slowpath->wb_data[2], bp->slowpath->wb_data[3]);

	mutex_unlock(&bp->dmae_mutex);
}

/* used only for slowpath so not inlined */
static void bnx2x_wb_wr(struct bnx2x *bp, int reg, u32 val_hi, u32 val_lo)
{
	u32 wb_write[2];

	wb_write[0] = val_hi;
	wb_write[1] = val_lo;
	REG_WR_DMAE(bp, reg, wb_write, 2);
}

#ifdef USE_WB_RD
static u64 bnx2x_wb_rd(struct bnx2x *bp, int reg)
{
	u32 wb_data[2];

	REG_RD_DMAE(bp, reg, wb_data, 2);

	return HILO_U64(wb_data[0], wb_data[1]);
}
#endif

static int bnx2x_mc_assert(struct bnx2x *bp)
{
	char last_idx;
	int i, rc = 0;
	u32 row0, row1, row2, row3;

	/* XSTORM */
	last_idx = REG_RD8(bp, BAR_XSTRORM_INTMEM +
			   XSTORM_ASSERT_LIST_INDEX_OFFSET);
	if (last_idx)
		BNX2X_ERR("XSTORM_ASSERT_LIST_INDEX 0x%x\n", last_idx);

	/* print the asserts */
	for (i = 0; i < STROM_ASSERT_ARRAY_SIZE; i++) {

		row0 = REG_RD(bp, BAR_XSTRORM_INTMEM +
			      XSTORM_ASSERT_LIST_OFFSET(i));
		row1 = REG_RD(bp, BAR_XSTRORM_INTMEM +
			      XSTORM_ASSERT_LIST_OFFSET(i) + 4);
		row2 = REG_RD(bp, BAR_XSTRORM_INTMEM +