#ifndef _LINUX_OF_H#define _LINUX_OF_H/* * Definitions for talking to the Open Firmware PROM on * Power Macintosh and other computers. * * Copyright (C) 1996-2005 Paul Mackerras. * * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. * Updates for SPARC64 by David S. Miller * Derived from PowerPC and Sparc prom.h files by Stephen Rothwell, IBM Corp. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */#include<linux/types.h>#include<linux/bitops.h>#include<linux/errno.h>#include<linux/kobject.h>#include<linux/mod_devicetable.h>#include<linux/spinlock.h>#include<linux/topology.h>#include<linux/notifier.h>#include<linux/property.h>#include<linux/list.h>#include<asm/byteorder.h>#include<asm/errno.h>typedefu32phandle;typedefu32ihandle;structproperty{char*name;intlength;void*value;structproperty*next;#if defined(CONFIG_OF_DYNAMIC) || defined(CONFIG_SPARC)unsignedlong_flags;#endif#if defined(CONFIG_OF_PROMTREE)unsignedintunique_id;#endifstructbin_attributeattr;};#if defined(CONFIG_SPARC)structof_irq_controller;#endifstructdevice_node{constchar*name;constchar*type;phandlephandle;constchar*full_name;structfwnode_handlefwnode;structproperty*properties;structproperty*deadprops;/* removed properties */structdevice_node*parent;structdevice_node*child;structdevice_node*sibling;structkobjectkobj;unsignedlong_flags;void*data;#if defined(CONFIG_SPARC)constchar*path_component_name;unsignedintunique_id;structof_irq_controller*irq_trans;#endif};#define MAX_PHANDLE_ARGS 16structof_phandle_args{structdevice_node*np;intargs_count;uint32_targs[MAX_PHANDLE_ARGS];};structof_phandle_iterator{/* Common iterator information */constchar*cells_name;intcell_count;conststructdevice_node*parent;/* List size information */const__be32*list_end;const__be32*phandle_end;/* Current position state */const__be32*cur;uint32_tcur_count;phandlephandle;structdevice_node*node;};structof_reconfig_data{structdevice_node*dn;structproperty*prop;structproperty*old_prop;};/* initialize a node */externstructkobj_typeof_node_ktype;externconststructfwnode_operationsof_fwnode_ops;staticinlinevoidof_node_init(structdevice_node*node){kobject_init(&node->kobj,&of_node_ktype);node->fwnode.ops