Skip to contentSkip to conversation

serial_cs: support 3com 3C562 lan&modem multi-function card

PATCH New Komuro 1 participant 1 message Feb 7, 2009 TTY layer and serial drivers

lore
Share & tools
lore

Komuro

author
#0 lore raw

PATCH 1/1 serial_cs: support 3com 3C562 lan&modem multi-function card

serial_cs:
fix serial_cs to support 3com 3C562 lan&modem multi-function pcmcia-card again.

This code was deleted by Dominik(2006/12/05),
but actually it is necessary for this card
to get the correct configuration register information.

---

drivers/serial/serial_cs.c renamed from drivers/serial/serial_cs.c.orig +15 -2
@@ -681,7 +681,7 @@ static int serial_config(struct pcmcia_d
 	u_char *buf;
 	cisparse_t *parse;
 	cistpl_cftable_entry_t *cf;
-	int i;
+	int i, last_ret, last_fn;
 
 	DEBUG(0, "serial_config(0x%p)\n", link);
 
@@ -699,6 +699,17 @@ static int serial_config(struct pcmcia_d
 	tuple->TupleDataMax = 255;
 	tuple->Attributes = 0;
 
+	/* Get configuration register information */
+	tuple->DesiredTuple = CISTPL_CONFIG;
+	last_ret = first_tuple(link, tuple, parse);
+	if (last_ret != 0) {
+		last_fn = ParseTuple;
+		goto cs_failed;
+   	}
+    	link->conf.ConfigBase = parse->config.base;
+   	link->conf.Present = parse->config.rmask[0];
+
+
 	/* Is this a compliant multifunction card? */
 	tuple->DesiredTuple = CISTPL_LONGLINK_MFC;
 	tuple->Attributes = TUPLE_RETURN_COMMON | TUPLE_RETURN_LINK;
@@ -761,7 +772,9 @@ static int serial_config(struct pcmcia_d
 	kfree(cfg_mem);
 	return 0;
 
- failed:
+cs_failed:
+	cs_error(link, last_fn, last_ret);
+failed:
 	serial_remove(link);
 	kfree(cfg_mem);
 	return -ENODEV;