From owner-freebsd-bugs Tue Jan 16 19:50:19 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9B5D737B402 for ; Tue, 16 Jan 2001 19:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f0H3o1G71207; Tue, 16 Jan 2001 19:50:01 -0800 (PST) (envelope-from gnats) Received: from kwanon.research.canon.com.au (kwanon.research.canon.com.au [203.12.172.254]) by hub.freebsd.org (Postfix) with ESMTP id 42EE837B401 for ; Tue, 16 Jan 2001 19:44:55 -0800 (PST) Received: from rice.research.canon.com.au (rice.research.canon.com.au [10.2.2.91]) by kwanon.research.canon.com.au (Postfix) with ESMTP id 94CE28A8B2 for ; Wed, 17 Jan 2001 03:51:17 +0000 (UTC) Received: (from iain@localhost) by rice.research.canon.com.au (8.11.0/8.11.1) id f0H3irq00407; Wed, 17 Jan 2001 14:44:53 +1100 (EST) (envelope-from iain) Message-Id: <200101170344.f0H3irq00407@rice.research.canon.com.au> Date: Wed, 17 Jan 2001 14:44:53 +1100 (EST) From: iain@research.canon.com.au Reply-To: iain@research.canon.com.au To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/24398: Unit number is not set in ahc driver. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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