Browse Source

Header rearrangement.

I want to get to the point where any header in include/ reflects a
standard user-level header (e.g. a POSIX header), while everything that's
specific to gPXE lives in include/gpxe/.  Headers that reflect a Linux
header (e.g. if_ether.h) should also be in include/gpxe/, with the same
name as the Linux header and, preferably, the same names used for the
definitions.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
824d6ffa7f
60 changed files with 108 additions and 89 deletions
  1. 1
    1
      src/arch/i386/core/pci_io.c
  2. 1
    1
      src/arch/i386/drivers/net/undi.c
  3. 1
    1
      src/arch/i386/include/relocate.h
  4. 1
    1
      src/arch/i386/prefix/select_pci.c
  5. 1
    1
      src/core/btext.c
  6. 5
    4
      src/core/nic.c
  7. 1
    1
      src/drivers/bus/pci.c
  8. 1
    1
      src/drivers/net/3c595.c
  9. 1
    1
      src/drivers/net/3c90x.c
  10. 1
    1
      src/drivers/net/amd8111e.c
  11. 1
    1
      src/drivers/net/davicom.c
  12. 1
    1
      src/drivers/net/dmfe.c
  13. 1
    1
      src/drivers/net/e1000.c
  14. 1
    1
      src/drivers/net/eepro100.c
  15. 1
    1
      src/drivers/net/epic100.c
  16. 1
    1
      src/drivers/net/etherfabric.c
  17. 1
    1
      src/drivers/net/forcedeth.c
  18. 1
    1
      src/drivers/net/mlx_ipoib/ib_mt23108.c
  19. 1
    1
      src/drivers/net/mlx_ipoib/ib_mt25218.c
  20. 1
    1
      src/drivers/net/mlx_ipoib/mt23108.c
  21. 1
    1
      src/drivers/net/mlx_ipoib/mt25218.c
  22. 1
    1
      src/drivers/net/mtd80x.c
  23. 1
    1
      src/drivers/net/natsemi.c
  24. 1
    1
      src/drivers/net/ns83820.c
  25. 1
    1
      src/drivers/net/ns8390.c
  26. 1
    1
      src/drivers/net/pcnet32.c
  27. 1
    1
      src/drivers/net/prism2.c
  28. 1
    1
      src/drivers/net/prism2_pci.c
  29. 1
    1
      src/drivers/net/prism2_plx.c
  30. 1
    1
      src/drivers/net/r8169.c
  31. 1
    1
      src/drivers/net/rtl8139.c
  32. 1
    1
      src/drivers/net/sis900.c
  33. 1
    1
      src/drivers/net/skel.c
  34. 1
    1
      src/drivers/net/sundance.c
  35. 1
    1
      src/drivers/net/tg3.c
  36. 1
    1
      src/drivers/net/tlan.c
  37. 1
    1
      src/drivers/net/tulip.c
  38. 1
    1
      src/drivers/net/via-rhine.c
  39. 1
    1
      src/drivers/net/via-velocity.c
  40. 1
    1
      src/drivers/net/w89c840.c
  41. 1
    1
      src/include/background.h
  42. 1
    1
      src/include/console.h
  43. 2
    2
      src/include/dev.h
  44. 2
    1
      src/include/errno.h
  45. 2
    2
      src/include/gpxe/hello.h
  46. 3
    3
      src/include/gpxe/if_arp.h
  47. 3
    3
      src/include/gpxe/if_ether.h
  48. 8
    5
      src/include/gpxe/in.h
  49. 3
    3
      src/include/gpxe/ip.h
  50. 3
    3
      src/include/gpxe/iscsi.h
  51. 14
    7
      src/include/gpxe/pci.h
  52. 5
    0
      src/include/gpxe/pci_ids.h
  53. 3
    3
      src/include/gpxe/scsi.h
  54. 6
    4
      src/include/gpxe/tables.h
  55. 3
    3
      src/include/gpxe/tcp.h
  56. 1
    1
      src/include/image.h
  57. 1
    1
      src/include/init.h
  58. 1
    1
      src/include/proto.h
  59. 1
    1
      src/include/resolv.h
  60. 1
    1
      src/proto/nmb.c

+ 1
- 1
src/arch/i386/core/pci_io.c View File

12
 */
12
 */
13
 #include "etherboot.h"
13
 #include "etherboot.h"
14
 #include "init.h"
14
 #include "init.h"
15
-#include "pci.h"
15
+#include <gpxe/pci.h>
16
 #include "pci_io.h"
16
 #include "pci_io.h"
17
 #ifdef KEEP_IT_REAL
17
 #ifdef KEEP_IT_REAL
18
 #include "realmode.h"
18
 #include "realmode.h"

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

33
 /* to get the interface to the body of the program */
33
 /* to get the interface to the body of the program */
34
 #include "nic.h"
34
 #include "nic.h"
35
 /* to get the PCI support functions, if this is a PCI NIC */
35
 /* to get the PCI support functions, if this is a PCI NIC */
36
-#include "pci.h"
36
+#include <gpxe/pci.h>
37
 /* UNDI and PXE defines.  Includes pxe.h. */
37
 /* UNDI and PXE defines.  Includes pxe.h. */
38
 #include "undi.h"
38
 #include "undi.h"
39
 /* 8259 PIC defines */
39
 /* 8259 PIC defines */

+ 1
- 1
src/arch/i386/include/relocate.h View File

4
 /* relocate() is conceptually impossible with KEEP_IT_REAL */
4
 /* relocate() is conceptually impossible with KEEP_IT_REAL */
5
 #ifndef KEEP_IT_REAL
5
 #ifndef KEEP_IT_REAL
6
 
6
 
7
-#include "tables.h"
7
+#include <gpxe/tables.h>
8
 
8
 
9
 /* An entry in the post-relocation function table */
9
 /* An entry in the post-relocation function table */
10
 struct post_reloc_fn {
10
 struct post_reloc_fn {

+ 1
- 1
src/arch/i386/prefix/select_pci.c View File

1
 #include "dev.h"
1
 #include "dev.h"
2
-#include "pci.h"
2
+#include <gpxe/pci.h>
3
 #include "registers.h"
3
 #include "registers.h"
4
 
4
 
5
 /*
5
 /*

+ 1
- 1
src/core/btext.c View File

10
 #include "etherboot.h"
10
 #include "etherboot.h"
11
 #include "console.h"
11
 #include "console.h"
12
 #include "init.h"
12
 #include "init.h"
13
-#include "pci.h"
13
+#include <gpxe/pci.h>
14
 
14
 
15
 #ifdef CONFIG_FILO
15
 #ifdef CONFIG_FILO
16
 #include <lib.h>
16
 #include <lib.h>

+ 5
- 4
src/core/nic.c View File

457
 
457
 
458
 	ip = (struct iphdr *)buf;
458
 	ip = (struct iphdr *)buf;
459
 	destip = ip->dest.s_addr;
459
 	destip = ip->dest.s_addr;
460
-	if (destip == IP_BROADCAST) {
460
+	if (destip == INADDR_BROADCAST) {
461
 		eth_transmit(broadcast, ETH_P_IP, len, buf);
461
 		eth_transmit(broadcast, ETH_P_IP, len, buf);
462
 	} else if ((destip & htonl(MULTICAST_MASK)) == htonl(MULTICAST_NETWORK)) {
462
 	} else if ((destip & htonl(MULTICAST_MASK)) == htonl(MULTICAST_NETWORK)) {
463
 		unsigned char multicast[6];
463
 		unsigned char multicast[6];
765
 		memset ( arptable, 0, sizeof(arptable) );
765
 		memset ( arptable, 0, sizeof(arptable) );
766
 		memcpy ( arptable[ARP_CLIENT].node, my_hwaddr, ETH_ALEN );
766
 		memcpy ( arptable[ARP_CLIENT].node, my_hwaddr, ETH_ALEN );
767
 
767
 
768
-		udp_transmit(IP_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER,
768
+		udp_transmit(INADDR_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER,
769
 			sizeof(struct bootpip_t), &ip);
769
 			sizeof(struct bootpip_t), &ip);
770
 		remaining_time = rfc2131_sleep_interval(BOOTP_TIMEOUT, retry++);
770
 		remaining_time = rfc2131_sleep_interval(BOOTP_TIMEOUT, retry++);
771
 		stop_time = currticks() + remaining_time;
771
 		stop_time = currticks() + remaining_time;
804
 		for (reqretry = 0; reqretry < MAX_BOOTP_RETRIES; ) {
804
 		for (reqretry = 0; reqretry < MAX_BOOTP_RETRIES; ) {
805
 			unsigned long timeout;
805
 			unsigned long timeout;
806
 
806
 
807
-			udp_transmit(IP_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER,
808
-				     sizeof(struct bootpip_t), &ip);
807
+			udp_transmit(INADDR_BROADCAST, BOOTP_CLIENT,
808
+				     BOOTP_SERVER, sizeof(struct bootpip_t),
809
+				     &ip);
809
 			dhcp_reply=0;
810
 			dhcp_reply=0;
810
 			timeout = rfc2131_sleep_interval(TIMEOUT, reqretry++);
811
 			timeout = rfc2131_sleep_interval(TIMEOUT, reqretry++);
811
 			if (!await_reply(await_bootp, 0, NULL, timeout))
812
 			if (!await_reply(await_bootp, 0, NULL, timeout))

+ 1
- 1
src/drivers/bus/pci.c View File

2
 #include "string.h"
2
 #include "string.h"
3
 #include "console.h"
3
 #include "console.h"
4
 #include "nic.h"
4
 #include "nic.h"
5
-#include "pci.h"
5
+#include <gpxe/pci.h>
6
 
6
 
7
 /*
7
 /*
8
  * pci_io.c may know how many buses we have, in which case it can
8
  * pci_io.c may know how many buses we have, in which case it can

+ 1
- 1
src/drivers/net/3c595.c View File

27
 
27
 
28
 #include "etherboot.h"
28
 #include "etherboot.h"
29
 #include "nic.h"
29
 #include "nic.h"
30
-#include "pci.h"
30
+#include <gpxe/pci.h>
31
 #include "3c595.h"
31
 #include "3c595.h"
32
 #include "timer.h"
32
 #include "timer.h"
33
 
33
 

+ 1
- 1
src/drivers/net/3c90x.c View File

39
 
39
 
40
 #include "etherboot.h"
40
 #include "etherboot.h"
41
 #include "nic.h"
41
 #include "nic.h"
42
-#include "pci.h"
42
+#include <gpxe/pci.h>
43
 #include "timer.h"
43
 #include "timer.h"
44
 
44
 
45
 static struct nic_operations a3c90x_operations;
45
 static struct nic_operations a3c90x_operations;

+ 1
- 1
src/drivers/net/amd8111e.c View File

31
 #include "etherboot.h"
31
 #include "etherboot.h"
32
 #include "nic.h"
32
 #include "nic.h"
33
 #include "mii.h"
33
 #include "mii.h"
34
-#include "pci.h"
34
+#include <gpxe/pci.h>
35
 #include "timer.h"
35
 #include "timer.h"
36
 #include "string.h"
36
 #include "string.h"
37
 #include "stdint.h"
37
 #include "stdint.h"

+ 1
- 1
src/drivers/net/davicom.c View File

43
 
43
 
44
 #include "etherboot.h"
44
 #include "etherboot.h"
45
 #include "nic.h"
45
 #include "nic.h"
46
-#include "pci.h"
46
+#include <gpxe/pci.h>
47
 
47
 
48
 #undef DAVICOM_DEBUG
48
 #undef DAVICOM_DEBUG
49
 #undef DAVICOM_DEBUG_WHERE
49
 #undef DAVICOM_DEBUG_WHERE

+ 1
- 1
src/drivers/net/dmfe.c View File

41
 /* to get the interface to the body of the program */
41
 /* to get the interface to the body of the program */
42
 #include "nic.h"
42
 #include "nic.h"
43
 /* to get the PCI support functions, if this is a PCI NIC */
43
 /* to get the PCI support functions, if this is a PCI NIC */
44
-#include "pci.h"
44
+#include <gpxe/pci.h>
45
 #include "timer.h"
45
 #include "timer.h"
46
 
46
 
47
 /* #define EDEBUG 1 */
47
 /* #define EDEBUG 1 */

+ 1
- 1
src/drivers/net/e1000.c View File

52
 /* to get the interface to the body of the program */
52
 /* to get the interface to the body of the program */
53
 #include "nic.h"
53
 #include "nic.h"
54
 /* to get the PCI support functions, if this is a PCI NIC */
54
 /* to get the PCI support functions, if this is a PCI NIC */
55
-#include "pci.h"
55
+#include <gpxe/pci.h>
56
 #include "timer.h"
56
 #include "timer.h"
57
 
57
 
58
 typedef unsigned char *dma_addr_t;
58
 typedef unsigned char *dma_addr_t;

+ 1
- 1
src/drivers/net/eepro100.c View File

105
 
105
 
106
 #include "etherboot.h"
106
 #include "etherboot.h"
107
 #include "nic.h"
107
 #include "nic.h"
108
-#include "pci.h"
108
+#include <gpxe/pci.h>
109
 #include "timer.h"
109
 #include "timer.h"
110
 
110
 
111
 static int ioaddr;
111
 static int ioaddr;

+ 1
- 1
src/drivers/net/epic100.c View File

5
 #define LINUX_OUT_MACROS
5
 #define LINUX_OUT_MACROS
6
 
6
 
7
 #include "etherboot.h"
7
 #include "etherboot.h"
8
-#include "pci.h"
8
+#include <gpxe/pci.h>
9
 #include "nic.h"
9
 #include "nic.h"
10
 #include "timer.h"
10
 #include "timer.h"
11
 #include "console.h"
11
 #include "console.h"

+ 1
- 1
src/drivers/net/etherfabric.c View File

18
 
18
 
19
 #include "etherboot.h"
19
 #include "etherboot.h"
20
 #include "nic.h"
20
 #include "nic.h"
21
-#include "pci.h"
21
+#include <gpxe/pci.h>
22
 #include "timer.h"
22
 #include "timer.h"
23
 #define dma_addr_t unsigned long
23
 #define dma_addr_t unsigned long
24
 #include "etherfabric.h"
24
 #include "etherfabric.h"

+ 1
- 1
src/drivers/net/forcedeth.c View File

48
 /* to get the interface to the body of the program */
48
 /* to get the interface to the body of the program */
49
 #include "nic.h"
49
 #include "nic.h"
50
 /* to get the PCI support functions, if this is a PCI NIC */
50
 /* to get the PCI support functions, if this is a PCI NIC */
51
-#include "pci.h"
51
+#include <gpxe/pci.h>
52
 /* Include timer support functions */
52
 /* Include timer support functions */
53
 #include "timer.h"
53
 #include "timer.h"
54
 #include "mii.h"
54
 #include "mii.h"

+ 1
- 1
src/drivers/net/mlx_ipoib/ib_mt23108.c View File

21
 
21
 
22
 #include "mt23108.h"
22
 #include "mt23108.h"
23
 #include "ib_driver.h"
23
 #include "ib_driver.h"
24
-#include "pci.h"
24
+#include <gpxe/pci.h>
25
 
25
 
26
 struct device_buffers_st {
26
 struct device_buffers_st {
27
 	union recv_wqe_u mads_qp_rcv_queue[NUM_MADS_RCV_WQES]
27
 	union recv_wqe_u mads_qp_rcv_queue[NUM_MADS_RCV_WQES]

+ 1
- 1
src/drivers/net/mlx_ipoib/ib_mt25218.c View File

21
 
21
 
22
 #include "mt25218.h"
22
 #include "mt25218.h"
23
 #include "ib_driver.h"
23
 #include "ib_driver.h"
24
-#include "pci.h"
24
+#include <gpxe/pci.h>
25
 
25
 
26
 #define MOD_INC(counter, max_count) (counter) = ((counter)+1) & ((max_count) - 1)
26
 #define MOD_INC(counter, max_count) (counter) = ((counter)+1) & ((max_count) - 1)
27
 
27
 

+ 1
- 1
src/drivers/net/mlx_ipoib/mt23108.c View File

15
 /* to get the interface to the body of the program */
15
 /* to get the interface to the body of the program */
16
 #include "nic.h"
16
 #include "nic.h"
17
 /* to get the PCI support functions, if this is a PCI NIC */
17
 /* to get the PCI support functions, if this is a PCI NIC */
18
-#include "pci.h"
18
+#include <gpxe/pci.h>
19
 /* to get the ISA support functions, if this is an ISA NIC */
19
 /* to get the ISA support functions, if this is an ISA NIC */
20
 #include "isa.h"
20
 #include "isa.h"
21
 
21
 

+ 1
- 1
src/drivers/net/mlx_ipoib/mt25218.c View File

15
 /* to get the interface to the body of the program */
15
 /* to get the interface to the body of the program */
16
 #include "nic.h"
16
 #include "nic.h"
17
 /* to get the PCI support functions, if this is a PCI NIC */
17
 /* to get the PCI support functions, if this is a PCI NIC */
18
-#include "pci.h"
18
+#include <gpxe/pci.h>
19
 /* to get the ISA support functions, if this is an ISA NIC */
19
 /* to get the ISA support functions, if this is an ISA NIC */
20
 #include "isa.h"
20
 #include "isa.h"
21
 
21
 

+ 1
- 1
src/drivers/net/mtd80x.c View File

28
 /* to get the interface to the body of the program */
28
 /* to get the interface to the body of the program */
29
 #include "nic.h"
29
 #include "nic.h"
30
 /* to get the PCI support functions, if this is a PCI NIC */
30
 /* to get the PCI support functions, if this is a PCI NIC */
31
-#include "pci.h"
31
+#include <gpxe/pci.h>
32
 
32
 
33
 /* Condensed operations for readability. */
33
 /* Condensed operations for readability. */
34
 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))
34
 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))

+ 1
- 1
src/drivers/net/natsemi.c View File

55
 
55
 
56
 #include "etherboot.h"
56
 #include "etherboot.h"
57
 #include "nic.h"
57
 #include "nic.h"
58
-#include "pci.h"
58
+#include <gpxe/pci.h>
59
 
59
 
60
 /* defines */
60
 /* defines */
61
 
61
 

+ 1
- 1
src/drivers/net/ns83820.c View File

40
 /* to get the interface to the body of the program */
40
 /* to get the interface to the body of the program */
41
 #include "nic.h"
41
 #include "nic.h"
42
 /* to get the PCI support functions, if this is a PCI NIC */
42
 /* to get the PCI support functions, if this is a PCI NIC */
43
-#include "pci.h"
43
+#include <gpxe/pci.h>
44
 
44
 
45
 #if ARCH == ia64		/* Support 64-bit addressing */
45
 #if ARCH == ia64		/* Support 64-bit addressing */
46
 #define USE_64BIT_ADDR
46
 #define USE_64BIT_ADDR

+ 1
- 1
src/drivers/net/ns8390.c View File

33
 #include "nic.h"
33
 #include "nic.h"
34
 #include "ns8390.h"
34
 #include "ns8390.h"
35
 #ifdef	INCLUDE_NS8390
35
 #ifdef	INCLUDE_NS8390
36
-#include "pci.h"
36
+#include <gpxe/pci.h>
37
 #else
37
 #else
38
 #include "isa.h"
38
 #include "isa.h"
39
 #endif
39
 #endif

+ 1
- 1
src/drivers/net/pcnet32.c View File

44
 /* to get the interface to the body of the program */
44
 /* to get the interface to the body of the program */
45
 #include "nic.h"
45
 #include "nic.h"
46
 /* to get the PCI support functions, if this is a PCI NIC */
46
 /* to get the PCI support functions, if this is a PCI NIC */
47
-#include "pci.h"
47
+#include <gpxe/pci.h>
48
 /* Include the time functions */
48
 /* Include the time functions */
49
 #include "timer.h"
49
 #include "timer.h"
50
 #include "mii.h"
50
 #include "mii.h"

+ 1
- 1
src/drivers/net/prism2.c View File

18
 /* to get the interface to the body of the program */
18
 /* to get the interface to the body of the program */
19
 #include "nic.h"
19
 #include "nic.h"
20
 /* to get the PCI support functions, if this is a PCI NIC */
20
 /* to get the PCI support functions, if this is a PCI NIC */
21
-#include "pci.h"
21
+#include <gpxe/pci.h>
22
 
22
 
23
 /*
23
 /*
24
  * Hard-coded SSID
24
  * Hard-coded SSID

+ 1
- 1
src/drivers/net/prism2_pci.c View File

14
  * your option) any later version.
14
  * your option) any later version.
15
  */
15
  */
16
 
16
 
17
-#include "pci.h"
17
+#include <gpxe/pci.h>
18
 #include "nic.h"
18
 #include "nic.h"
19
 
19
 
20
 #define WLAN_HOSTIF WLAN_PCI
20
 #define WLAN_HOSTIF WLAN_PCI

+ 1
- 1
src/drivers/net/prism2_plx.c View File

14
  * your option) any later version.
14
  * your option) any later version.
15
  */
15
  */
16
 
16
 
17
-#include "pci.h"
17
+#include <gpxe/pci.h>
18
 #include "nic.h"
18
 #include "nic.h"
19
 
19
 
20
 #define WLAN_HOSTIF WLAN_PLX
20
 #define WLAN_HOSTIF WLAN_PLX

+ 1
- 1
src/drivers/net/r8169.c View File

49
 /* to get the interface to the body of the program */
49
 /* to get the interface to the body of the program */
50
 #include "nic.h"
50
 #include "nic.h"
51
 /* to get the PCI support functions, if this is a PCI NIC */
51
 /* to get the PCI support functions, if this is a PCI NIC */
52
-#include "pci.h"
52
+#include <gpxe/pci.h>
53
 #include "timer.h"
53
 #include "timer.h"
54
 
54
 
55
 #define drv_version "v1.6"
55
 #define drv_version "v1.6"

+ 1
- 1
src/drivers/net/rtl8139.c View File

64
 
64
 
65
 #include "etherboot.h"
65
 #include "etherboot.h"
66
 #include "nic.h"
66
 #include "nic.h"
67
-#include "pci.h"
67
+#include <gpxe/pci.h>
68
 #include "timer.h"
68
 #include "timer.h"
69
 
69
 
70
 #define RTL_TIMEOUT (1*TICKS_PER_SEC)
70
 #define RTL_TIMEOUT (1*TICKS_PER_SEC)

+ 1
- 1
src/drivers/net/sis900.c View File

45
 
45
 
46
 #include "etherboot.h"
46
 #include "etherboot.h"
47
 #include "nic.h"
47
 #include "nic.h"
48
-#include "pci.h"
48
+#include <gpxe/pci.h>
49
 #include "timer.h"
49
 #include "timer.h"
50
 
50
 
51
 #include "sis900.h"
51
 #include "sis900.h"

+ 1
- 1
src/drivers/net/skel.c View File

15
 /* to get the interface to the body of the program */
15
 /* to get the interface to the body of the program */
16
 #include "nic.h"
16
 #include "nic.h"
17
 /* Drag in support for whichever bus(es) we want for this NIC */
17
 /* Drag in support for whichever bus(es) we want for this NIC */
18
-#include "pci.h"
18
+#include <gpxe/pci.h>
19
 #include "isa.h"
19
 #include "isa.h"
20
 #include "eisa.h"
20
 #include "eisa.h"
21
 #include "isapnp.h"
21
 #include "isapnp.h"

+ 1
- 1
src/drivers/net/sundance.c View File

45
 /* to get the interface to the body of the program */
45
 /* to get the interface to the body of the program */
46
 #include "nic.h"
46
 #include "nic.h"
47
 /* to get the PCI support functions, if this is a PCI NIC */
47
 /* to get the PCI support functions, if this is a PCI NIC */
48
-#include "pci.h"
48
+#include <gpxe/pci.h>
49
 #include "timer.h"
49
 #include "timer.h"
50
 #include "mii.h"
50
 #include "mii.h"
51
 
51
 

+ 1
- 1
src/drivers/net/tg3.c View File

14
 
14
 
15
 #include "etherboot.h"
15
 #include "etherboot.h"
16
 #include "nic.h"
16
 #include "nic.h"
17
-#include "pci.h"
17
+#include <gpxe/pci.h>
18
 #include "timer.h"
18
 #include "timer.h"
19
 #include "string.h"
19
 #include "string.h"
20
 #include "tg3.h"
20
 #include "tg3.h"

+ 1
- 1
src/drivers/net/tlan.c View File

43
 /* to get the interface to the body of the program */
43
 /* to get the interface to the body of the program */
44
 #include "nic.h"
44
 #include "nic.h"
45
 /* to get the PCI support functions, if this is a PCI NIC */
45
 /* to get the PCI support functions, if this is a PCI NIC */
46
-#include "pci.h"
46
+#include <gpxe/pci.h>
47
 #include "timer.h"
47
 #include "timer.h"
48
 #include "tlan.h"
48
 #include "tlan.h"
49
 
49
 

+ 1
- 1
src/drivers/net/tulip.c View File

108
 
108
 
109
 #include "etherboot.h"
109
 #include "etherboot.h"
110
 #include "nic.h"
110
 #include "nic.h"
111
-#include "pci.h"
111
+#include <gpxe/pci.h>
112
 
112
 
113
 /* User settable parameters */
113
 /* User settable parameters */
114
 
114
 

+ 1
- 1
src/drivers/net/via-rhine.c View File

48
 
48
 
49
 #include "etherboot.h"
49
 #include "etherboot.h"
50
 #include "nic.h"
50
 #include "nic.h"
51
-#include "pci.h"
51
+#include <gpxe/pci.h>
52
 #include "timer.h"
52
 #include "timer.h"
53
 
53
 
54
 /* define all ioaddr */
54
 /* define all ioaddr */

+ 1
- 1
src/drivers/net/via-velocity.c View File

43
 /* to get the interface to the body of the program */
43
 /* to get the interface to the body of the program */
44
 #include "nic.h"
44
 #include "nic.h"
45
 /* to get the PCI support functions, if this is a PCI NIC */
45
 /* to get the PCI support functions, if this is a PCI NIC */
46
-#include "pci.h"
46
+#include <gpxe/pci.h>
47
 
47
 
48
 
48
 
49
 #include "via-velocity.h"
49
 #include "via-velocity.h"

+ 1
- 1
src/drivers/net/w89c840.c View File

79
 
79
 
80
 #include "etherboot.h"
80
 #include "etherboot.h"
81
 #include "nic.h"
81
 #include "nic.h"
82
-#include "pci.h"
82
+#include <gpxe/pci.h>
83
 #include "timer.h"
83
 #include "timer.h"
84
 
84
 
85
 static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
85
 static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";

+ 1
- 1
src/include/background.h View File

17
  *
17
  *
18
  */
18
  */
19
 
19
 
20
-#include "tables.h"
20
+#include <gpxe/tables.h>
21
 #include "ip.h"
21
 #include "ip.h"
22
 
22
 
23
 /** A background protocol */
23
 /** A background protocol */

+ 1
- 1
src/include/console.h View File

3
 
3
 
4
 #include "stdint.h"
4
 #include "stdint.h"
5
 #include "vsprintf.h"
5
 #include "vsprintf.h"
6
-#include "tables.h"
6
+#include <gpxe/tables.h>
7
 
7
 
8
 /** @file
8
 /** @file
9
  *
9
  *

+ 2
- 2
src/include/dev.h View File

5
 #include "string.h"
5
 #include "string.h"
6
 #include "buffer.h"
6
 #include "buffer.h"
7
 #include "dhcp.h" /* for dhcp_dev_id */
7
 #include "dhcp.h" /* for dhcp_dev_id */
8
-#include "tables.h"
8
+#include <gpxe/tables.h>
9
 #include <assert.h>
9
 #include <assert.h>
10
 
10
 
11
 /*
11
 /*
202
 
202
 
203
 #define DRIVER(_name,_type_driver,_bus_driver,_bus_info,	 	      \
203
 #define DRIVER(_name,_type_driver,_bus_driver,_bus_info,	 	      \
204
 	       _probe,_disable) 		 			      \
204
 	       _probe,_disable) 		 			      \
205
-	static struct device_driver device_ ## _bus_info __device_driver = {  \
205
+	struct device_driver device_ ## _bus_info __device_driver = {  \
206
 		.name = _name,						      \
206
 		.name = _name,						      \
207
 		.type_driver = &_type_driver,				      \
207
 		.type_driver = &_type_driver,				      \
208
 		.bus_driver = &_bus_driver,				      \
208
 		.bus_driver = &_bus_driver,				      \

+ 2
- 1
src/include/errno.h View File

125
 #define ENOENT		0xd4
125
 #define ENOENT		0xd4
126
 #define EAFNOSUPPORT	0xd5
126
 #define EAFNOSUPPORT	0xd5
127
 #define EAGAIN		0xd6
127
 #define EAGAIN		0xd6
128
+#define EIO		0xd7
128
 
129
 
129
 /* Data structures and declarations */
130
 /* Data structures and declarations */
130
 
131
 
131
-#include "tables.h"
132
+#include <gpxe/tables.h>
132
 
133
 
133
 extern int errno;
134
 extern int errno;
134
 
135
 

+ 2
- 2
src/include/gpxe/hello.h View File

1
-#ifndef _HELLO_H
2
-#define _HELLO_H
1
+#ifndef _GPXE_HELLO_H
2
+#define _GPXE_HELLO_H
3
 
3
 
4
 /** @file
4
 /** @file
5
  *
5
  *

+ 3
- 3
src/include/gpxe/if_arp.h View File

1
-#ifndef	_IF_ARP_H
2
-#define	_IF_ARP_H
1
+#ifndef	_GPXE_IF_ARP_H
2
+#define	_GPXE_IF_ARP_H
3
 
3
 
4
 /** @file
4
 /** @file
5
  *
5
  *
97
 	return ( arp_target_ha ( arphdr ) + arphdr->ar_hln );
97
 	return ( arp_target_ha ( arphdr ) + arphdr->ar_hln );
98
 }
98
 }
99
 
99
 
100
-#endif	/* _IF_ARP_H */
100
+#endif	/* _GPXE_IF_ARP_H */

+ 3
- 3
src/include/gpxe/if_ether.h View File

1
-#ifndef	_IF_ETHER_H
2
-#define	_IF_ETHER_H
1
+#ifndef	_GPXE_IF_ETHER_H
2
+#define	_GPXE_IF_ETHER_H
3
 
3
 
4
 #include <stdint.h>
4
 #include <stdint.h>
5
 
5
 
29
         uint16_t h_protocol;
29
         uint16_t h_protocol;
30
 } __attribute__ ((packed));
30
 } __attribute__ ((packed));
31
 
31
 
32
-#endif	/* _IF_ETHER_H */
32
+#endif	/* _GPXE_IF_ETHER_H */

+ 8
- 5
src/include/gpxe/in.h View File

1
-#ifndef	_IN_H
2
-#define	_IN_H
1
+#ifndef	_GPXE_IN_H
2
+#define	_GPXE_IN_H
3
 
3
 
4
 #include <stdint.h>
4
 #include <stdint.h>
5
 
5
 
8
 #define IP_TCP		6
8
 #define IP_TCP		6
9
 #define IP_UDP		17
9
 #define IP_UDP		17
10
 
10
 
11
-/* Same after going through htonl */
12
-#define IP_BROADCAST	0xFFFFFFFF
11
+#define INADDR_NONE 0xffffffff
12
+
13
+#define INADDR_BROADCAST 0xffffffff
14
+
15
+#define IN_MULTICAST(addr) ( ( (addr) & 0xf0000000 ) == 0xe0000000 )
13
 
16
 
14
 struct in_addr {
17
 struct in_addr {
15
 	uint32_t	s_addr;
18
 	uint32_t	s_addr;
27
 extern int inet_aton ( const char *cp, struct in_addr *inp );
30
 extern int inet_aton ( const char *cp, struct in_addr *inp );
28
 extern char * inet_ntoa ( struct in_addr in );
31
 extern char * inet_ntoa ( struct in_addr in );
29
 
32
 
30
-#endif	/* _IN_H */
33
+#endif	/* _GPXE_IN_H */

+ 3
- 3
src/include/gpxe/ip.h View File

1
-#ifndef _IP_H
2
-#define _IP_H
1
+#ifndef _GPXE_IP_H
2
+#define _GPXE_IP_H
3
 
3
 
4
 /** @file
4
 /** @file
5
  *
5
  *
17
 extern void init_tcpip ( void );
17
 extern void init_tcpip ( void );
18
 extern void run_tcpip ( void );
18
 extern void run_tcpip ( void );
19
 
19
 
20
-#endif /* _IP_H */
20
+#endif /* _GPXE_IP_H */

+ 3
- 3
src/include/gpxe/iscsi.h View File

1
-#ifndef _ISCSI_H
2
-#define _ISCSI_H
1
+#ifndef _GPXE_ISCSI_H
2
+#define _GPXE_ISCSI_H
3
 
3
 
4
 /** @file
4
 /** @file
5
  *
5
  *
457
 	return ( iscsi->state == ISCSI_STATE_FAILED );
457
 	return ( iscsi->state == ISCSI_STATE_FAILED );
458
 }
458
 }
459
 
459
 
460
-#endif /* _ISCSI_H */
460
+#endif /* _GPXE_ISCSI_H */

src/include/pci.h → src/include/gpxe/pci.h View File

1
-#ifndef	PCI_H
2
-#define PCI_H
1
+#ifndef	_GPXEPCI_H
2
+#define _GPXEPCI_H
3
 
3
 
4
 /*
4
 /*
5
 ** Support for NE2000 PCI clones added David Monro June 1997
5
 ** Support for NE2000 PCI clones added David Monro June 1997
21
  * your option) any later version.
21
  * your option) any later version.
22
  */
22
  */
23
 
23
 
24
-#include "stdint.h"
25
-#include "nic.h"
24
+#include <stdint.h>
26
 #include "pci_ids.h"
25
 #include "pci_ids.h"
27
 
26
 
28
 #define	PCI_BUS_TYPE	1
27
 #define	PCI_BUS_TYPE	1
256
 	uint16_t	busdevfn;
255
 	uint16_t	busdevfn;
257
 	uint8_t		revision;
256
 	uint8_t		revision;
258
 	uint8_t		irq;
257
 	uint8_t		irq;
259
-} __attribute__ (( packed ));
258
+	void *priv;
259
+};
260
 
260
 
261
 /*
261
 /*
262
  * Useful busdevfn calculations
262
  * Useful busdevfn calculations
348
 				     unsigned int bar );
348
 				     unsigned int bar );
349
 extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int bar );
349
 extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int bar );
350
 extern int pci_find_capability ( struct pci_device *pci, int capability );
350
 extern int pci_find_capability ( struct pci_device *pci, int capability );
351
-extern void pci_fill_nic ( struct nic *nic, struct pci_device *pci );
352
 
351
 
353
 /*
352
 /*
354
  * PCI bus global definition
353
  * PCI bus global definition
356
  */
355
  */
357
 extern struct bus_driver pci_driver;
356
 extern struct bus_driver pci_driver;
358
 
357
 
359
-#endif	/* PCI_H */
358
+static inline void pci_set_drvdata ( struct pci_device *pci, void *priv ) {
359
+	pci->priv = priv;
360
+}
361
+
362
+static inline void * pci_get_drvdata ( struct pci_device *pci ) {
363
+	return pci->priv;
364
+}
365
+
366
+#endif	/* _GPXE_PCI_H */

src/include/pci_ids.h → src/include/gpxe/pci_ids.h View File

1
+#ifndef _GPXE_PCI_IDS_H
2
+#define _GPXE_PCI_IDS_H
3
+
1
 /*
4
 /*
2
  *	PCI Class, Vendor and Device IDs
5
  *	PCI Class, Vendor and Device IDs
3
  *
6
  *
341
 #define PCI_SUBVENDOR_ID_EXSYS		0xd84d
344
 #define PCI_SUBVENDOR_ID_EXSYS		0xd84d
342
 #define PCI_VENDOR_ID_TIGERJET		0xe159
345
 #define PCI_VENDOR_ID_TIGERJET		0xe159
343
 #define PCI_VENDOR_ID_ARK		0xedd8
346
 #define PCI_VENDOR_ID_ARK		0xedd8
347
+
348
+#endif /* _GPXE_PCI_IDS_H */

+ 3
- 3
src/include/gpxe/scsi.h View File

1
-#ifndef _SCSI_H
2
-#define _SCSI_H
1
+#ifndef _GPXE_SCSI_H
2
+#define _GPXE_SCSI_H
3
 
3
 
4
 #include <stdint.h>
4
 #include <stdint.h>
5
 
5
 
31
 	char bytes[16];
31
 	char bytes[16];
32
 };
32
 };
33
 
33
 
34
-#endif /* _SCSI_H */
34
+#endif /* _GPXE_SCSI_H */

src/include/tables.h → src/include/gpxe/tables.h View File

1
-#ifndef TABLES_H
2
-#define TABLES_H
1
+#ifndef _GPXE_TABLES_H
2
+#define _GPXE_TABLES_H
3
 
3
 
4
 /** @page ifdef_harmful #ifdef considered harmful
4
 /** @page ifdef_harmful #ifdef considered harmful
5
  *
5
  *
164
  *
164
  *
165
  */
165
  */
166
 
166
 
167
-#include "compiler.h" /* for doxygen */
167
+#ifdef DOXYGEN
168
+#define __attribute__(x)
169
+#endif
168
 
170
 
169
 #define __table_str(x) #x
171
 #define __table_str(x) #x
170
 #define __table_section(table,idx) \
172
 #define __table_section(table,idx) \
224
 #define __table_end(table) \
226
 #define __table_end(table) \
225
 	__attribute__ (( unused, __table_section_end(table) ))
227
 	__attribute__ (( unused, __table_section_end(table) ))
226
 
228
 
227
-#endif /* TABLES_H */
229
+#endif /* _GPXE_TABLES_H */

+ 3
- 3
src/include/gpxe/tcp.h View File

1
-#ifndef _TCP_H
2
-#define _TCP_H
1
+#ifndef _GPXE_TCP_H
2
+#define _GPXE_TCP_H
3
 
3
 
4
 /** @file
4
 /** @file
5
  *
5
  *
99
 		       size_t len );
99
 		       size_t len );
100
 extern void tcp_close ( struct tcp_connection *conn );
100
 extern void tcp_close ( struct tcp_connection *conn );
101
 
101
 
102
-#endif /* _TCP_H */
102
+#endif /* _GPXE_TCP_H */

+ 1
- 1
src/include/image.h View File

3
 
3
 
4
 #include "stdint.h"
4
 #include "stdint.h"
5
 #include "io.h"
5
 #include "io.h"
6
-#include "tables.h"
6
+#include <gpxe/tables.h>
7
 #include "dev.h"
7
 #include "dev.h"
8
 
8
 
9
 struct image {
9
 struct image {

+ 1
- 1
src/include/init.h View File

2
 #define INIT_H
2
 #define INIT_H
3
 
3
 
4
 #include "stddef.h" /* for NULL */
4
 #include "stddef.h" /* for NULL */
5
-#include "tables.h"
5
+#include <gpxe/tables.h>
6
 
6
 
7
 /*
7
 /*
8
  * In order to avoid having objects dragged in just because main()
8
  * In order to avoid having objects dragged in just because main()

+ 1
- 1
src/include/proto.h View File

1
 #ifndef PROTO_H
1
 #ifndef PROTO_H
2
 #define PROTO_H
2
 #define PROTO_H
3
 
3
 
4
-#include "tables.h"
4
+#include <gpxe/tables.h>
5
 #include "buffer.h"
5
 #include "buffer.h"
6
 #include <gpxe/in.h>
6
 #include <gpxe/in.h>
7
 
7
 

+ 1
- 1
src/include/resolv.h View File

2
 #define RESOLV_H
2
 #define RESOLV_H
3
 
3
 
4
 #include <gpxe/in.h>
4
 #include <gpxe/in.h>
5
-#include "tables.h"
5
+#include <gpxe/tables.h>
6
 
6
 
7
 struct resolver {
7
 struct resolver {
8
 	const char *name;
8
 	const char *name;

+ 1
- 1
src/proto/nmb.c View File

54
 	DBG ( "NMB resolving %s\n", name );
54
 	DBG ( "NMB resolving %s\n", name );
55
 
55
 
56
 	/* Set up the query data */
56
 	/* Set up the query data */
57
-	nameserver.sin_addr.s_addr = IP_BROADCAST;
57
+	nameserver.sin_addr.s_addr = INADDR_BROADCAST;
58
 	nameserver.sin_port = NBNS_UDP_PORT;
58
 	nameserver.sin_port = NBNS_UDP_PORT;
59
 	memset ( &query, 0, sizeof ( query ) );
59
 	memset ( &query, 0, sizeof ( query ) );
60
 	query.dns.id = htons ( 1 );
60
 	query.dns.id = htons ( 1 );

Loading…
Cancel
Save