Fix DOS interrupt error messages
[syslinux.git] / core / pxeidle.inc
blob7d85beb54184a9ce474b8f74504f3a740fd45b5d
1 ;; -*- fundamental -*- ---------------------------------------------------
2 ;;
3 ;;   Copyright 2008 H. Peter Anvin - All Rights Reserved
4 ;;
5 ;;   This program is free software; you can redistribute it and/or modify
6 ;;   it under the terms of the GNU General Public License as published by
7 ;;   the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
8 ;;   Boston MA 02110-1301, USA; either version 2 of the License, or
9 ;;   (at your option) any later version; incorporated herein by reference.
11 ;; -----------------------------------------------------------------------
14 ;; pxeidle.inc
17 ;; Query for the NIC type, and detect certain special cases.
20                 section .text
23 ;; Initializes the idle mechanism based on the device type
25 ;;      Assumes CS == DS == ES
27 pxe_detect_nic_type:
28                 pushad
30                 mov di,pxenv_get_nic_type
31                 mov bx,PXENV_UNDI_GET_NIC_TYPE
32                 call pxenv
33                 jc .done
34                 cmp word [di],0
35                 jne .done
36                 cmp byte [di+2],2               ; PCI_NIC
37                 jne .done                       ; No list for non-PCI nics
39                 mov cx,pxe_idle_pci_list.len
40                 mov si,pxe_idle_pci_list
41 .look_for_id:
42                 lodsd
43                 cmp eax,[di+3]                  ; VID:DID
44                 je .found_device
45                 loop .look_for_id
46 .done:
47                 popad
48                 ret
50 .found_device:
51                 and byte [feature_flags],~2
52                 jmp .done
55 ;; List of devices for which we want to actually issue idle calls.
57                 section .data
58                 align 4, db 0
59 pxe_idle_pci_list:
61 ; Older Broadcom NICs; these need idle calls to avoid FIFO stalls.
63                 dw 0x14e4, 0x1659               ; BCM5721
64                 dw 0x14e4, 0x165a               ; BCM5722
65                 dw 0x14e4, 0x165b               ; BCM5723
66                 dw 0x14e4, 0x1668               ; BCM5714
67                 dw 0x14e4, 0x1669               ; BCM5714S
68                 dw 0x14e4, 0x166a               ; BCM5780
69                 dw 0x14e4, 0x166b               ; BCM5780S
70                 dw 0x14e4, 0x1673               ; BCM5755M
71                 dw 0x14e4, 0x1674               ; BCM5756ME
72                 dw 0x14e4, 0x1678               ; BCM5715
73                 dw 0x14e4, 0x1679               ; BCM5715S
74                 dw 0x14e4, 0x167b               ; BCM5755
76 .len            equ ($-pxe_idle_pci_list) >> 2
78                 section .bss
79 pxenv_get_nic_type:
80 .status:        resw 1
81 .nic_type:      resb 1
82 .vid:           resw 1
83 .did:           resw 1
84 .base_class:    resb 1
85 .sub_class:     resb 1
86 .prog_intf:     resb 1
87 .rev:           resb 1
88 .busdevfunc:    resw 1
89 .svid:          resw 1
90 .sdid:          resw 1
92                 section .text