From owner-freebsd-current@FreeBSD.ORG Sat Dec 29 16:37:04 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF9B94A7; Sat, 29 Dec 2012 16:37:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by mx1.freebsd.org (Postfix) with ESMTP id 2D26B8FC08; Sat, 29 Dec 2012 16:37:03 +0000 (UTC) Received: by mail-wg0-f45.google.com with SMTP id dq12so5116576wgb.0 for ; Sat, 29 Dec 2012 08:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=w28H5FaF4GxFjApd1OZZCJ/fTaPSa/DTSjKsKUo/kfg=; b=PTPvVUoXWTlT7BxKjjmC061K+c9UulrAJcJlvtTFBqXkb1xwtvwZ9GgBGiqwfUkBdD 4xk62R0G29EErIdJ2t7UhaKHynCwi53/aMQBXYdeYxO3q2edpqjr3Mr5n0OS0kH78P19 EcDXhFBT9kUNevk0x/nq3AiXZP4qcxH8ko5YdCp1yCFD8x6P9OrmxSWB6h7Stt4+mIyd xwQ2kcUH3bedMqDDOw65JGFVs8U2NGGFSHPE3N/6q98yLbpo6kDagRTz9gl8CHVHfY7N t3/tTGsUJXqGQ24XX8gsOoCCnEYitZ7u6Rdd/L8iJLyKQTgEzqsX0/dkRa9xqXOmJLgi ocLg== MIME-Version: 1.0 Received: by 10.180.88.40 with SMTP id bd8mr48622616wib.33.1356798551800; Sat, 29 Dec 2012 08:29:11 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Sat, 29 Dec 2012 08:29:11 -0800 (PST) In-Reply-To: <20121229152934.AFFA5E6726@smtp.hushmail.com> References: <20121123213551.C2CB9E6739@smtp.hushmail.com> <201212101437.54825.jhb@freebsd.org> <201212111549.49942.jhb@freebsd.org> <20121213211100.5395F10E2C8@smtp.hushmail.com> <20121214085607.3938D10E2C8@smtp.hushmail.com> <20121227200643.9F13DE6726@smtp.hushmail.com> <20121228114821.675D1E6726@smtp.hushmail.com> <20121229152934.AFFA5E6726@smtp.hushmail.com> Date: Sat, 29 Dec 2012 08:29:11 -0800 X-Google-Sender-Auth: ES9_1Sjd1sNhMyxzoUTKumbwVL4 Message-ID: Subject: Re: ath0: unable to attach hardware From: Adrian Chadd To: husyh@hush.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2012 16:37:04 -0000 Erm.. that's confusing. I've never seen this build problem before. The modules should build fine.. On 29 December 2012 07:29, wrote: > Hi, > > here's my new config: http://nopaste.info/7c11afee7c.html > and here's the complete kernel build output: http://nopaste.info/34db985f= 16.html > The error message is this: > > cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdin= c -I. -I/usr/src/sys/modules/ath/../../dev/ath -I/usr/src/sys/modules/ath/= ../../dev/ath/ath_hal -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/usr/sr= c/sys/PAVILIONNOATH/opt_global.h -I. -I@ -I@/contrib/altq -finline-limit=3D= 8000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 = -fno-common -g -fno-omit-frame-pointer -I/usr/obj/usr/src/sys/PAVILIONNOATH= -mno-sse -mcmodel=3Dkernel -mno-red-zone -mno-mmx -msoft-float -fno-asyn= chronous-unwind-tables -ffreestanding -fstack-protector -std=3Diso9899:1999= -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-protot= ypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -W= no-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-s= how-option -c /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c > In file included from /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c= :55: > @/net/if_var.h:125: error: 'IFNAMSIZ' undeclared here (not in a function) > @/net/if_var.h:151: error: field 'if_data' has incomplete type > cc1: warnings being treated as errors > @/net/if_var.h:157: warning: 'struct sockaddr' declared inside parameter = list > @/net/if_var.h:157: warning: its scope is only this definition or declara= tion, which is probably not what you want > @/net/if_var.h:167: warning: 'struct sockaddr' declared inside parameter = list > @/net/if_var.h:187: error: 'AF_MAX' undeclared here (not in a function) > @/net/if_var.h:718: error: field 'if_data' has incomplete type > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c: In function 'ath_hal= _attach': > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:65: warning: derefere= ncing 'void *' pointer > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:65: error: request fo= r member 'sc_ifp' in something not a structure or union > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:70: warning: derefere= ncing 'void *' pointer > /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:70: error: request fo= r member 'sc_ifp' in something not a structure or union > *** Error code 1 > > What am I supposed to do? > > Thank you very much. :) > >> >>Oh, comment out the if_ath_pci device too. >> >>Sorry, forgot about that. >> >> >> >>adrian >> >> >>On 28 December 2012 03:48, wrote: >>> Hello again, >>> >>> here's the new kernel config: http://nopaste.info/d7929aa100.html >>> and here's the make output: http://nopaste.info/ae7826ba48.html >>> The error messages I get when building are these: >>> >>> cc -c -O2 -frename-registers -pipe -fno-strict-aliasing - >>std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict- >>prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast- >>qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing- >>include-dirs -fdiagnostics-show-option -nostdinc -I. - >>I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL - >>DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common - >>finline-limit=3D8000 --param inline-unit-growth=3D100 --param large- >>function-growth=3D1000 -fno-omit-frame-pointer -mno-sse - >>mcmodel=3Dkernel -mno-red-zone -mno-mmx -msoft-float -fno- >>asynchronous-unwind-tables -ffreestanding -fstack-protector - >>Werror vers.c >>> linking kernel.debug >>> if_ath_pci.o: In function `ath_pci_resume': >>> /usr/src/sys/dev/ath/if_ath_pci.c:231: undefined reference to >>`ath_resume' >>> if_ath_pci.o: In function `ath_pci_suspend': >>> /usr/src/sys/dev/ath/if_ath_pci.c:221: undefined reference to >>`ath_suspend' >>> if_ath_pci.o: In function `ath_pci_shutdown': >>> /usr/src/sys/dev/ath/if_ath_pci.c:212: undefined reference to >>`ath_shutdown' >>> if_ath_pci.o: In function `ath_pci_detach': >>> /usr/src/sys/dev/ath/if_ath_pci.c:193: undefined reference to >>`ath_detach' >>> if_ath_pci.o: In function `ath_pci_attach': >>> /usr/src/sys/dev/ath/if_ath_pci.c:140: undefined reference to >>`ath_intr' >>> /usr/src/sys/dev/ath/if_ath_pci.c:168: undefined reference to >>`ath_attach' >>> if_ath_pci.o: In function `ath_pci_probe': >>> /usr/src/sys/dev/ath/if_ath_pci.c:82: undefined reference to >>`ath_hal_probe' >>> *** Error code 1 >>> >>> I'm sorry for being so unexperienced. What am I doing wrong? >>> >>>> >>>>Hi, >>>> >>>>Just leave all of the ath/ah options in the kernel. >>>> >>>>Then comment out >>>> >>>>device ath >>>>device ath_hal >>>>device ath_rate_sample >>>> >>>>.. but yes, leave all the options in there. >>>> >>>> >>>> >>>>Adrian >>>> >>>> >>>>On 27 December 2012 12:06, wrote: >>>>> Hello, >>>>> >>>>> I hope you had a pleasant trip. Sorry for not replying for a >>>>while. >>>>> >>>>> Anyway, I tried to do what you asked me to. However, it seems >>>>like I misunderstood the handbook and/or your request, as I >>failed >>>>to compile the kernel. >>>>> >>>>> I copied my previous, working kernel config to a new file, and >>>>commented the devices ath, ath_pci, ath_hal and ath_rate_sample, >>>>as well as the options AH_SUPPORT_AR5416, AH_DEBUG and ATH_DEBUG. >>>>I did this because I could not find instructions in the handbook >>>>that explained how to build a module as a kld, and commenting the >>>>modules out was my best guess. Please point me to the relevant >>>>section in the handbook in the case that the information was >>>>actually there and I just was unable to find it. >>>>> The full kernel config can be seen here: >>>>http://nopaste.info/d7475552bd.html >>>>> Finally, I went to /usr/src and entered >>>>> make buildkernel KERNCONF=3DPAVILIONNOATH >>>>> >>>>> This is what I suspect is the relevant output: >>>>> >>>>> cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL - >>DKLD_MODULE >>>>-nostdinc -I. -I/usr/src/sys/modules/ath/../../dev/ath - >>>>I/usr/src/sys/modules/ath/../../dev/ath/ath_hal - >>>>DHAVE_KERNEL_OPTION_HEADERS -include >>>>/usr/obj/usr/src/sys/PAVILIONNOATH/opt_global.h -I. -I@ - >>>>I@/contrib/altq -finline-limit=3D8000 --param inline-unit- >>growth=3D100 >>>>--param large-function-growth=3D1000 -fno-common -g -fno-omit- >>frame- >>>>pointer -I/usr/obj/usr/src/sys/PAVILIONNOATH -mno-sse - >>>>mcmodel=3Dkernel -mno-red-zone -mno-mmx -msoft-float -fno- >>>>asynchronous-unwind-tables -ffreestanding -fstack-protector - >>>>std=3Diso9899:1999 -fstack-protector -Wall -Wredundant-decls - >>>>Wnested-externs -Wstrict-prototypes -Wmissing-prototypes - >>>>Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign - >>>>fformat-extensions -Wmissing-include-dirs -fdiagnostics-show- >>>>option -c /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c >>>>> In file included from >>>>/usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:55: >>>>> @/net/if_var.h:125: error: 'IFNAMSIZ' undeclared here (not in a >>>>function) >>>>> @/net/if_var.h:151: error: field 'if_data' has incomplete type >>>>> cc1: warnings being treated as errors >>>>> @/net/if_var.h:157: warning: 'struct sockaddr' declared inside >>>>parameter list >>>>> @/net/if_var.h:157: warning: its scope is only this definition >>>>or declaration, which is probably not what you want >>>>> @/net/if_var.h:167: warning: 'struct sockaddr' declared inside >>>>parameter list >>>>> @/net/if_var.h:187: error: 'AF_MAX' undeclared here (not in a >>>>function) >>>>> @/net/if_var.h:718: error: field 'if_data' has incomplete type >>>>> /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c: In >>function >>>>'ath_hal_attach': >>>>> /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:65: >>warning: >>>>dereferencing 'void *' pointer >>>>> /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:65: error: >>>>request for member 'sc_ifp' in something not a structure or union >>>>> /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:70: >>warning: >>>>dereferencing 'void *' pointer >>>>> /usr/src/sys/modules/ath/../../dev/ath/ath_hal/ah.c:70: error: >>>>request for member 'sc_ifp' in something not a structure or union >>>>> *** Error code 1 >>>>> >>>>> The full output has been posted to >>>>http://nopaste.info/408e62ac0f.html >>>>> >>>>> I'm willing and hoping to help troubleshoot this issue, but >>>>please keep in mind that I'm new to FreeBSD, so please give >>>>detailed instructions whenever you can. >>>>> >>>>> Thank you very much! >>>>> >>>>>> >>>>>>Hi, >>>>>> >>>>>>Ok. I'm travelling for a little bit; if I don't reply in a few >>>>>>days, >>>>>>please poke me again. >>>>>> >>>>>>It may be that the device is asleep for a bit longer (failing >>>>this >>>>>>test) and has completed resetting at this point. >>>>>> >>>>>>It may be that the power on sequence is not quite right for >>some >>>>>>reason. >>>>>> >>>>>>Would you mind recompiling your kernel and making if_ath a kld, >>>>>>rather >>>>>>than statically in the kernel? >>>>>> >>>>>>Thanks, >>>>>> >>>>>> >>>>>>Adrian >>>>>> >>>>>>> >>>>>>> attached to this e-mail you find the output of dmesg. What I >>>>>>guess the most relevant lines could be is: >>>>>>> >>>>>>> ath0: mem 0xfdee0000-0xfdeeffff irq 16 at >>device >>>>>>4.0 on pci2 >>>>>>> ar5212ChipTest: address test failed addr: 0x00008000 - >>>>>>wr:0x00000000 !=3D rd:0xffffffff >>>>>>> ar5212Attach: hardware self-test failed >>>>>>> ath0: unable to attach hardware; HAL status 14 >>>>>>> device_attach: ath0 attach returned 6 >>>>>>> >>>>>>> I read the registers 4004 and 4010 again to make sure the >>>>values >>>>>>still are the same, which indeed they are. >>>>>>> >>>>>>> I hope this helps. >>>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> On Donnerstag, 13. Dezember 2012 at 10:18 PM, "Adrian Chadd" >>>>>> wrote: >>>>>>>> >>>>>>>>On 13 December 2012 13:11, wrote: >>>>>>>>> Hello everyone, >>>>>>>>> >>>>>>>>> I'm afraid I still don't know what exactly BAR is, or how I >>>>get >>>>>>>>its value that I'm supposed to plug into the line John >>>>provided: >>>>>>>>> dd if=3D/dev/mem bs=3D4 iseek=3D((start of bar + reg offset)/4) >>>>>>>>count=3D1 | hd >>>>>>>>> >>>>>>>>> I assumed that "start of bar" is 0xfdee0000 in my case, >>since >>>>>>>>dmesg reports >>>>>>>>> ath0: mem 0xfdee0000-0xfdeeffff irq 16 at >>>>device >>>>>>>>4.0 on pci2 >>>>>>>> >>>>>>>>Yup. >>>>>>>> >>>>>>>>> This is what I get: >>>>>>>>> # dd if=3D/dev/mem bs=3D4 iseek=3D`echo "ibase=3D16; >>>>(FDEE0000+4004)/4" >>>>>>>>| bc` count=3D1 | hd >>>>>>>>> 00 00 01 00 >>>>>>>>> # dd if=3D/dev/mem bs=3D4 iseek=3D`echo "ibase=3D16; >>>>(FDEE0000+4010)/4" >>>>>>>>| bc` count=3D1 | hd >>>>>>>>> 14 00 01 00 >>>>>>>>> >>>>>>>>> Please correct me if my assumption about "start of bar" was >>>>>>>>wrong and/or I made some other mistake. >>>>>>>>> Also, please don't hesitate to ask me to do anything else >>>>that >>>>>>>>might help you during debugging. >>>>>>>>> >>>>>>>>> Thank you very much for the effort. >>>>>>>> >>>>>>>>Hm. Wait, what's the rest of the ath0: output? >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>Adrian >>>>> >>> >