Lines Matching defs:rc
61 static int cmd_rsv_establish(struct uwb_rc *rc,
70 target = uwb_dev_get_by_macaddr(rc, &macaddr);
74 rsv = uwb_rsv_create(rc, uwb_dbg_rsv_cb, rc->dbg);
91 spin_lock(&(rc->dbg)->list_lock);
92 list_add_tail(&rsv->pal_node, &rc->dbg->rsvs);
93 spin_unlock(&(rc->dbg)->list_lock);
98 static int cmd_rsv_terminate(struct uwb_rc *rc,
104 spin_lock(&(rc->dbg)->list_lock);
106 list_for_each_entry(rsv, &rc->dbg->rsvs, pal_node) {
115 spin_unlock(&(rc->dbg)->list_lock);
126 static int cmd_ie_add(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_add)
128 return uwb_rc_ie_add(rc,
133 static int cmd_ie_rm(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_rm)
135 return uwb_rc_ie_rm(rc, ie_to_rm->data[0]);
148 struct uwb_rc *rc = file->private_data;
160 ret = cmd_rsv_establish(rc, &cmd.rsv_establish);
163 ret = cmd_rsv_terminate(rc, &cmd.rsv_terminate);
166 ret = cmd_ie_add(rc, &cmd.ie_add);
169 ret = cmd_ie_rm(rc, &cmd.ie_rm);
172 ret = uwb_radio_start(&rc->dbg->pal);
175 uwb_radio_stop(&rc->dbg->pal);
194 struct uwb_rc *rc = s->private;
197 mutex_lock(&rc->rsvs_mutex);
199 list_for_each_entry(rsv, &rc->reservations, rc_node) {
208 is_owner = &rc->uwb_dev == rsv->owner;
224 mutex_unlock(&rc->rsvs_mutex);
244 struct uwb_rc *rc = s->private;
247 bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.global, UWB_NUM_MAS);
249 bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.local, UWB_NUM_MAS);
251 bitmap_scnprintf(buf, sizeof(buf), rc->drp_avail.pending, UWB_NUM_MAS);
272 struct device *dev = &pal->rc->uwb_dev.dev;
294 * @rc: the radio controller
296 void uwb_dbg_add_rc(struct uwb_rc *rc)
298 rc->dbg = kzalloc(sizeof(struct uwb_dbg), GFP_KERNEL);
299 if (rc->dbg == NULL)
302 INIT_LIST_HEAD(&rc->dbg->rsvs);
303 spin_lock_init(&(rc->dbg)->list_lock);
305 uwb_pal_init(&rc->dbg->pal);
306 rc->dbg->pal.rc = rc;
307 rc->dbg->pal.channel_changed = uwb_dbg_channel_changed;
308 rc->dbg->pal.new_rsv = uwb_dbg_new_rsv;
309 uwb_pal_register(&rc->dbg->pal);
312 rc->dbg->root_d = debugfs_create_dir(dev_name(&rc->uwb_dev.dev),
314 rc->dbg->command_f = debugfs_create_file("command", 0200,
315 rc->dbg->root_d, rc,
317 rc->dbg->reservations_f = debugfs_create_file("reservations", 0444,
318 rc->dbg->root_d, rc,
320 rc->dbg->accept_f = debugfs_create_bool("accept", 0644,
321 rc->dbg->root_d,
322 &rc->dbg->accept);
323 rc->dbg->drp_avail_f = debugfs_create_file("drp_avail", 0444,
324 rc->dbg->root_d, rc,
331 * @rc: the radio controller
333 void uwb_dbg_del_rc(struct uwb_rc *rc)
337 if (rc->dbg == NULL)
340 list_for_each_entry_safe(rsv, t, &rc->dbg->rsvs, pal_node) {
344 uwb_pal_unregister(&rc->dbg->pal);
347 debugfs_remove(rc->dbg->drp_avail_f);
348 debugfs_remove(rc->dbg->accept_f);
349 debugfs_remove(rc->dbg->reservations_f);
350 debugfs_remove(rc->dbg->command_f);
351 debugfs_remove(rc->dbg->root_d);
377 struct uwb_rc *rc = pal->rc;
379 if (root_dir && rc->dbg && rc->dbg->root_d && pal->name)
380 return debugfs_create_dir(pal->name, rc->dbg->root_d);