aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/bluetooth.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 9f5f2c1c5554..5ca9219fe940 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -131,6 +131,33 @@ enum {
131 BT_CLOSED 131 BT_CLOSED
132}; 132};
133 133
134/* If unused will be removed by compiler */
135static inline const char *state_to_string(int state)
136{
137 switch (state) {
138 case BT_CONNECTED:
139 return "BT_CONNECTED";
140 case BT_OPEN:
141 return "BT_OPEN";
142 case BT_BOUND:
143 return "BT_BOUND";
144 case BT_LISTEN:
145 return "BT_LISTEN";
146 case BT_CONNECT:
147 return "BT_CONNECT";
148 case BT_CONNECT2:
149 return "BT_CONNECT2";
150 case BT_CONFIG:
151 return "BT_CONFIG";
152 case BT_DISCONN:
153 return "BT_DISCONN";
154 case BT_CLOSED:
155 return "BT_CLOSED";
156 }
157
158 return "invalid state";
159}
160
134/* BD Address */ 161/* BD Address */
135typedef struct { 162typedef struct {
136 __u8 b[6]; 163 __u8 b[6];