Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jan 2001 14:44:53 +1100 (EST)
From:      iain@research.canon.com.au
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/24398: Unit number is not set in ahc driver.
Message-ID:  <200101170344.f0H3irq00407@rice.research.canon.com.au>

next in thread | raw e-mail | index | archive | help


>Number:         24398
>Category:       kern
>Synopsis:       Unit number is not set in ahc driver.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 16 19:50:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Iain Templeton
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Canon Information Systems Research Australia
>Environment:

4.2-STABLE, current version of aic7xxx driver.

>Description:

The ahc->unit field is not being set in the softc structure. This effects
the test against AHC_TARGET_MODE since it uses that field. If it is not set
it is 0, and the test happens as if all the devices were ahc0.

I suspect it doesn't effect anything else (the field isn't used elsewhere).

>How-To-Repeat:

Use AHC_TARGET_MODE set to some value with bits other than bit 0 set. It
won't activate target mode on any units higher than 0.

>Fix:

Try this patch. It simply sets the unit number after allocating the 
ahc_softc structure.


*** ahc_eisa.c.old	Wed Jan 17 14:37:08 2001
--- ahc_eisa.c	Wed Jan 17 14:37:56 2001
***************
*** 126,131 ****
--- 126,134 ----
  	if (ahc == NULL)
  		return (ENOMEM);
  
+ 	/* Set the unit number of the ahc instance */
+ 	ahc_set_unit(ahc, device_get_unit(dev));
+ 
  	/* Allocate a dmatag for our SCB DMA maps */
  	/* XXX Should be a child of the PCI bus dma tag */
  	error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1,
*** ahc_pci.c.old	Wed Jan 17 14:36:26 2001
--- ahc_pci.c	Wed Jan 17 14:36:09 2001
***************
*** 98,103 ****
--- 98,106 ----
  	if (ahc == NULL)
  		return (ENOMEM);
  
+ 	/* Set the unit number of the ahc instance */
+ 	ahc_set_unit(ahc, device_get_unit(dev));
+ 
  	/* Allocate a dmatag for our SCB DMA maps */
  	/* XXX Should be a child of the PCI bus dma tag */
  	error = bus_dma_tag_create(/*parent*/NULL, /*alignment*/1,

>Release-Note:
>Audit-Trail:
>Unformatted:


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




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