Commit Graph

7808 Commits

Author SHA1 Message Date
Claudio Takahasi
8e77033327 hcid header cleanup 2010-11-29 15:35:35 +02:00
Johan Hedberg
3266ab0556 Remove unused scan_mode variable 2010-11-28 21:14:13 +02:00
Johan Hedberg
9a91d21a65 Use existing bit functions from hci.h 2010-11-28 20:23:43 +02:00
Johan Hedberg
20ccc578c8 Remove unused includes 2010-11-28 13:41:35 +02:00
Johan Hedberg
872da68684 Remove unused define 2010-11-28 13:19:53 +02:00
Johan Hedberg
16348199ed Use address instead of object path in device logs 2010-11-27 18:15:25 +02:00
Johan Hedberg
0e9aac1c77 Improve hciops logging 2010-11-27 17:39:37 +02:00
Johan Hedberg
d013ad3c90 Improve agent PIN length error log 2010-11-27 17:01:03 +02:00
Johan Hedberg
c3ebed5a7d Use hci_send_cmd instead of hci_send_req for authentication
In addition to blocking the mainloop hci_send_req changes the socket
filters which makes it unusable for the per-adapter HCI socket in
hciops.c. Using hci_send_cmd makes much more sense here.
2010-11-27 16:51:37 +02:00
Rafal Michalski
508fdc901e Fix crash after simultaneous authentication requests
Previously simultaneous authentication requests to the same device caused
bluetoothd crash. Now if ongoing authentication occurs error is returned,
preventing from simultaneous requests to the same device.
2010-11-25 22:10:57 +02:00
Claudio Takahasi
c230755062 sdpd header cleanup 2010-11-25 22:02:00 +02:00
Luiz Augusto von Dentz
565ffe72f8 Fix telephony maemo6 driver deinitialization
Remove all match rules and unregister its interface when telephony_exit
is called.
2010-11-25 22:00:06 +02:00
Luiz Augusto von Dentz
ebccbc1806 Fix telephony dummy driver
Make it unregister its interface on telephony_exit
2010-11-25 22:00:02 +02:00
Luiz Augusto von Dentz
b9d85c0010 Fix not deinitializing telephony driver when there is no adapter powered
This changes hook telephony driver de/initialization to powered state so
telephony drivers can now free their resources when there is no adapter
active in the system.
2010-11-25 22:00:00 +02:00
Sheldon Demario
63beb887a6 Extend discover characteristic by UUID in gatttool to fetch all values
If the number of characteristics returned exceeds the MTU size, it will
be needed to ask for more data until the handle range is entirely
searched.
2010-11-25 14:19:41 +02:00
Suraj Sumangala
4e0e44626d hciattach: download configuration at user requested baud rate
This patch support downloading configuration for Atheros AR300x HCI UART
chip at user requested baud rate instead of the initial baud rate.
2010-11-23 12:09:20 +01:00
Suraj Sumangala
429877099f hciattach: make set_speed return error if any operation fails
This patch lets set_speed function changing UART baud rate to return an
error code if any one operation fails instead of returning only the last
operation's status.
2010-11-23 12:08:54 +01:00
Wade Brown
53095459ee Add a runtime option to set the BCSP communication rate 2010-11-23 10:01:58 +01:00
Jose Antonio Santos Cadenas
6b5e3cb05b Fix typo in adapter documentation 2010-11-22 23:06:23 +01:00
Jose Antonio Santos Cadenas
d6523428ac Fix MDL and MCL reference counting in IO watchers
When a io_watcher is added to an MDL or an MCL channel, its reference
should be incremented because the watcher should keep its own reference
the the structure.

Also a destroy function is added in order to decrement the reference
once the watcher is removed.
2010-11-22 18:02:26 +01:00
Santiago Carot-Nemesio
d8e13154ce Do not increment mdl reference in reconnections 2010-11-22 15:34:19 +01:00
Marcel Holtmann
78aca46d99 Release 4.80 2010-11-21 20:12:19 +01:00
Johan Hedberg
29c494df12 Make LE_LINK define private to hcitool.c for now
The value 0x03 isn't something that exists in the core spec, so it
shouldn't be used in the same API as SCO/ACL link types. Since there are
some experimental kernel patches that use it this patch makes it private
to hcitool.c.
2010-11-21 20:01:20 +01:00
Johan Hedberg
9f524fe68a Fix possible race condition when initializing adapters
Due to a possible kernel bug, sometimes the very first HCI commands that
the kernel sends might go unnoticed. Therefore check for this when one
of the last commands (read_local_name) that the kernel sends completes.
2010-11-19 21:02:56 +02:00
Luiz Augusto von Dentz
a26ae500a9 Fix not indicating disconnected state when connecting to avdtp
This cause parts of code such as audio/sink.c to keeps its internal state
as connecting and thus prevent any other connection attempt to succeed.
2010-11-19 18:19:28 +02:00
Luiz Augusto von Dentz
8a139ecb87 Fix not dropping avdtp session reference when cancelling stream setup
This will indicate to the session that there is no need to proceed with
stream configuration and that it should disconnect.
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
18e6c24989 Fix possible crashes when attempting to connect avdtp
Since the connections can be cancelled while still not complete the
GIOChannel must be stored in order to be properly closed when freeing
avdtp session or stream and thus avoid any callbacks to be called after
that.
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
742ab0b9e3 Add debug logs for state changes on sink 2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
0889e245ef Fix reference count of a2dp stream setup
Each callback should have a reference to the setup and once the callback
is removed the setup should be unreferenced which wasn't always the case.
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
6ecff04e0a Fix abort not being send when the state is idle
The spec clearly suggested that abort can be send while on idle state:

"AVDTP_ABORT_CMD can be sent or received in IDLE state. In the event that
an AVDTP_ABORT_CMD is received in IDLE state, ACP or INT shall reply with
an AVDTP_ABORT_RSP, no state change is required."

In fact abort is the only way to cancel set_configuration and open
commands.
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
31cff5b28f Fix not removing all timers when user request to disconnect audio
This timers can trigger reconnections which is not a desirable behavior
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
ee4af90e93 Cleanup a2dp_cancel code
If the id doesn't match any data we should not try to free anything since
obviously there is nothing to free.
2010-11-19 18:19:27 +02:00
Luiz Augusto von Dentz
08b6a53b6f Cleanup a2dp setup code 2010-11-19 18:19:27 +02:00
Johan Hedberg
55685d2037 Fix minor typo 2010-11-19 17:39:15 +02:00
Anderson Lizardo
9fc82ba9c4 Avoid reallocations of services UUID array
The array of service UUIDs used by the DeviceFound signal contains the
same information from the GSList of services. Instead of reallocating
this array on each signal, store it on the remote_dev_info structure and
only reallocate it if there are new UUIDs.
2010-11-19 17:29:44 +02:00
Anderson Lizardo
2c3e727a9f Merge service UUIDs from different BR/EDR EIR data
For LE devices, service UUIDs present in advertising data are merged
into a single list. This change makes the same thing for BR/EDR devices.
2010-11-19 17:28:56 +02:00
Bruna Moreira
f9939cfe36 Extract flags from advertising data
These flags will be used to decide if GATT service discovery will happen
over LE (for single mode devices) or BR/EDR (for dual mode and non-LE
devices).
2010-11-19 17:26:01 +02:00
Sheldon Demario
ad0e7f2c5a Implement Characteristic Value Read using UUID in the gatttool
Sub-procedure used to read a Characteristic Value when the client
only knows the characteristic UUID and doesn't know the handle.
More than one handle and attribute value pair can be returned,
it is up to the user define the handles range based on the service
handles range.

Usage example:
$gatttool --char-read --uuid=2a00 -i hcix -b xx:xx:xx:xx:xx:xx
2010-11-19 17:25:30 +02:00
Suraj Sumangala
0e32ca24d1 hciattach: send hci commands after hci socket bring up
This patch makes The Atheros AR300x specific initialization code
to send power management command over HCI socket after bringing up
the device.
2010-11-19 17:24:17 +02:00
Claudio Takahasi
f9523a9bf5 Implement Discover Primary Service by Service UUID in the gatttool
Implement only the first interaction of the discovery procedure. If the
response doesn't fit in the MTU, "start" and "end" options can be used
to discover the handles ranges of the remaining primary service instances.
UUID16 and UUID128 are supported in the uuid option.

Usage example:
$gatttool -i hcix -b xx:xx:xx:xx:xx:xx --uuid=1801 --primary
2010-11-18 22:00:02 +02:00
Claudio Takahasi
8022b94b05 Add an extra parameter in the discovery primary to specify the UUID
Extends discover primary function to perform discover by UUID. UUID
parameter defines which procedure will be executed: Discover All
Primary Services or Discover Primary Service by Service UUID.
2010-11-18 21:58:22 +02:00
Claudio Takahasi
0f8be9dbaa Extend bt_string2uuid to convert hex strings to UUID16
Convert four or six(0x) digits length hexadecimal strings to UUID16.
2010-11-18 21:56:37 +02:00
Claudio Takahasi
37017e6e98 Implement Find by Type Value Request in the atttribute server
GATT Discover Primary Service by Service UUID sub-procedure is based
on ATT Find By Type Value Request/Response.

Implement an extra verification for broken requests: "Ending Handle"
different than 0xFFFF. The Group End Handle may be greater than the
"Ending Handle" in the Find By Type Value Request. Forces the "Ending
Handle" in the response to 0xFFFF to avoid another request from the
clients. 0xFFFF means that the sub-procedure is complete.
2010-11-18 21:54:43 +02:00
Claudio Takahasi
2b3f200f29 Add Find By Type Value Response encoding/decoding functions
Find by type operation is used by Discover Primary Service by Service
UUID. Find By Type Value Response shall contain one or more group handles.
2010-11-18 21:53:54 +02:00
Keith Mok
f127d461f5 Add iwmmxt optimization for sbc for pxa series cpu
Add iwmmxt optimization for sbc for pxa series cpu.

Benchmarked on ARM PXA platform:
===  Before (4 bands) ====
$ time  ./sbcenc_orig  -s 4     long.au  > /dev/null
real    0m 2.44s
user    0m 2.39s
sys     0m 0.05s
===  After (4 bands) ====
$ time  ./sbcenc  -s 4     long.au  > /dev/null
real    0m 1.59s
user    0m 1.49s
sys     0m 0.10s

===  Before (8 bands) ====
$ time  ./sbcenc_orig   -s 8     long.au  > /dev/null
real    0m 4.05s
user    0m 3.98s
sys     0m 0.07s
===  After (8 bands) ====
$ time  ./sbcenc  -s 8     long.au  > /dev/null
real    0m 1.48s
user    0m 1.41s
sys     0m 0.06s

===  Before (a2dp usage) ====
$ time  ./sbcenc_orig   -b53 -s8 -j    long.au  > /dev/null
real    0m 4.51s
user    0m 4.41s
sys     0m 0.10s
===  After (a2dp usage) ====
$ time  ./sbcenc   -b53 -s8 -j    long.au  > /dev/null
real    0m 2.05s
user    0m 1.99s
sys     0m 0.06s
2010-11-18 18:50:20 +02:00
Johan Hedberg
fe743cc4b1 Fix C++ style comment 2010-11-18 17:03:10 +02:00
Jose Antonio Santos Cadenas
d99c3e454e Check if the mcl insiede the device is correctly set before use it 2010-11-18 16:56:28 +02:00
Santiago Carot-Nemesio
f6322e527e Check if MCAP Instance is already released when a callbacks comes back. 2010-11-18 16:56:28 +02:00
Jose Antonio Santos Cadenas
fb750fb7fd Fixes to echo 2010-11-18 16:56:27 +02:00
Jose Antonio Santos Cadenas
0c17e36816 Remove magic number to check ECHO MDEPs in HDP 2010-11-18 16:56:27 +02:00