1 ;; -*- fundamental -*- ---------------------------------------------------
3 ;; Copyright 2008 H. Peter Anvin - All Rights Reserved
4 ;; Copyright 2009 Intel Corporation; author: H. Peter Anvin
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
9 ;; Boston MA 02110-1301, USA; either version 2 of the License, or
10 ;; (at your option) any later version; incorporated herein by reference.
12 ;; -----------------------------------------------------------------------
18 ;; Query for the NIC type, and detect certain special cases.
24 ;; Initializes the idle mechanism based on the device type
26 ;; Assumes CS == DS == ES
31 mov di,pxenv_get_nic_type
32 mov bx,PXENV_UNDI_GET_NIC_TYPE
37 cmp byte [di+2],2 ; PCI_NIC
38 jne .done ; No list for non-PCI nics
40 mov cx,pxe_idle_pci_list.len
41 mov si,pxe_idle_pci_list
44 cmp eax,[di+3] ; VID:DID
52 mov word [IdleHook],check_for_arp
56 ;; List of devices for which we want to actually issue idle calls.
62 ; Older Broadcom NICs; these need idle calls to avoid FIFO stalls.
64 dw 0x14e4, 0x1659 ; BCM5721
65 dw 0x14e4, 0x165a ; BCM5722
66 dw 0x14e4, 0x165b ; BCM5723
67 dw 0x14e4, 0x1668 ; BCM5714
68 dw 0x14e4, 0x1669 ; BCM5714S
69 dw 0x14e4, 0x166a ; BCM5780
70 dw 0x14e4, 0x166b ; BCM5780S
71 dw 0x14e4, 0x1673 ; BCM5755M
72 dw 0x14e4, 0x1674 ; BCM5756ME
73 dw 0x14e4, 0x1678 ; BCM5715
74 dw 0x14e4, 0x1679 ; BCM5715S
75 dw 0x14e4, 0x167b ; BCM5755
77 .len equ ($-pxe_idle_pci_list) >> 2
95 ; Call the receive loop while idle. This is done mostly so we can respond to
96 ; ARP messages, but perhaps in the future this can be used to do network
99 ; hpa sez: people using automatic control on the serial port get very
100 ; unhappy if we poll for ARP too often (the PXE stack is pretty slow,
101 ; typically.) Therefore, only poll if at least 4 BIOS timer ticks have
102 ; passed since the last poll, and reset this when a character is
103 ; received (call reset_idle).
105 ; Note: we only do this if pxe_detect_nic_type has set the IdleHook
106 ; to point to this routine.
111 mov [pxe_udp_read_pkt.buffer],di
112 mov [pxe_udp_read_pkt.buffer+2],ds
113 mov word [pxe_udp_read_pkt.buffersize],packet_buf_size
115 mov [pxe_udp_read_pkt.dip],eax
116 mov word [pxe_udp_read_pkt.lport],htons(9) ; discard port
117 mov di,pxe_udp_read_pkt
118 mov bx,PXENV_UDP_READ