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.
This commit is contained in:
Warner Losh 2005-01-21 02:11:48 +00:00
parent 94aa7aecdf
commit 9cdd39c25f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140542
2 changed files with 15 additions and 2 deletions

View File

@ -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:

View File

@ -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