diff options
author | simokawa <simokawa@FreeBSD.org> | 2002-12-30 09:41:32 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2002-12-30 09:41:32 +0000 |
commit | 996afb0c07df9ae40416364ca079c342cfdf8d0f (patch) | |
tree | 164bab6cb2e1b6c9ef9b7b4470e2e1750119d7a4 /sys/dev/firewire/iec13213.h | |
parent | 0f60a19b2edd6c507b914dcc8fd50e50241c83f5 (diff) | |
download | FreeBSD-src-996afb0c07df9ae40416364ca079c342cfdf8d0f.zip FreeBSD-src-996afb0c07df9ae40416364ca079c342cfdf8d0f.tar.gz |
- Add more CSR related definitions (IEEE-1212).
- Fix struct csrtext's spec fields.
- Add prototypes of upcoming configuration ROM related functions.
Diffstat (limited to 'sys/dev/firewire/iec13213.h')
-rw-r--r-- | sys/dev/firewire/iec13213.h | 67 |
1 files changed, 62 insertions, 5 deletions
diff --git a/sys/dev/firewire/iec13213.h b/sys/dev/firewire/iec13213.h index 113613a..1e4e8cd 100644 --- a/sys/dev/firewire/iec13213.h +++ b/sys/dev/firewire/iec13213.h @@ -33,14 +33,50 @@ * $FreeBSD$ * */ + +#define CSRTYPE_SHIFT 6 +#define CSRTYPE_MASK (3 << CSRTYPE_SHIFT) +#define CSRTYPE_I (0 << CSRTYPE_SHIFT) /* Immediate */ +#define CSRTYPE_C (1 << CSRTYPE_SHIFT) /* CSR offset */ +#define CSRTYPE_L (2 << CSRTYPE_SHIFT) /* Leaf */ +#define CSRTYPE_D (3 << CSRTYPE_SHIFT) /* Directory */ + +#define CSRKEY_MASK 0x3f +#define CSRKEY_DESC 0x01 /* Descriptor */ +#define CSRKEY_BDINFO 0x02 /* Bus_Dependent_Info */ +#define CSRKEY_VENDOR 0x03 /* Vendor */ +#define CSRKEY_HW 0x04 /* Hardware_Version */ +#define CSRKEY_MODULE 0x07 /* Module */ +#define CSRKEY_NCAP 0x0c /* Node_Capabilities */ +#define CSRKEY_EUI64 0x0d /* EUI_64 */ +#define CSRKEY_UNIT 0x11 /* Unit */ +#define CSRKEY_SPEC 0x12 /* Specifier_ID */ +#define CSRKEY_VER 0x13 /* Version */ +#define CSRKEY_DINFO 0x14 /* Dependent_Info */ +#define CSRKEY_ULOC 0x15 /* Unit_Location */ +#define CSRKEY_MODEL 0x17 /* Model */ +#define CSRKEY_INST 0x18 /* Instance */ +#define CSRKEY_KEYW 0x19 /* Keyword */ +#define CSRKEY_FEAT 0x1a /* Feature */ +#define CSRKEY_EROM 0x1b /* Extended_ROM */ +#define CSRKEY_EKSID 0x1c /* Extended_Key_Specifier_ID */ +#define CSRKEY_EKEY 0x1d /* Extended_Key */ +#define CSRKEY_EDATA 0x1e /* Extended_Data */ +#define CSRKEY_MDESC 0x1f /* Modifiable_Descriptor */ +#define CSRKEY_DID 0x20 /* Directory_ID */ +#define CSRKEY_REV 0x21 /* Revision */ + +#define CROM_TEXTLEAF (CSRTYPE_L | CSRKEY_DESC) /* 0x81 */ +#define CROM_LUN (CSRTYPE_I | CSRKEY_DINFO) /* 0x14 */ + +/* ??? #define CSRKEY_MVID 0x3 -#define CSRKEY_NCAP 0xc #define CSRKEY_NUNQ 0x8d #define CSRKEY_NPWR 0x30 -#define CSRKEY_SPEC 0x12 +*/ + #define CSRVAL_1394TA 0x00a02d #define CSRVAL_ANSIT10 0x00609e -#define CSRKEY_VER 0x13 #define CSR_PROTAVC 0x010001 #define CSR_PROTCAL 0x010002 #define CSR_PROTEHS 0x010004 @@ -70,8 +106,8 @@ struct csrdirectory { struct csrtext { u_int32_t crc:16, crc_len:16; - u_int32_t spec_id:16, - spec_type:16; + u_int32_t spec_id:24, + spec_type:8; u_int32_t lang_id; u_int32_t text[0]; }; @@ -90,3 +126,24 @@ struct businfo { v_id:24; u_int32_t c_id_lo; }; + +#define CROM_MAX_DEPTH 10 +struct crom_ptr { + struct csrdirectory *dir; + int index; +}; + +struct crom_context { + int depth; + struct crom_ptr stack[CROM_MAX_DEPTH]; +}; + +void crom_init_context(struct crom_context *, u_int32_t *); +struct csrreg *crom_get(struct crom_context *); +void crom_next(struct crom_context *); +void crom_parse_text(struct crom_context *, char *, int); +u_int16_t crom_crc(u_int32_t *r, int); +struct csrreg *crom_search_key(struct crom_context *, u_int8_t); +#ifndef _KERNEL +char *crom_desc(struct crom_context *, char *, int); +#endif |