From 1d19b4dd3decc0557abbfab25ddc65bcb0ccdc3c Mon Sep 17 00:00:00 2001 From: augustss Date: Fri, 15 Oct 1999 11:10:58 +0000 Subject: [PATCH] Add a number of CARDBUS_CLASS defines. Copied from PCI_CLASS. --- sys/dev/cardbus/cardbusvar.h | 45 +++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index ce4b3683386b..e1a58a3db373 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cardbusvar.h,v 1.2 1999/10/15 06:42:22 haya Exp $ */ +/* $NetBSD: cardbusvar.h,v 1.3 1999/10/15 11:10:58 augustss Exp $ */ /* * Copyright (c) 1998 and 1999 @@ -77,6 +77,49 @@ typedef u_int16_t cardbus_product_id_t; #define CARDBUS_CLASS_REG 0x08 +#define CARDBUS_CLASS_SHIFT 24 +#define CARDBUS_CLASS_MASK 0xff +#define CARDBUS_CLASS(cr) \ + (((cr) >> CARDBUS_CLASS_SHIFT) & CARDBUS_CLASS_MASK) + +#define CARDBUS_SUBCLASS_SHIFT 16 +#define CARDBUS_SUBCLASS_MASK 0xff +#define CARDBUS_SUBCLASS(cr) \ + (((cr) >> CARDBUS_SUBCLASS_SHIFT) & CARDBUS_SUBCLASS_MASK) + +#define CARDBUS_INTERFACE_SHIFT 8 +#define CARDBUS_INTERFACE_MASK 0xff +#define CARDBUS_INTERFACE(cr) \ + (((cr) >> CARDBUS_INTERFACE_SHIFT) & CARDBUS_INTERFACE_MASK) + +#define CARDBUS_REVISION_SHIFT 0 +#define CARDBUS_REVISION_MASK 0xff +#define CARDBUS_REVISION(cr) \ + (((cr) >> CARDBUS_REVISION_SHIFT) & CARDBUS_REVISION_MASK) + +/* base classes */ +#define CARDBUS_CLASS_PREHISTORIC 0x00 +#define CARDBUS_CLASS_MASS_STORAGE 0x01 +#define CARDBUS_CLASS_NETWORK 0x02 +#define CARDBUS_CLASS_DISPLAY 0x03 +#define CARDBUS_CLASS_MULTIMEDIA 0x04 +#define CARDBUS_CLASS_MEMORY 0x05 +#define CARDBUS_CLASS_BRIDGE 0x06 +#define CARDBUS_CLASS_COMMUNICATIONS 0x07 +#define CARDBUS_CLASS_SYSTEM 0x08 +#define CARDBUS_CLASS_INPUT 0x09 +#define CARDBUS_CLASS_DOCK 0x0a +#define CARDBUS_CLASS_PROCESSOR 0x0b +#define CARDBUS_CLASS_SERIALBUS 0x0c +#define CARDBUS_CLASS_UNDEFINED 0xff + +/* 0x0c serial bus subclasses */ +#define CARDBUS_SUBCLASS_SERIALBUS_FIREWIRE 0x00 +#define CARDBUS_SUBCLASS_SERIALBUS_ACCESS 0x01 +#define CARDBUS_SUBCLASS_SERIALBUS_SSA 0x02 +#define CARDBUS_SUBCLASS_SERIALBUS_USB 0x03 +#define CARDBUS_SUBCLASS_SERIALBUS_FIBER 0x04 + /* BIST, Header Type, Latency Timer, Cache Line Size */ #define CARDBUS_BHLC_REG 0x0c