mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:52:44 +00:00 
			
		
		
		
	 59fdeec7f5
			
		
	
	
		59fdeec7f5
		
	
	
	
	
		
			
			Read the appropriate registers for RTL8139, RTL8168 and E1000. For NE2000 just assume 10mbit full duplex as there is no indicator for it in the pure NE2000 spec. Mock values for loopback.
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			706 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
	
		
			706 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <Kernel/Net/NetworkAdapter.h>
 | |
| 
 | |
| namespace Kernel {
 | |
| 
 | |
| class LoopbackAdapter final : public NetworkAdapter {
 | |
|     AK_MAKE_ETERNAL
 | |
| 
 | |
| private:
 | |
|     LoopbackAdapter();
 | |
| 
 | |
| public:
 | |
|     static RefPtr<LoopbackAdapter> try_create();
 | |
|     virtual ~LoopbackAdapter() override;
 | |
| 
 | |
|     virtual void send_raw(ReadonlyBytes) override;
 | |
|     virtual StringView class_name() const override { return "LoopbackAdapter"; }
 | |
|     virtual bool link_up() override { return true; }
 | |
|     virtual bool link_full_duplex() override { return true; }
 | |
|     virtual int link_speed() override { return 1000; }
 | |
| };
 | |
| 
 | |
| }
 |