Date: Tue, 17 Oct 2000 11:10:38 +0900 From: MIHIRA Sanpei Yoshiro <sanpei@sanpei.org> To: mobile@FreeBSD.org Subject: [Patch] ignore kernel information (-I option for /usr/sbin/pccardd) Message-ID: <200010170210.e9H2Adj20814@lavender.sanpei.org>
next in thread | raw e-mail | index | archive | help
Hi.
Mobile user
I created and committed PIOCSRESOURCE ioctl into 5-current and
4-stable. Now /usr/sbin/pccardd read free resource(io,irq) range
with this ioctl from kernel.
But I have a problem with IBM ThinkPad600. ``sio1'' was disabled
in BIOS and irq 3 was free (also not listed in dmesg), I think. But
I could not use irq 3 for PC-Card with new pccardd. (Why... Sorry I
did not check in kernel)
For the present, I want to add -I option, ``Don't get and use a
list of free IRQs from kernel.''.. And also want to add ``ignore
KERN IRQ'' to Select Free IRQ for PC-Card menu in sysinstall for
installation. Original idea was from PAO.
Any comments?
Index: usr.sbin/pccard/pccardd/cardd.h
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.h,v
retrieving revision 1.26
diff -u -r1.26 cardd.h
--- usr.sbin/pccard/pccardd/cardd.h 2000/09/21 13:13:00 1.26
+++ usr.sbin/pccard/pccardd/cardd.h 2000/10/13 15:57:11
@@ -154,6 +154,7 @@
EXTERN bitstr_t *io_avail;
EXTERN bitstr_t *io_init;
EXTERN int pccard_init_sleep; /* Time to sleep on init */
+EXTERN int use_kern_irq;
EXTERN int debug_level;
/* cardd.c functions */
Index: usr.sbin/pccard/pccardd/pccardd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/pccardd.c,v
retrieving revision 1.11
diff -u -r1.11 pccardd.c
--- usr.sbin/pccard/pccardd/pccardd.c 2000/08/20 16:16:57 1.11
+++ usr.sbin/pccard/pccardd/pccardd.c 2000/10/13 15:57:13
@@ -161,14 +161,18 @@
int irq_specified = 0;
int i;
struct sockaddr_un sun;
-#define COM_OPTS ":dvf:s:i:z"
+#define COM_OPTS ":Idvf:s:i:z"
bzero(irq_arg, sizeof(irq_arg));
+ use_kern_irq = 1;
debug_level = 0;
pccard_init_sleep = 5000000;
cards = last_card = 0;
while ((count = getopt(argc, argv, COM_OPTS)) != -1) {
switch (count) {
+ case 'I':
+ use_kern_irq = 0;
+ break;
case 'd':
setbuf(stdout, 0);
setbuf(stderr, 0);
Index: usr.sbin/pccard/pccardd/cardd.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.c,v
retrieving revision 1.63
diff -u -r1.63 cardd.c
--- usr.sbin/pccard/pccardd/cardd.c 2000/10/13 15:11:48 1.63
+++ usr.sbin/pccard/pccardd/cardd.c 2000/10/13 16:00:30
@@ -528,7 +528,8 @@
perror("ioctl (PIOCSRESOURCE)");
exit(1);
}
- if (pool_irq[i] && res.resource_addr == i) {
+ if (pool_irq[i]
+ && (res.resource_addr == i || !use_kern_irq)) {
conf->irq = i;
pool_irq[i] = 0;
break;
Index: src/usr.sbin/pccard/pccardd/pccardd.8
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/pccardd.8,v
retrieving revision 1.19
diff -u -r1.19 pccardd.8
--- src/usr.sbin/pccard/pccardd/pccardd.8 2000/04/08 05:19:44 1.19
+++ src/usr.sbin/pccard/pccardd/pccardd.8 2000/10/15 13:56:26
@@ -37,6 +37,7 @@
.Op Fl v
.Op Fl z
.Op Fl i Ar IRQ
+.Op Fl I
.Op Fl f Ar configfile
.Sh DESCRIPTION
.Nm Pccardd
@@ -135,6 +136,8 @@
of it.
.It Fl z
Delays running as a daemon until after the cards have been probed and attached.
+.It Fl I
+Don't get and use a list of free IRQs from kernel.
.It Fl i Ar IRQ
Configures an available IRQ. It overrides the "irq" line in
.Pa /etc/defaults/pccard.conf
Index: release/sysinstall/pccard.c
===================================================================
RCS file: /home/ncvs/src/release/sysinstall/pccard.c,v
retrieving revision 1.14
diff -u -r1.14 pccard.c
--- release/sysinstall/pccard.c 2000/10/13 09:51:18 1.14
+++ release/sysinstall/pccard.c 2000/10/13 15:59:26
@@ -24,7 +24,7 @@
/*
* Set up defines for pccardd interrupt selection.
*/
-#define IRQ_COUNT 9
+#define IRQ_COUNT 10
#define IRQ_10 0x00001
#define IRQ_11 0x00002
#define IRQ_03 0x00004
@@ -34,6 +34,7 @@
#define IRQ_05 0x00040
#define IRQ_06 0x00080
#define IRQ_15 0x00100
+#define IGN_KERN_IRQ 0x00200
unsigned int CardIrq;
@@ -55,6 +56,7 @@
{ "irq_10", "-i 10", ~IRQ_10, IRQ_10 },
{ "irq_11", "-i 11", ~IRQ_11, IRQ_11 },
{ "irq_15", "-i 15", ~IRQ_15, IRQ_15 },
+ { "ign_KERN_IRQ", "-I", ~IGN_KERN_IRQ, IGN_KERN_IRQ },
{NULL},
};
@@ -124,6 +126,8 @@
dmenuFlagCheck, dmenuSetFlag, NULL, &CardIrq, '[', 'X', ']', IRQ_15 },
{ "11 IRQ 6", "IRQ 6 will be free if laptop only has USB floppy drive",
dmenuFlagCheck, dmenuSetFlag, NULL, &CardIrq, '[', 'X', ']', IRQ_06 },
+ { "12 IGN KERN IRQ", "don't get a list of free IRQs from kernel",
+ dmenuFlagCheck, dmenuSetFlag, NULL, &CardIrq, '[', 'X', ']', IGN_KERN_IRQ },
{ NULL } },
};
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?200010170210.e9H2Adj20814>
