Commit Graph

617 Commits

Author SHA1 Message Date
Santiago Carot-Nemesio
5da4dd8afa gatt-service: Add missing user_data parameter for callbacks 2012-01-09 14:28:29 +02:00
Johan Hedberg
ec60f0ad0d mgmtops: Log confirm_name field in mgmt_device_found 2012-01-02 13:22:59 +02:00
Johan Hedberg
d94854fb14 hciops: Add check for EIR complete name 2011-12-30 15:30:58 +02:00
Johan Hedberg
d08600bbcf hciops: Fix missing eir in btd_event_device_found call 2011-12-30 15:26:31 +02:00
David Herrmann
3b2985bab4 wiimote: Fix device_get_address to use new API
Commit b06899eace introduced a new API for
device_get_address but apparently missed fixing the call in
plugins/wiimote.c. This patch converts the plugin to use the new API.
2011-12-30 13:05:40 +02:00
Santiago Carot-Nemesio
54f49e31d5 attrib-server: Add adapter in attrib_create_sdp function 2011-12-30 13:02:27 +02:00
Santiago Carot-Nemesio
99156a2444 attrib-server: Add adapter in attrib_db_update function 2011-12-30 13:01:05 +02:00
Santiago Carot-Nemesio
7188fe255e gatt-service: Add adapter in gatt_service_add function 2011-12-30 13:00:34 +02:00
Santiago Carot-Nemesio
6a1e46afaf attrib-server: Add adapter in attrib_db_add
Because of there can be many adapters plugged, the GATT servers must
provide the adapter in which the attributes will be registered.
2011-12-30 13:00:00 +02:00
Santiago Carot-Nemesio
bbc34269b0 attrib-server: Add adapter to attrib_db_find_avail function
Adapters manage their own list of handlers so we need to specify the
adapter where the handlers will be registered.
2011-12-30 12:59:09 +02:00
Santiago Carot-Nemesio
caa6034e46 gatt-example: Use adapter driver to register GATT attributes
GATT servers should register their attributes on each adapter when it is
plugged instead of doing that when the plugins is loaded. This patch
registers a new adapter driver to manage plug and unplug events in order
to register attributes in each GATT served managed in each adapter.
2011-12-30 12:57:33 +02:00
Johan Hedberg
ddaf4b475f hciops: Fix integer type for Class of Device 2011-12-28 23:00:46 +02:00
Johan Hedberg
cac78035f1 Remove useless btd_event_bonding_complete function 2011-12-28 16:34:40 +02:00
Johan Hedberg
2a8c76faaf Move name resolving control into hciops
Due to the way legacy name resolving is handled for the mgmt interface
the entire logic that was previously part of the core daemon needs to be
moved into hciops. Essentially hciops now contains what the mgmt code
in the kernel will do when mgmtops is used.
2011-12-28 16:15:31 +02:00
Johan Hedberg
9a1006eebc hciops: Fix passing correct bdaddr pointer to oob lookups 2011-12-28 11:13:13 +02:00
Johan Hedberg
632164a86b Clean up name resolving state handling 2011-12-23 14:20:11 +02:00
Johan Hedberg
b06899eace Fix device address type tracking 2011-12-23 13:00:55 +02:00
Johan Hedberg
26495f6734 Fix size_t format specifiers 2011-12-19 14:35:03 +02:00
Johan Hedberg
4d155a809b mgmtops: Check for exact mgmt_device_found event size 2011-12-19 13:53:07 +02:00
Johan Hedberg
42a03e1c6f mgmtops: Implement mgmt_confirm_name 2011-12-19 13:30:23 +02:00
Johan Hedberg
0c6f4b692c Add initial hooks to pass confirm_name info around 2011-12-19 13:25:54 +02:00
Hemant Gupta
e8c8ec2cac mgmt: Add support for Passkey handling
This patch adds support for handling Passkey Requests and response over
management interface.
2011-12-15 16:20:55 +02:00
Johan Hedberg
f60a1b5fee mgmt: Update implementation to match latest API spec 2011-12-14 14:21:46 +02:00
Johan Hedberg
89ae2d2c0f mgmt: Update read_info & related messages to match the API spec 2011-12-14 14:21:36 +02:00
Santiago Carot-Nemesio
f2fa8743c8 Update gatt-example to check if attributes were registered 2011-12-02 13:29:11 +02:00
Anderson Lizardo
f4d4dd6d41 Migrate example service to high level GATT API
This commit migrates the dummy "Battery Service" from example GATT
plugin to demonstrate how the new API is used.
2011-11-14 21:09:50 +02:00
Johan Hedberg
0573fc7cb1 mgmt: Add address type to mgmt_pair_device
This is important especially in the future when dual-mode devices can be
connected to over LE. It's also important if/when we decide to move the
advertisement cache into user-space.
2011-11-11 00:04:10 +02:00
Johan Hedberg
74b43ba833 mgmt: Add status parameter to disconnect response 2011-11-10 14:17:24 +02:00
Johan Hedberg
86c731b39b mgmtops: Update start_discovery parameters to latest spec 2011-11-10 10:51:03 +02:00
Johan Hedberg
4c63c025a5 mgmt: Update BR/EDR link key message naming to match new API 2011-11-07 20:09:03 +02:00
Johan Hedberg
7ee8ea022d mgmt: Add address type fields to messages that need them 2011-11-07 19:54:04 +02:00
Andre Guedes
d0ae998760 Add discovery cases to mgmt_cmd_complete() 2011-11-04 15:22:17 +02:00
Johan Hedberg
76bfabc7a3 mgmt: Update set_discoverable to match new API 2011-11-03 13:50:35 +02:00
Frédéric Danis
bb957be6a4 Add EIR length parameter to eir_parse()
LE uses shorter EIR (31 bytes) than HCI (240 bytes)
2011-10-21 13:35:01 +03:00
Johan Hedberg
9b98a6c764 Add glib-compat.h to deal with issues in old GLib versions 2011-10-18 10:57:06 +03:00
Johan Hedberg
549087a10b hciops: fix discov_state when powering off an adapter 2011-10-17 18:11:01 +03:00
Luiz Augusto von Dentz
b110c73356 hciops: fix adapter initialization when commands are missed
Sometimes after e.g, suspend we miss some initialization commands from
the kernel, even though we had a workaround for this it doesn't really
work as expected since the adapter must be up in order to resend.

To fix this problem the resend logic is moved after DEVUP.
2011-10-17 12:53:59 +03:00
Claudio Takahasi
0ddc54ca5f Set auto connect from maemo6 plugin
Inform the adapter that the system has been unlocked when the MCE
sends the tklock_mode_ind signal. This signal will trigger the
automatic re-connections for the devices selected by the profiles.
Profiles register ATTIO callbacks to indicate that ATT connection
is required.
2011-10-05 18:01:48 +03:00
Anderson Briglia
cd907d8c84 Add display lock watcher on maemo6 plugin
Implements display status signal watcher in maemo6 plugin.
2011-10-05 18:01:43 +03:00
Luiz Augusto von Dentz
42b90a434a Remove use of read_device_id in wiimote plugin
Make use of btd_device_get_vendor and btd_device_get_product intead.
2011-10-01 09:02:19 +03:00
Antti Julku
f8a44769ff Rename fast_connectable function in hciops
Rename fast_connectable function in hciops to set_fast_connectable
to make it consistent with rest of the file and with mgmt interface
counterpart.
2011-09-26 15:39:39 +03:00
Antti Julku
1dcd74358c Implement fast connectable mode for mgmt interface
Management interface implementation for fast connectable mode.
2011-09-26 15:39:36 +03:00
Vinicius Costa Gomes
6184bc5911 Attrib server integration for outgoing connections
We need support for attaching a client connection to the attribute
server because the server that we are connected may want to do
something similar to a reverse service discovery, and we need to be
able to receive indications and notifications.
2011-09-22 20:25:23 +09:00
Anderson Lizardo
c703241170 Fix characteristic property on GATT example plugin
Any GATT characteristics which have a Client Characteristic
Configuration must have "Notify" property set.
2011-09-22 20:01:40 +09:00
Syam Sidhardhan
472095161e Fix crash when update service record with an invalid XML
If we pass an invalid xml to sdp_xml_parse_record(), then it returns
NULL. Further we are passing the this NULL pointer to the
sdp_record_free(), which leads to invalid memory access.
2011-09-18 18:36:43 +09:00
Claudio Takahasi
11ddc90c92 Serialize powering up/down in maemo6 plugin
This patch fixes wrong adapter state when using Management interface.
When bluetoothd starts, the adapter should be switched to the state
informed by Maemo6 MCE. In the current implementation, Maemo6 plugin
sends set powered command when the adapter is still powering up, the
last command sent fails(kernel returns EALREADY).
2011-09-12 15:17:22 +03:00
Claudio Takahasi
7aeeea795a Fix loop when setting adapter name
When management interface is enabled, name changed event comes when the
adapter is initialized as consequence of the Read Local Name. Use the
same function to set and handle event causes looping when bluetoothd
starts if the name stored in the controller is different from the name
provided by the adapter name plugin.

Splitting the adapter_update_local_name also fix the PropertyChanged
(for Name) signal being sent before AdapterAdded.
2011-09-12 10:59:27 +03:00
Antti Julku
396607837a Add support for blacklisting events
Add support for mgmt interface events for device blocking/unblocking.
Kernel sends a mgmt event when a device has been blocked by another
management socket or with ioctl command (e.g. by hciconfig).

Parameter update_only is added to device_block/unblock functions in
device.c to avoid code copying. When update_only is true, blocking
command is not sent to kernel, but only device status is updated and
dbus signal is sent.
2011-09-01 16:02:10 +03:00
Pavel Raiskup
7af9f8687e formfactor: Add missing comma
Missing comma in static array chassis_map definition between
"Blade" and "Blade Enclosure" field.

Typing error fixed.
2011-08-29 13:45:41 +03:00
Pavel Raiskup
edb505b8c0 Off-by-one(two) error in form factor detection
Indexing of chassis_map array has to be done like that:
    chassis_map[chassis_type * 2 - 1]

because if not, everything is shifted by one. When (e.g.) chassis_type
is 0x04 result should be "Low Profile Desktop" =>  "desktop" (not a
"Pizza Box" => "server"). Lets see the 2.6.1 document on:

http://www.dmtf.org/standards/smbios
2011-08-29 13:44:33 +03:00
Claudio Takahasi
bf857b7a57 Read local extended features at the initialization
Local extended features bitmask may change when Write LE Host Supported
Command is sent by the kernel. This patch adds reading of the local
extended features in the initialization sending a HCI command, extend
the ioctl HCIGETDEVINFO is not suitable due possible inconsistency
between kernel and userspace.
2011-08-22 13:39:10 +03:00
Claudio Takahasi
d7e1f84d30 Remove EnableLE option from the user-space
Deprecated configure option after adding "enable_le" parameter in the
bluetooth module. Write LE Host Supported Command is now sent by the
kernel if "enable_le" is enabled and the controller supports LE.
2011-08-22 13:39:08 +03:00
Szymon Janc
5a0c179b9a Add external dummy plugin for testing 2011-08-14 14:08:29 -07:00
Łukasz Stelmach
0065cf3be9 Fix off-by-one error in form factor detection
The keywords we are looking for are at odd positions.
2011-07-29 13:12:28 +03:00
Luiz Augusto von Dentz
e2482a5ee3 Fix removing inotify watch whenever an adapter is removed
This sometimes cause bluetoothd to burn cpu when an adapter is removed
from the system.

Since the watch is not really bond to any adapter, in fact it is added on
plugin .init, its removal is now moved to plugin .exit.
2011-07-26 12:59:54 +03:00
David Herrmann
1106efd440 Add support for wiimote pairing
The Nintendo Wii Remote requires binary bluetooth addresses as PINs.
This is not possible via dbus agent API. So this adds a plugin that
registers a pin-callback and forces the right pin for every
authentication request of wiimotes.
2011-07-14 17:25:05 +03:00
Marcel Holtmann
3f553a30ad Allow building with GLib 2.16 for now 2011-07-04 11:09:55 +02:00
Luiz Augusto von Dentz
634f0a0436 Make use of g_slist_free_full on hciops plugin 2011-06-30 12:32:29 +03:00
Bastien Nocera
c98f635b44 Add adaptername plugin
Replacing the name setting code in src/adapter.c.

Moving the adapter naming allows us to use the /etc/machine-info [1]
pretty hostname, as implemented by hostnamed [2] in systemd.

If /etc/machine-info is not present, the adapter name stored
on disk in /var/lib/bluetooth will be used. If no adapter name
has been set yet, the default from the main.conf will be used.

We don't currently number the name of hci0 if a pretty name is
available, but we should instead number it if it happens not
to be the default adapter. As we cannot be told when the default
adapter changes, we'll behave this way for now.

Note that when an adapter name is set automatically from
the pretty hostname, changing it through the D-Bus interface
will fail.

[1]: http://0pointer.de/public/systemd-man/machine-info.html
[2]: http://www.freedesktop.org/wiki/Software/systemd/hostnamed
2011-06-28 13:19:20 +03:00
Andre Guedes
4c893ee487 Cleanup: read_local_features callback is no longer used
This patch removes read_local_features callback from struct
btd_adapter_ops and its hciops/mgmtops implementations.
2011-06-17 13:36:38 +03:00
Antti Julku
6c558d3620 Add blacklisting support for management interface
Management interface commands for blocking and unblocking devices.
2011-06-16 21:51:44 +03:00
Waldemar Rymarkiewicz
90ec29300d Add support of secure pin code in mgmt code
Use secure pin code parameter received from the kernel in
MGMT_EV_PIN_CODE_REQUEST event and propagate this to agent
code.

Secure flag is specific for the pin code request only.
2011-06-08 10:04:23 +09:00
Bruna Moreira
f169bea7d5 Drop variable EIR length
The functions eir_parse() and adapter_update_found_devices() now
assume that the EIR buffer has always 240 octets. For advertising
reports, the advertising data is stored on a buffer with 240 bytes,
padded with zeroes.
2011-05-18 16:46:54 -07:00
Bruna Moreira
5b1f949a42 Remove btd_event_advertising_report
Advertises should be notified using btd_event_device_found function
to keep the compatibility with mgmtops plugin.
2011-05-18 16:46:12 -07:00
Frédéric Danis
9480e8c706 mgmt: fix DBG string format 2011-05-17 09:43:06 -07:00
Claudio Takahasi
991a7a4f09 Move EIR related functions to a new file 2011-05-17 09:07:28 -07:00
David Herrmann
2d59b9b4a3 Add length argument to hci pincode reply
This adds a new "length" argument to the hci pincode reply to allow
sending binary pins including \0 characters.
2011-05-15 02:14:17 +03:00
Szymon Janc
5cfe640e88 Remove unused discoverable variable from mgmt_update_powered 2011-05-15 01:47:11 +03:00
Szymon Janc
b671636c82 Remove unused err variable from init_conn_list 2011-05-15 01:47:11 +03:00
Szymon Janc
e37b81fa94 Remove not needed NULL check in link_key_notify
get_connection() always returns valid pointer so conn cannot be NULL.
2011-05-15 01:47:07 +03:00
Andre Guedes
e6c2d1c3fc Remove 'periodic' param from hciops_start_inquiry()
The 'periodic' parameter from hciops_start_inquiry() is useless.
This patch removes it.
2011-05-05 01:10:33 -07:00
Andre Guedes
ef7435b9c1 Remove inquiry and scanning callbacks from btd_adapter_ops
The discovery procedure is implemented in discovery callbacks
(start_discovery and stop_discovery). We don't need inquiry and
scanning specifics callbacks in btd_adapter_ops anymore.
2011-05-05 01:09:43 -07:00
Anderson Briglia
6613e8695b Implement mgmt start and stop discovery
This patch implements mgmt_start_discovery and mgmt_stop_discovery
callbacks for mgmtops.
2011-05-05 01:09:16 -07:00
Andre Guedes
57bd6dd224 Implement stop_discovery hciops callback 2011-05-05 01:09:08 -07:00
Andre Guedes
cae9fbfc03 Remove obsolete code.
adapter_get_discover_type() has become obsolete. This patch removes it and
do the proper adaptation.
2011-05-05 01:09:00 -07:00
Andre Guedes
8be3b42e34 Implement start_discovery hciops callback 2011-05-05 01:08:46 -07:00
Andre Guedes
94e7feb45f Add extfeatures to struct dev_info
The extfeatures field will be used by hciops layer to know if the
adapter is LE capable.
2011-05-05 01:08:31 -07:00
Andre Guedes
ff376acf18 Refactoring adapter_set_state()
This patch implements a new state machine for struct btd_adapter.

The adapter_set_state() function was completely rewritten since its
logic does not apply anymore. The whole logic of interleaved discovery
procedure before implemented in adapter_set_state() should be
implemented at hciops and mgmtops layers.

At the adapter layer, it is not important to track what is the current
state (inquiring or scanning) during the discovery session. All the
adapter layer cares about is if it is performing the discovery or not.
Therefore, the adapter states STATE_STDINQ, STATE_PINQ and
STATE_LE_SCAN were replaced by a new state called STATE_DISCOV.

Additionally, because there is no point in implementing states
as a bitmask, all adapter states were implemented using integers
instead of a bitmask.
2011-05-05 01:07:26 -07:00
Andre Guedes
9235d4b5ae Add 'timeout' param to start_scanning callback
This patch adds a timeout parameter to start_scanning callback in
btd_adapter. The parameter should be used to stop scanning  after
'timeout' milliseconds.
2011-05-05 01:07:14 -07:00
Andre Guedes
17baf8a0d5 Remove Periodic Inquiry support in hciops
Periodic Inquiry is no longer supported in hciops since the discovery
procedure will use Standard Inquiry only.

External tools which request Periodic Inquiry will not change the
adapter's state.
2011-05-05 01:06:03 -07:00
Andre Guedes
2a807a5036 Add 'discov_state' field to struct dev_info
We need to track the current discovering state (HALTED, INQUIRY or SCAN)
of the adapter in hciops layer during the discovery procedure. This will
help us to properly update the state of btd_adapter and emit the property
"Discovering" correctly.
2011-05-05 01:05:13 -07:00
Andre Guedes
4cb11a06dc Add discovery callbacks to btd_adapter_ops
This patch adds start_discovery and stop_discovery callbacks to
struct btd_adapter_ops. These callbacks are responsible for starting
and stoping the discovery procedure. It also creates dummy functions
in hciops and mgmtops which implements those callbacks.
2011-05-05 00:41:48 -07:00
Johan Hedberg
3caf142f55 Add support for store_hint in mgmt_ev_new_key 2011-04-28 23:00:15 +03:00
Johan Hedberg
2ad1015a16 mgmtops: Add support for confirm_hint in mgmt_ev_user_confirm_request
Since we don't yet have a proper Agent.ConfirmPairing D-Bus callback,
and can't add one before 5.x just do an automatic reply for now.
2011-04-28 02:27:01 +03:00
Bruna Moreira
cef8838500 Use HCI_MAX_EIR_LENGTH instead of hard-coded value 2011-04-27 16:25:02 -07:00
Bruna Moreira
cc263203a5 Remove read_local_version() from struct btd_adapter_ops
This callback is used only for getting HCI version/manufacturer
information, and is not being called anywhere in BlueZ anymore.
2011-04-20 19:33:15 +03:00
Bruna Moreira
cdb503df88 Remove ssp_mode from struct hci_dev
ssp_mode is duplicated information and is not being used anywhere.
2011-04-20 19:27:24 +03:00
Johan Hedberg
6f7add5435 mgmt: Add support for discovering event 2011-03-31 14:36:43 +03:00
Johan Hedberg
421efd407e mgmt: Add support for start_discovery & stop_discovery 2011-03-31 14:26:20 +03:00
Anderson Lizardo
d3c57d0f63 Remove hard-coded handles from example GATT plugin
Instead of having static handles, use attrib_db_find_avail() to find
available handle ranges.

Also split the big register_attributes() into one function per service.
2011-03-30 19:37:47 +03:00
Anderson Lizardo
a3e9d397f0 Move GATT example server to a standalone plugin
The GATT example server was in the same plugin as the GATT client.
Moving it to a separate plugin will allow to easily disable it.
2011-03-30 19:19:29 +03:00
Johan Hedberg
56fe067384 mgmt: Add support for remote_name event 2011-03-30 12:25:08 +03:00
Johan Hedberg
cb6dd1222d mgmt: Add support for device_found event 2011-03-30 12:25:08 +03:00
Johan Hedberg
5fda71ad98 Remove unused define 2011-03-28 19:16:42 +03:00
Johan Hedberg
9d5936a515 Clean up Out Of Band D-Bus interface naming 2011-03-28 19:16:19 +03:00
Johan Hedberg
d97cea1477 mgmtops: Pass UUID-128's in little endian format to the kernel
To be consistent with the rest of the management interface the UUIDs
should also be sent in little endian byte order.
2011-03-28 13:59:44 +03:00
Szymon Janc
d812870321 Add D-Bus OOB plugin
A sample OOB plugin that directly exposes OOB functionality over D-Bus.
2011-03-27 22:58:13 +03:00
Szymon Janc
23586efc94 Add support for Out of Band (OOB) association model in hciops 2011-03-27 22:55:28 +03:00
Szymon Janc
ca8ea935e9 Add support for Out of Band (OOB) association model in mgmtops 2011-03-27 22:55:11 +03:00
Szymon Janc
75397433e8 Add initial support for Out of Band (OOB) association model 2011-03-27 22:52:54 +03:00
Rafal Michalski
ab8a3b8361 Fix strict aliasing issue in hciops
This patch changes type of the "pending" variable to uint32_t. A pointer
to this variable is passed to the hci_clear_bit function as void * and
then cast to uint32_t * again.

Previously the unsigned long type could cause some unexpected behavior
due to violating strict aliasing rules. This patch fixes this problem by
making sure that the same integer type is used in all places.

This solution is simpler than the other option of changing the types of
all other places (from uint32_t to unsigned long, including changing
type for casting in hci_*_bit function family). Also, not all places can
be changed, like the hci_dev_info struct, since it would violate
compatibility rules between the kernel and user space.
2011-03-23 15:11:23 +02:00
Johan Hedberg
4f8d6ba353 Fix missing check for dev->up before calling init_adapter
With some kernels and the right timing it is possible to get into the
state where we get the local name but haven't yet gotten a DEVUP event.
In such a case it is *not* ok to call init_adapter.
2011-03-17 14:33:02 +02:00
Johan Hedberg
803db5d475 mgmt: support for local_name_changed event 2011-03-15 20:51:46 +02:00
Johan Hedberg
7abf8c6e4d mgmt: Fix debug log strings 2011-03-15 20:34:08 +02:00
Johan Hedberg
3011a312a7 mgmt: Implement adapter name control
This patch adds a new set_local_name command as well as a
local_name_changed event to the management interface. Instead of 248
bytes (like in the HCI spec) 249 bytes are always reserved for the name
in the messages so that there's a guarantee of it being nul-terminated
(this is not guaranteed on the HCI level).
2011-03-15 19:32:09 +02:00
Johan Hedberg
1c16543345 mgmt: Add adapter name to read_info response 2011-03-15 19:30:11 +02:00
Johan Hedberg
9bae9813ab Remove check for adapter->up for read_local_name_complete
Due to recent kernel changes we could be receiving these command
complete events even though HCIDEVUP hasn't completed yet.
2011-03-04 16:21:52 -03:00
Szymon Janc
3119976f87 Fix hal plugin compilation error 2011-03-04 15:51:49 -03:00
Szymon Janc
da4ffa7209 Move index to common header in management interface
Match changes introduced in mgmt interface after moving controller
index to common header.
2011-02-25 12:53:48 -03:00
Daniel Orstadius
1b80034b89 Maemo6 MCE: skip first adapter_powered callback
The maemo6 MCE plugin should be used with the flag InitiallyPowered
in main.conf set to 'true' so that BlueZ powers on the adapter
and leaves it in that state when the daemon is started. The plugin
will read the radio state from the MCE and set the state
accordingly. The maemo6 plugin is a btd_adapter_driver and those
drivers are loaded after BlueZ has read the BD address etc from the
adapter.

This patch adds a boolean flag in the callback to ignore the initial
powering on of the adapter by BlueZ, since it shouldn't be
propagated to the MCE. With InitiallyPowered set to 'false' the
adapter_powered callback is not called when the adapter is turned
on at BlueZ startup, which is why this wasn't implemented before.
2011-02-24 16:17:38 -03:00
Anderson Lizardo
941eb99732 Fix DBG() calls with bogus messages
Remove unnecessary trailing newlines (already added by DBG()) and
rewrite debug messages to become more useful.
2011-02-24 15:27:17 -03:00
Andre Guedes
e27614655c Fix potential bug in le_advertising_report()
In the current implementation of le_advertising_report(), the variable
'info' has an invalid memory address after the 'for' loop. If 'info'
is dereferenced it will access invalid memory.

This patch fixes this potential bug and improves the code's readability.
2011-02-22 23:59:47 -03:00
Johan Hedberg
62d7730afe Fix bonding_complete indication for mgmt_pair_device complete event
In some (rare) circumstances it is possible for the mgmt_pair_device
command to complete without there being any other indication of
completion of the procedure. Therefore, the bonding_complete event needs
to be notified to the core daemon also in this situation.
2011-02-20 15:18:37 -03:00
Johan Hedberg
a20bb21f47 mgmt: Add support for auth_failed event and bonding_complete hooks
This patch adds support for the mgmt_auth_failed event together with the
related bonding_complete failure hooks to the core daemon.
2011-02-18 21:54:47 +02:00
Johan Hedberg
4d21e85715 Move SSP auto-accept handling completely inside hciops
There's no need to expose the auto-accept case to the core daemon so
move it to hciops. For the management interface this will all be handled
on the kernel side.
2011-02-17 11:31:35 -03:00
Johan Hedberg
50102905d9 mgmt: Add User Confirmation request support 2011-02-16 22:47:25 +02:00
Johan Hedberg
073c798c8f Remove unused scan_enable code
Several functions aren't needed anymore since we don't do a
HCI_Write_Scan_Enable(NO_SCAN) upon adapter power off.
2011-02-15 19:46:02 +02:00
Johan Hedberg
1c93c6fa88 mgmt: Add mgmt_pair_device command
This patch adds a new management command for triggering a dedicated
bonding procedure to a remote device.
2011-02-08 23:15:23 +02:00
Johan Hedberg
71ba00415b Clean up hciops dev_info init code a little bit 2011-02-02 01:21:52 +02:00
Luiz Augusto von Dentz
dc2860e16a Fix stopping inquiry before adapter object is initialized
This can cause errors on command complete since the adapter object could
not be found to set its mode.
2011-02-02 01:07:50 +02:00
Luiz Augusto von Dentz
149f5d0b49 Fix sending HCIDEVUP when adapter is already up
There is no need for HCIDEVUP/fork in such cases it will just consume
more resources for no reason.

To fix this HCI_DEV_REG is no longer generate for adapter already up
instead init_device is called directly which simplify the code path.
2011-02-02 01:06:44 +02:00
Johan Hedberg
596e8ddd21 Remove unneeded adapter_ops->request_authentication callback 2011-01-31 15:10:11 +02:00
Johan Hedberg
1cd99f445e Fix bonding IO channel closing
The kernel seems to have some state tracking issues if we close the
bonding socket before it gets into connected state. This needs to be
investigated on the kernel side but a simple fix is to let the socket be
closed in its BtIO callback instead of through some HCI event (for the
successful case).
2011-01-29 15:18:56 +02:00
Johan Hedberg
629c9dbe7f Add some more debug prints to the bonding procedure 2011-01-29 10:23:15 +02:00
Johan Hedberg
d4a25e44a8 Fix agent cancellation in security mode 3 situations
When there's a connection failure the issue needs to be communicated to
the device bonding logic so that any pending agent request is cancelled.
2011-01-29 09:04:00 +02:00
Johan Hedberg
b18b51e97b Create a separate conn_failed callback to match mgmt interface 2011-01-29 11:33:32 +02:00
Johan Hedberg
32c3d13c1f Clean up connection failure handling 2011-01-29 11:27:18 +02:00
Johan Hedberg
fa41c93fe1 Rename btd_event_bonding_process_complete to btd_event_bonding_complete 2011-01-29 10:56:15 +02:00
Johan Hedberg
5ac0142426 hciops: Use g_slist_prepend instead of g_slist_append for storing keys
Once a key is generated it's likely to be used soon again. Therefore,
store it in the beginning of the list for fast lookup.
2011-01-28 23:57:48 +02:00
Johan Hedberg
c614654d76 hciops: Remove unnecessary conn->key_type
Since we always store the keys in runtime memory there's no need to have
a separate per-connection variable for the key type.
2011-01-28 23:54:52 +02:00
Johan Hedberg
b9efb73d37 Refactor pairing code to match the management interface
This patch refactors the pairing code in hciops and the core daemon to
better match the management interface. Particularly all logic regarding
IO capabilities and authentication requirements are moved into hciops.c.
The patch is quite big because there are a lot of cross-dependencies
which makes it difficult to split the changes up into smaller chunks.

The important adapter_ops preparations for the management interface in
this patch are the create_bonding and cancel_bonding callbacks. Those
will be directly mapped to corresponding management commands.
2011-01-28 23:34:39 +02:00
Pavan Savoy
06ee7ea71b hciops: remove scan disable on poweroff
Remove sending of the scan disable command when the device is being
powered off. This was originally a safe-guard for the non-connectable
GAP test case in case the HCI driver leaves the controller powered after
the DEV_DOWN ioctl, but now-days it can be expected that drivers behave
properly.
2011-01-26 13:33:40 +02:00
Johan Hedberg
9634f5c410 mgmt: Add set_io_capability command 2011-01-25 13:45:24 +02:00
Johan Hedberg
3c8ab480f9 mgmt: Add command complete detection for PIN code handling 2011-01-25 13:43:58 +02:00
Johan Hedberg
8b77225e7b mgmt: Add PIN Code request handling 2011-01-24 11:51:47 +02:00
Johan Hedberg
f871d16282 mgmt: Fix new_key event content validation
This patch adds some stricter checks for the new_key management
interface event.
2011-01-24 11:51:22 +02:00
Luiz Augusto von Dentz
9ac53f53be Fix initialization when adapter is already up
When handling HCI_DEV_REG event it should not be necessary to generate a
HCI_DEV_UP since init_known_adapters already does it in case the adapter
is already up.
2011-01-24 11:38:18 +02:00
Johan Hedberg
1e862b561c mgmt: add support for get_connections command 2011-01-21 13:55:44 +02:00
Johan Hedberg
cc0e50e3ab Fix hciops connection list initialization 2011-01-21 12:44:20 +02:00
Johan Hedberg
76522723bd Use simple bdaddr list for existing connections
There's no need to return more than a list of addresses from adapter_ops
to the core daemon for the existing connections list.
2011-01-21 12:12:38 +02:00
Johan Hedberg
d6fda82e31 mgmt: add support for connect failed event 2011-01-21 10:57:41 +02:00
Johan Hedberg
1d87257dc5 mgmt: add core daemon callbacks for connected events 2011-01-21 10:08:46 +02:00
Johan Hedberg
cc8588d684 Add support for disconnect management command 2011-01-21 10:06:50 +02:00
Johan Hedberg
48908574c4 mgmt: Add support for connected/disconnected events 2011-01-21 07:03:02 +02:00
Johan Hedberg
bda6bb0079 Keep connection handle information inside adapter_ops
There's no point to export connection handle details to the core daemon
since it will not be available in the management interface. Instead
track the handles inside hciops (managment interface will do this inside
the kernel).
2011-01-21 06:56:55 +02:00
Johan Hedberg
b115f34444 mgmt: add initial support for link key handling 2011-01-21 05:28:45 +02:00
Johan Hedberg
1522d65680 Use an unsigned integer for representing the PIN length
The value 0 is not allowed by the HCI spec so it can be used to denote
"not applicable" or "unknown". Also, the management interface will use
an unsigned integer for the PIN length so mirroring that in the core
daemon code makes sense. This patch also takes care of handling
previously stored -1 values and converts them to 0 whenever they are
detected.
2011-01-21 05:02:19 +02:00
Luiz Augusto von Dentz
90e78131e3 Fix use of deprecated glib on hciops plugin 2011-01-19 14:10:05 +02:00
Johan Hedberg
006301ab40 Update Class of Device handling to the latest management interface
This patch updates the class of device handling code to match the latest
management interface. A notable feature is that UUID to service class
mapping policy remains in user space with the help of the svc_hint
parameter of the add_uuid command. This is to make it easy to update the
mapping table when new profiles come along.
2011-01-16 23:09:40 +02:00
Johan Hedberg
bca43a4edb Fix event mask setting for a specific 1.2 adapter
One 1.2 Broadcom adapter doesn't respond to the event mask HCI command
at all unless the second byte of the mask is 0xff. Strictly speaking
this is an invalid value because bits 0x02 and 0x04 are reserved.
However, no other adapters seem to mind and using 0xff instead of 0xf9
makes this particular adapter work properly.
2011-01-11 00:40:27 +02:00
Johan Hedberg
5b1a2a39dc Fix event mask setting for 1.1 controllers
Controllers based on the core spec 1.1 support the event mask HCI
command but need a very stripped down default value for the mask. This
patch makes sure the command gets issued for 1.1 controllers with the
appropriate value.
2011-01-11 00:16:33 +02:00
Johan Hedberg
6d2ce6e859 Remove unnecessary type cast 2011-01-08 00:02:57 +02:00
Johan Hedberg
dbc131f84d mgmt: Fix opcode endianess in commands 2011-01-03 22:57:44 +02:00
Johan Hedberg
a31b2bfb5f mgmt: Add preliminary UUID handling
This patch adds support for the add_uuid and remove_uuid management
commands. The kernel uses them to track the list of UUIDs and
automatically set the service class bits as well as the EIR value
accordingly.
2011-01-03 22:27:21 +02:00
Johan Hedberg
6964bd2dd5 mgmt: Implement set_pairable
This patch implements support for the set_pairable managment command.
Due to the async nature of it a new btd_adapter_pairable_changed
function is added to the core daemon.
2010-12-30 15:06:16 +02:00
Johan Hedberg
3e1b64c81d Refactor handling of UUIDs with respect to adapter_ops
The management interface will have simple add_uuid and remove_uuid
methods so it makes sense to have the adapter_ops interface reflect
that. This patch removes the services_updated callback and replaces it
with add_uuid and remove_uuid callbacks.
2010-12-30 12:20:43 +02:00
Johan Hedberg
6e48f26366 Rename mgmt_update_mode to mgmt_update_powered for clarity 2010-12-30 00:13:48 +02:00
Johan Hedberg
fb88bd2992 mgmt: Use a common structure for powered, discoverable and connectable
The events, commands and responses to these modes are represented by
identical management messages. By having a unified struct for all of
them quite a lot of code can simplified and reused.
2010-12-30 00:13:48 +02:00
Johan Hedberg
d8426949bd mgmt: Clean up scan mode evaluation code 2010-12-30 00:13:47 +02:00
Johan Hedberg
14655825c9 mgmt: Implement set_connectable 2010-12-30 00:13:47 +02:00
Johan Hedberg
528432cc7a mgmt: Implement set_discoverable 2010-12-30 00:13:47 +02:00
Johan Hedberg
07481cab56 mgmt: Implement set_powered 2010-12-30 00:13:47 +02:00
Johan Hedberg
833c7ab1a6 Remove unneeded set_connectable adapter_ops callback 2010-12-29 13:33:29 +02:00
Johan Hedberg
8440ce6ac8 Rename btd_adapter_get_state to btd_adapter_get_mode
There's already an adapter_get_state function so to avoid confusion it's
better to have a different name.
2010-12-28 11:35:35 +02:00
Johan Hedberg
27c58425af Change power_on & power_off adapter_ops callbacks to set_powered
The current idea is to have a single set_powered management command
which for the switching on case would leave the controller in a
non-connectable, non-pairable and non-discoverable state.
2010-12-23 14:38:52 +02:00
Bruna Moreira
051ad18433 Change LE scan interval and window to recommended values
Replace default scan interval and scan window values with recommended
ones for general discovery procedure, according to the Core
specification.
2010-12-23 00:42:25 +02:00
Vinicius Costa Gomes
50fb53c4a7 Add a way to store the remote device type
Because we need to know the device type (LE, Basic Rate or Dual Mode)
to be able to fully restore the device from storage, we have to store
and load this information to permanent storage.

Note: due to "device_type_t" usage in storage.h, some header includes
needed to be reordered in files which include storage.h.
2010-12-22 13:57:33 +02:00
Johan Hedberg
a61d0e8e73 Remove unneeded variables from link_key_request() 2010-12-21 15:01:04 +02:00
Johan Hedberg
3829cf140b Remove unused variables from link_key_request() 2010-12-20 21:16:15 +02:00
Johan Hedberg
dccef4954d Move debug key handling into adapter_ops
There's no need for the core daemon to have special handling for debug
keys anymore as long as it tells adapter_ops if they are enabled or not
(new parameter added to adapter_ops->load_keys).
2010-12-20 19:38:43 +02:00
Johan Hedberg
27a311476a Add initial code for mgmtops adapter power control 2010-12-20 19:15:07 +02:00
Johan Hedberg
700d2ae37c Fix compilation error in read_simple_pairing_mode_complete
This slipped in by mistake when doing the find -> find_by_id change.
2010-12-20 13:45:14 +02:00
Johan Hedberg
f674830aba Use find_adapter_by_id instead of find_adapter when it makes sense
In most cases it's more convenient to use the adapter index when looking
up the adapter object since the index is always available in the
adapter_ops callbacks.
2010-12-20 12:42:08 +02:00
Johan Hedberg
65edd4d539 Get rid of unnecessary manager_stop_adapter function 2010-12-20 12:36:20 +02:00
Johan Hedberg
5a50e2192e Simplify disconnect_addr helper function 2010-12-19 20:31:11 +02:00
Johan Hedberg
6b9921107e Get rid of unneeded btd_adapter_get_conn_handle function 2010-12-19 16:50:27 +02:00
Johan Hedberg
58b68d33c5 Fix handle endianess issues with btd_adapter_read_clock 2010-12-19 16:34:44 +02:00
Johan Hedberg
8e17ca3a78 Remove unnecessary btd_adapter_get_remote_version function 2010-12-19 15:35:07 +02:00
Johan Hedberg
b98312395e Rename btd_event_inquiry_result to btd_event_device_found 2010-12-19 15:16:29 +02:00
Johan Hedberg
53a4fa31e7 Move PIN code storage access to core daemon 2010-12-19 15:04:32 +02:00
Johan Hedberg
49a520fbda Move storage dependencies from hciops to core daemon 2010-12-19 14:40:54 +02:00
Johan Hedberg
4efb97bdae Add manager_foreach_adapter()
Ultimately manager_get_adapters shouldn't be needed at all. By
introducing manager_foreach_adapter most instances can be removed.
2010-12-19 13:25:51 +02:00
Johan Hedberg
b95ef500f7 Implement storing of link keys in runtime memory
The management interface will enable storing link keys in runtime memory
in the kernel. This patch makes the adapter interface match this model
and adds storing of link keys into hciops.
2010-12-19 01:25:24 +02:00
Johan Hedberg
423b80f993 Add missing mgmtops callbacks 2010-12-18 13:55:04 +02:00
Johan Hedberg
63ff6738ab Switch to using power_on & power_off adapter_ops callbacks
These map better to the new management interface.
2010-12-18 13:55:04 +02:00
Johan Hedberg
fdb266b679 Remove hciops device info struct member defines
The struct is growing quite large and having a define for every member
is not really clean.
2010-12-18 13:55:03 +02:00
Johan Hedberg
2db4f654cb Remove unnecessary read_local_ext_features callback 2010-12-18 13:55:03 +02:00
Johan Hedberg
5c1c35eb38 Refactor adapter initialization and power control
This (rather big) patch refactors the way that adapters are initialized
and powered on/off. The purpose is to align the adapter_ops <-> core
daemon interface with how the management interface will behave.
2010-12-18 13:55:03 +02:00
Johan Hedberg
ea30b84b23 Fix overriding global link_policy due to a single adapter
The global link policy should remain unchanged even if an adapter
doesn't happen to support some features. These features should only be
disabled for that specific adapter.
2010-12-16 19:50:41 +02:00
Johan Hedberg
8582b8e4cd Implement support for management powered event 2010-12-16 00:54:34 +02:00
Johan Hedberg
6a63c31255 Rename set_powered callbacks accordingly 2010-12-16 00:53:43 +02:00
Gustavo F. Padovan
e395d1bb9d plugins: use btd_error_failed() 2010-12-14 10:31:15 +02:00
Pawel Wieczorkiewicz
b59dabdd25 Setting default Link Policy according to the chip supported features
By default all features are enabled (RSWITCH, HOLD, PARK, SNIFF).
When "read local supported features" complete event occurs, not supported
features are disabled and then "Write default link policy" command with
supported features is sent.

On behalf of ST-Ericsson SA
2010-12-13 16:26:46 +02:00
Johan Hedberg
914a9093c1 Rename hciops_set_class to write_class
Since hciops_set_class isn't (anymore) part of the exported adapter_ops
callbacks it's better to change it's name to avoid confusion.
2010-12-13 12:30:25 +02:00
Johan Hedberg
00c2267405 Refactor class of device (and related values) handling to adapter_ops
The management interface will move class of device and extended inquiry
response handling to the kernel side so the same functionality needs to
be moved into hciops. These features are quite tightly coupled in
bluetoothd so splitting this into multiple patches would have been hard
(if not impossible). Thus this quite large single commit.
2010-12-13 11:41:20 +02:00
Johan Hedberg
983bc0f8cc Remove unused adapter_ops->read_link_policy function
There is no code to react to the command complete of this HCI command so
there's really no value in issuing it to begin with.
2010-12-12 00:04:18 +02:00
Johan Hedberg
24a34a8b1f Merge read_mode management command into read_info
The read_mode and read_info commands are issued only once in the
beginning for each adapter so it doesn't make sense to have the
information fetching split across two different commands. Instead all
necessary info can be fetched through the read_info command.
2010-12-12 00:04:17 +02:00
Gustavo F. Padovan
3df548164d convert errors to btd_error_does_not_exist() 2010-12-08 22:54:48 +02:00
Gustavo F. Padovan
b7d1fc1f39 Add btd_error_not_authorized() 2010-12-07 23:13:16 +02:00
Gustavo F. Padovan
581171be9b Add btd_error_does_not_exist() 2010-12-07 23:12:32 +02:00
Gustavo F. Padovan
cd5f44488f Add btd_error_not_available() 2010-12-07 23:10:30 +02:00
Gustavo F. Padovan
696c18c48f Create btd_error_invalid_args()
DBus error handling in BlueZ is a mess. This is the first patch to unify
all DBus error handling like in ConnMan and oFono. This unifies all
.InvalidArguments errors.
2010-12-07 22:58:32 +02:00
Sheldon Demario
5f9ebfaa84 Emit Connect signal for LE capable devices 2010-11-29 22:20:57 +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
0e9aac1c77 Improve hciops logging 2010-11-27 17:39:37 +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
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
Johan Hedberg
684b1d3be1 hciops: fix encryption request
hciops_encrypt_link() was not working because it interfered with the
event filters of the hciops internal socket. Instead a separate socket
opened with hci_open_dev() needs to be used.
2010-11-18 08:40:49 +00:00
Bruna Moreira
e430998efb Initial advertising data parsing implementation
Implement adapter_update_adv() function to parse advertising data
received by btd_event_adv() function. Add some fields for advertising
data in remote_device_info struct.
2010-11-15 14:05:54 +00:00
Johan Hedberg
19084de6a6 Clean up adapter_update_local_name API 2010-11-12 23:04:47 +02:00
Johan Hedberg
e47f4351bc Clean up EIR TX power handling 2010-11-12 22:40:18 +02:00
Johan Hedberg
af56f3b6d5 Get rid of event.c wrapper for SSP mode read event 2010-11-12 22:25:50 +02:00
Johan Hedberg
bd7f8939b5 Move local name reading into hciops 2010-11-12 22:15:03 +02:00
Johan Hedberg
7afa48dcf3 Move SSP mode reading into hciops
Since the only thing the code does upon a write_ssp_mode_complete event
is issue a read_ssp_mode command it makes sense to have this internal to
hciops.
2010-11-12 22:01:38 +02:00
Johan Hedberg
be49c2621d Move SSP mode setting into hciops 2010-11-12 21:41:48 +02:00
Johan Hedberg
b8486f046a Move more hciops specific functionality into hciops
Several adapter initialization features will be handled by the new
management interface in the future, so move these from adapter.c into
hciops. This also gets rid of a couple of unnecessary adapter_ops
callbacks.
2010-11-12 18:37:40 +02:00
Johan Hedberg
6429d27b42 Don't cache the local name until it's actually used for something
This saves 248 bytes per adapter until there's actually some code that
might need the cache.
2010-11-12 18:04:36 +02:00
Johan Hedberg
fa472e0c70 hciops: wait for read_local_name complete in adapter init
To avoid clashes with name reads and writes in the core daemon it's
better to wait for the name read command that the kernel sends upon
init.
2010-11-12 17:46:37 +02:00
Johan Hedberg
be3d4f5e4c hciops: fix adapter initialization to wait for kernel HCI commands
The kernel sends several HCI commands when initializing an adapter and
several of them are important for the current adapter_start function. So
far only the local address was waited for, but it also makes sense to
wait for local version and features. This patch adds a bitmask to track
the completed commands and only informs adapter.c about readyness when
all commands have been completed.
2010-11-12 14:45:24 +02:00
Claudio Takahasi
3ef2b1cae6 Fix interleave discovery regression
Command complete event for LE commands are not being handled properly
due blocking calls of LE Set Scan Parameters and LE Set Scan Enable
Commands. Fix wrong Discovering signal emission in the interleaved
discovery mode.
2010-11-11 23:16:39 +02:00
Johan Hedberg
f6732f2da4 Fix initialization of adapters which are already up
Adapters which are already up when bluetoothd starts will already have
their bdaddr's known and bluetoothd should therefore not wait for a
read_bd_addr_complete event before assuming that they're ready for use.
2010-11-10 14:36:38 +02:00
Johan Hedberg
6f59ffc28f mgmtops: implement mgmt_read_local_version 2010-11-08 21:41:47 +02:00
Johan Hedberg
dd41f8f9a4 mgmtops: implement mgmt_read_local_features 2010-11-08 21:10:48 +02:00
Johan Hedberg
8c442fd677 mgmtops: add version information to read_info response 2010-11-08 21:08:41 +02:00
Johan Hedberg
1f5eb60c20 mgmtops: start enabled adapters 2010-11-08 20:16:18 +02:00
Johan Hedberg
69a96577af mgmtops: implement mgmt_read_bdaddr 2010-11-08 20:14:25 +02:00
Johan Hedberg
28c405b17a Fix bdaddr log message to be DBG() instead of info() 2010-11-08 12:07:08 +02:00
Johan Hedberg
e5828c7e30 hciops: fix coding style issues (long lines) 2010-11-08 11:25:15 +02:00
Johan Hedberg
cc758c498e Remove unnecessary parameter from btd_event_request_pin 2010-11-08 11:17:54 +02:00
Johan Hedberg
42bb162ca1 Clean up hciops code
Get rid of unnecessary variables now that the most important info is
tracked in the devs table.
2010-11-08 11:15:08 +02:00
Johan Hedberg
5569445401 hciops: merge io_data and devs tables 2010-11-08 05:10:08 +02:00
Johan Hedberg
5a58cd8ac9 hciops: fix adapter initialization racecondition
We might not have the adapter address when we get HCI_DEV_UP so it's not
safe to cache it and let the core daemon know about the adapter being
ready for use. This patch adds tracking of the read_bd_addr command and
only informs the core daemon about the adapter when the command has been
completed. Additional tracking of the UP/DOWN state is also added since
in theory HCI events can come before DEV_UP (since HCI data and stack
internal events are handled using separate kernel threads).
2010-11-08 04:14:21 +02:00
Johan Hedberg
4291b9c521 Use correct variable type for watch id 2010-11-08 03:25:43 +02:00
Johan Hedberg
93a41b7031 Fix incorrect format type specifier for sizeof() 2010-11-08 02:41:13 +02:00
Johan Hedberg
9a404a4e6b Fix Managment API names to be consistent with the kernel 2010-11-07 19:12:30 +02:00
Johan Hedberg
ff489b4fe3 mgmtops: add parsing of cmd_status and controller_error events 2010-11-07 17:59:09 +02:00
Johan Hedberg
49bedc0b8c mgmtops: add events for controller removal and addition 2010-11-07 16:50:31 +02:00
Daniel Orstadius
f47205ab9b Fix Maemo6 MCE: set state variable directly
If the state variable is not updated until mce_signal_callback and
SetProperty(Powered) is called two times quickly, then the second
call will not generate a request to change the radio state of the
MCE if its corresponding call to adapter_powered occurs before the
first triggering of mce_signal_callback.

With this patch two calls to the MCE are executed, although there
might still be an unnecessary power cycle in that
mce_signal_callback is also triggered twice.
2010-11-04 14:39:43 +00:00
Johan Hedberg
a352058752 Cache adapter address for quick lookup 2010-11-04 04:38:35 +02:00
Johan Hedberg
db5266f0af Remove redundant tracking of ignored adapters
Since hciops already takes care of hiding ignored adapters there's no
need to have special logic for them in adapter.c.
2010-11-04 04:22:18 +02:00
Johan Hedberg
fdd43acc2a Add support for reading controller mode in mgmtops 2010-11-04 02:56:31 +02:00
Johan Hedberg
fe53cb366d Add support for reading controller info to hciops 2010-11-02 00:10:25 +02:00
Johan Hedberg
4d91fb30e0 Keep track of discovered controllers in mgmtops 2010-11-01 23:18:44 +02:00
Johan Hedberg
6275027dcb Store management version info into global variables for easy access
In the future when the mgmtops code needs to behave in different ways
depending on the kernel side management API version it's convenient to
have the exact version/revision number in easily accessible global
variables inside mgmtops.c.
2010-11-01 21:16:44 +02:00
Johan Hedberg
3d3063f323 Remove unnecessary status parameter from mgmt version response 2010-11-01 21:00:49 +02:00
Johan Hedberg
c0882114c2 Add support for getting the controller index list 2010-11-01 20:58:48 +02:00
Johan Hedberg
fb91c88916 Change hci_mgmt_ prefix to simply mgmt_ 2010-11-01 20:23:03 +02:00
Johan Hedberg
1d555f47c4 Add support for parsing management version response 2010-11-01 20:19:17 +02:00