All of lore.kernel.org
 help / color / mirror / Atom feed
* [CFT][PATCH v2] net/8390: apne.c - read out and log PCMCIA cftable entries
@ 2021-08-22  3:11 Michael Schmitz
  2021-08-23  7:36 ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Schmitz @ 2021-08-22  3:11 UTC (permalink / raw)
  To: linux-m68k; +Cc: alex, Michael Schmitz, Debian/m68k

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.

CC: Debian/m68k <debian-68k@lists.debian.org>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 drivers/net/ethernet/8390/apne.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c
index fe6c834..dd71b10 100644
--- a/drivers/net/ethernet/8390/apne.c
+++ b/drivers/net/ethernet/8390/apne.c
@@ -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)) < 3) {
+		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");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [CFT][PATCH v2] net/8390: apne.c - read out and log PCMCIA cftable entries
  2021-08-22  3:11 [CFT][PATCH v2] net/8390: apne.c - read out and log PCMCIA cftable entries Michael Schmitz
@ 2021-08-23  7:36 ` Geert Uytterhoeven
  2021-08-23 21:41   ` Michael Schmitz
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2021-08-23  7:36 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: Linux/m68k, ALeX Kazik, Debian/m68k

Hi Michael,

On Sun, Aug 22, 2021 at 5:11 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> 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.
>
> CC: Debian/m68k <debian-68k@lists.debian.org>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

> --- a/drivers/net/ethernet/8390/apne.c
> +++ b/drivers/net/ethernet/8390/apne.c
> @@ -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)) < 3) {
> +               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");

print_hex_dump()?

> +       }
>  #endif
>
>         pr_cont("ethernet PCMCIA card inserted\n");

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [CFT][PATCH v2] net/8390: apne.c - read out and log PCMCIA cftable entries
  2021-08-23  7:36 ` Geert Uytterhoeven
@ 2021-08-23 21:41   ` Michael Schmitz
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Schmitz @ 2021-08-23 21:41 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linux/m68k, ALeX Kazik, Debian/m68k

Hi Geert,


On 23/08/21 19:36, Geert Uytterhoeven wrote:
>> +
>> +       if ((len_cftuple = pcmcia_copy_tuple(CISTPL_CFTABLE_ENTRY, cftuple, 256)) < 3) {
>> +               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");
> print_hex_dump()?
Too true - I'll use that in the next iteration.

Cheers,

     Michael




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-23 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22  3:11 [CFT][PATCH v2] net/8390: apne.c - read out and log PCMCIA cftable entries Michael Schmitz
2021-08-23  7:36 ` Geert Uytterhoeven
2021-08-23 21:41   ` Michael Schmitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.