diff options
author | imp <imp@FreeBSD.org> | 2005-01-21 02:11:48 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-01-21 02:11:48 +0000 |
commit | 510edccb0d8c8d2c96921b48753b91e372ba1eaa (patch) | |
tree | 3c945e8b70eee8a209e7d73194b9f3332eea6f9f /sys | |
parent | e8ecd4c9fc0b2dd21266e388dd65b133d852cd35 (diff) | |
download | FreeBSD-src-510edccb0d8c8d2c96921b48753b91e372ba1eaa.zip FreeBSD-src-510edccb0d8c8d2c96921b48753b91e372ba1eaa.tar.gz |
Some older PC Cards have a weird format for FUNCE tuples. They appear
as type 0, rather than the usualy type 4. Assume that this format is
from an old standard and go with it. The Fujitsu FMV-186A and Silicom
Ethernet cards I have both have tuples with this format, and they are
both pretty old cards.
# if somebody knows for sure, please let me know.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pccard/pccard_cis.c | 16 | ||||
-rw-r--r-- | sys/dev/pccard/pccard_cis.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/pccard/pccard_cis.c b/sys/dev/pccard/pccard_cis.c index 2fa88ef..4286208 100644 --- a/sys/dev/pccard/pccard_cis.c +++ b/sys/dev/pccard/pccard_cis.c @@ -1269,6 +1269,8 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg) static int decode_funce(struct pccard_tuple *tuple, struct pccard_function *pf) { + int i; + int len; int type = pccard_tuple_read_1(tuple, 0); switch (pf->function) { @@ -1280,8 +1282,7 @@ decode_funce(struct pccard_tuple *tuple, struct pccard_function *pf) break; case PCCARD_FUNCTION_NETWORK: if (type == PCCARD_TPLFE_TYPE_LAN_NID) { - int i; - int len = pccard_tuple_read_1(tuple, 1); + len = pccard_tuple_read_1(tuple, 1); if (tuple->length < 2 + len || len > 8) { /* tuple length not enough or nid too long */ break; @@ -1291,6 +1292,17 @@ decode_funce(struct pccard_tuple *tuple, struct pccard_function *pf) = pccard_tuple_read_1(tuple, i + 2); } pf->pf_funce_lan_nidlen = len; + } else if (type == PCCARD_TPLFE_TYPE_LAN_OLD_NID) { + /* Some older cards have this format, no idea if it is standard */ + if (tuple->length != 13) + break; + len = pccard_tuple_read_1(tuple, 4); + if (len != 6) + break; + for (i = 0; i < len; i++) { + pf->pf_funce_lan_nid[i] + = pccard_tuple_read_1(tuple, i + 5); + } } break; default: diff --git a/sys/dev/pccard/pccard_cis.h b/sys/dev/pccard/pccard_cis.h index d6b9c38..2db3064 100644 --- a/sys/dev/pccard/pccard_cis.h +++ b/sys/dev/pccard/pccard_cis.h @@ -168,6 +168,7 @@ #define PCCARD_FUNCTION_SECURITY 9 #define PCCARD_FUNCTION_INSTRUMENT 10 #define CISTPL_FUNCE 0x22 +#define PCCARD_TPLFE_TYPE_LAN_OLD_NID 0x00 /* Old way? */ #define PCCARD_TPLFE_TYPE_LAN_TECH 0x01 #define PCCARD_TPLFE_TYPE_LAN_SPEED 0x02 #define PCCARD_TPLFE_TYPE_LAN_MEDIA 0x03 |