Skip to contentSkip to conversation

net/8390: apne.c - read out and log PCMCIA cftable entries

PATCH Superseded Michael Schmitz 1 participant 1 message Aug 22, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/8390: apne.c - read out and log PCMCIA cftable entries

Could someone with a 'normal' Amiga PCMCIA ethernet card (supported by the current apne driver) please test this patch and send me the kernel log output relating to the apne driver probe?

At least for the 16 bit card that Alex tested, the PCMCIA config tuple data correctly records the 16 bit IO width of the card. I need to know whether 8 bit cards also report 16 bit IO width, or only 8 bit.

The IO width from the config table data, iff accurate, would allow auto-probing of 16 bit cards. That would make it easier to get a patch to support 16 bit cards accepted.

Thanks,

Michael

Read the card's CISTPL_CFTABLE_ENTRY tuple, and log to the kernel log buffer. This tuple ought to hold information about the IO width of the card memory window that can be used in autoprobing to detect 16 bit datapath cards.

---
 drivers/net/ethernet/8390/apne.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/net/ethernet/8390/apne.c +16 -0
index fe6c834..363c1d5 100644
@@ -127,6 +127,8 @@ struct net_device * __init apne_probe(int unit)
 
 #ifndef MANUAL_CONFIG
 	char tuple[8];
+	char cftuple[258];
+	int len_cftuple = 0;
 #endif
 	int err;
 
@@ -168,6 +170,20 @@ struct net_device * __init apne_probe(int unit)
 		free_netdev(dev);
 		return ERR_PTR(-ENODEV);
 	}
+
+	if ((len_cftuple = pcmcia_copy_tuple(CISTPL_CFTABLE_ENTRY, cftuple, 256)) < 32) {
+		pr_cont("no cftable entry for card\n");
+		/* XXX: shouldn't we re-enable irq here? */
+	} else {
+		int i;
+
+		pr_info("CFTABLE_ENTRY tuple:\n");
+		for (i=0; i<len_cftuple; i++) {
+			pr_cont("%hhx ", cftuple[i]);
+			if (i > 0 && !(i % 10)) pr_cont("\n");			
+		}
+		pr_cont("\n");
+	}
 #endif
 
 	pr_cont("ethernet PCMCIA card inserted\n");
Signature · 1 line
2.7.4