Commit Graph

196 Commits

Author SHA1 Message Date
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
Johan Hedberg
908795609b Pass the management message body to event callbacks
For parsing purposes it's more practical to simply pass the message body
instead of the entire packet to the individual callbacks.
2010-11-01 17:21:56 +02:00
Johan Hedberg
14b60d8002 Add basic parsing support for management events 2010-11-01 17:12:45 +02:00
Johan Hedberg
d8a9a0e7c0 Make all unimplemented mgmtops functions fail by default 2010-11-01 16:46:50 +02:00
Johan Hedberg
93d8dc9eed Add debug prints to mgmtops functions 2010-11-01 16:46:50 +02:00
Johan Hedberg
49a10b37b7 mgmtops: add initial setup support
This patch adds initial mgmtops setup support. The code will fail on
kernels without Bluetooth Management support and cause bluetoothd to
fall back to using hciops.
2010-10-27 15:18:26 -04:00
Johan Hedberg
80f5ccd70c Remove remote name requests upon connect complete events
Newer kernel versions will deal with the automated name request for
connection complete events, so remove it from userspace to avoid
unnecessary traffic and potential interop issues.
2010-10-27 12:22:16 -04:00
Johan Hedberg
0c3e080828 Add initial skeleton for mgmtops 2010-10-27 11:21:38 -04:00
Johan Hedberg
d57934d1d0 Minor coding style fix 2010-10-27 11:09:36 -04:00
Johan Hedberg
d300441574 Add support for multiple potential adapter_ops implementations
This patch changes the adapter_ops registration procedure to simply add
the callback struct into a list. The actual adapter_ops implementation
that gets used gets chosen in the adapter_ops_setup function.
2010-10-27 11:07:36 -04:00
Johan Hedberg
f92841301d hciops: don't initialize existing adapters in hciops_setup()
Initializing existing adapters requires calls into adapter.c and a fully
setup adapter_ops so this can only be done after the adapter_ops setup
function (hciops_setup in this case) has returned.
2010-10-27 11:04:18 -04:00
Claudio Takahasi
5ade59881c Move HCI_REQ_TIMEOUT to hciops.c 2010-10-26 19:05:19 -03:00
Johan Hedberg
abe7cd4412 Move ACL encryption functions to hciops 2010-10-26 17:51:41 -04:00
Johan Hedberg
5288199788 Move security.c callbacks into hciops 2010-10-26 16:06:18 -04:00
Johan Hedberg
16d507e0bb Rename dbus-hci.c event.c and use btd_event_ prefix for it 2010-10-26 14:59:49 -04:00
Rafal Michalski
4ebe698e22 Adjust mce_bt_set flag to gboolean type values
This patch makes assignment to mce_bt_set flag more readable and makes
sure that it takes only TRUE or FALSE value from gboolean type.
2010-10-13 17:23:21 +03:00
Johan Hedberg
646f0c7e6b Move remote name and version requests to hciops
Move the remote name and version requests that are done upon a
connection complete event to hciops. Instead of queuing the version
request after the name just delay it for one second (this simplifies the
logic quite a bit).
2010-10-10 22:44:25 +01:00
Johan Hedberg
ef071f94a7 Add struct for hciops per-adapter data
For future extensibility it's better to have a whole struct for each
adapter in hciops.
2010-10-10 18:05:11 +03:00
Johan Hedberg
6844ac4ce5 Create a global HCI socket array in hciops
This patch adds a global HCI array in hciops to avoid hci_open_dev calls
for each hciops callback.
2010-10-06 23:26:56 +02:00
Marcel Holtmann
ecb835fca7 Remove netlink plugin 2010-10-06 10:21:11 +02:00
Claudio Takahasi
9ebc8d3b0f Read local extended features asynchronously 2010-10-04 17:38:23 -03:00
Claudio Takahasi
3af792e57b Rename hciops {start, stop}_discovery to {start, stop}_inquiry
With dual mode adapters, "discovery" expression is being used to
represent both BR/EDR inquiry and LE scanning.
2010-10-04 17:38:22 -03:00