Sfoglia il codice sorgente

Merge branch 'master' of rom.etherboot.org:/pub/scm/gpxe

tags/v0.9.3
Michael Brown 17 anni fa
parent
commit
cbd4542dc0

+ 1
- 1
src/arch/i386/core/video_subr.c Vedi File

@@ -33,7 +33,7 @@ static void video_init(void)
33 33
 {
34 34
 	static int inited=0;
35 35
 
36
-	vidmem = (unsigned char *)phys_to_virt(VIDBUFFER);
36
+	vidmem = (char *)phys_to_virt(VIDBUFFER);
37 37
 
38 38
 	if (!inited) {
39 39
 		video_line = 0;

+ 0
- 204
src/arch/i386/drivers/bus/bios_disks.c Vedi File

@@ -1,204 +0,0 @@
1
-#include "realmode.h"
2
-#include "console.h"
3
-#include "disk.h"
4
-#include "bios_disks.h"
5
-
6
-#warning "This file is obsolete"
7
-#if 0
8
-
9
-#define CF ( 1 << 0 )
10
-#define BIOS_DISK_NONE 0
11
-
12
-/*
13
- * Reset the disk system using INT 13,0.  Forces both hard disks and
14
- * floppy disks to seek back to track 0.
15
- *
16
- */
17
-static void bios_disk_init ( void ) {
18
-	REAL_EXEC ( rm_bios_disk_init,
19
-		    "sti\n\t"
20
-		    "xorw %%ax,%%ax\n\t"
21
-		    "movb $0x80,%%dl\n\t"
22
-		    "int $0x13\n\t"
23
-		    "cli\n\t",
24
-		    0,
25
-		    OUT_CONSTRAINTS (),
26
-		    IN_CONSTRAINTS (),
27
-   		    CLOBBER ( "eax", "ebx", "ecx", "edx",
28
-			      "ebp", "esi", "edi" ) );
29
-}
30
-
31
-/*
32
- * Read a single sector from a disk using INT 13,2.
33
- *
34
- * Returns the BIOS status code (%ah) - 0 indicates success.
35
- * Automatically retries up to three times to allow time for floppy
36
- * disks to spin up, calling bios_disk_init() after each failure.
37
- *
38
- */
39
-static unsigned int bios_disk_read ( struct bios_disk_device *bios_disk,
40
-				     unsigned int cylinder,
41
-				     unsigned int head,
42
-				     unsigned int sector,
43
-				     struct bios_disk_sector *buf ) {
44
-	uint16_t basemem_buf, ax, flags;
45
-	unsigned int status, discard_c, discard_d;
46
-	int retry = 3;
47
-
48
-	basemem_buf = BASEMEM_PARAMETER_INIT ( *buf );
49
-	do {
50
-		REAL_EXEC ( rm_bios_disk_read,
51
-			    "sti\n\t"
52
-			    "movw $0x0201, %%ax\n\t" /* Read a single sector */
53
-			    "int $0x13\n\t"
54
-			    "pushfw\n\t"
55
-			    "popw %%bx\n\t"
56
-			    "cli\n\t",
57
-			    4,
58
-			    OUT_CONSTRAINTS ( "=a" ( ax ), "=b" ( flags ),
59
-					      "=c" ( discard_c ),
60
-					      "=d" ( discard_d ) ),
61
-			    IN_CONSTRAINTS ( "c" ( ( (cylinder & 0xff) << 8 ) |
62
-						   ( (cylinder >> 8) & 0x3 ) |
63
-						   sector ),
64
-					     "d" ( ( head << 8 ) |
65
-						   bios_disk->drive ),
66
-					     "b" ( basemem_buf ) ),
67
-			    CLOBBER ( "ebp", "esi", "edi" ) );
68
-		status = ( flags & CF ) ? ( ax >> 8 ) : 0;
69
-	} while ( ( status != 0 ) && ( bios_disk_init(), retry-- ) );
70
-	BASEMEM_PARAMETER_DONE ( *buf );
71
-
72
-	return status;
73
-}
74
-
75
-/*
76
- * Increment a bus_loc structure to the next possible BIOS disk
77
- * location.  Leave the structure zeroed and return 0 if there are no
78
- * more valid locations.
79
- *
80
- */
81
-static int bios_disk_next_location ( struct bus_loc *bus_loc ) {
82
-	struct bios_disk_loc *bios_disk_loc
83
-		= ( struct bios_disk_loc * ) bus_loc;
84
-	
85
-	/*
86
-	 * Ensure that there is sufficient space in the shared bus
87
-	 * structures for a struct bios_disk_loc and a struct
88
-	 * bios_disk_dev, as mandated by bus.h.
89
-	 *
90
-	 */
91
-	BUS_LOC_CHECK ( struct bios_disk_loc );
92
-	BUS_DEV_CHECK ( struct bios_disk_device );
93
-
94
-	return ( ++bios_disk_loc->drive );
95
-}
96
-
97
-/*
98
- * Fill in parameters for a BIOS disk device based on drive number
99
- *
100
- */
101
-static int bios_disk_fill_device ( struct bus_dev *bus_dev,
102
-				   struct bus_loc *bus_loc ) {
103
-	struct bios_disk_loc *bios_disk_loc
104
-		= ( struct bios_disk_loc * ) bus_loc;
105
-	struct bios_disk_device *bios_disk
106
-		= ( struct bios_disk_device * ) bus_dev;
107
-	uint16_t flags;
108
-
109
-	/* Store drive in struct bios_disk_device */
110
-	bios_disk->drive = bios_disk_loc->drive;
111
-       
112
-	REAL_EXEC ( rm_bios_disk_exists,
113
-		    "sti\n\t"
114
-		    "movb $0x15, %%ah\n\t"
115
-		    "int $0x13\n\t"
116
-		    "pushfw\n\t"
117
-		    "popw %%dx\n\t"
118
-		    "movb %%ah, %%al\n\t"
119
-		    "cli\n\t",
120
-		    2,
121
-		    OUT_CONSTRAINTS ( "=a" ( bios_disk->type ),
122
-				      "=d" ( flags ) ),
123
-		    IN_CONSTRAINTS ( "d" ( bios_disk->drive ) ),
124
-		    CLOBBER ( "ebx", "ecx", "esi", "edi", "ebp" ) );
125
-
126
-	if ( ( flags & CF ) || ( bios_disk->type == BIOS_DISK_NONE ) )
127
-		return 0;
128
-
129
-	DBG ( "BIOS disk found valid drive %hhx\n", bios_disk->drive );
130
-	return 1;
131
-}
132
-
133
-/*
134
- * Test whether or not a driver is capable of driving the device.
135
- *
136
- */
137
-static int bios_disk_check_driver ( struct bus_dev *bus_dev,
138
-				    struct device_driver *device_driver ) {
139
-	struct bios_disk_device *bios_disk
140
-		= ( struct bios_disk_device * ) bus_dev;
141
-	struct bios_disk_driver *driver
142
-		= ( struct bios_disk_driver * ) device_driver->bus_driver_info;
143
-
144
-	/* Compare against driver's valid ID range */
145
-	if ( ( bios_disk->drive >= driver->min_drive ) &&
146
-	     ( bios_disk->drive <= driver->max_drive ) ) {
147
-		driver->fill_drive_name ( bios_disk->name, bios_disk->drive );
148
-		DBG ( "BIOS disk found drive %hhx (\"%s\") "
149
-		      "matching driver %s\n",
150
-		      bios_disk->drive, bios_disk->name,
151
-		      driver->name );
152
-		return 1;
153
-	}
154
-
155
-	return 0;
156
-}
157
-
158
-/*
159
- * Describe a BIOS disk device
160
- *
161
- */
162
-static char * bios_disk_describe_device ( struct bus_dev *bus_dev ) {
163
-	struct bios_disk_device *bios_disk
164
-		= ( struct bios_disk_device * ) bus_dev;
165
-	static char bios_disk_description[] = "BIOS disk 00";
166
-
167
-	sprintf ( bios_disk_description + 10, "%hhx", bios_disk->drive );
168
-	return bios_disk_description;
169
-}
170
-
171
-/*
172
- * Name a BIOS disk device
173
- *
174
- */
175
-static const char * bios_disk_name_device ( struct bus_dev *bus_dev ) {
176
-	struct bios_disk_device *bios_disk
177
-		= ( struct bios_disk_device * ) bus_dev;
178
-	
179
-	return bios_disk->name;
180
-}
181
-
182
-/*
183
- * BIOS disk bus operations table
184
- *
185
- */
186
-struct bus_driver bios_disk_driver __bus_driver = {
187
-	.name			= "BIOS DISK",
188
-	.next_location		= bios_disk_next_location,
189
-	.fill_device		= bios_disk_fill_device,
190
-	.check_driver		= bios_disk_check_driver,
191
-	.describe_device	= bios_disk_describe_device,
192
-	.name_device		= bios_disk_name_device,
193
-};
194
-
195
-/*
196
- * Fill in a disk structure
197
- *
198
- */
199
-void bios_disk_fill_disk ( struct disk *disk __unused,
200
-			   struct bios_disk_device *bios_disk __unused ) {
201
-
202
-}
203
-
204
-#endif

+ 0
- 27
src/arch/i386/drivers/disk/floppy.c Vedi File

@@ -1,27 +0,0 @@
1
-#include "console.h"
2
-#include "disk.h"
3
-#include "bios_disks.h"
4
-
5
-static void fill_floppy_name ( char *buf, uint8_t drive ) {
6
-	sprintf ( buf, "fd%d", drive );
7
-}
8
-
9
-static struct disk_operations floppy_operations = {
10
-
11
-};
12
-
13
-static int floppy_probe ( struct disk *disk,
14
-			  struct bios_disk_device *bios_disk ) {
15
-	
16
-	return 1;
17
-}
18
-
19
-static void floppy_disable ( struct disk *disk,
20
-			     struct bios_disk_device *bios_disk ) {
21
-	
22
-}
23
-
24
-BIOS_DISK_DRIVER ( floppy_driver, fill_floppy_name, 0x00, 0x7f );
25
-
26
-DRIVER ( "floppy", disk_driver, bios_disk_driver, floppy_driver,
27
-	 floppy_probe, floppy_disable );

+ 1
- 1
src/arch/i386/firmware/pcbios/bios_console.c Vedi File

@@ -233,7 +233,7 @@ static const char * scancode_to_ansi_seq ( unsigned int scancode ) {
233 233
 static int bios_getchar ( void ) {
234 234
 	uint16_t keypress;
235 235
 	unsigned int character;
236
-	char *ansi_seq;
236
+	const char *ansi_seq;
237 237
 
238 238
 	/* If we are mid-sequence, pass out the next byte */
239 239
 	if ( ( character = *ansi_input ) ) {

+ 1
- 1
src/arch/i386/prefix/bImageprefix.S Vedi File

@@ -436,7 +436,7 @@ a20_done:
436 436
 	orb	$CR0_PE, %al
437 437
 	movl	%eax, %cr0
438 438
 
439
-	DATA32 ljmp %ds:(code32 - setup_code)
439
+	DATA32 ljmp *%ds:(code32 - setup_code)
440 440
 code32:
441 441
 	.long	0x100000
442 442
 	.word	__BOOT_CS, 0

+ 1
- 1
src/arch/i386/prefix/int19exit.c Vedi File

@@ -25,7 +25,7 @@
25 25
  * @bug Not yet implemented
26 26
  *
27 27
  */
28
-void exit_via_int19 ( struct i386_all_regs *ix86 ) {
28
+void exit_via_int19 ( __unused struct i386_all_regs *ix86 ) {
29 29
 	bochsbp();
30 30
 	/* Placeholder */
31 31
 }

+ 0
- 289
src/core/disk.c Vedi File

@@ -1,289 +0,0 @@
1
-#include <etherboot.h>
2
-#include <disk.h>
3
-
4
-#warning "disk.c is currently broken"
5
-#if 0
6
-
7
-#undef disk_disable
8
-
9
-static int dummy(void *unused __unused)
10
-{
11
-	return (0);
12
-}
13
-
14
-static unsigned char disk_buffer[DISK_BUFFER_SIZE];
15
-struct disk disk =
16
-{
17
-	{
18
-		0,				/* dev.disable */
19
-		{
20
-			0,
21
-			0,
22
-			PCI_BUS_TYPE,
23
-		},				/* dev.devid */
24
-		0,				/* index */
25
-		0,				/* type */
26
-		PROBE_FIRST,			/* how_probe */
27
-		PROBE_NONE,			/* to_probe */
28
-		0,				/* failsafe */
29
-		0,				/* type_index */
30
-		{},				/* state */
31
-	},
32
-	(int (*)(struct disk *, sector_t ))dummy,		/* read */
33
-	0 - 1, 		/* drive */
34
-	0,		/* hw_sector_size */
35
-	0,		/* sectors_per_read */
36
-	0,		/* bytes */
37
-	0,		/* sectors */
38
-	0, 		/* sector */
39
-	disk_buffer,	/* buffer */
40
-	0,		/* priv */
41
-	
42
-	0,		/* disk_offset */
43
-	0,		/* direction */
44
-};
45
-
46
-
47
-static int disk_read(
48
-	struct disk *disk, unsigned char *buffer, sector_t sector)
49
-{
50
-	int result;
51
-	sector_t base_sector;
52
-
53
-	/* Note: I do not handle disk wrap around here! */
54
-
55
-	/* Compute the start of the track cache */
56
-	base_sector = sector;
57
-	/* Support sectors_per_read > 1 only on small disks */
58
-	if ((sizeof(sector_t) > sizeof(unsigned long)) &&
59
-		(disk->sectors_per_read > 1)) {
60
-		unsigned long offset;
61
-		offset = ((unsigned long)sector) % disk->sectors_per_read;
62
-		base_sector -= offset;
63
-	}
64
-
65
-	/* See if I need to update the track cache */
66
-	if ((sector < disk->sector) ||
67
-		sector >= disk->sector + (disk->bytes >> 9)) {
68
-		twiddle();
69
-		result = disk->read(disk, base_sector);
70
-		if (result < 0)
71
-			return result;
72
-	}
73
-	/* Service the request from the track cache */
74
-	memcpy(buffer, disk->buffer + ((sector - base_sector)<<9), SECTOR_SIZE);
75
-	return 0;
76
-}
77
-	
78
-static int disk_read_sectors(
79
-	struct disk *disk,
80
-	unsigned char *buffer,
81
-	sector_t base_sector, unsigned int sectors)
82
-{
83
-	sector_t sector = 0;
84
-	unsigned long offset;
85
-	int result = 0;
86
-
87
-	for(offset = 0; offset < sectors; offset++) {
88
-		sector = base_sector + offset;
89
-		if (sector >= disk->sectors) {
90
-			sector -= disk->sectors;
91
-		}
92
-		result = disk_read(disk, buffer + (offset << 9), sector);
93
-		if (result < 0)
94
-			break;
95
-	}
96
-	if (result < 0) {
97
-		printf("disk read error at 0x%lx\n", sector);
98
-	}
99
-	return result;
100
-}
101
-
102
-static os_download_t probe_buffer(unsigned char *buffer, unsigned int len,
103
-	int increment, unsigned int offset, unsigned int *roffset)
104
-{
105
-	os_download_t os_download;
106
-	unsigned int end;
107
-	end = 0;
108
-	os_download = 0;
109
-	if (increment > 0) {
110
-		end = len - SECTOR_SIZE;
111
-	}
112
-	do {
113
-		offset += increment;
114
-		os_download = probe_image(buffer + offset, len - offset);
115
-	} while(!os_download && (offset != end));
116
-	*roffset = offset;
117
-	return os_download;
118
-}
119
-
120
-static int load_image(
121
-	struct disk *disk, 
122
-	unsigned char *buffer, unsigned int buf_sectors,
123
-	sector_t block, unsigned int offset,
124
-	os_download_t os_download)
125
-{
126
-	sector_t skip_sectors;
127
-
128
-	skip_sectors = 0;
129
-	while(1) {
130
-		skip_sectors = os_download(buffer + offset, 
131
-			(buf_sectors << 9) - offset, 0);
132
-
133
-		block += skip_sectors + buf_sectors;
134
-		if (block >= disk->sectors) {
135
-			block -= disk->sectors;
136
-		}
137
-
138
-		offset = 0;
139
-		buf_sectors = 1;
140
-		if (disk_read_sectors(disk, buffer, block, 1) < 0) {
141
-			return 0;
142
-		}
143
-	}
144
-	return -1;
145
-}
146
-
147
-int disk_probe(struct dev *dev)
148
-{
149
-	struct disk *disk = (struct disk *)dev;
150
-	if (dev->how_probe == PROBE_NEXT) {
151
-		disk->drive += 1;
152
-	}
153
-	return probe(dev);
154
-}
155
-
156
-
157
-int disk_load_configuration(struct dev *dev)
158
-{
159
-	/* Start with the very simplest possible disk configuration */
160
-	struct disk *disk = (struct disk *)dev;
161
-	disk->direction = (dev->failsafe)?-1:1;
162
-	disk->disk_offset = 0;
163
-	return 0;
164
-}
165
-
166
-int disk_load(struct dev *dev)
167
-{
168
-	struct disk *disk = (struct disk *)dev;
169
-	/* 16K == 8K in either direction from the start of the disk */
170
-	static unsigned char buffer[32*SECTOR_SIZE]; 
171
-	os_download_t os_download;
172
-	unsigned int offset;
173
-	unsigned int len;
174
-	unsigned int buf_sectors;
175
-	volatile sector_t block;
176
-	volatile int inc, increment;
177
-	int i;
178
-	int result;
179
-	jmp_buf real_restart;
180
-
181
-
182
-	printf("Searching for image...\n");
183
-	result = 0;
184
-	/* Only check for 16byte aligned images */
185
-	increment = (disk->direction < 0)?-16:16;
186
-	/* Load a buffer, and see if it contains the start of an image
187
-	 * we can boot from disk.
188
-	 */
189
-	len = sizeof(buffer);
190
-	buf_sectors = sizeof(buffer) / SECTOR_SIZE;
191
-	inc = increment;
192
-	block = (disk->disk_offset) >> 9;
193
-	if (buf_sectors/2 > block) {
194
-		block = (disk->sectors - (buf_sectors/2)) + block;
195
-	}
196
-	/* let probe buffer assume offset always needs to be incremented */
197
-	offset = (len/2 + ((disk->disk_offset) & 0x1ff)) - inc;
198
-
199
-	/* Catch longjmp so if this image fails to load, I start looking
200
-	 * for the next image where I left off looking for this image.
201
-	 */
202
-	memcpy(&real_restart, &restart_etherboot, sizeof(jmp_buf));
203
-	i = setjmp(restart_etherboot);
204
-	if ((i != 0) && (i != -2)) {
205
-		memcpy(&restart_etherboot, &real_restart, sizeof(jmp_buf));
206
-		longjmp(restart_etherboot, i);
207
-	}
208
-	/* Read the canidate sectors into the buffer */
209
-	if (disk_read_sectors(disk, buffer, block, buf_sectors) < 0) {
210
-		result = -1;
211
-		goto out;
212
-	}
213
-	if (inc == increment) {
214
-		os_download = probe_buffer(buffer, len, inc, offset, &offset);
215
-		if (os_download)
216
-			goto load_image;
217
-		inc = -inc;
218
-	}
219
-	os_download = probe_buffer(buffer, len, inc, offset, &offset);
220
-	if (!os_download) {
221
-		result = -1;
222
-		goto out;
223
-	}
224
- load_image:
225
-	printf("Loading image...\n");
226
-	result = load_image(disk, buffer, buf_sectors, block, offset, os_download);
227
- out:
228
-	memcpy(&restart_etherboot, &real_restart, sizeof(jmp_buf));
229
-	return result;
230
-}
231
-
232
-int url_file(const char *name,
233
-	int (*fnc)(unsigned char *, unsigned int, unsigned int, int) __unused)
234
-{
235
-	unsigned int drive;
236
-	unsigned long  disk_offset;
237
-	int direction;
238
-	int type;
239
-
240
-	disk_offset = 0;
241
-	direction = 1;
242
-	if (memcmp(name, "disk", 4) == 0) {
243
-		type = DISK_DRIVER;
244
-		name += 4;
245
-	}
246
-	else if (memcmp(name, "floppy", 6) == 0) {
247
-		type = FLOPPY_DRIVER;
248
-		name += 6;
249
-	}
250
-	else {
251
-		printf("Unknown device type\n");
252
-		return 0;
253
-	}
254
-	drive = strtoul(name, &name, 10);
255
-	if ((name[0] == '+') || (name[0] == '-')) {
256
-		direction = (name[0] == '-')? -1 : 1;
257
-		name++;
258
-		disk_offset = strtoul(name, &name, 10);
259
-	}
260
-	if (name[0]) {
261
-		printf("Junk '%s' at end of disk url\n", name);
262
-		return 0;
263
-	}
264
-	memset(&disk, 0, sizeof(disk));
265
-	disk.buffer = disk_buffer;
266
-	disk.drive = 0;
267
-	disk.dev.how_probe = PROBE_FIRST;
268
-	disk.dev.type = type;
269
-	do {
270
-		disk_disable();
271
-		disk.dev.how_probe = disk_probe(&disk.dev);
272
-		if (disk.dev.how_probe == PROBE_FAILED) {
273
-			printf("Not that many drives\n");
274
-			return 0;
275
-		}
276
-	} while(disk.drive < drive);
277
-	disk.direction = direction;
278
-	disk.disk_offset = disk_offset;
279
-	
280
-	return disk_load(&disk.dev);
281
-}
282
-
283
-void disk_disable(void)
284
-{
285
-	disable(&disk.dev);
286
-}
287
-
288
-
289
-#endif

+ 0
- 58
src/include/disk.h Vedi File

@@ -1,58 +0,0 @@
1
-#ifndef DISK_H
2
-#define DISK_H
3
-
4
-#include "etherboot.h" /* for sector_t */
5
-#include "dev.h"
6
-
7
-/*
8
- *	Structure returned from disk_probe and passed to other driver
9
- *	functions.
10
- */
11
-struct disk
12
-{
13
-	struct dev    dev;  /* This must come first */
14
-	int	      (*read)(struct disk *, sector_t sector);
15
-	unsigned int  drive;
16
-	unsigned long hw_sector_size;   /* The hardware sector size for dealing
17
-				         * with partition tables and the like.
18
-				         * Must be >= 512
19
-				         */
20
-	unsigned int  sectors_per_read; /* The number of 512 byte sectors
21
-					 * returned by each read call. 
22
-				         * All I/O must be aligned to this size.
23
-				         */
24
-	unsigned int  bytes;	        /* The number of bytes in the read buffer. */
25
-	sector_t      sectors;	        /* The number of sectors on the drive.  */
26
-	sector_t      sector;	        /* The first sector in the driver buffer  */
27
-	unsigned char *buffer;	        /* The data read from the drive */
28
-	void	      *priv;	        /* driver can hang private data here */
29
-
30
-	unsigned long disk_offset;
31
-	int           direction;
32
-};
33
-
34
-struct disk_operations {
35
-};
36
-
37
-extern struct disk disk;
38
-extern int url_file(const char *name,
39
-	int (*fnc)(unsigned char *, unsigned int, unsigned int, int));
40
-
41
-extern int disk_probe(struct dev *dev);
42
-extern int disk_load_configuration(struct dev *dev);
43
-extern int disk_load(struct dev *dev);
44
-extern void disk_disable(void);
45
-
46
-extern struct type_driver disk_driver;
47
-
48
-#ifndef DOWNLOAD_PROTO_DISK
49
-#define disk_disable()	do { } while(0)
50
-#endif
51
-
52
-#define SECTOR_SIZE 512
53
-#define SECTOR_SHIFT 9
54
-
55
-/* Maximum block_size that may be set. */
56
-#define DISK_BUFFER_SIZE (18 * SECTOR_SIZE)
57
-
58
-#endif /* DISK_H */

+ 3
- 0
src/include/gpxe/ramdisk.h Vedi File

@@ -16,4 +16,7 @@ struct ramdisk {
16 16
 	userptr_t data;
17 17
 };
18 18
 
19
+int init_ramdisk ( struct ramdisk *ramdisk, userptr_t data, size_t len,
20
+		   unsigned int blksize );
21
+
19 22
 #endif /* _GPXE_RAMDISK_H */

+ 0
- 28
src/usr/autoboot.c Vedi File

@@ -43,34 +43,6 @@ static struct net_device * find_boot_netdev ( void ) {
43 43
 	return NULL;
44 44
 }
45 45
 
46
-/**
47
- * Get the next network device to try
48
- *
49
- * @ret netdev		'Next' network device
50
- *
51
- * This function will cycle through all registered network devices in
52
- * order, returning NULL.
53
- *
54
- * This function should be safe against registration/deregistration of
55
- * net devices between calls to next_netdev().
56
- */
57
-static struct net_device * next_netdev ( void ) {
58
-	static struct net_device *last_netdev = NULL;
59
-	struct net_device *netdev;
60
-
61
-	for_each_netdev ( netdev ) {
62
-		if ( ! last_netdev ) {
63
-			last_netdev = netdev;
64
-			return netdev;
65
-		}
66
-		if ( last_netdev == netdev )
67
-			last_netdev = NULL;
68
-	}
69
-
70
-	last_netdev = NULL;
71
-	return NULL;
72
-}
73
-
74 46
 /**
75 47
  * Boot from a network device
76 48
  *

Loading…
Annulla
Salva