Browse Source

Use insb/outsb; it's marginally faster.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
4d0a0f822d
1 changed files with 2 additions and 9 deletions
  1. 2
    9
      src/drivers/net/pnic.c

+ 2
- 9
src/drivers/net/pnic.c View File

@@ -44,7 +44,6 @@ static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command,
44 44
 				     void *input, uint16_t input_length,
45 45
 				     void *output, uint16_t output_max_length,
46 46
 				     uint16_t *output_length ) {
47
-	int i;
48 47
 	uint16_t status;
49 48
 	uint16_t _output_length;
50 49
 
@@ -52,10 +51,7 @@ static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command,
52 51
 		/* Write input length */
53 52
 		outw ( input_length, pnic->ioaddr + PNIC_REG_LEN );
54 53
 		/* Write input data */
55
-		for ( i = 0; i < input_length; i++ ) {
56
-			outb( ((char*)input)[i],
57
-			      pnic->ioaddr + PNIC_REG_DATA );
58
-		}
54
+		outsb ( pnic->ioaddr + PNIC_REG_DATA, input, input_length );
59 55
 	}
60 56
 	/* Write command */
61 57
 	outw ( command, pnic->ioaddr + PNIC_REG_CMD );
@@ -80,10 +76,7 @@ static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command,
80 76
 			_output_length = output_max_length;
81 77
 		}
82 78
 		/* Retrieve output data */
83
-		for ( i = 0; i < _output_length; i++ ) {
84
-			((char*)output)[i] =
85
-				inb ( pnic->ioaddr + PNIC_REG_DATA );
86
-		}
79
+		insb ( pnic->ioaddr + PNIC_REG_DATA, output, _output_length );
87 80
 	}
88 81
 	return status;
89 82
 }

Loading…
Cancel
Save