From owner-freebsd-bluetooth@freebsd.org Thu Mar 5 09:33:11 2020 Return-Path: Delivered-To: freebsd-bluetooth@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71B79263C48 for ; Thu, 5 Mar 2020 09:33:11 +0000 (UTC) (envelope-from jason-fbsd-bluetooth@shalott.net) Received: from waffle.shalott.net (waffle.shalott.net [209.151.236.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.shalott.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48Y5C86QbGz4Tp4 for ; Thu, 5 Mar 2020 09:33:08 +0000 (UTC) (envelope-from jason-fbsd-bluetooth@shalott.net) Received: (qmail 13894 invoked by uid 2034); 5 Mar 2020 09:33:01 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 5 Mar 2020 09:33:01 -0000 Date: Thu, 5 Mar 2020 01:33:01 -0800 (PST) From: jason-fbsd-bluetooth@shalott.net X-X-Sender: jason@waffle.shalott.net To: freebsd-bluetooth@freebsd.org Subject: Re: ath3k USB bluetooth card not detected by ng_ubt, possible regression In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LRH 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 48Y5C86QbGz4Tp4 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jason-fbsd-bluetooth@shalott.net designates 209.151.236.43 as permitted sender) smtp.mailfrom=jason-fbsd-bluetooth@shalott.net X-Spamd-Result: default: False [-0.79 / 15.00]; ARC_NA(0.00)[]; IP_SCORE(-0.01)[country: US(-0.05)]; R_SPF_ALLOW(-0.20)[+mx:shalott.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[shalott.net]; NEURAL_SPAM_MEDIUM(0.52)[0.521,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; FROM_NO_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:11051, ipnet:209.151.224.0/19, country:US]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-bluetooth@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Using Bluetooth in FreeBSD environments List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2020 09:33:11 -0000 > Hello. I am trying to get an ath3k-based USB bluetooth adapter working. > I previously had this adapter working under FreeBSD, several years ago > (FreeBSD-8 or FreeBSD-9 timeframe); but it doesn't seem to work now on > my current FreeBSD-12 box. After loading the firmware, it is not > detected by ng_ubt. > > The card is an ASUS USB-BT211, and shows up as vendor 0x0cf3 product > 0x3000. > The switch from 0x3000 to 0x3002 seems to indicate that the card is, in > fact, loading the firmware correctly. I tracked this down: https://svnweb.freebsd.org/base?view=revision&revision=249178 Looks like this device (and many others) were blacklisted from the driver. Reverting this commit and rebuilding ng_ubt.ko fixes my problem: ubtath3kfw0 on uhub5 ubtath3kfw0: on usbus1 ugen1.4: at usbus1 (disconnected) ubtath3kfw0: at uhub5, port 2, addr 4 (disconnected) ubtath3kfw0: detached ugen1.4: at usbus1 ubt0 on uhub5 ubt0: on usbus1 # hccontrol -n ubt0hci inquiry Inquiry result, num_responses=1 Inquiry result #0 BD_ADDR: 75:10:27:18:59:c5 [...] Can someone explain why these devices were blacklisted from the ng_ubt driver? It seems like the devices will fail to work if the firmware is not loaded to the device before ng_ubt is loaded into the kernel; but it seems like the failure mode is just that those devices don't work in that case. So blacklisting them from the driver seems a lot worse... Couldn't the driver do something like just log a warning that if the device isn't working, unload ng_ubt, ensure that any required firmware is pushed, and then reload it? Or something else more clever? Thanks. -Jason