diff options
author | h.sandeep <h.sandeep@samsung.com> | 2016-09-01 12:00:57 +0530 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2016-12-14 13:53:04 +0900 |
commit | 10751017c942a2a25cd36bae1460eb9dafb828f0 (patch) | |
tree | 386bebd8b1887c79ee289d4561dedb06e795949a /net | |
parent | 77f70c9444f1db11f1e67e43225867e6fa2c3f0c (diff) |
Bluetooth: Add MGMT tizen_handlers and TIZEN_OP_BASE_CODE.
Added the basic skeleton code for tizen_mgmt_handlers and
mgmt_tizen.h header file.
Change-Id: I8f3100aa79e6673840ba561f0a9c50238ca0880b
Signed-off-by: h.sandeep <h.sandeep@samsung.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_sock.c | 21 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 13 |
2 files changed, 34 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index e11a5cfda4b1..cee8f5d8725c 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c @@ -31,6 +31,9 @@ #include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_mon.h> #include <net/bluetooth/mgmt.h> +#ifdef TIZEN_BT +#include <net/bluetooth/mgmt_tizen.h> +#endif #include "mgmt_util.h" @@ -1002,6 +1005,21 @@ static int hci_mgmt_cmd(struct hci_mgmt_chan *chan, struct sock *sk, goto done; } +#ifdef TIZEN_BT + if (opcode >= TIZEN_OP_CODE_BASE) { + u16 tizen_opcode_index = opcode - TIZEN_OP_CODE_BASE; + if (tizen_opcode_index >= chan->tizen_handler_count || + chan->tizen_handlers[tizen_opcode_index].func == NULL) { + BT_DBG("Unknown op %u", opcode); + err = mgmt_cmd_status(sk, index, opcode, + MGMT_STATUS_UNKNOWN_COMMAND); + goto done; + } + + handler = &chan->tizen_handlers[tizen_opcode_index]; + + } else { +#endif if (opcode >= chan->handler_count || chan->handlers[opcode].func == NULL) { BT_DBG("Unknown op %u", opcode); @@ -1011,6 +1029,9 @@ static int hci_mgmt_cmd(struct hci_mgmt_chan *chan, struct sock *sk, } handler = &chan->handlers[opcode]; +#ifdef TIZEN_BT + } +#endif if (!hci_sock_test_flag(sk, HCI_SOCK_TRUSTED) && !(handler->flags & HCI_MGMT_UNTRUSTED)) { diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 58d60cbbc33f..4e4e2ba869ea 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -32,6 +32,9 @@ #include <net/bluetooth/hci_sock.h> #include <net/bluetooth/l2cap.h> #include <net/bluetooth/mgmt.h> +#ifdef TIZEN_BT +#include <net/bluetooth/mgmt_tizen.h> +#endif #include "hci_request.h" #include "smp.h" @@ -7238,6 +7241,12 @@ static const struct hci_mgmt_handler mgmt_handlers[] = { { remove_advertising, MGMT_REMOVE_ADVERTISING_SIZE }, }; +#ifdef TIZEN_BT +static const struct hci_mgmt_handler tizen_mgmt_handlers[] = { + { NULL }, /* 0x0000 (no command) */ +}; +#endif + void mgmt_index_added(struct hci_dev *hdev) { struct mgmt_ev_ext_index ev; @@ -8403,6 +8412,10 @@ static struct hci_mgmt_chan chan = { .channel = HCI_CHANNEL_CONTROL, .handler_count = ARRAY_SIZE(mgmt_handlers), .handlers = mgmt_handlers, +#ifdef TIZEN_BT + .tizen_handler_count = ARRAY_SIZE(tizen_mgmt_handlers), + .tizen_handlers = tizen_mgmt_handlers, +#endif .hdev_init = mgmt_init_hdev, }; |