瀏覽代碼

Split out EISA driver into a separate file, since 3c509s can only take 16K

ROMs (AFAIK).
tags/v0.9.3
Michael Brown 19 年之前
父節點
當前提交
bd2c3b0f27
共有 2 個文件被更改,包括 40 次插入37 次删除
  1. 38
    0
      src/drivers/net/3c509-eisa.c
  2. 2
    37
      src/drivers/net/3c509.c

+ 38
- 0
src/drivers/net/3c509-eisa.c 查看文件

@@ -0,0 +1,38 @@
1
+/*
2
+ * Split out from 3c509.c, since EISA cards are relatively rare, and
3
+ * ROM space in 3c509s is very limited.
4
+ *
5
+ */
6
+
7
+#include "eisa.h"
8
+#include "isa.h"
9
+#include "console.h"
10
+#include "3c509.h"
11
+
12
+/*
13
+ * The EISA probe function
14
+ *
15
+ */
16
+static int el3_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) {
17
+	struct nic *nic = nic_device ( dev );
18
+	
19
+	enable_eisa_device ( eisa );
20
+	nic->ioaddr = eisa->ioaddr;
21
+	nic->irqno = 0;
22
+	printf ( "3C5x9 board on EISA at %#hx - ", nic->ioaddr );
23
+
24
+	/* Hand off to generic t5x9 probe routine */
25
+	return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK );
26
+}
27
+
28
+static struct eisa_id el3_eisa_adapters[] = {
29
+	{ "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID },
30
+};
31
+
32
+static struct eisa_driver el3_eisa_driver =
33
+	EISA_DRIVER ( "3c509 (EISA)", el3_eisa_adapters );
34
+
35
+BOOT_DRIVER ( "3c509 (EISA)", find_eisa_boot_device, el3_eisa_driver,
36
+	      el3_eisa_probe );
37
+
38
+ISA_ROM ( "3c509-eisa","3c509 (EISA)" );

+ 2
- 37
src/drivers/net/3c509.c 查看文件

@@ -4,12 +4,11 @@
4 4
  *
5 5
  */
6 6
 
7
-#include "eisa.h"
8 7
 #include "isa.h"
9 8
 #include "io.h"
10 9
 #include "timer.h"
11 10
 #include "string.h"
12
-#include "etherboot.h"
11
+#include "console.h"
13 12
 #include "3c509.h"
14 13
 
15 14
 /*
@@ -235,38 +234,4 @@ static struct t509_driver el3_t509_driver = { "3c509 (ISA)" };
235 234
 BOOT_DRIVER ( "3c509", find_t509_boot_device, el3_t509_driver,
236 235
 	      el3_t509_probe );
237 236
 
238
-/*
239
- * The EISA probe function
240
- *
241
- */
242
-static int el3_eisa_probe ( struct dev *dev, struct eisa_device *eisa ) {
243
-	struct nic *nic = nic_device ( dev );
244
-	
245
-	enable_eisa_device ( eisa );
246
-	nic->ioaddr = eisa->ioaddr;
247
-	nic->irqno = 0;
248
-	printf ( "3C5x9 board on EISA at %#hx - ", nic->ioaddr );
249
-
250
-	/* Hand off to generic t5x9 probe routine */
251
-	return t5x9_probe ( nic, ISA_PROD_ID ( PROD_ID ), ISA_PROD_ID_MASK );
252
-}
253
-
254
-static struct eisa_id el3_eisa_adapters[] = {
255
-	{ "3Com 3c509 EtherLink III (EISA)", MFG_ID, PROD_ID },
256
-};
257
-
258
-static struct eisa_driver el3_eisa_driver =
259
-	EISA_DRIVER ( "3c509 (EISA)", el3_eisa_adapters );
260
-
261
-BOOT_DRIVER ( "3c509 (EISA)", find_eisa_boot_device, el3_eisa_driver,
262
-	      el3_eisa_probe );
263
-
264
-/*
265
- * We currently build both ISA and EISA support into a single ROM
266
- * image, though there's no reason why this couldn't be split to
267
- * reduce code size; just split this .c file into two in the obvious
268
- * place.
269
- *
270
- */
271
-ISA_ROM ( "3c509","3c509, ISA/EISA" );
272
-
237
+ISA_ROM ( "3c509","3c509" );

Loading…
取消
儲存