Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2000 20:55:21 +0900
From:      Tatsumi Hosokawa <hosokawa@itc.keio.ac.jp>
To:        mobile@FreeBSD.org
Subject:   Re: Working pcic polling mode patch (Re: Polling mode of pcic as default?)
Message-ID:  <86iu0vh7me.wl@ringo.FromTo.Cc>
In-Reply-To: In your message of "Sat, 15 Jan 2000 18:39:05 %2B0900" <86ln5rhdxi.wl@ringo.FromTo.Cc>
References:  <86oganhgj8.wl@ringo.FromTo.Cc> <86ln5rhdxi.wl@ringo.FromTo.Cc>

next in thread | previous in thread | raw e-mail | index | archive | help
At Sat, 15 Jan 2000 18:39:05 +0900,
Tatsumi Hosokawa <hosokawa@itc.keio.ac.jp> wrote:

> I tested polling mode of -current and it does not work.
> I wrote a patch to fix this bug.
> If there's no objection, I'll commit it as soon as possible
> because 4.0 will soon be frozen.

Last patch have a minor bug.
(if pcic_irq was not defined in loader.rc,
 polling mode was selected)
I fixed this bug.

New patch:

Index: pcic.c
===================================================================
RCS file: /home/ncvs/src/sys/pccard/pcic.c,v
retrieving revision 1.85
diff -u -r1.85 pcic.c
--- pcic.c	1999/12/10 07:02:41	1.85
+++ pcic.c	2000/01/15 11:49:18
@@ -263,7 +263,7 @@
 	char *name;
 	int i;
 	int error;
-	struct resource *res;
+	struct resource *res = 0;
 	int rid;
 	static int maybe_vlsi = 0;
 
@@ -452,10 +452,14 @@
 		if (pcic_irq == 0) {
 			/* See if the user has requested a specific IRQ */
 			if (!getenv_int("machdep.pccard.pcic_irq", &pcic_irq))
-				pcic_irq = 0;
+				pcic_irq = -1;
 			rid = 0;
-			res = bus_alloc_resource(dev, SYS_RES_IRQ, 
-			    &rid, pcic_irq, ~0, 1, RF_ACTIVE);
+			if (pcic_irq) {
+				if (pcic_irq < 0)
+					pcic_irq = 0;
+				res = bus_alloc_resource(dev, SYS_RES_IRQ, 
+				    &rid, pcic_irq, ~0, 1, RF_ACTIVE);
+			}
 			if (res) {
 				error = bus_setup_intr(dev, res, 
 				    INTR_TYPE_MISC, pcicintr, NULL, &ih);
@@ -465,9 +469,14 @@
 					return error;
 				}
 				pcic_irq = rman_get_start(res);
+				printf("pcic: management irq %d\n", pcic_irq);
 			} else {
-				printf("pcic: polling, can't alloc %d\n",
-				    pcic_irq);
+				if (pcic_irq)
+					printf("pcic: polling mode, can't alloc %d\n",
+						pcic_irq);
+				else
+					printf("pcic: polling mode\n");
+				pcic_irq = 0;
 			}
 		}
 		/*
@@ -496,6 +505,8 @@
 		 */
 		if (pcic_irq > 0)
 			sp->putb(sp, PCIC_STAT_INT, (pcic_irq << 4) | 0xF);
+		else if (pcic_irq == 0) 
+			sp->putb(sp, PCIC_STAT_INT, 0xF);
 	}
 	if (validslots && pcic_irq <= 0)
 		pcictimeout_ch = timeout(pcictimeout, 0, hz/2);


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86iu0vh7me.wl>