From 7d2e8d00b47b973c92db4df7444d5e6d3bb945f9 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 18 Oct 2009 18:22:32 +0200 Subject: pcmcia: use pre-determined values A few PCMCIA network drivers can make use of values provided by the pcmcia core, instead of tedious, independent CIS parsing. xirc32ps_cs.c: manf_id hostap_cs.c: multifunction count b43/pcmcia.c: ConfigBase address and "Present" smc91c92_cs.c: By default, mhz_setup() can use VERS_1 as it is stored in struct pcmcia_device. Only some cards require workarounds, such as reading out VERS_1 twice. CC: David S. Miller CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org Acked-by: John W. Linville Signed-off-by: Dominik Brodowski --- drivers/net/pcmcia/smc91c92_cs.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/net/pcmcia/smc91c92_cs.c') diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 7bde2cd34c7e..af03759d186d 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c @@ -545,6 +545,14 @@ static int mhz_setup(struct pcmcia_device *link) u_char *buf, *station_addr; int rc; + /* Read the station address from the CIS. It is stored as the last + (fourth) string in the Version 1 Version/ID tuple. */ + if ((link->prod_id[3]) && + (cvt_ascii_address(dev, link->prod_id[3]) == 0)) + return 0; + + /* Workarounds for broken cards start here. */ + cfg_mem = kmalloc(sizeof(struct smc_cfg_mem), GFP_KERNEL); if (!cfg_mem) return -1; @@ -557,8 +565,7 @@ static int mhz_setup(struct pcmcia_device *link) tuple->TupleData = (cisdata_t *)buf; tuple->TupleDataMax = 255; - /* Read the station address from the CIS. It is stored as the last - (fourth) string in the Version 1 Version/ID tuple. */ + /* Ugh -- the EM1144 card has two VERS_1 tuples!?! */ tuple->DesiredTuple = CISTPL_VERS_1; if (first_tuple(link, tuple, parse) != 0) { rc = -1; -- cgit v1.2.1