Preliminary support for Xircom Credit Card Adapter. Not to be
confused with the Credit Card Adapter II and its spawn (which the xe driver supports). These changes get my card probing and attaching. I recently won one of these (and a NEC rebadged version) in an lot auction. The NEC didn't work, so I took it apart and found the MB86960A chip and then modified if_fe_pccard.c to attach. I can't test this card further since I have no dongle for this card.
This commit is contained in:
parent
108506206f
commit
bc465e4070
@ -64,6 +64,7 @@ static const struct fe_pccard_product {
|
||||
struct pccard_product mpp_product;
|
||||
int mpp_flags;
|
||||
#define MPP_MBH10302 1
|
||||
#define MPP_ANYFUNC 2
|
||||
} fe_pccard_products[] = {
|
||||
/* These need to be first */
|
||||
{ PCMCIA_CARD(FUJITSU2, FMV_J181), MPP_MBH10302 },
|
||||
@ -81,31 +82,32 @@ static const struct fe_pccard_product {
|
||||
{ PCMCIA_CARD(FUJITSU, LA10S), 0 },
|
||||
{ PCMCIA_CARD(FUJITSU, NE200T), MPP_MBH10302 },/* Sold by Eagle */
|
||||
{ PCMCIA_CARD(RATOC, REX_R280), 0 },
|
||||
{ PCMCIA_CARD(XIRCOM, CE), MPP_ANYFUNC },
|
||||
{ { NULL } }
|
||||
};
|
||||
|
||||
static int
|
||||
fe_pccard_probe(device_t dev)
|
||||
{
|
||||
const struct pccard_product *pp;
|
||||
int error;
|
||||
uint32_t fcn = PCCARD_FUNCTION_UNSPEC;
|
||||
const struct fe_pccard_product *pp;
|
||||
|
||||
/* Make sure we're a network function */
|
||||
error = pccard_get_function(dev, &fcn);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (fcn != PCCARD_FUNCTION_NETWORK)
|
||||
return (ENXIO);
|
||||
|
||||
if ((pp = pccard_product_lookup(dev,
|
||||
if ((pp = (const struct fe_pccard_product *)pccard_product_lookup(dev,
|
||||
(const struct pccard_product *)fe_pccard_products,
|
||||
sizeof(fe_pccard_products[0]), NULL)) != NULL) {
|
||||
if (pp->pp_name != NULL)
|
||||
device_set_desc(dev, pp->pp_name);
|
||||
return 0;
|
||||
if (pp->mpp_product.pp_name != NULL)
|
||||
device_set_desc(dev, pp->mpp_product.pp_name);
|
||||
if (pp->mpp_flags & MPP_ANYFUNC)
|
||||
return (0);
|
||||
/* Make sure we're a network function */
|
||||
error = pccard_get_function(dev, &fcn);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (fcn != PCCARD_FUNCTION_NETWORK)
|
||||
return (ENXIO);
|
||||
}
|
||||
return EIO;
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
static device_method_t fe_pccard_methods[] = {
|
||||
@ -248,6 +250,40 @@ fe_probe_mbh(device_t dev, const struct fe_pccard_product *pp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
sn_pccard_xircom_mac(const struct pccard_tuple *tuple, void *argp)
|
||||
{
|
||||
uint8_t *enaddr = argp;
|
||||
int i;
|
||||
|
||||
#if 1
|
||||
/*
|
||||
* We fail to map the CIS twice, for reasons unknown. We
|
||||
* may fix this in the future by loading the CIS with a sane
|
||||
* CIS from userland.
|
||||
*/
|
||||
static uint8_t defaultmac[ETHER_ADDR_LEN] = {
|
||||
0x00, 0x80, 0xc7, 0xed, 0x16, 0x7b};
|
||||
|
||||
/* Copy the MAC ADDR and return success */
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++)
|
||||
enaddr[i] = defaultmac[i];
|
||||
#else
|
||||
/* FUNCE is not after FUNCID, so we gotta go find it */
|
||||
if (tuple->code != 0x22)
|
||||
return (0);
|
||||
|
||||
/* Make sure this is a sane node */
|
||||
if (tuple->length < ETHER_ADDR_LEN + 3)
|
||||
return (0);
|
||||
|
||||
/* Copy the MAC ADDR and return success */
|
||||
for (i = 0; i < ETHER_ADDR_LEN; i++)
|
||||
enaddr[i] = pccard_tuple_read_1(tuple, i + 3);
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Probe and initialization for TDK/CONTEC PCMCIA Ethernet interface.
|
||||
* by MASUI Kenji <masui@cs.titech.ac.jp>
|
||||
@ -270,6 +306,7 @@ fe_probe_tdk (device_t dev, const struct fe_pccard_product *pp)
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
/* C-NET(PC)C occupies 16 I/O addresses. */
|
||||
if (fe_alloc_port(dev, 16))
|
||||
return ENXIO;
|
||||
@ -289,6 +326,11 @@ fe_probe_tdk (device_t dev, const struct fe_pccard_product *pp)
|
||||
|
||||
pccard_get_ether(dev, sc->enaddr);
|
||||
|
||||
/* Make sure we got a valid station address. */
|
||||
if (!fe_valid_Ether_p(sc->enaddr, 0)) {
|
||||
pccard_cis_scan(dev, sn_pccard_xircom_mac, sc->enaddr);
|
||||
}
|
||||
|
||||
/* Make sure we got a valid station address. */
|
||||
if (!fe_valid_Ether_p(sc->enaddr, 0))
|
||||
return ENXIO;
|
||||
|
Loading…
x
Reference in New Issue
Block a user