X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=blobdiff_plain;f=include%2Fprom.h;h=a512f2be5a4d1db15a144dfc3e256ce81eb0bc93;hp=e7ee4a9a2651aa9dc90a0c588734ae1b95d601cc;hb=a01ba048668c5a7e5efa2aa41eeb0a3ed374a63a;hpb=5d4289bddaef010cc14bcbeecfd13d5068b50a8e diff --git a/include/prom.h b/include/prom.h index e7ee4a9..a512f2b 100644 --- a/include/prom.h +++ b/include/prom.h @@ -27,6 +27,7 @@ #ifndef PROM_H #define PROM_H +#include "types.h" #include "stdarg.h" typedef void *prom_handle; @@ -36,6 +37,10 @@ typedef void *phandle; #define PROM_INVALID_HANDLE ((prom_handle)-1UL) #define BOOTDEVSZ (2048) /* iscsi args can be in excess of 1040 bytes */ #define TOK_ISCSI "iscsi" +#define TOK_IPV6 "ipv6" +#define PROM_CLAIM_MAX_ADDR 0x8000000 +#define BOOTLASTSZ 1024 +#define FW_NBR_REBOOTSZ 4 struct prom_args; typedef int (*prom_entry)(struct prom_args *); @@ -84,6 +89,7 @@ int prom_set_color(prom_handle device, int color, int r, int g, int b); /* memory */ +void *prom_claim_chunk(void *virt, unsigned int size, unsigned int align); void *prom_claim (void *virt, unsigned int size, unsigned int align); void prom_release(void *virt, unsigned int size); void prom_map (void *phys, void *virt, int size); @@ -118,4 +124,40 @@ extern void prom_pause(void); extern void *call_prom (const char *service, int nargs, int nret, ...); extern void *call_prom_return (const char *service, int nargs, int nret, ...); +/* Netboot stuffs */ + +/* + * "bootp-response" is the property name which is specified in + * the recommended practice doc for obp-tftp. However, pmac + * provides a "dhcp-response" property and chrp provides a + * "bootpreply-packet" property. The latter appears to begin the + * bootp packet at offset 0x2a in the property for some reason. + */ + +struct bootp_property_offset { + char *name; /* property name */ + int offset; /* offset into property where bootp packet occurs */ +}; + +static const struct bootp_property_offset bootp_response_properties[] = { + { .name = "bootp-response", .offset = 0 }, + { .name = "dhcp-response", .offset = 0 }, + { .name = "bootpreply-packet", .offset = 0x2a }, +}; + +struct bootp_packet { + __u8 op, htype, hlen, hops; + __u32 xid; + __u16 secs, flags; + __u32 ciaddr, yiaddr, siaddr, giaddr; + unsigned char chaddr[16]; + unsigned char sname[64]; + unsigned char file[128]; + unsigned char options[]; /* vendor options */ +}; + +struct bootp_packet * prom_get_netinfo (void); +char * prom_get_mac (struct bootp_packet * packet); +char * prom_get_ip (struct bootp_packet * packet); + #endif