Date: Wed, 14 Jul 1999 17:16:14 +0930 From: Greg Lehey <grog@lemis.com> To: Warner Losh <imp@village.org>, mobile@FreeBSD.ORG Subject: Re: More verbose errors from pccard Message-ID: <19990714171614.09487@mojave.lemis.com> In-Reply-To: <199907140724.BAA53478@harmony.village.org>; from Warner Losh on Wed, Jul 14, 1999 at 01:24:20AM -0600 References: <199907140724.BAA53478@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, 14 July 1999 at 1:24:20 -0600, Warner Losh wrote:
>
> Here are some preliminary patches to improve the error reporting when
> things go wrong. I've added error messages as well as changing the
> return value for unknown ioctls from EINVAL to ENOTTY. What comments
> do people have?
This is similar to some of the stuff I've been doing. I'm not in a
position to test at the moment (I'm in Darwin NT about to deliver a
workshop, and I need the machine in a known state :-), but here are a
few comments:
> Index: pccard.c
> ===================================================================
> RCS file: /home/imp/FreeBSD/CVS/src/sys/pccard/pccard.c,v
> retrieving revision 1.80
> diff -u -r1.80 pccard.c
> --- pccard.c 1999/05/31 11:28:48 1.80
> +++ pccard.c 1999/07/14 07:19:48
> @@ -590,11 +590,19 @@
Immediately before this code, I have:
/*
* If an instance of this driver is already installed,
* but not running, then remove it. If it is running,
* then reject the request.
*/
for (devi = slt->devices; devi; devi = devi->next)
if (devi->drv == drv && devi->isahd.id_unit == desc->unit) {
if (devi->running)
{
printf ("Driver for %s already active\n", desc->name);
return(EBUSY);
}
remove_device(devi);
break;
}
> * against the slot interrupt (if one has been allocated).
> */
> if (desc->irqmask && drv->imask) {
> - if ((slt->ctrl->irqs & desc->irqmask) == 0)
> + if ((slt->ctrl->irqs & desc->irqmask) == 0) {
> + printf("pccard: PIOCSDRV requested irq (mask 0x%x) is "
> + "not free (available mask 0x%x)\n", desc->irqmask,
Is this message going to pass the Bruce test? It could easily exceed
80 chars :-) Also, here I have the name of the device. How about the
following:
printf("pccard: can't allocate requested irq (mask 0x%x) to %s "
" (available: 0x%x)\n", desc->name,
desc->irqmask,
> + slt->ctrl->irqs);
> return(EINVAL);
Again, maybe an EBUSY?
> + }
> if (slt->irq) {
> - if (((1 << slt->irq) & desc->irqmask) == 0)
> + if (((1 << slt->irq) & desc->irqmask) == 0) {
> + printf("pccard: PIOSCDRIV irq %d not in "
> + "available mask 0x%x\n", slt->irq,
> + desc->irqmask);
A similar comment to the last one. I find the name of use in all of
these messages. The same applies to the other changes, which look
pretty much right to me apart from that.
Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers
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?19990714171614.09487>
