Commit Graph

51 Commits

Author SHA1 Message Date
rmind 56a73a7d30 netbt: rename some attach/detach functions to have _pcb suffix, so
we could use standard attach/detach naming for pr_usrreq functions.
No functional change.
2014-05-20 18:25:54 +00:00
pooka 4f6fb3bf35 Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist before
the sysctl link sets are processed, and remove redundancy.

Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate
lines of code.
2014-02-25 18:30:08 +00:00
christos ae92eb2a24 recognize apple bluetooth adapter in MacBook Air. (Ryo Onodera) 2012-10-06 14:37:41 +00:00
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
christos 5d64ab4de6 PR/46338: Nat Sloss: Prevent ubt synchronization loss from overwriting memory. 2012-04-24 20:04:49 +00:00
plunky 38c4ee0750 no need to device_pmf_is_registered() before unregister 2012-04-05 16:31:53 +00:00
mrg 73104627df pull down from usbmp branch:
- rename usb_detach_{wake,waitup}() to usb_detach_{wake,waitup}old()
- use some c99 struct .initialisers
2012-03-06 03:35:29 +00:00
plunky 4aff709aa0 make sure kernel lock is held when changing isoc configuration
(this is called from sysctl and autoconf)
2012-01-23 08:30:24 +00:00
plunky a1de434dbe don't behave differently when DIAGNOSTIC is defined 2012-01-14 21:37:17 +00:00
jakllsch 71fd84843e Revert previous due to active usbmp branch(es). 2011-12-23 00:51:43 +00:00
jakllsch 7f2b9b9ad4 Adjust-away inconsistent and trailing whitespace. 2011-12-22 20:06:59 +00:00
plunky 2e4ce7a95f use C99 style for variadic macro arguments 2011-03-16 21:35:30 +00:00
dyoung 49337c8880 Stop using the compatibility macros USB_ATTACH(), USB_DETACH(),
USB_MATCH(), et cetera.  These files produce the same assembly
(according to objdump -d) before and after the change
2010-11-03 22:34:23 +00:00
dyoung efc6bfe74a Simplify device-activation hooks. 2009-12-06 21:40:31 +00:00
plunky 5fab894c54 fix up USB drivers printing of autoconf information
1. expand the USB_ATTACH_SETUP macro (requested by jmcneill)

2. reorder the attach function so that the first thing it does is print
   newlines.

3. after this, we can call usbd_devinfo_alloc(), which polls the device
   allowing a context switch, and aprint_normal() the device information.

this avoids problems where autoconf messages are getting mixed up.
2009-09-23 19:07:19 +00:00
plunky ca9e57b2e6 (perhaps) fix a long standing issue that I came across recently. If
you repeatedly enable/disable a ubt device it sometimes hangs in
the bluetooth initialisation where the device responses never arrive,
but if you interrupt and try again it works fine.

additionally aborting the default pipe on shutdown seems to fix that
2009-08-30 18:35:53 +00:00
drochner 3126a6b09b Don't pmf_device_deregister() if it was not registered, which happens
if attach() encountered an error before.
In contrast, such a protection should not be needed for the register()
call, so remove it there.
2008-07-28 14:19:26 +00:00
plunky 86cf58d587 remove comment that is no longer true 2008-07-26 20:16:10 +00:00
tonnerre 232e862b92 Don't ignore poor retarded ubt(4) devices which have vendor and product id
== 0. Discovered by mballmer@obsd, ok'd by plucky@.
2008-07-16 08:43:01 +00:00
cube 3624455eba Split device_t and softc for all USB device drivers, and related cosmetic
changes.

Matthias Drochner kindly reviewed this patch, and tested ums, ubt, uaudio
and ral.  I tested umass myself.
2008-05-24 16:40:58 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos f54e064ee9 add null pmf handlers. 2007-12-16 19:01:35 +00:00
plunky 736a9db087 Clean up the way that bluetooth drivers attach to the bluetooth stack,
to remove the frobbing that drivers must do in the hci_unit structure.

- driver provides a static const interface descriptor
- hci_unit is allocated by hci_attach() rather than part of softc
- statistics are compiled by driver and provided on request
- driver provides output methods and is responsible for output queue
- stack provides input methods and is responsible for input queue
- mutex is used to arbitrate device queue access
2007-11-28 20:16:11 +00:00
plunky 7cca9485cc convert device printf() usages to aprint_xxxx() 2007-11-11 12:59:02 +00:00
plunky 0b799668fb use more device_t and device_xxx() accessors
make bluetooth stack keep device_t instead of softc pointer as
device is not necessarily part of softc, and pass device_t to
driver callbacks. hci_devname is no longer required.
2007-11-10 23:12:22 +00:00
plunky 2e43d32311 fix typo : -> ; 2007-10-02 05:53:47 +00:00
plunky 0327efae31 clean up activate function 2007-10-02 05:38:06 +00:00
drochner 8258b792b7 Introduce different autoconf interface attributes for USB drivers
matching (and handling) a whole device and those which match an
interface only. This will allow to enforce some rules, eg that
the former don't use interface information for matching or that the
latter don't modify global device state.
The previous way left too much freedom do the drivers which led to
inconsistencies and abuse.
For now, I've not changed locators and submatch rules, this will
happen later.
There should not be any change in behaviour, except in the case of
some drivers which did behave inconsistently:
if_atu, if_axe, uep: matched the configured device in the interface
 stage, but did configuration again. I've converted them to match
 in the device stage.
ustir, utoppy: matched in the interface stage, but only against
 vendor/device information, and used any configuration/interface
 without checking. Changed to match in device stage, and added
 some simple code to configure and use the first interface.
If you have one of those devices, please test!
2007-03-13 13:51:53 +00:00
plunky 0319d7247c match against the whole device, since we take more than one interface. 2007-03-12 20:32:00 +00:00
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
drochner c7a98882c8 don't specify the interrupt pipe polling interval explicitely; just rely
on the endpoint descriptor
approved by plunky
2006-12-01 20:41:23 +00:00
christos 168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
plunky 4b7ccf17f9 explicitly disallow changing the config # when the device is enabled. 2006-09-19 20:34:33 +00:00
plunky 661865e783 return errno instead of usbd status 2006-09-19 19:45:48 +00:00
plunky 999bb1e465 It seems that EHCI at least will complete a empty transfer with
status == NORMAL_COMPLETION.

Guard against that.
2006-08-30 19:42:37 +00:00
plunky 95d2b886d7 The ubtbcmfw(4) driver fails to compile, as noted by PR kern/34219.
While it can be made to compile, the paradigm is not quite right because
it attempts to contact the filesystem during autoconfig which sometimes
causes a panic. Even if that was fixed, there is another potential problem
in that the driver tries/sleeps/tries/sleeps and the sleep could
theoretically sleep past the rc.d/btconfig stage and the controller
would remain unconfigured.

So, I have prepared a different method for loading the firmware to
Broadcom BCM2033 chip based devices. A package 'sysutils/bcmfw' will load
the firmware files via a ugen(4) device interface.

This update removes the ubtbcmfw(4) driver and adds a table to the ubt(4)
driver so that it will not attach to Broadcom BCM2033 based devices before
the firmware was loaded.

This fixes kern/34219
2006-08-19 16:35:02 +00:00
gdamore a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
augustss 834327c847 Don't keep the devinfo string on the stack, instead use malloc/free.
This should cure some rare stack overflows.
2005-05-11 10:02:28 +00:00
itojun 300aa0dcd5 use bounded string ops (snprintf, strl*) 2004-04-23 17:25:25 +00:00
dsainty 232d108953 Kill the flow control interface. Bluetooth devices are not equipped to deal
with flow control being applied.  It is simpler and no more problematic to
accept the data and drop it if we hit a resource limit than to expect the
Bluetooth device to do anything about it (which it won't).
2004-01-04 05:47:43 +00:00
dsainty d3a5c746ab Correct a conditional masking error conditions 2004-01-02 02:36:25 +00:00
dsainty 275cfd33b4 Correctly initialise ALL of the attach argument block. Fixes panic on
device open (previously avoided by compiler-dependent luck :)
2004-01-01 16:10:13 +00:00
augustss 5ad4518358 Lower debug level so the match routine isn't so verbose. 2003-01-20 21:14:57 +00:00
dsainty e648b82855 Changed the interface for passing output data between the bthci driver
and the back end Bluetooth device driver.  The device driver now
allocates a suitable buffer on behalf of the bthci driver, and bthci
fills the buffer before despatch.

This saves an ugly temporary allocation (in bthci) and memory copy (in
the USB driver) per write, and also works better with the
sockets-based interface I'm experimenting with.
2003-01-11 06:12:09 +00:00
dsainty 97f7cada0b Make the ubt driver functional. This is an experimental, incomplete, but
actually functional driver.  It provides a local HCI interface to the
HCI-over-USB interface on standards-compliant Bluetooth USB devices.

Currently this device can be attached to the bthci driver for direct user-land
access to the device.
2003-01-05 05:20:20 +00:00
dsainty 6957647e8b Move #define UBT_DEBUG from ubt.c to usb_port.h 2003-01-05 03:48:18 +00:00
augustss ffc3083503 Attach Bluetooth host controller driver (which has not been written) to
ubt device.
2002-08-24 17:31:19 +00:00
augustss 974cba9514 Print a message saying that this is not real driver. 2002-08-22 10:17:46 +00:00