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,7 +12,7 @@
12 12
 */
13 13
 #include "etherboot.h"
14 14
 #include "init.h"
15
-#include "pci.h"
15
+#include <gpxe/pci.h>
16 16
 #include "pci_io.h"
17 17
 #ifdef KEEP_IT_REAL
18 18
 #include "realmode.h"

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

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

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

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

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

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

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

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

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

@@ -457,7 +457,7 @@ int ip_transmit(int len, const void *buf)
457 457
 
458 458
 	ip = (struct iphdr *)buf;
459 459
 	destip = ip->dest.s_addr;
460
-	if (destip == IP_BROADCAST) {
460
+	if (destip == INADDR_BROADCAST) {
461 461
 		eth_transmit(broadcast, ETH_P_IP, len, buf);
462 462
 	} else if ((destip & htonl(MULTICAST_MASK)) == htonl(MULTICAST_NETWORK)) {
463 463
 		unsigned char multicast[6];
@@ -765,7 +765,7 @@ static int bootp(void)
765 765
 		memset ( arptable, 0, sizeof(arptable) );
766 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 769
 			sizeof(struct bootpip_t), &ip);
770 770
 		remaining_time = rfc2131_sleep_interval(BOOTP_TIMEOUT, retry++);
771 771
 		stop_time = currticks() + remaining_time;
@@ -804,8 +804,9 @@ static int bootp(void)
804 804
 		for (reqretry = 0; reqretry < MAX_BOOTP_RETRIES; ) {
805 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 810
 			dhcp_reply=0;
810 811
 			timeout = rfc2131_sleep_interval(TIMEOUT, reqretry++);
811 812
 			if (!await_reply(await_bootp, 0, NULL, timeout))

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

@@ -2,7 +2,7 @@
2 2
 #include "string.h"
3 3
 #include "console.h"
4 4
 #include "nic.h"
5
-#include "pci.h"
5
+#include <gpxe/pci.h>
6 6
 
7 7
 /*
8 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,7 +27,7 @@
27 27
 
28 28
 #include "etherboot.h"
29 29
 #include "nic.h"
30
-#include "pci.h"
30
+#include <gpxe/pci.h>
31 31
 #include "3c595.h"
32 32
 #include "timer.h"
33 33
 

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

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

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

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

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

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

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

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

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

@@ -52,7 +52,7 @@ Drivers are port from Intel's Linux driver e1000-4.3.15
52 52
 /* to get the interface to the body of the program */
53 53
 #include "nic.h"
54 54
 /* to get the PCI support functions, if this is a PCI NIC */
55
-#include "pci.h"
55
+#include <gpxe/pci.h>
56 56
 #include "timer.h"
57 57
 
58 58
 typedef unsigned char *dma_addr_t;

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

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

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

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

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

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

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

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

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

@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "mt23108.h"
23 23
 #include "ib_driver.h"
24
-#include "pci.h"
24
+#include <gpxe/pci.h>
25 25
 
26 26
 struct device_buffers_st {
27 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,7 +21,7 @@
21 21
 
22 22
 #include "mt25218.h"
23 23
 #include "ib_driver.h"
24
-#include "pci.h"
24
+#include <gpxe/pci.h>
25 25
 
26 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,7 +15,7 @@ Skeleton NIC driver for Etherboot
15 15
 /* to get the interface to the body of the program */
16 16
 #include "nic.h"
17 17
 /* to get the PCI support functions, if this is a PCI NIC */
18
-#include "pci.h"
18
+#include <gpxe/pci.h>
19 19
 /* to get the ISA support functions, if this is an ISA NIC */
20 20
 #include "isa.h"
21 21
 

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

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

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

@@ -28,7 +28,7 @@
28 28
 /* to get the interface to the body of the program */
29 29
 #include "nic.h"
30 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 33
 /* Condensed operations for readability. */
34 34
 #define virt_to_le32desc(addr)  cpu_to_le32(virt_to_bus(addr))

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

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

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

@@ -40,7 +40,7 @@
40 40
 /* to get the interface to the body of the program */
41 41
 #include "nic.h"
42 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 45
 #if ARCH == ia64		/* Support 64-bit addressing */
46 46
 #define USE_64BIT_ADDR

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

@@ -33,7 +33,7 @@ SMC8416 PIO support added by Andrew Bettison (andrewb@zip.com.au) on 4/3/02
33 33
 #include "nic.h"
34 34
 #include "ns8390.h"
35 35
 #ifdef	INCLUDE_NS8390
36
-#include "pci.h"
36
+#include <gpxe/pci.h>
37 37
 #else
38 38
 #include "isa.h"
39 39
 #endif

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

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

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

@@ -18,7 +18,7 @@ $Id$
18 18
 /* to get the interface to the body of the program */
19 19
 #include "nic.h"
20 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 24
  * Hard-coded SSID

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -48,7 +48,7 @@ static const char *version = "rhine.c v1.0.2 2004-10-29\n";
48 48
 
49 49
 #include "etherboot.h"
50 50
 #include "nic.h"
51
-#include "pci.h"
51
+#include <gpxe/pci.h>
52 52
 #include "timer.h"
53 53
 
54 54
 /* define all ioaddr */

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

@@ -43,7 +43,7 @@
43 43
 /* to get the interface to the body of the program */
44 44
 #include "nic.h"
45 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 49
 #include "via-velocity.h"

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -1,5 +1,5 @@
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 4
 /** @file
5 5
  *
@@ -97,4 +97,4 @@ static inline void * arp_target_pa ( struct arphdr *arphdr ) {
97 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,5 +1,5 @@
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 4
 #include <stdint.h>
5 5
 
@@ -29,4 +29,4 @@ struct ethhdr {
29 29
         uint16_t h_protocol;
30 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,5 +1,5 @@
1
-#ifndef	_IN_H
2
-#define	_IN_H
1
+#ifndef	_GPXE_IN_H
2
+#define	_GPXE_IN_H
3 3
 
4 4
 #include <stdint.h>
5 5
 
@@ -8,8 +8,11 @@
8 8
 #define IP_TCP		6
9 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 17
 struct in_addr {
15 18
 	uint32_t	s_addr;
@@ -27,4 +30,4 @@ struct sockaddr_in {
27 30
 extern int inet_aton ( const char *cp, struct in_addr *inp );
28 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,5 +1,5 @@
1
-#ifndef _IP_H
2
-#define _IP_H
1
+#ifndef _GPXE_IP_H
2
+#define _GPXE_IP_H
3 3
 
4 4
 /** @file
5 5
  *
@@ -17,4 +17,4 @@ extern void set_gateway ( struct in_addr address );
17 17
 extern void init_tcpip ( void );
18 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,5 +1,5 @@
1
-#ifndef _ISCSI_H
2
-#define _ISCSI_H
1
+#ifndef _GPXE_ISCSI_H
2
+#define _GPXE_ISCSI_H
3 3
 
4 4
 /** @file
5 5
  *
@@ -457,4 +457,4 @@ static inline int iscsi_error ( struct iscsi_session *iscsi ) {
457 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,5 +1,5 @@
1
-#ifndef	PCI_H
2
-#define PCI_H
1
+#ifndef	_GPXEPCI_H
2
+#define _GPXEPCI_H
3 3
 
4 4
 /*
5 5
 ** Support for NE2000 PCI clones added David Monro June 1997
@@ -21,8 +21,7 @@
21 21
  * your option) any later version.
22 22
  */
23 23
 
24
-#include "stdint.h"
25
-#include "nic.h"
24
+#include <stdint.h>
26 25
 #include "pci_ids.h"
27 26
 
28 27
 #define	PCI_BUS_TYPE	1
@@ -256,7 +255,8 @@ struct pci_device {
256 255
 	uint16_t	busdevfn;
257 256
 	uint8_t		revision;
258 257
 	uint8_t		irq;
259
-} __attribute__ (( packed ));
258
+	void *priv;
259
+};
260 260
 
261 261
 /*
262 262
  * Useful busdevfn calculations
@@ -348,7 +348,6 @@ extern unsigned long pci_bar_start ( struct pci_device *pci,
348 348
 				     unsigned int bar );
349 349
 extern unsigned long pci_bar_size ( struct pci_device *pci, unsigned int bar );
350 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 353
  * PCI bus global definition
@@ -356,4 +355,12 @@ extern void pci_fill_nic ( struct nic *nic, struct pci_device *pci );
356 355
  */
357 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,3 +1,6 @@
1
+#ifndef _GPXE_PCI_IDS_H
2
+#define _GPXE_PCI_IDS_H
3
+
1 4
 /*
2 5
  *	PCI Class, Vendor and Device IDs
3 6
  *
@@ -341,3 +344,5 @@
341 344
 #define PCI_SUBVENDOR_ID_EXSYS		0xd84d
342 345
 #define PCI_VENDOR_ID_TIGERJET		0xe159
343 346
 #define PCI_VENDOR_ID_ARK		0xedd8
347
+
348
+#endif /* _GPXE_PCI_IDS_H */

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

@@ -1,5 +1,5 @@
1
-#ifndef _SCSI_H
2
-#define _SCSI_H
1
+#ifndef _GPXE_SCSI_H
2
+#define _GPXE_SCSI_H
3 3
 
4 4
 #include <stdint.h>
5 5
 
@@ -31,4 +31,4 @@ union scsi_cdb {
31 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,5 +1,5 @@
1
-#ifndef TABLES_H
2
-#define TABLES_H
1
+#ifndef _GPXE_TABLES_H
2
+#define _GPXE_TABLES_H
3 3
 
4 4
 /** @page ifdef_harmful #ifdef considered harmful
5 5
  *
@@ -164,7 +164,9 @@
164 164
  *
165 165
  */
166 166
 
167
-#include "compiler.h" /* for doxygen */
167
+#ifdef DOXYGEN
168
+#define __attribute__(x)
169
+#endif
168 170
 
169 171
 #define __table_str(x) #x
170 172
 #define __table_section(table,idx) \
@@ -224,4 +226,4 @@
224 226
 #define __table_end(table) \
225 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,5 +1,5 @@
1
-#ifndef _TCP_H
2
-#define _TCP_H
1
+#ifndef _GPXE_TCP_H
2
+#define _GPXE_TCP_H
3 3
 
4 4
 /** @file
5 5
  *
@@ -99,4 +99,4 @@ extern void tcp_send ( struct tcp_connection *conn, const void *data,
99 99
 		       size_t len );
100 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,7 +3,7 @@
3 3
 
4 4
 #include "stdint.h"
5 5
 #include "io.h"
6
-#include "tables.h"
6
+#include <gpxe/tables.h>
7 7
 #include "dev.h"
8 8
 
9 9
 struct image {

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

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

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

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

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

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

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

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

Loading…
Cancel
Save