summaryrefslogtreecommitdiff
path: root/sys/dev/bluetooth
AgeCommit message (Collapse)Author
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2020-06-11Update for proplib(3) API changes.thorpej
2020-06-08Update for proplib(3) API changes.thorpej
2020-03-14fix memory leaksmaxv
2019-11-16Don't wait in interrupt context.mlelstv
2019-06-08Clean get_props().isaki
- Make get_props() return AUDIO_PROP_{PLAYBACK,CAPTURE} properly. This eliminates need for audio.c to take care of such (old) drivers which don't return both of PLAYBACK and CAPTURE. - All get_props() doesn't need to return AUDIO_PROP_MMAP. It is handled in the audio layer now.
2019-05-25Make it compilable even with debug option.isaki
2019-05-08Merge isaki-audio2 branch, the overhaul of audio subsystem.isaki
- Interrupt-oriented system rather than thread-oriented. - Improve stability, quality and performance. - Split playback and record cleanly. Improve halfduplex support. - Many bugs are fixed including deadlocks, resource leaks, abuses, etc. - Simplify audio filter mechanism. The encoding/channels/frequency conversions are completely handled in the upper layer. So the hard- ware driver only converts its hardware encoding (if necessary). - audio_hw_if changes: - Obsoletes query_encoding and add query_format instead. - Obsoletes set_params and add set_format instead. - Remove drain, setfd, mappage. - The call sequences are changed. - ioctl AUDIO_GETFD/SETFD, AUDIO_GETCHAN/SETCHAN are obsoleted. - ioctl AUDIO_{QUERY,GET,SET}FORMAT are introduced. - cleanup config attributes: au*conv and mulaw. - All hardware drivers should follow it (I've done as much as possible). Some file paths are changed: - dev/audio.c -> dev/audio/audio.c (rewritten) - dev/audiovar.h -> dev/audio/audiovar.h - dev/audio_dai.h -> dev/audio/audio_dai.h - dev/audio_if.h -> dev/audio/audio_if.h - dev/audiobell.c -> dev/audio/audiobell.c - dev/audiobellvar.h -> dev/audio/audiobellvar.h - dev/mulaw.[ch] -> dev/audio/mulaw.[ch] + dev/audio/alaw.c
2019-03-16Use C99 style struct initializer to audio_hw_if.isaki
2019-02-03- add or adjust /* FALLTHROUGH */ where appropriatemrg
- add __unreachable() after functions that can return but won't in this case, and thus can't be marked __dead easily
2019-01-24Add comments about D_MPSAFE to functions called as struct linesw.l_ioctl.knakahara
2018-11-15Correctly handle signed/unsigned quantities in kernel HID parser.jakllsch
Should fix PR kern/53605.
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)
2017-12-10Factor out bus-independant HID code so that it can be shared by USB, bluetoothbouyer
and i2c. dev/usb/ukbdmap.c is renamed to dev/hid/hidkbdmap.c dev/usb/hid.[ch] moved to dev/hid/ usage pages moved from dev/usb/usbhid.h moved to dev/hid/hid.h, and updated with OpenBSD entries. bus-independant code moved from dev/usb/ums.c to dev/hid/hidms.c (the same should be done for keyboard and touchpad drivers) Needed for the upcoming HID over I2C support, proposed on tech-kern@ on Dec, 1.
2017-09-03Remove references to BlueCore.nat
Enable XON/XOFF flowcontrol in SLIP layer depending on config response. Send an acknowlegment packet on timeout/retry. Compute tx{ack,seq} and rx{ack,seq} according to the specification.
2017-08-14Apply the sequence number mask to txack.nat
2017-08-14Conform to the spec. with regards to acknowlegment packets. This preventsnat
the host controller from freezing. Inmprove communication from inactive to active state.
2017-08-11Ensure the XMIT flag is cleared before calling bth5_start.nat
This avoids a panic due to a diagnostic assertion.
2017-08-10Add support for btuart h5 3-wire protocol.nat
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
2017-05-28bt_lock is now used as the audio interrupt lock. This is more appropriatenat
as the interrupt lock deals with the hardware. btsco audio works again with the new audio changes.
2016-08-15Curious typo, found by mootjamaxv
2016-07-07KNF. Remove extra spaces. No functional change.msaitoh
2015-12-13STRENGHT -> STRENGTH and misc spelling/whitespace. no functional changeplunky
2015-09-06More on PR 41200: headers that declare ioctls should include sys/ioccom.h.dholland
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-08-20include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.christos
2015-07-10Wrap up calls to softint_schedule in kpeempt_[dis/en]able.nat
Addresses PR kern/48459. This commit was approved by christos@
2015-07-03Add basic support for tap detection, emulating a left-click.bouyer
2015-05-09use standard idiom - thanks riastradh@dholland
2015-05-09Coverity CID 975184: don't ignore pmf_device_register failure.dholland
(XXX: unfortunately all we can do for the moment is print a warning)
2015-05-08goto out for negative lengths too. Really this test should either be removedchristos
or turned into a KASSERT(). From max.
2015-04-30Fix more memory leaks by changing the transmit routines to always free thechristos
mbuf to send.
2015-04-27free mbuf on failure (Brainy)christos
2015-04-16CID 1293640/1 memory corruption/overrunchristos
2015-04-06Add support for Apple Magic Trackpad.bouyer
3 button emulation by detecting in which area of the bottom of the device the trackpad's button is pressed. Pointer move support with 1 finger touch, X/Y scroll with 2-finger touch. TODO: - detect tap to emulate button press and drag/n/drop. - Detect and support zoom, if wsmouse allows to report this
2014-12-13Added quirk for ELECOM M-XG2BB.nonaka
2014-11-16Replace callout_stop with callout_haltozaki-r
In order to call callout_destroy for a callout safely, we have to ensure the function of the callout is not running and pending. To do so, we should use callout_halt, not callout_stop. Discussed with martin@ and riastradh@.
2014-08-05split PRU_SEND function out of pr_generic() usrreq switches and put intortr
separate functions xxx_send(struct socket *, struct mbuf *, struct mbuf *, struct mbuf *, struct lwp *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_SEND with calls to pr_send() rename existing functions that operate on PCB for consistency (and to free up their names for xxx_send() PRUs - l2cap_send() -> l2cap_send_pcb() - sco_send() -> sco_send_pcb() - rfcomm_send() -> rfcomm_send_pcb() patch reviewed by rmind
2014-07-31split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out ofrtr
pr_generic() usrreq switches and put into separate functions xxx_disconnect(struct socket *) xxx_shutdown(struct socket *) xxx_abort(struct socket *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_{DISCONNECT,SHUTDOWN,ABORT} with calls to pr_{disconnect,shutdown,abort}() respectively rename existing internal functions used to implement above functionality to permit use of the names for xxx_{disconnect,shutdown,abort}(). - {l2cap,sco,rfcomm}_disconnect() -> {l2cap,sco,rfcomm}_disconnect_pcb() - {unp,rip,tcp}_disconnect() -> {unp,rip,tcp}_disconnect1() - unp_shutdown() -> unp_shutdown1() patch reviewed by rmind
2014-07-30split PRU_CONNECT function out of pr_generic() usrreq switches and putrtr
into seaparate functions xxx_listen(struct socket *, struct mbuf *) - always KASSERT(solocked(so)) and KASSERT(nam != NULL) - replace calls to pr_generic() with req = PRU_CONNECT with pr_connect() - rename existin {l2cap,sco,rfcomm}_connect() to {l2cap,sco,rfcomm}_connect_pcb() respectively to permit naming consistency with other protocols functions. - drop struct lwp * parameter from unp_connect() and at_pcbconnect() and use curlwp instead where appropriate. patch reviewed by rmind
2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland
All have been set to "nodiscard"; some should get a real implementation.
2014-07-24split PRU_BIND and PRU_LISTEN function out of pr_generic() usrreqrtr
switches and put into separate functions xxx_bind(struct socket *, struct mbuf *) xxx_listen(struct socket *) - always KASSERT(solocked(so)) even if not implemented - replace calls to pr_generic() with req = PRU_BIND with call to pr_bind() - replace calls to pr_generic() with req = PRU_LISTEN with call to pr_listen() - drop struct lwp * parameter from at_pcbsetaddr(), in_pcbbind() and unp_bind() and always use curlwp. rename existing functions that operate on PCB for consistency (and to free up their names for xxx_{bind,listen}() PRUs - l2cap_{bind,listen}() -> l2cap_{bind,listen}_pcb() - sco_{bind,listen}() -> sco_{bind,listen}_pcb() - rfcomm_{bind,listen}() -> rfcomm_{bind,listen}_pcb() patch reviewed by rmind welcome to netbsd 6.99.48
2014-05-20netbt: rename some attach/detach functions to have _pcb suffix, sormind
we could use standard attach/detach naming for pr_usrreq functions. No functional change.
2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland
designated initializers. I have not built every extant kernel so I have probably broken at least one build; however I've also found and fixed some wrong cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-02-25Ensure that the top level sysctl nodes (kern, vfs, net, ...) exist beforepooka
the sysctl link sets are processed, and remove redundancy. Shaves >13kB off of an amd64 GENERIC, not to mention >1k duplicate lines of code.
2013-10-17add __USE for debugging variableschristos
2013-09-12#ifdef the "npress" variable, so it is only defined (and initialized) whenmartin
it is also used.
2012-12-20increase some diagnosticsplunky
2012-12-20when no link-mode is specified, explicitly set a mode of (int)0plunky
otherwise l2cap_setmode() will fail during connection setup for bthidev.c, this fixes a problem with Microsoft Wedge Touch mouse (which may not be able to authenticate) for btmagic.c, include this fix in case somebody tries that related to PR/47286