96 if ( remaining <
sizeof ( *
token ) ) {
100 remaining -=
sizeof ( *token );
101 data = ( ( (
const void * )
token ) +
sizeof ( *token ) );
112 if ( remaining <
len ) {
113 DBGC ( &
fdt,
"FDT unterminated node name at +%#04x\n",
123 if ( pos->
depth < 0 ) {
124 DBGC ( &
fdt,
"FDT spurious node end at +%#04x\n",
129 if ( pos->
depth < 0 ) {
139 if ( remaining <
sizeof ( *prop ) ) {
140 DBGC ( &
fdt,
"FDT truncated property at +%#04x\n",
144 desc->data = ( ( (
const void * ) prop ) +
sizeof ( *prop ) );
146 len = (
sizeof ( *prop ) +
desc->len );
147 if ( remaining <
len ) {
148 DBGC ( &
fdt,
"FDT overlength property at +%#04x\n",
154 DBGC ( &
fdt,
"FDT property name outside strings " 155 "block at +%#04x\n", pos->
offset );
169 DBGC ( &
fdt,
"FDT unexpected token %#08x at +%#04x\n",
177 pos->
offset += (
sizeof ( *token ) +
len );
194 unsigned int *child ) {
197 unsigned int orig_offset;
215 DBGC ( &
fdt,
"FDT +%#04x has no child node \"%s\": " 222 DBGC2 ( &
fdt,
"FDT +%#04x has child node \"%s\"\n",
223 orig_offset,
desc.name );
225 DBGC2 ( &
fdt,
"FDT +%#04x found child node " 226 "\"%s\" at +%#04x\n", orig_offset,
242 char *
tmp = ( (
char * ) path );
253 while ( *
tmp ==
'/' )
269 while ( *
tmp && ( *
tmp !=
'/' ) )
273 DBGC2 ( &
fdt,
"FDT found path \"%s\" at +%#04x\n", path, *
offset );
295 DBGC ( &
fdt,
"FDT alias \"%s\" is \"%s\"\n",
name, alias );
326 DBGC ( &
fdt,
"FDT +%#04x has no property \"%s\": %s\n",
332 if ( ( pos.
depth == 0 ) &&
desc->data ) {
333 DBGC2 ( &
fdt,
"FDT +%#04x has property \"%s\" len " 336 DBGC2 ( &
fdt,
"FDT +%#04x found property " 362 DBGC ( &
fdt,
"FDT unterminated string property \"%s\"\n",
393 DBGC ( &
fdt,
"FDT oversized integer property \"%s\"\n",
name );
399 remaining =
desc.len;
400 while ( remaining-- ) {
430 DBGC ( &
fdt,
"FDT malformed MAC address \"%s\":\n",
454 DBGC ( &
fdt,
"FDT version %d at %p+%#04zx\n",
459 DBGC ( &
fdt,
"FDT has invalid magic value %#08x\n",
466 DBGC ( &
fdt,
"FDT unsupported version %d\n",
474 DBGC ( &
fdt,
"FDT structure block at +[%#04x,%#04zx)\n",
478 DBGC ( &
fdt,
"FDT structure block exceeds table\n" );
483 DBGC ( &
fdt,
"FDT structure block is misaligned\n" );
490 DBGC ( &
fdt,
"FDT strings block at +[%#04x,%#04zx)\n",
494 DBGC ( &
fdt,
"FDT strings block exceeds table\n" );
501 if ( *(--
end) ==
'\0' )
505 DBGC ( &
fdt,
"FDT strings block shrunk to +[%#04x,%#04zx)\n",
#define EINVAL
Invalid argument.
uint32_t name_off
Name offset.
struct arbelprm_rc_send_wqe rc
const char * name
Node or property name (if applicable)
#define FDT_STRUCTURE_ALIGN
Alignment of structure block.
unsigned int offset
Offset within structure block.
#define FDT_NOP
NOP token.
size_t len
Length of tree.
struct golan_inbox_hdr hdr
Message header.
int fdt_mac(unsigned int offset, struct net_device *netdev)
Get MAC address from property.
int fdt_path(const char *path, unsigned int *offset)
Find node by path.
uint64_t desc
Microcode descriptor list physical address.
#define ENOENT
No such file or directory.
unsigned long long uint64_t
static int fdt_property(unsigned int offset, const char *name, struct fdt_descriptor *desc)
Find property.
const struct fdt_header * hdr
Tree header.
size_t strings_len
Length of strings block.
static int fdt_exists(void)
Check if device tree exists.
uint32_t fdt_token_t
Device tree token.
const char * fdt_string(unsigned int offset, const char *name)
Find string property.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define be32_to_cpu(value)
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
uint8_t hw_addr_len
Hardware address length.
#define FDT_MAGIC
Magic signature.
pseudo_bit_t value[0x00020]
int fdt_u64(unsigned int offset, const char *name, uint64_t *value)
Find integer property.
static struct net_device * netdev
size_t len
Length of property data (if applicable)
unsigned int structure
Offset to structure block.
#define FDT_VERSION
Expected device tree version.
#define ERANGE
Result too large.
char * strerror(int errno)
Retrieve string representation of error number.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
char * strchr(const char *src, int character)
Find character within a string.
size_t strnlen(const char *src, size_t max)
Get length of string.
A position within a device tree.
static int fdt_child(unsigned int offset, const char *name, unsigned int *child)
Find child node.
REQUIRE_OBJECT(config_fdt)
size_t structure_len
Length of structure block.
#define FDT_PROP
Property token.
Network device management.
#define cpu_to_be32(value)
static int fdt_traverse(struct fdt_cursor *pos, struct fdt_descriptor *desc)
Traverse device tree.
REQUIRING_SYMBOL(register_fdt)
int strcmp(const char *first, const char *second)
Compare strings.
uint32_t name_off
Name offset.
const void * raw
Raw data.
#define FDT_END_NODE
End node token.
uint32_t end
Ending offset.
uint8_t data[48]
Additional event data.
#define FDT_BEGIN_NODE
Begin node token.
uint16_t offset
Offset to command line.
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
#define NULL
NULL pointer (VOID *)
const void * data
Property data (if applicable)
int register_fdt(const struct fdt_header *hdr)
Register device tree.
struct ll_protocol * ll_protocol
Link-layer protocol.
unsigned int strings
Offset to strings block.
void * memset(void *dest, int character, size_t len) __nonnull
int fdt_alias(const char *name, unsigned int *offset)
Find node by alias.