Skip to contentSkip to conversation

pcmcia: hostap_cs.c - 0xc00f,0x0000 conflicts with pcnet_cs

PATCH In review Dominik Brodowski 2 participants 7 messages Jun 30, 2006 – Jul 3, 2006 11 messages not in the archive

Subsystems (5)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 3/15 pcmcia: another ID for serial_cs.c

From: Dominik Brodowski <[email protected]>
Date: Wed, 26 Apr 2006 19:57:32 +0200
Subject: [PATCH] pcmcia: another ID for serial_cs.c

Add an ID for "GlobeTrotter" cards which need a CIS override

---
 drivers/serial/serial_cs.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/serial/serial_cs.c +1 -0
index 2c70773..cbf260b 100644
@@ -786,6 +786,7 @@ static struct pcmcia_device_id serial_id
 	PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "COMpad4.cis"),
 	PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "COMpad2.cis"),
 	PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "RS-COM-2P.cis"),
+	PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"),
 	/* too generic */
 	/* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */
 	/* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */
Signature · 1 line
1.4.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

PATCH 7/15 pcmcia: Make ide_cs work with the memory space of CF-Cards if IO space is not available

From: Thomas Kleffel <[email protected]>
Date: Sun, 14 May 2006 15:16:30 +0200
Subject: [PATCH] pcmcia: Make ide_cs work with the memory space of CF-Cards if IO space is not available

This patch enables ide_cs to access CF-cards via their common memory rather than via their IO space.

---
 drivers/ide/legacy/ide-cs.c |   81 ++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 71 insertions(+), 10 deletions(-)
drivers/ide/legacy/ide-cs.c +71 -10
index 602797a..b7e459e 100644
@@ -146,7 +146,16 @@ static void ide_detach(struct pcmcia_dev
     kfree(link->priv);
 } /* ide_detach */
 
-static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq, struct pcmcia_device *handle)
+static void idecs_mmio_fixup(ide_hwif_t *hwif)
+{
+	default_hwif_mmiops(hwif);
+	hwif->mmio = 2;
+
+	ide_undecoded_slave(hwif);
+}
+
+static int idecs_register(unsigned long io, unsigned long ctl,
+	unsigned long irq, struct pcmcia_device *handle, int is_mmio)
 {
     hw_regs_t hw;
     memset(&hw, 0, sizeof(hw));
@@ -154,7 +163,19 @@ static int idecs_register(unsigned long 
     hw.irq = irq;
     hw.chipset = ide_pci;
     hw.dev = &handle->dev;
-    return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+
+    if(is_mmio)
+    	return ide_register_hw_with_fixup(&hw, NULL, idecs_mmio_fixup);
+    else
+        return ide_register_hw_with_fixup(&hw, NULL, ide_undecoded_slave);
+}
+
+void outb_io(unsigned char value, unsigned long port) {
+	outb(value, port);
+}
+
+void outb_mem(unsigned char value, unsigned long port) {
+	writeb(value, (void __iomem *) port);
 }
 
 /*======================================================================
@@ -180,7 +201,8 @@ static int ide_config(struct pcmcia_devi
     } *stk = NULL;
     cistpl_cftable_entry_t *cfg;
     int i, pass, last_ret = 0, last_fn = 0, hd, is_kme = 0;
-    unsigned long io_base, ctl_base;
+    unsigned long io_base, ctl_base, is_mmio, try_slave;
+    void (*my_outb)(unsigned char, unsigned long);
 
     DEBUG(0, "ide_config(0x%p)\n", link);
 
@@ -210,7 +232,7 @@ static int ide_config(struct pcmcia_devi
     /* Not sure if this is right... look up the current Vcc */
     CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &stk->conf));
 
-    pass = io_base = ctl_base = 0;
+    pass = io_base = ctl_base = is_mmio = try_slave = 0;
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
     CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
@@ -258,11 +280,45 @@ static int ide_config(struct pcmcia_devi
 			goto next_entry;
 		io_base = link->io.BasePort1;
 		ctl_base = link->io.BasePort1 + 0x0e;
+
+		if (io->win[0].len >= 0x20)
+			try_slave = 1;
+
 	    } else goto next_entry;
 	    /* If we've got this far, we're done */
 	    break;
 	}
 
+	if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
+	    win_req_t req;
+	    memreq_t map;
+	    cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
+
+	    if (mem->win[0].len < 16)
+	    	goto next_entry;
+
+	    req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
+	    req.Attributes |= WIN_ENABLE;
+	    req.Base = mem->win[0].host_addr;
+	    req.Size = 0;
+
+	    req.AccessSpeed = 0;
+	    if (pcmcia_request_window(&link, &req, &link->win) != 0)
+		goto next_entry;
+	    map.Page = 0; map.CardOffset = mem->win[0].card_addr;
+	    if (pcmcia_map_mem_page(link->win, &map) != 0)
+		goto next_entry;
+
+      	    io_base = (unsigned long) ioremap(req.Base, req.Size);
+    	    ctl_base = io_base + 0x0e;
+    	    is_mmio = 1;
+
+    	    if (mem->win[0].len >= 0x20)
+    	    	try_slave = 1;
+
+	    break;
+	}
+
     next_entry:
 	if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
 	    memcpy(&stk->dflt, cfg, sizeof(stk->dflt));
@@ -278,21 +334,26 @@ static int ide_config(struct pcmcia_devi
     CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
     CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
 
+    if(is_mmio)
+    	my_outb = outb_mem;
+    else
+    	my_outb = outb_io;
+
     /* disable drive interrupts during IDE probe */
-    outb(0x02, ctl_base);
+    my_outb(0x02, ctl_base);
 
     /* special setup for KXLC005 card */
     if (is_kme)
-	outb(0x81, ctl_base+1);
+	my_outb(0x81, ctl_base+1);
 
     /* retry registration in case device is still spinning up */
     for (hd = -1, i = 0; i < 10; i++) {
-	hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
+	hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link, is_mmio);
 	if (hd >= 0) break;
-	if (link->io.NumPorts1 == 0x20) {
-	    outb(0x02, ctl_base + 0x10);
+	if (try_slave) {
+	    my_outb(0x02, ctl_base + 0x10);
 	    hd = idecs_register(io_base + 0x10, ctl_base + 0x10,
-				link->irq.AssignedIRQ, link);
+				link->irq.AssignedIRQ, link, is_mmio);
 	    if (hd >= 0) {
 		io_base += 0x10;
 		ctl_base += 0x10;
Signature · 1 line
1.4.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

PATCH 9/15 pcmcia: hostap_cs.c - 0xc00f,0x0000 conflicts with pcnet_cs

From: Komuro <[email protected]>
Date: Mon, 17 Apr 2006 21:41:21 +0900
Subject: [PATCH] pcmcia: hostap_cs.c - 0xc00f,0x0000 conflicts with pcnet_cs

Comment out the ID 0xc00f,0x0000 in hostap_cs.c, as it conflicts with the pcnet_cs driver.

---
 drivers/net/wireless/hostap/hostap_cs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/hostap/hostap_cs.c +1 -1
index db03dc2..fbb4189 100644
@@ -844,7 +844,7 @@ static struct pcmcia_device_id hostap_cs
 	PCMCIA_DEVICE_MANF_CARD(0x02d2, 0x0001),
 	PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x0001),
 	PCMCIA_DEVICE_MANF_CARD(0x50c2, 0x7300),
-	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),
+/*	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),    conflict with pcnet_cs */
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002),
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005),
 	PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010),
Signature · 1 line
1.4.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

PATCH 14/15 com20020_cs: more device support

From: Marc Sowen <[email protected]>
Date: Sun, 25 Jun 2006 01:56:24 -0700
Subject: [PATCH] com20020_cs: more device support

Enable the com20020_cs arcnet driver to see the SoHard (now Mercury Computer Systems Inc.) SH ARC-PCMCIA card.

---
 drivers/net/pcmcia/com20020_cs.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/pcmcia/com20020_cs.c +4 -1
index 441de82..48434d7 100644
@@ -387,7 +387,10 @@ static int com20020_resume(struct pcmcia
 }
 
 static struct pcmcia_device_id com20020_ids[] = {
-	PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.", "PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
+	PCMCIA_DEVICE_PROD_ID12("Contemporary Control Systems, Inc.",
+			"PCM20 Arcnet Adapter", 0x59991666, 0x95dfffaf),
+	PCMCIA_DEVICE_PROD_ID12("SoHard AG",
+			"SH ARC PCMCIA", 0xf8991729, 0x69dff0c7),
 	PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, com20020_ids);
Signature · 1 line
1.4.0
#15 lore raw

Re: [PATCH 9/15] pcmcia: hostap_cs.c - 0xc00f, 0x0000 conflicts with pcnet_cs

In reply to Dominik Brodowski

Hi Dominik,

drivers/net/wireless/hostap/hostap_cs.c static struct pcmcia_device_id hostap_cs · line 847

Quoted 2 lines · Dominik Brodowski
drivers/net/wireless/hostap/hostap_cs.c +1 -1
-	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),
+/*	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),    conflict with pcnet_cs */

That's fine if we also add symbolic names. I could identify two hostap_cs compatible cards using this ID :

card "Allied Telesyn AT-WCL452"
version "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", "Ver.
1.00"
manfid 0xc00f, 0x0000
bind "hostap_cs"

card "corega WL PCCL-11"
version "corega", "WL PCCL-11", "ISL37300P", "RevA" manfid 0xc00f, 0x0000
bind "hostap_cs"

(from http://www.handhelds.org/hypermail/oe-commits/41/4121.html)

Signature · 2 lines
Regards,
Pavel Roskin
#16 lore raw

Re: [PATCH 9/15] pcmcia: hostap_cs.c - 0xc00f, 0x0000 conflicts with pcnet_cs

Hi Pavel,

Quoted 13 lines · Pavel Roskin

Review

Quoted 2 lines · Dominik Brodowski
(quoted diff) +1 -1
-	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),
+/*	PCMCIA_DEVICE_MANF_CARD(0xc00f, 0x0000),    conflict with pcnet_cs */

That's fine if we also add symbolic names. I could identify two hostap_cs compatible cards using this ID :

card "Allied Telesyn AT-WCL452"
version "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", "Ver.
1.00"
manfid 0xc00f, 0x0000
bind "hostap_cs"

Quoted 4 lines

card "corega WL PCCL-11"
version "corega", "WL PCCL-11", "ISL37300P", "RevA" manfid 0xc00f, 0x0000
bind "hostap_cs"

Like this?

From: Dominik Brodowski <[email protected]>
Date: Sun, 2 Jul 2006 21:21:51 +0200
Subject: [PATCH] pcmcia: add more IDs to hostap_cs.c

As a replacement for the broad manufactor/card ID match we commented out because of conflicts with pcnet_cs, add two product ID matches.

---
 drivers/net/wireless/hostap/hostap_cs.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/wireless/hostap/hostap_cs.c +7 -0
index 52e6df5..f39d735 100644
@@ -886,6 +886,13 @@ static struct pcmcia_device_id hostap_cs
 	PCMCIA_DEVICE_PROD_ID123(
 		"U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02",
 		0xc7b8df9d, 0x1700d087, 0x4b74baa0),
+	PCMCIA_DEVICE_PROD_ID123(
+		"Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio",
+		"Ver. 1.00",
+		0x5cd01705, 0x4271660f, 0x9d08ee12),
+	PCMCIA_DEVICE_PROD_ID1234(
+		"corega", "WL PCCL-11", "ISL37300P", "RevA",
+		0xa21501a, 0x59868926, 0xc9049a39, 0x57a66194),
 	PCMCIA_DEVICE_NULL
 };
 MODULE_DEVICE_TABLE(pcmcia, hostap_cs_ids);
Signature · 1 line
1.4.0
#17 lore raw

Re: [PATCH 9/15] pcmcia: hostap_cs.c - 0xc00f, 0x0000 conflicts with pcnet_cs

Hi Dominik,

Quoted 1 line · Dominik Brodowski

Like this?

Yes, but I usually drop revisions from the matched IDs, especially in presence of the chip ID. Why would we exclude "RevB" if it happens to be ISL37300P based? So the new entries would be:

	PCMCIA_DEVICE_PROD_ID123(
		"Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio",
		"Ver. 1.00",
		0x5cd01705, 0x4271660f, 0x9d08ee12),
	PCMCIA_DEVICE_PROD_ID123(
		"corega", "WL PCCL-11", "ISL37300P",
		0xa21501a, 0x59868926, 0xc9049a39),
Signature · 2 lines
Regards,
Pavel Roskin