From owner-svn-src-head@FreeBSD.ORG Mon Dec 14 21:11:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D55106566C; Mon, 14 Dec 2009 21:11:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 834598FC14; Mon, 14 Dec 2009 21:11:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBELBomi038551; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBELBogp038549; Mon, 14 Dec 2009 21:11:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912142111.nBELBogp038549@svn.freebsd.org> From: Marius Strobl Date: Mon, 14 Dec 2009 21:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200544 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2009 21:11:50 -0000 Author: marius Date: Mon Dec 14 21:11:50 2009 New Revision: 200544 URL: http://svn.freebsd.org/changeset/base/200544 Log: Set ATA_CHECKS_CABLE when appropriate. Reviewed by: mav MFC after: 1 week Modified: head/sys/dev/ata/chipsets/ata-amd.c Modified: head/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 20:59:18 2009 (r200543) +++ head/sys/dev/ata/chipsets/ata-amd.c Mon Dec 14 21:11:50 2009 (r200544) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ +static int ata_amd_ch_attach(device_t dev); static int ata_amd_chipinit(device_t dev); static int ata_amd_setmode(device_t dev, int target, int mode); @@ -59,7 +60,6 @@ static int ata_amd_setmode(device_t dev, #define AMD_BUG 0x01 #define AMD_CABLE 0x02 - /* * American Micro Devices (AMD) chipset support functions */ @@ -100,6 +100,7 @@ ata_amd_chipinit(device_t dev) else pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1); + ctlr->ch_attach = ata_amd_ch_attach; ctlr->setmode = ata_amd_setmode; return 0; } @@ -137,4 +138,19 @@ ata_amd_setmode(device_t dev, int target return (mode); } +static int +ata_amd_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + int error; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + error = ata_pci_ch_attach(dev); + if (ctlr->chip->cfg1 & AMD_CABLE) + ch->flags |= ATA_CHECKS_CABLE; + return (error); +} + ATA_DECLARE_DRIVER(ata_amd);