summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-10-07 03:33:54 +0000
committerimp <imp@FreeBSD.org>2003-10-07 03:33:54 +0000
commita14856a6a81631c0c8dfd1be5637683ede9db4c3 (patch)
tree5153842bccbf28986c9ee3a2e5700c9a9456ab9b /sys/dev/cardbus
parentcaf26b3917784e6903ffb5d56107fea634db500f (diff)
downloadFreeBSD-src-a14856a6a81631c0c8dfd1be5637683ede9db4c3.zip
FreeBSD-src-a14856a6a81631c0c8dfd1be5637683ede9db4c3.tar.gz
o move the cis tuple definitions into a common file.
o minor optimization of cardbus_cis processing. Remove a bunch of generic entries that are handled by generic. o no longer need the card_get_type stuff.
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r--sys/dev/cardbus/cardbus_cis.c39
-rw-r--r--sys/dev/cardbus/cardbus_cis.h44
2 files changed, 4 insertions, 79 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c
index 478554c..1506af5 100644
--- a/sys/dev/cardbus/cardbus_cis.c
+++ b/sys/dev/cardbus/cardbus_cis.c
@@ -49,12 +49,13 @@ __FBSDID("$FreeBSD$");
#include <dev/pci/pcivar.h>
#include <dev/pci/pcireg.h>
+#include <dev/pccard/pccardvar.h>
+#include <dev/pccard/pccard_cis.h>
+
#include <dev/cardbus/cardbusreg.h>
#include <dev/cardbus/cardbusvar.h>
#include <dev/cardbus/cardbus_cis.h>
-#include <dev/pccard/pccardvar.h>
-
extern int cardbus_cis_debug;
#define DPRINTF(a) if (cardbus_cis_debug) printf a
@@ -676,12 +677,6 @@ decode_tuple(device_t cbdev, device_t child, int tupleid, int len,
return (callbacks[i].func(cbdev, child, tupleid, len,
tupledata, start, off, &callbacks[i]));
}
-
- if (tupleid < CISTPL_CUSTOMSTART) {
- device_printf(cbdev, "Undefined tuple encountered, "
- "CIS parsing terminated\n");
- return (EINVAL);
- }
return (callbacks[i].func(cbdev, child, tupleid, len,
tupledata, start, off, NULL));
}
@@ -1019,43 +1014,17 @@ cardbus_do_cis(device_t cbdev, device_t child)
{
int ret;
struct tuple_callbacks init_callbacks[] = {
- MAKETUPLE(NULL, generic),
- MAKETUPLE(DEVICE, generic),
- MAKETUPLE(LONG_LINK_CB, unhandled),
+ MAKETUPLE(LONGLINK_CB, unhandled),
MAKETUPLE(INDIRECT, unhandled),
- MAKETUPLE(CONFIG_CB, generic),
- MAKETUPLE(CFTABLE_ENTRY_CB, generic),
MAKETUPLE(LONGLINK_MFC, unhandled),
MAKETUPLE(BAR, bar),
- MAKETUPLE(PWR_MGMNT, generic),
- MAKETUPLE(EXTDEVICE, generic),
- MAKETUPLE(CHECKSUM, generic),
MAKETUPLE(LONGLINK_A, unhandled),
MAKETUPLE(LONGLINK_C, unhandled),
MAKETUPLE(LINKTARGET, linktarget),
- MAKETUPLE(NO_LINK, generic),
MAKETUPLE(VERS_1, vers_1),
- MAKETUPLE(ALTSTR, generic),
- MAKETUPLE(DEVICE_A, generic),
- MAKETUPLE(JEDEC_C, generic),
- MAKETUPLE(JEDEC_A, generic),
- MAKETUPLE(CONFIG, generic),
- MAKETUPLE(CFTABLE_ENTRY, generic),
- MAKETUPLE(DEVICE_OC, generic),
- MAKETUPLE(DEVICE_OA, generic),
- MAKETUPLE(DEVICE_GEO, generic),
- MAKETUPLE(DEVICE_GEO_A, generic),
MAKETUPLE(MANFID, manfid),
MAKETUPLE(FUNCID, funcid),
MAKETUPLE(FUNCE, funce),
- MAKETUPLE(SWIL, generic),
- MAKETUPLE(VERS_2, generic),
- MAKETUPLE(FORMAT, generic),
- MAKETUPLE(GEOMETRY, generic),
- MAKETUPLE(BYTEORDER, generic),
- MAKETUPLE(DATE, generic),
- MAKETUPLE(BATTERY, generic),
- MAKETUPLE(ORG, generic),
MAKETUPLE(END, end),
MAKETUPLE(GENERIC, generic),
};
diff --git a/sys/dev/cardbus/cardbus_cis.h b/sys/dev/cardbus/cardbus_cis.h
index 3a2eacc..a56d13b 100644
--- a/sys/dev/cardbus/cardbus_cis.h
+++ b/sys/dev/cardbus/cardbus_cis.h
@@ -38,50 +38,6 @@ int cardbus_do_cis(device_t, device_t);
#define MAXTUPLESIZE 0x400
-/* CIS TUPLES */
-
-#define CISTPL_NULL 0x00
-#define CISTPL_DEVICE 0x01
-#define CISTPL_LONG_LINK_CB 0x02
-#define CISTPL_INDIRECT 0x03
-#define CISTPL_CONFIG_CB 0x04
-#define CISTPL_CFTABLE_ENTRY_CB 0x05
-#define CISTPL_LONGLINK_MFC 0x06
-#define CISTPL_BAR 0x07
-#define CISTPL_PWR_MGMNT 0x08
-#define CISTPL_EXTDEVICE 0x09
-#define CISTPL_CHECKSUM 0x10
-#define CISTPL_LONGLINK_A 0x11
-#define CISTPL_LONGLINK_C 0x12
-#define CISTPL_LINKTARGET 0x13
-#define CISTPL_NO_LINK 0x14
-#define CISTPL_VERS_1 0x15
-#define CISTPL_ALTSTR 0x16
-#define CISTPL_DEVICE_A 0x17
-#define CISTPL_JEDEC_C 0x18
-#define CISTPL_JEDEC_A 0x19
-#define CISTPL_CONFIG 0x1A
-#define CISTPL_CFTABLE_ENTRY 0x1B
-#define CISTPL_DEVICE_OC 0x1C
-#define CISTPL_DEVICE_OA 0x1D
-#define CISTPL_DEVICE_GEO 0x1E
-#define CISTPL_DEVICE_GEO_A 0x1F
-#define CISTPL_MANFID 0x20
-#define CISTPL_FUNCID 0x21
-#define CISTPL_FUNCE 0x22
-#define CISTPL_SWIL 0x23
-#define CISTPL_VERS_2 0x40
-#define CISTPL_FORMAT 0x41
-#define CISTPL_GEOMETRY 0x42
-#define CISTPL_BYTEORDER 0x43
-#define CISTPL_DATE 0x44
-#define CISTPL_BATTERY 0x45
-#define CISTPL_ORG 0x46
-#define CISTPL_CUSTOMSTART 0x80
-#define CISTPL_END 0xFF
-
-#define CISTPL_GENERIC -1 /* catchall */
-
/* BAR */
#define TPL_BAR_REG_ASI_MASK 0x07
#define TPL_BAR_REG_AS 0x10
OpenPOWER on IntegriCloud