Allow configure default link policy in main.conf

Currently BlueZ is hard-coding the default link policy to include
role switch, hold mode, sniff mode and park state. However, some
device will have problem to maintain the connection or setup SCO
if they are in park state. Making these operation modes configurable
in main.conf improves flexibility so any of these four modes can be
disabled if necessary.

Signed-off-by: Bao Liang <tim.bao@motorola.com>
diff --git a/src/main.c b/src/main.c
index ecc90da..5d8661e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -250,6 +250,9 @@
 	main_opts.remember_powered = TRUE;
 	main_opts.reverse_sdp = TRUE;
 	main_opts.name_resolv = TRUE;
+	main_opts.link_mode = HCI_LM_ACCEPT;
+	main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
+						HCI_LP_HOLD | HCI_LP_PARK;
 
 	if (gethostname(main_opts.host_name, sizeof(main_opts.host_name) - 1) < 0)
 		strcpy(main_opts.host_name, "noname");
diff --git a/src/main.conf b/src/main.conf
index 0418e7c..a06aa71 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -64,3 +64,10 @@
 # useful for testing. Attribute server is not enabled over LE if EnableLE
 # is false.
 AttributeServer = false
+
+# The link policy for connections. By default it's set to 0x000f which is 
+# a bitwise OR of role switch(0x0001), hold mode(0x0002), sniff mode(0x0004)
+# and park state(0x0008) are all enabled. However, some devices have
+# connection stability issue or fail to setup SCO when the link is in park
+# state, which requires park state bit cleared.
+DefaultLinkPolicy = 0x000f