aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/bluetooth.h
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-02-17 04:40:55 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-17 06:01:10 -0500
commit20d1803a70ddafc8410b461caaa397e49da246ac (patch)
treed2347c25bb35832d6c931bdb1711c16f3f57d441 /include/net/bluetooth/bluetooth.h
parent3ed7003e724a04482e0ef1e794eece8c1c177b37 (diff)
Bluetooth: Move scope of state_to_string
Function state_to_string will be used in other files in debug statements. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net/bluetooth/bluetooth.h')
-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];