diff options
author | Stefano Panella <stefano.panella@csr.com> | 2008-11-04 09:24:57 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-11-04 10:54:30 -0500 |
commit | 6d5a681dfb583b2f1eefe7cd5505419ca2d4d6c8 (patch) | |
tree | 9fd40c92608017b08521d1a9b503f96ad3fa0550 | |
parent | c5995bd2819dc577d0b32b26be0836d16c977e24 (diff) |
uwb: add commands to add/remove IEs to the debug interface
Add the commands UWB_DBG_CMD_IE_ADD and UWB_DBG_CMD_IE_RM to the debug
interface and make them call uwb_rc_ie_add() and uwb_rc_ie_rm().
Signed-off-by: Stefano Panella <stefano.panella@csr.com>
Signed-off-by: David Vrabel <david.vrabel@csr.com>
-rw-r--r-- | drivers/uwb/uwb-debug.c | 20 | ||||
-rw-r--r-- | include/linux/uwb/debug-cmd.h | 9 |
2 files changed, 28 insertions, 1 deletions
diff --git a/drivers/uwb/uwb-debug.c b/drivers/uwb/uwb-debug.c index 6db641e45313..88e6ac713817 100644 --- a/drivers/uwb/uwb-debug.c +++ b/drivers/uwb/uwb-debug.c | |||
@@ -168,6 +168,18 @@ static int cmd_rsv_terminate(struct uwb_rc *rc, | |||
168 | return 0; | 168 | return 0; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int cmd_ie_add(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_add) | ||
172 | { | ||
173 | return uwb_rc_ie_add(rc, | ||
174 | (const struct uwb_ie_hdr *) ie_to_add->data, | ||
175 | ie_to_add->len); | ||
176 | } | ||
177 | |||
178 | static int cmd_ie_rm(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_rm) | ||
179 | { | ||
180 | return uwb_rc_ie_rm(rc, ie_to_rm->data[0]); | ||
181 | } | ||
182 | |||
171 | static int command_open(struct inode *inode, struct file *file) | 183 | static int command_open(struct inode *inode, struct file *file) |
172 | { | 184 | { |
173 | file->private_data = inode->i_private; | 185 | file->private_data = inode->i_private; |
@@ -195,6 +207,12 @@ static ssize_t command_write(struct file *file, const char __user *buf, | |||
195 | case UWB_DBG_CMD_RSV_TERMINATE: | 207 | case UWB_DBG_CMD_RSV_TERMINATE: |
196 | ret = cmd_rsv_terminate(rc, &cmd.rsv_terminate); | 208 | ret = cmd_rsv_terminate(rc, &cmd.rsv_terminate); |
197 | break; | 209 | break; |
210 | case UWB_DBG_CMD_IE_ADD: | ||
211 | ret = cmd_ie_add(rc, &cmd.ie_add); | ||
212 | break; | ||
213 | case UWB_DBG_CMD_IE_RM: | ||
214 | ret = cmd_ie_rm(rc, &cmd.ie_rm); | ||
215 | break; | ||
198 | default: | 216 | default: |
199 | return -EINVAL; | 217 | return -EINVAL; |
200 | } | 218 | } |
@@ -332,7 +350,7 @@ void uwb_dbg_add_rc(struct uwb_rc *rc) | |||
332 | } | 350 | } |
333 | 351 | ||
334 | /** | 352 | /** |
335 | * uwb_dbg_add_rc - remove a radio controller's debug interface | 353 | * uwb_dbg_del_rc - remove a radio controller's debug interface |
336 | * @rc: the radio controller | 354 | * @rc: the radio controller |
337 | */ | 355 | */ |
338 | void uwb_dbg_del_rc(struct uwb_rc *rc) | 356 | void uwb_dbg_del_rc(struct uwb_rc *rc) |
diff --git a/include/linux/uwb/debug-cmd.h b/include/linux/uwb/debug-cmd.h index 1141f41bab5c..6a16566f0221 100644 --- a/include/linux/uwb/debug-cmd.h +++ b/include/linux/uwb/debug-cmd.h | |||
@@ -32,6 +32,8 @@ | |||
32 | enum uwb_dbg_cmd_type { | 32 | enum uwb_dbg_cmd_type { |
33 | UWB_DBG_CMD_RSV_ESTABLISH = 1, | 33 | UWB_DBG_CMD_RSV_ESTABLISH = 1, |
34 | UWB_DBG_CMD_RSV_TERMINATE = 2, | 34 | UWB_DBG_CMD_RSV_TERMINATE = 2, |
35 | UWB_DBG_CMD_IE_ADD = 3, | ||
36 | UWB_DBG_CMD_IE_RM = 4, | ||
35 | }; | 37 | }; |
36 | 38 | ||
37 | struct uwb_dbg_cmd_rsv_establish { | 39 | struct uwb_dbg_cmd_rsv_establish { |
@@ -46,11 +48,18 @@ struct uwb_dbg_cmd_rsv_terminate { | |||
46 | int index; | 48 | int index; |
47 | }; | 49 | }; |
48 | 50 | ||
51 | struct uwb_dbg_cmd_ie { | ||
52 | __u8 data[128]; | ||
53 | int len; | ||
54 | }; | ||
55 | |||
49 | struct uwb_dbg_cmd { | 56 | struct uwb_dbg_cmd { |
50 | __u32 type; | 57 | __u32 type; |
51 | union { | 58 | union { |
52 | struct uwb_dbg_cmd_rsv_establish rsv_establish; | 59 | struct uwb_dbg_cmd_rsv_establish rsv_establish; |
53 | struct uwb_dbg_cmd_rsv_terminate rsv_terminate; | 60 | struct uwb_dbg_cmd_rsv_terminate rsv_terminate; |
61 | struct uwb_dbg_cmd_ie ie_add; | ||
62 | struct uwb_dbg_cmd_ie ie_rm; | ||
54 | }; | 63 | }; |
55 | }; | 64 | }; |
56 | 65 | ||