From sanpei@sanpei.org  Mon Oct  2 07:29:59 2000
Return-Path: <sanpei@sanpei.org>
Received: from lavender.sanpei.org (ppp109.dialup.st.keio.ac.jp [131.113.27.109])
	by hub.freebsd.org (Postfix) with ESMTP id 2877837B503
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  2 Oct 2000 07:29:52 -0700 (PDT)
Received: (from sanpei@localhost)
	by lavender.sanpei.org (8.11.0/3.7W) id e92ETeT00495;
	Mon, 2 Oct 2000 23:29:40 +0900 (JST)
Message-Id: <200010021429.e92ETeT00495@lavender.sanpei.org>
Date: Mon, 02 Oct 2000 23:29:39 +0900
From: sanpei@FreeBSD.org
Sender: sanpei@sanpei.org
To: freebsd-gnats-submit@FreeBSD.org, pa@cdg.chalmers.se
Subject: pccard fixes

>Number:         21702
>Category:       kern
>Synopsis:       pccard fixes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    imp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 02 07:30:01 PDT 2000
>Closed-Date:    Mon Oct 23 07:44:02 PDT 2000
>Last-Modified:  Mon Oct 23 07:49:53 PDT 2000
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
   I created below patch for Per Andersson's bug report.
   How about this patch, Warner-san and Andersson-san? obtained from
 PAO3
 ---
 MIHIRA, Sanpei Yoshiro
 Yokohama, Japan.
 
 
 Index: src/usr.sbin/pccard/pccardd/cardd.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/pccard/pccardd/cardd.c,v
 retrieving revision 1.60
 diff -u -r1.60 cardd.c
 --- src/usr.sbin/pccard/pccardd/cardd.c	2000/10/01 12:36:14	1.60
 +++ src/usr.sbin/pccard/pccardd/cardd.c	2000/10/02 14:24:39
 @@ -192,6 +192,7 @@
  card_removed(struct slot *sp)
  {
  	struct card *cp;
 +	struct allocblk *sio;
  	int in_use = 0;
  
  	if (sp->config && sp->config->driver && sp->card)
 @@ -210,10 +211,14 @@
  	sp->cis = 0;
  	sp->config = 0;
  	/* release io */
 -	bit_nset(io_avail, sp->io.addr, sp->io.addr + sp->io.size - 1);
 +	if (sp->flags & IO_ASSIGNED) 
 +            for (sio = &sp->io; sio; sio = sio->next)
 +                if (sio->addr && sio->size)
 +			bit_nset(io_avail, sio->addr, sio->addr + sio->size - 1);
  	/* release irq */
 -	if (sp->irq)
 -		pool_irq[sp->irq] = 1;
 +	if (sp->flags & IRQ_ASSIGNED)
 +		if (sp->irq >= 1 && sp->irq <= 15)
 +			pool_irq[sp->irq] = 1;
  }
  
  /* CIS string comparison */
 
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->imp 
Responsible-Changed-By: peter 
Responsible-Changed-When: Mon Oct 2 12:05:00 PDT 2000 
Responsible-Changed-Why:  
misfiled - Warner, please take a look at this... 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21702 
State-Changed-From-To: open->closed 
State-Changed-By: sanpei 
State-Changed-When: Mon Oct 23 07:44:02 PDT 2000 
State-Changed-Why:  
This mail was replied to bin/20454. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21702 
>Unformatted:
