Browse Source

undipci_probe() has to calculate busdevfn anyway, so we may as well pass

it directly to undi_load_pci().
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
6b09dd8244

+ 1
- 2
src/arch/i386/drivers/net/undi.c View File

91
 		}
91
 		}
92
 
92
 
93
 		/* Call UNDI ROM loader to create pixie */
93
 		/* Call UNDI ROM loader to create pixie */
94
-		if ( ( rc = undi_load_pci ( undi, undirom, pci->bus,
95
-					    pci->devfn ) ) != 0 )
94
+		if ( ( rc = undi_load_pci ( undi, undirom, busdevfn ) ) != 0 )
96
 			goto err_load_pci;
95
 			goto err_load_pci;
97
 	}
96
 	}
98
 
97
 

+ 2
- 18
src/arch/i386/drivers/net/undiload.c View File

49
  * @v undirom		UNDI ROM
49
  * @v undirom		UNDI ROM
50
  * @ret rc		Return status code
50
  * @ret rc		Return status code
51
  */
51
  */
52
-static int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
52
+int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
53
 	struct s_PXE ppxe;
53
 	struct s_PXE ppxe;
54
 	uint16_t fbms;
54
 	uint16_t fbms;
55
 	unsigned int fbms_seg;
55
 	unsigned int fbms_seg;
138
 	return 0;
138
 	return 0;
139
 }
139
 }
140
 
140
 
141
-/**
142
- * Call UNDI loader to create a pixie
143
- *
144
- * @v undi		UNDI device
145
- * @v undirom		UNDI ROM
146
- * @v pci_busdevfn	PCI bus:dev.fn
147
- * @ret rc		Return status code
148
- */
149
-int undi_load_pci ( struct undi_device *undi, struct undi_rom *undirom,
150
-		    unsigned int bus, unsigned int devfn ) {
151
-	undi->pci_busdevfn = ( ( bus << 8 ) | devfn );
152
-	undi->isapnp_csn = 0xffff;
153
-	undi->isapnp_read_port = 0xffff;
154
-	return undi_load ( undi, undirom );
155
-}
156
-
157
 /**
141
 /**
158
  * Unload a pixie
142
  * Unload a pixie
159
  *
143
  *
172
 	/* Erase signatures */
156
 	/* Erase signatures */
173
 	if ( undi->pxenv.segment )
157
 	if ( undi->pxenv.segment )
174
 		put_real ( dead, undi->pxenv.segment, undi->pxenv.offset );
158
 		put_real ( dead, undi->pxenv.segment, undi->pxenv.offset );
175
-	if ( undi->ppxe_segment )
159
+	if ( undi->ppxe.segment )
176
 		put_real ( dead, undi->ppxe.segment, undi->ppxe.offset );
160
 		put_real ( dead, undi->ppxe.segment, undi->ppxe.offset );
177
 
161
 
178
 	/* Free base memory, if possible */
162
 	/* Free base memory, if possible */

+ 18
- 2
src/arch/i386/include/undiload.h View File

10
 struct undi_device;
10
 struct undi_device;
11
 struct undi_rom;
11
 struct undi_rom;
12
 
12
 
13
-extern int undi_load_pci ( struct undi_device *undi, struct undi_rom *undirom,
14
-			   unsigned int bus, unsigned int devfn );
13
+extern int undi_load ( struct undi_device *undi, struct undi_rom *undirom );
15
 extern int undi_unload ( struct undi_device *undi );
14
 extern int undi_unload ( struct undi_device *undi );
16
 
15
 
16
+/**
17
+ * Call UNDI loader to create a pixie
18
+ *
19
+ * @v undi		UNDI device
20
+ * @v undirom		UNDI ROM
21
+ * @v pci_busdevfn	PCI bus:dev.fn
22
+ * @ret rc		Return status code
23
+ */
24
+static inline int undi_load_pci ( struct undi_device *undi,
25
+				  struct undi_rom *undirom,
26
+				  unsigned int pci_busdevfn ) {
27
+	undi->pci_busdevfn = pci_busdevfn;
28
+	undi->isapnp_csn = 0xffff;
29
+	undi->isapnp_read_port = 0xffff;
30
+	return undi_load ( undi, undirom );
31
+}
32
+
17
 #endif /* _UNDILOAD_H */
33
 #endif /* _UNDILOAD_H */

Loading…
Cancel
Save