Rev 4788 | Rev 6716 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4788 | Rev 5166 | ||
---|---|---|---|
Line 222... | Line 222... | ||
222 | mov ch, [V_Dev] |
222 | mov ch, [V_Dev] |
223 | mov cl, 0 ; offset to device/vendor id |
223 | mov cl, 0 ; offset to device/vendor id |
224 | mcall 62 ; get ID's |
224 | mcall 62 ; get ID's |
Line 225... | Line 225... | ||
225 | 225 | ||
226 | cmp ax, 0 ; Vendor ID should not be 0 or 0xFFFF |
226 | cmp ax, 0 ; Vendor ID should not be 0 or 0xFFFF |
227 | je nextDev ; check next device if nothing exists here |
- | |
228 | 227 | je .nextDev ; check next device if nothing exists here |
|
229 | cmp ax, 0xffff ; |
228 | cmp ax, 0xffff ; |
Line 230... | Line 229... | ||
230 | je nextDev ; |
229 | je .nextDev ; |
231 | 230 | ||
232 | mov [PCI_Vendor], ax ; There is a device here, save the ID's |
231 | mov [PCI_Vendor], ax ; There is a device here, save the ID's |
233 | shr eax, 16 ; |
232 | shr eax, 16 ; |
234 | mov [PCI_Device], ax ; |
233 | mov [PCI_Device], ax ; |
235 | mov bl, 4 ; Read config byte |
234 | mov bl, 4 ; Read config byte |
236 | mov bh, [V_Bus] ; Bus # |
235 | mov bh, [V_Bus] ; Bus # |
237 | mov ch, [V_Dev] ; Device # on bus |
236 | mov ch, [V_Dev] ; Device # on bus |
238 | mov cl, 0x08 ; Register to read (Get Revision) |
237 | mov cl, 0x08 ; Register to read (Get Revision) |
- | 238 | mcall 62 ; Read it |
|
239 | mcall 62 ; Read it |
239 | mov [PCI_Rev], al ; Save it |
240 | mov [PCI_Rev], al ; Save it |
240 | |
241 | mov cl, 0x0b ; Register to read (Get class) |
- | |
242 | mcall 62 ; Read it |
241 | mov cl, 0x0b ; Register to read (Get class) |
- | 242 | mcall 62 ; Read it |
|
243 | 243 | mov [PCI_Class], al ; Save it |
|
244 | mov [PCI_Class], al ; Save it |
244 | |
245 | mov cl, 0x0a ; Register to read (Get Subclass) |
245 | mov cl, 0x0a ; Register to read (Get Subclass) |
- | 246 | mcall 62 ; Read it |
|
246 | mcall 62 ; Read it |
247 | mov [PCI_SubClass], al ; Save it |
247 | mov [PCI_SubClass], al ; Save it |
248 | |
248 | mov cl, 0x09 ; Register to read (Get Interface) |
249 | mov cl, 0x09 ; Register to read (Get Interface) |
- | 250 | mcall 62 ; Read it |
|
249 | mcall 62 ; Read it |
251 | mov [PCI_Interface], al ; Save it |
250 | mov [PCI_Interface], al ; Save it |
252 | |
251 | mov cl, 0x3c ; Register to read (Get IRQ) |
253 | mov cl, 0x3c ; Register to read (Get IRQ) |
Line -... | Line 254... | ||
- | 254 | mcall 62 ; Read it |
|
252 | @@: mcall 62 ; Read it |
255 | mov [PCI_IRQ], al ; Save it |
253 | mov [PCI_IRQ], al ; Save it |
256 | |
Line 254... | Line 257... | ||
254 | 257 | ; Could it be a network card? |
|
255 | cmp [PCI_Class], 2 ; network controller |
258 | cmp [PCI_Class], 2 ; network controller |
256 | je @f |
259 | je .found |
257 | 260 | ||
258 | cmp [PCI_Class], 6 ; bridge type device |
261 | cmp [PCI_Class], 6 ; bridge type device |
259 | jne nextDev |
262 | jne .nextDev |
260 | cmp [PCI_SubClass], 0x80 ; PCI-other bridge (for nvidia chipset) |
- | |
Line -... | Line 263... | ||
- | 263 | cmp [PCI_SubClass], 0x80 ; PCI-other bridge (for nvidia chipset) |
|
261 | jne nextDev |
264 | jne .nextDev |
262 | cmp [PCI_Vendor], 0x10DE ; nvidia |
265 | cmp [PCI_Vendor], 0x10DE ; nvidia |
Line 263... | Line -... | ||
263 | jne nextDev |
- | |
264 | @@: |
- | |
265 | - | ||
266 | cmp byte[param], 0 |
- | |
267 | jne load_and_start |
266 | jne .nextDev |
268 | - | ||
269 | mov cl, 0x0e |
- | |
270 | mcall 62 |
- | |
Line 271... | Line 267... | ||
271 | 267 | ||
272 | push eax |
268 | .found: |
273 | call Print_New_Device ; print device info to screen |
269 | cmp byte[param], 0 ; Load network driver immediately? |
- | 270 | jne load_and_start |
|
- | 271 | ||
- | 272 | call Print_New_Device ; print device info to screen |
|
- | 273 | ||
- | 274 | .nextDev: |
|
- | 275 | test [V_Dev], 7 |
|
- | 276 | jnz .nextFn |
|
- | 277 | ||
- | 278 | ; Is this a multifunction device? |
|
Line -... | Line 279... | ||
- | 279 | mov bl, 4 ; Read config byte |
|
274 | pop eax |
280 | mov bh, [V_Bus] ; Bus # |
Line 275... | Line 281... | ||
275 | test al, al |
281 | mov ch, [V_Dev] ; Device # on bus |
276 | js nextDev |
282 | mov cl, 0x0e |
277 | 283 | mcall 62 |
|
Line 278... | Line 284... | ||
278 | nextdev2: |
284 | test al, al |
279 | test [V_Dev], 7 |
285 | js .nextFn |
Line 319... | Line 325... | ||
319 | 325 | ||
Line 320... | Line 326... | ||
320 | mcall 68, 17, IOCTL |
326 | mcall 68, 17, IOCTL |
321 | 327 | ||
322 | .next: |
328 | .next: |
323 | cmp byte[param], 'A' |
329 | cmp byte[param], 'A' |
Line 324... | Line 330... | ||
324 | je nextdev2 |
330 | je Start_Enum.nextDev |