klconfig.h

来自「优龙2410linux2.6.8内核源代码」· C头文件 代码 · 共 703 行 · 第 1/2 页

H
703
字号
#define BOARD_SLOT(_brd)	((_brd)->brd_slot)#define KLCF_CLASS(_brd)	KLCLASS((_brd)->brd_type)#define KLCF_TYPE(_brd)		KLTYPE((_brd)->brd_type)#define KLCF_NUM_COMPS(_brd)	((_brd)->brd_numcompts)#define KLCF_MODULE_ID(_brd)	((_brd)->brd_module)#define NODE_OFFSET_TO_KLINFO(n,off)    ((klinfo_t*) TO_NODE_CAC(n,off))#define KLCF_NEXT(_brd)         \        ((_brd)->brd_next_same ?     \         (NODE_OFFSET_TO_LBOARD((_brd)->brd_next_same_host, (_brd)->brd_next_same)): NULL)#define KLCF_NEXT_ANY(_brd)         \        ((_brd)->brd_next_any ?     \         (NODE_OFFSET_TO_LBOARD(NASID_GET(_brd), (_brd)->brd_next_any)): NULL)#define KLCF_COMP(_brd, _ndx)   \                ((((_brd)->brd_compts[(_ndx)]) == 0) ? 0 : \			(NODE_OFFSET_TO_KLINFO(NASID_GET(_brd), (_brd)->brd_compts[(_ndx)])))#define KLCF_COMP_TYPE(_comp)	((_comp)->struct_type)#define KLCF_BRIDGE_W_ID(_comp)	((_comp)->physid)	/* Widget ID *//* * Generic info structure. This stores common info about a  * component. */ typedef struct klinfo_s {                  /* Generic info */        unsigned char   struct_type;       /* type of this structure */        unsigned char   struct_version;    /* version of this structure */        unsigned char   flags;            /* Enabled, disabled etc */        unsigned char   revision;         /* component revision */        unsigned short  diagval;          /* result of diagnostics */        unsigned short  diagparm;         /* diagnostic parameter */        unsigned char   inventory;        /* previous inventory status */        unsigned short  partid;		   /* widget part number */	nic_t 		nic;              /* MUst be aligned properly */        unsigned char   physid;           /* physical id of component */        unsigned int    virtid;           /* virtual id as seen by system */	unsigned char	widid;	          /* Widget id - if applicable */	nasid_t		nasid;            /* node number - from parent */	char		pad1;		  /* pad out structure. */	char		pad2;		  /* pad out structure. */	void		*data;        klconf_off_t	errinfo;          /* component specific errors */        unsigned short  pad3;             /* pci fields have moved over to */        unsigned short  pad4;             /* klbri_t */} klinfo_t ;#define KLCONFIG_INFO_ENABLED(_i)	((_i)->flags & KLINFO_ENABLE)/* * Component structures. * Following are the currently identified components: * 	CPU, HUB, MEM_BANK,  * 	XBOW(consists of 16 WIDGETs, each of which can be HUB or GRAPHICS or BRIDGE) * 	BRIDGE, IOC3, SuperIO, SCSI, FDDI  * 	ROUTER * 	GRAPHICS */#define KLSTRUCT_UNKNOWN	0#define KLSTRUCT_CPU  		1#define KLSTRUCT_HUB  		2#define KLSTRUCT_MEMBNK 	3#define KLSTRUCT_XBOW 		4#define KLSTRUCT_BRI 		5#define KLSTRUCT_ROU		9#define KLSTRUCT_GFX 		10#define KLSTRUCT_SCSI 		11#define KLSTRUCT_DISK 		14#define KLSTRUCT_CDROM 		16#define KLSTRUCT_FIBERCHANNEL 	25#define KLSTRUCT_MOD_SERIAL_NUM 26#define KLSTRUCT_QLFIBRE        32#define KLSTRUCT_1394           33#define KLSTRUCT_USB		34#define KLSTRUCT_USBKBD		35#define KLSTRUCT_USBMS		36#define KLSTRUCT_SCSI_CTLR	37#define KLSTRUCT_PEBRICK	38#define KLSTRUCT_GIGE           39#define KLSTRUCT_IDE		40#define KLSTRUCT_IOC4		41#define KLSTRUCT_IOC4UART	42#define KLSTRUCT_IOC4_TTY	43#define KLSTRUCT_IOC4PCKM	44#define KLSTRUCT_IOC4MS		45#define KLSTRUCT_IOC4_ATA	46#define KLSTRUCT_PCIGFX		47/* * The port info in ip27_cfg area translates to a lboart_t in the  * KLCONFIG area. But since KLCONFIG does not use pointers, lboart_t * is stored in terms of a nasid and a offset from start of KLCONFIG  * area  on that nasid. */typedef struct klport_s {	nasid_t		port_nasid;	unsigned char	port_flag;	klconf_off_t	port_offset;	short		port_num;} klport_t;typedef struct klcpu_s {                          /* CPU */	klinfo_t 	cpu_info;	unsigned short 	cpu_prid;	/* Processor PRID value */	unsigned short 	cpu_fpirr;	/* FPU IRR value */    	unsigned short 	cpu_speed;	/* Speed in MHZ */    	unsigned short 	cpu_scachesz;	/* secondary cache size in MB */    	unsigned short 	cpu_scachespeed;/* secondary cache speed in MHz */	unsigned long	pad;} klcpu_t ;#define CPU_STRUCT_VERSION   2typedef struct klhub_s {			/* HUB */	klinfo_t 	hub_info;	unsigned int 	hub_flags;		/* PCFG_HUB_xxx flags */#define MAX_NI_PORTS                    2	klport_t	hub_port[MAX_NI_PORTS + 1];/* hub is connected to this */	nic_t		hub_box_nic;		/* nic of containing box */	klconf_off_t	hub_mfg_nic;		/* MFG NIC string */	u64		hub_speed;		/* Speed of hub in HZ */	moduleid_t	hub_io_module;		/* attached io module */	unsigned long	pad;} klhub_t ;typedef struct klhub_uart_s {			/* HUB */	klinfo_t 	hubuart_info;	unsigned int 	hubuart_flags;		/* PCFG_HUB_xxx flags */	nic_t		hubuart_box_nic;	/* nic of containing box */	unsigned long	pad;} klhub_uart_t ;#define MEMORY_STRUCT_VERSION   2typedef struct klmembnk_s {			/* MEMORY BANK */	klinfo_t 	membnk_info;    	short 		membnk_memsz;		/* Total memory in megabytes */	short		membnk_dimm_select; /* bank to physical addr mapping*/	short		membnk_bnksz[MD_MEM_BANKS]; /* Memory bank sizes */	short		membnk_attr;	unsigned long	pad;} klmembnk_t ;#define MAX_SERIAL_NUM_SIZE 10typedef struct klmod_serial_num_s {      klinfo_t        snum_info;      union {              char snum_str[MAX_SERIAL_NUM_SIZE];              unsigned long long       snum_int;      } snum;      unsigned long   pad;} klmod_serial_num_t;/* Macros needed to access serial number structure in lboard_t.   Hard coded values are necessary since we cannot treat    serial number struct as a component without losing compatibility   between prom versions. */#define GET_SNUM_COMP(_l) 	((klmod_serial_num_t *)\				KLCF_COMP(_l, _l->brd_numcompts))#define MAX_XBOW_LINKS 16typedef struct klxbow_s {                          /* XBOW */	klinfo_t 	xbow_info ;    	klport_t	xbow_port_info[MAX_XBOW_LINKS] ; /* Module number */        int		xbow_master_hub_link;        /* type of brd connected+component struct ptr+flags */	unsigned long	pad;} klxbow_t ;#define MAX_PCI_SLOTS 8typedef struct klpci_device_s {	s32	pci_device_id;	/* 32 bits of vendor/device ID. */	s32	pci_device_pad;	/* 32 bits of padding. */} klpci_device_t;#define BRIDGE_STRUCT_VERSION	2typedef struct klbri_s {                          /* BRIDGE */	klinfo_t 	bri_info ;    	unsigned char	bri_eprominfo ;    /* IO6prom connected to bridge */    	unsigned char	bri_bustype ;      /* PCI/VME BUS bridge/GIO */    	u64	    	*pci_specific  ;    /* PCI Board config info */	klpci_device_t	bri_devices[MAX_PCI_DEVS] ;	/* PCI IDs */	klconf_off_t	bri_mfg_nic ;	unsigned long	pad;} klbri_t ;#define ROUTER_VECTOR_VERS	2/* XXX - Don't we need the number of ports here?!? */typedef struct klrou_s {                          /* ROUTER */	klinfo_t 	rou_info ;	unsigned int	rou_flags ;           /* PCFG_ROUTER_xxx flags */	nic_t		rou_box_nic ;         /* nic of the containing module */    	klport_t 	rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */	klconf_off_t	rou_mfg_nic ;     /* MFG NIC string */	u64	rou_vector;	  /* vector from master node */	unsigned long   pad;} klrou_t ;/* *  Graphics Controller/Device * *  (IP27/IO6) Prom versions 6.13 (and 6.5.1 kernels) and earlier *  used a couple different structures to store graphics information. *  For compatibility reasons, the newer data structure preserves some *  of the layout so that fields that are used in the old versions remain *  in the same place (with the same info).  Determination of what version *  of this structure we have is done by checking the cookie field. */#define KLGFX_COOKIE	0x0c0de000typedef struct klgfx_s {		/* GRAPHICS Device */	klinfo_t 	gfx_info;	klconf_off_t    old_gndevs;	/* for compatibility with older proms */	klconf_off_t    old_gdoff0;	/* for compatibility with older proms */	unsigned int	cookie;		/* for compatibility with older proms */	unsigned int	moduleslot;	struct klgfx_s	*gfx_next_pipe;	u64		*gfx_specific;	klconf_off_t    pad0;		/* for compatibility with older proms */	klconf_off_t    gfx_mfg_nic;	unsigned long	pad;} klgfx_t;#define MAX_SCSI_DEVS 16/* * NOTE: THis is the max sized kl* structure and is used in klmalloc.c * to allocate space of type COMPONENT. Make sure that if the size of * any other component struct becomes more than this, then redefine * that as the size to be klmalloced. */typedef struct klscsi_s {                          /* SCSI Bus */	klinfo_t 	scsi_info ;    	u64       	*scsi_specific   ; 	unsigned char 	scsi_numdevs ;	klconf_off_t	scsi_devinfo[MAX_SCSI_DEVS] ; 	unsigned long	pad;} klscsi_t ;typedef struct klscctl_s {                          /* SCSI Controller */	klinfo_t 	scsi_info ;	unsigned int	type;	unsigned int	scsi_buscnt;                        /* # busses this cntlr */	void		*scsi_bus[2];                       /* Pointer to 2 klscsi_t's */	unsigned long	pad;} klscctl_t ;typedef struct klscdev_s {                          /* SCSI device */	klinfo_t 	scdev_info ;	struct scsidisk_data *scdev_cfg ; /* driver fills up this */	unsigned long	pad;} klscdev_t ;typedef struct klttydev_s {                          /* TTY device */	klinfo_t 	ttydev_info ;	struct terminal_data *ttydev_cfg ; /* driver fills up this */	unsigned long	pad;} klttydev_t ;typedef struct klpcigfx_s {                          /* PCI GFX */        klinfo_t        gfx_info ;} klpcigfx_t ;typedef struct klkbddev_s {                          /* KBD device */	klinfo_t 	kbddev_info ;	struct keyboard_data *kbddev_cfg ; /* driver fills up this */	unsigned long	pad;} klkbddev_t ;typedef struct klmsdev_s {                          /* mouse device */        klinfo_t        msdev_info ;        void 		*msdev_cfg ; 	unsigned long	pad;} klmsdev_t ;/* * USB info */typedef struct klusb_s {	klinfo_t	usb_info;	/* controller info */	void		*usb_bus;	/* handle to usb_bus_t */	uint64_t	usb_controller;	/* ptr to controller info */	unsigned long	pad;} klusb_t ; typedef union klcomp_s {	klcpu_t		kc_cpu;	klhub_t		kc_hub;	klmembnk_t 	kc_mem;	klxbow_t  	kc_xbow;	klbri_t		kc_bri;	klrou_t		kc_rou;	klgfx_t		kc_gfx;	klscsi_t	kc_scsi;	klscctl_t	kc_scsi_ctl;	klscdev_t	kc_scsi_dev;	klmod_serial_num_t kc_snum ;	klusb_t		kc_usb;} klcomp_t;typedef union kldev_s {      /* for device structure allocation */	klscdev_t	kc_scsi_dev ;	klttydev_t	kc_tty_dev ;	klkbddev_t 	kc_kbd_dev ;} kldev_t ;/* external declarations of Linux kernel functions. */extern lboard_t *root_lboard[];extern lboard_t *find_lboard_any(lboard_t *start, unsigned char type);extern lboard_t *find_lboard_nasid(lboard_t *start, nasid_t, unsigned char type);extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type);extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type);extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);extern lboard_t *find_gfxpipe(int pipenum);extern lboard_t *find_lboard_class_any(lboard_t *start, unsigned char brd_class);extern lboard_t *find_lboard_class_nasid(lboard_t *start, nasid_t, unsigned char brd_class);extern lboard_t *find_nic_lboard(lboard_t *, nic_t);extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);extern lboard_t *find_lboard_modslot(lboard_t *start, geoid_t geoid);extern int	config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);extern int	config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);extern int	config_find_xbow(nasid_t, lboard_t **, klxbow_t**);extern int 	update_klcfg_cpuinfo(nasid_t, int);extern void 	board_to_path(lboard_t *brd, char *path);extern void 	nic_name_convert(char *old_name, char *new_name);extern int 	module_brds(nasid_t nasid, lboard_t **module_brds, int n);extern lboard_t *brd_from_key(uint64_t key);extern void 	device_component_canonical_name_get(lboard_t *,klinfo_t *,						    char *);extern int	board_serial_number_get(lboard_t *,char *);extern nasid_t	get_actual_nasid(lboard_t *brd) ;extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);#endif /* _ASM_IA64_SN_KLCONFIG_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?