mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
- Add more CSR related definitions (IEEE-1212).
- Fix struct csrtext's spec fields. - Add prototypes of upcoming configuration ROM related functions.
This commit is contained in:
parent
e5009256fb
commit
e238f68de5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108432
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user