28 #include <linux/module.h>
29 #include <linux/slab.h>
31 #include <linux/device.h>
69 static struct dentry *root_dir;
71 static void uwb_dbg_rsv_cb(
struct uwb_rsv *
rsv)
85 static int cmd_rsv_establish(
struct uwb_rc *
rc,
115 spin_lock(&(rc->
dbg)->list_lock);
117 spin_unlock(&(rc->
dbg)->list_lock);
122 static int cmd_rsv_terminate(
struct uwb_rc *rc,
128 spin_lock(&(rc->
dbg)->list_lock);
131 if (i == cmd->
index) {
139 spin_unlock(&(rc->
dbg)->list_lock);
163 size_t len, loff_t *off)
177 ret = cmd_rsv_establish(rc, &cmd.rsv_establish);
180 ret = cmd_rsv_terminate(rc, &cmd.rsv_terminate);
183 ret = cmd_ie_add(rc, &cmd.ie_add);
186 ret = cmd_ie_rm(rc, &cmd.ie_rm);
198 return ret < 0 ? ret : len;
203 .write = command_write,
209 static int reservations_print(
struct seq_file *
s,
void *
p)
222 uwb_dev_addr_print(owner,
sizeof(owner), &rsv->
owner->dev_addr);
224 devaddr = rsv->
target.dev->dev_addr;
227 devaddr = rsv->
target.devaddr;
230 uwb_dev_addr_print(target,
sizeof(target), &devaddr);
233 is_owner ?
'O' :
'T',
246 static int reservations_open(
struct inode *
inode,
struct file *file)
252 .open = reservations_open,
259 static int drp_avail_print(
struct seq_file *s,
void *p)
274 static int drp_avail_open(
struct inode *
inode,
struct file *file)
280 .open = drp_avail_open,
292 dev_info(dev,
"debug: channel %d started\n", channel);
294 dev_info(dev,
"debug: channel stopped\n");
297 static void uwb_dbg_new_rsv(
struct uwb_pal *pal,
struct uwb_rsv *rsv)
319 INIT_LIST_HEAD(&rc->
dbg->rsvs);
323 rc->
dbg->pal.rc =
rc;
324 rc->
dbg->pal.channel_changed = uwb_dbg_channel_changed;
325 rc->
dbg->pal.new_rsv = uwb_dbg_new_rsv;
396 if (root_dir && rc->
dbg && rc->
dbg->root_d && pal->
name)