add Magic Mouse driver and manpage btmagic(4)

This commit is contained in:
plunky 2010-05-22 18:56:00 +00:00
parent 3368a77b7c
commit b1c545a2cf
5 changed files with 1481 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1209 2010/05/16 15:33:29 jruoho Exp $
# $NetBSD: mi,v 1.1210 2010/05/22 18:56:00 plunky Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -819,6 +819,7 @@
./usr/share/man/cat4/bthset.0 man-obsolete obsolete
./usr/share/man/cat4/bthub.0 man-sys-catman .cat
./usr/share/man/cat4/btkbd.0 man-sys-catman .cat
./usr/share/man/cat4/btmagic.0 man-sys-catman .cat
./usr/share/man/cat4/btms.0 man-sys-catman .cat
./usr/share/man/cat4/btsco.0 man-sys-catman .cat
./usr/share/man/cat4/btuart.0 man-sys-catman .cat
@ -3479,6 +3480,7 @@
./usr/share/man/html4/bthidev.html man-sys-htmlman html
./usr/share/man/html4/bthub.html man-sys-htmlman html
./usr/share/man/html4/btkbd.html man-sys-htmlman html
./usr/share/man/html4/btmagic.html man-sys-htmlman html
./usr/share/man/html4/btms.html man-sys-htmlman html
./usr/share/man/html4/btsco.html man-sys-htmlman html
./usr/share/man/html4/btuart.html man-sys-htmlman html
@ -5915,6 +5917,7 @@
./usr/share/man/man4/bthset.4 man-obsolete obsolete
./usr/share/man/man4/bthub.4 man-sys-man .man
./usr/share/man/man4/btkbd.4 man-sys-man .man
./usr/share/man/man4/btmagic.4 man-sys-man .man
./usr/share/man/man4/btms.4 man-sys-man .man
./usr/share/man/man4/btsco.4 man-sys-man .man
./usr/share/man/man4/btuart.4 man-sys-man .man

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.516 2010/04/10 17:55:25 jruoho Exp $
# $NetBSD: Makefile,v 1.517 2010/05/22 18:56:01 plunky Exp $
# @(#)Makefile 8.1 (Berkeley) 6/18/93
MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@ -13,7 +13,8 @@ MAN= aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
auixp.4 autri.4 auvia.4 awi.4 azalia.4 \
battery_pmu.4 bba.4 bce.4 bcsp.4 be.4 bge.4 bnx.4 bha.4 \
bio.4 bktr.4 bluetooth.4 bmtphy.4 bpf.4 \
brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 btms.4 btsco.4 btuart.4 \
brgphy.4 bridge.4 bthidev.4 bthub.4 btkbd.4 \
btmagic.4 btms.4 btsco.4 btuart.4 \
bwi.4 \
cac.4 cardbus.4 carp.4 cas.4 ccd.4 cd.4 \
cec.4 cgd.4 cfb.4 ch.4 chipsfb.4 ciphy.4 ciss.4 clcs.4 clct.4 clnp.4 \

113
share/man/man4/btmagic.4 Normal file
View File

@ -0,0 +1,113 @@
.\" $NetBSD: btmagic.4,v 1.1 2010/05/22 18:56:01 plunky Exp $
.\"
.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Iain Hibbert.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 22, 2010
.Dt BTMAGIC 4
.Os
.Sh NAME
.Nm btmagic
.Nd Apple Magic Mouse
.Sh SYNOPSIS
.Cd "btmagic* at bthub?"
.Cd "wsmouse* at btmagic?"
.Sh DESCRIPTION
The
.Nm
driver provides support for the
.Tn Bluetooth
.Dq Magic Mouse
from
.Tn Apple, Inc .
.Pp
The Magic Mouse uses the standard
.Tn USB
Human Interface Device protocol to communicate, but does not provide a
proper HID Descriptor, and requires specific initializations to enable
the proprietary touch reports.
.Pp
The Magic Mouse provides basic mouse functionality with two buttons,
and the
.Nm
driver additionally interprets the touch reports to emulate a middle
mouse button when more than one firm touch is detected during a click
event, plus horizontal and vertical scrolling for touch movements
greater than a certain distance.
The mouse has a base resolution of 1300dpi, which the driver scales
by default to a less sensitive 650dpi, but this is adjustable with
.Xr sysctl 8
along with the pressure needed to discern a firm touch, the minimum
distance necessary to trigger scrolling and the additional downscale
factor applied to scroll movements.
.Pp
The Magic Mouse should be configured with the
.Xr btdevctl 8
program and
.Nm
interfaces to the system as usual through the
.Xr wscons 4
driver.
The following properties are used during autoconfiguration:
.Bl -tag -width ".It remote-bdaddr"
.It vendor-id
Must be 0x05ac.
.It product-id
Must be 0x030d.
.It local-bdaddr
Local device address.
.It remote-bdaddr
Remote device address.
.It link-mode
This optional string represents the link mode of the baseband link, and
may be one of
.Sq auth ,
.Sq encrypt ,
or
.Sq secure .
.El
.Pp
When the
.Nm
driver has configured, it will attempt to open a connection to the mouse
and, if this fails or the connection is lost, will wait for the
mouse to initiate connections.
.Sh SEE ALSO
.Xr bluetooth 4 ,
.Xr bthub 4 ,
.Xr wsmouse 4 ,
.Xr btdevctl 8 ,
.Xr sysctl 8
.Sh HISTORY
The
.Nm
driver was written by
.An Iain Hibbert
with reference to the
.Tn Linux
driver written by
.An Michael Poole .

1355
sys/dev/bluetooth/btmagic.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# $NetBSD: files.bluetooth,v 1.13 2008/06/10 12:49:16 drochner Exp $
# $NetBSD: files.bluetooth,v 1.14 2010/05/22 18:56:01 plunky Exp $
#
# Config file for machine independent Bluetooth devices
@ -27,6 +27,11 @@ device btms: hid, wsmousedev
attach btms at bthidbus
file dev/bluetooth/btms.c btms
# Apple MagicMouse
device btmagic: bluetooth, hid, wsmousedev
attach btmagic at bthub
file dev/bluetooth/btmagic.c btmagic
# SCO Audio
device btsco: bluetooth, audiobus, auconv, mulaw, aurateconv
attach btsco at bthub