| 
				
			 | 
			
			
				
				@@ -86,6 +86,7 @@ FILE_LICENCE ( GPL_ANY ); 
			 | 
		
		
	
		
			
			| 
				86
			 | 
			
				86
			 | 
			
			
				
				 #include <ipxe/nvo.h> 
			 | 
		
		
	
		
			
			| 
				87
			 | 
			
				87
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				88
			 | 
			
				88
			 | 
			
			
				
				 #define TX_RING_SIZE 4 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				89
			 | 
			
			
				
				+#define TX_MAX_LEN 8192 
			 | 
		
		
	
		
			
			| 
				89
			 | 
			
				90
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				90
			 | 
			
				91
			 | 
			
			
				
				 struct rtl8139_tx { 
			 | 
		
		
	
		
			
			| 
				91
			 | 
			
				92
			 | 
			
			
				
				 	unsigned int next; 
			 | 
		
		
	
	
		
			
			| 
				
			 | 
			
			
				
				@@ -383,6 +384,13 @@ static int rtl_transmit ( struct net_device *netdev, 
			 | 
		
		
	
		
			
			| 
				383
			 | 
			
				384
			 | 
			
			
				
				 		return -ENOBUFS; 
			 | 
		
		
	
		
			
			| 
				384
			 | 
			
				385
			 | 
			
			
				
				 	} 
			 | 
		
		
	
		
			
			| 
				385
			 | 
			
				386
			 | 
			
			
				
				  
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				387
			 | 
			
			
				
				+	/* Check for oversized packets */ 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				388
			 | 
			
			
				
				+	if ( iob_len ( iobuf ) >= TX_MAX_LEN ) { 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				389
			 | 
			
			
				
				+		DBGC ( rtl, "rtl8139 %p TX too large (%zd bytes)\n", 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				390
			 | 
			
			
				
				+		       rtl, iob_len ( iobuf ) ); 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				391
			 | 
			
			
				
				+		return -ERANGE; 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				392
			 | 
			
			
				
				+	} 
			 | 
		
		
	
		
			
			| 
				
			 | 
			
				393
			 | 
			
			
				
				+ 
			 | 
		
		
	
		
			
			| 
				386
			 | 
			
				394
			 | 
			
			
				
				 	/* Pad and align packet */ 
			 | 
		
		
	
		
			
			| 
				387
			 | 
			
				395
			 | 
			
			
				
				 	iob_pad ( iobuf, ETH_ZLEN ); 
			 | 
		
		
	
		
			
			| 
				388
			 | 
			
				396
			 | 
			
			
				
				  
			 |