From owner-freebsd-acpi@FreeBSD.ORG Sun Jan 2 17:38:35 2005 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 011A616A4CE for ; Sun, 2 Jan 2005 17:38:35 +0000 (GMT) Received: from sana.init-main.com (104.194.138.210.bn.2iij.net [210.138.194.104]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F40643D49 for ; Sun, 2 Jan 2005 17:38:34 +0000 (GMT) (envelope-from takawata@init-main.com) Received: from init-main.com (localhost.init-main.com [127.0.0.1]) by sana.init-main.com (8.13.1/8.13.1) with ESMTP id j02HZWAs017587; Mon, 3 Jan 2005 02:35:32 +0900 (JST) (envelope-from takawata@init-main.com) Message-Id: <200501021735.j02HZWAs017587@sana.init-main.com> To: freebsd-acpi@freebsd.org, sam@errno.com From: takawata@jp.freebsd.org Date: Mon, 03 Jan 2005 02:35:32 +0900 Sender: takawata@init-main.com Subject: ACPI C3 patch for atheros X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2005 17:38:35 -0000 Happy Newyear! I was pity to be unable to use atheros wlan adaptor on FreeBSD with ACPI. I checked madwifi archive and I found problem much alike with me in Linux and the fix. It seems that it can easyly be applyed to FreeBSD, so I tried following patch and it works. How about this? And should it be in PCI framework? Index: if_ath_pci.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ath/if_ath_pci.c,v retrieving revision 1.10 diff -u -r1.10 if_ath_pci.c --- if_ath_pci.c 31 Dec 2004 22:41:45 -0000 1.10 +++ if_ath_pci.c 2 Jan 2005 17:30:21 -0000 @@ -109,6 +109,9 @@ bzero(psc, sizeof (*psc)); sc->sc_dev = dev; + /*Disable RETRY_TIMEOUT */ + pci_write_config(dev, 0x41, 0, 1 ); + cmd = pci_read_config(dev, PCIR_COMMAND, 4); cmd |= PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 4); @@ -248,6 +251,7 @@ struct ath_pci_softc *psc = device_get_softc(dev); u_int16_t cmd; + pci_write_config(dev, 0x41, 0, 1 ); pci_write_config(dev, PCIR_INTLINE, psc->sc_saved_intline, 1); pci_write_config(dev, PCIR_CACHELNSZ, psc->sc_saved_cachelinesz, 1); pci_write_config(dev, PCIR_LATTIMER, psc->sc_saved_lattimer, 1);