Lines Matching refs:rc

85 static int cmd_rsv_establish(struct uwb_rc *rc,  in cmd_rsv_establish()  argument
94 target = uwb_dev_get_by_macaddr(rc, &macaddr); in cmd_rsv_establish()
98 rsv = uwb_rsv_create(rc, uwb_dbg_rsv_cb, rc->dbg); in cmd_rsv_establish()
115 spin_lock(&(rc->dbg)->list_lock); in cmd_rsv_establish()
116 list_add_tail(&rsv->pal_node, &rc->dbg->rsvs); in cmd_rsv_establish()
117 spin_unlock(&(rc->dbg)->list_lock); in cmd_rsv_establish()
122 static int cmd_rsv_terminate(struct uwb_rc *rc, in cmd_rsv_terminate() argument
128 spin_lock(&(rc->dbg)->list_lock); in cmd_rsv_terminate()
130 list_for_each_entry(rsv, &rc->dbg->rsvs, pal_node) { in cmd_rsv_terminate()
139 spin_unlock(&(rc->dbg)->list_lock); in cmd_rsv_terminate()
150 static int cmd_ie_add(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_add) in cmd_ie_add() argument
152 return uwb_rc_ie_add(rc, in cmd_ie_add()
157 static int cmd_ie_rm(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_rm) in cmd_ie_rm() argument
159 return uwb_rc_ie_rm(rc, ie_to_rm->data[0]); in cmd_ie_rm()
165 struct uwb_rc *rc = file->private_data; in command_write() local
177 ret = cmd_rsv_establish(rc, &cmd.rsv_establish); in command_write()
180 ret = cmd_rsv_terminate(rc, &cmd.rsv_terminate); in command_write()
183 ret = cmd_ie_add(rc, &cmd.ie_add); in command_write()
186 ret = cmd_ie_rm(rc, &cmd.ie_rm); in command_write()
189 ret = uwb_radio_start(&rc->dbg->pal); in command_write()
192 uwb_radio_stop(&rc->dbg->pal); in command_write()
211 struct uwb_rc *rc = s->private; in reservations_show() local
214 mutex_lock(&rc->rsvs_mutex); in reservations_show()
216 list_for_each_entry(rsv, &rc->reservations, rc_node) { in reservations_show()
224 is_owner = &rc->uwb_dev == rsv->owner; in reservations_show()
239 mutex_unlock(&rc->rsvs_mutex); in reservations_show()
247 struct uwb_rc *rc = s->private; in drp_avail_show() local
249 seq_printf(s, "global: %*pb\n", UWB_NUM_MAS, rc->drp_avail.global); in drp_avail_show()
250 seq_printf(s, "local: %*pb\n", UWB_NUM_MAS, rc->drp_avail.local); in drp_avail_show()
251 seq_printf(s, "pending: %*pb\n", UWB_NUM_MAS, rc->drp_avail.pending); in drp_avail_show()
259 struct device *dev = &pal->rc->uwb_dev.dev; in uwb_dbg_channel_changed()
283 void uwb_dbg_add_rc(struct uwb_rc *rc) in uwb_dbg_add_rc() argument
285 rc->dbg = kzalloc(sizeof(struct uwb_dbg), GFP_KERNEL); in uwb_dbg_add_rc()
286 if (rc->dbg == NULL) in uwb_dbg_add_rc()
289 INIT_LIST_HEAD(&rc->dbg->rsvs); in uwb_dbg_add_rc()
290 spin_lock_init(&(rc->dbg)->list_lock); in uwb_dbg_add_rc()
292 uwb_pal_init(&rc->dbg->pal); in uwb_dbg_add_rc()
293 rc->dbg->pal.rc = rc; in uwb_dbg_add_rc()
294 rc->dbg->pal.channel_changed = uwb_dbg_channel_changed; in uwb_dbg_add_rc()
295 rc->dbg->pal.new_rsv = uwb_dbg_new_rsv; in uwb_dbg_add_rc()
296 uwb_pal_register(&rc->dbg->pal); in uwb_dbg_add_rc()
299 rc->dbg->root_d = debugfs_create_dir(dev_name(&rc->uwb_dev.dev), in uwb_dbg_add_rc()
301 rc->dbg->command_f = debugfs_create_file("command", 0200, in uwb_dbg_add_rc()
302 rc->dbg->root_d, rc, in uwb_dbg_add_rc()
304 rc->dbg->reservations_f = debugfs_create_file("reservations", 0444, in uwb_dbg_add_rc()
305 rc->dbg->root_d, rc, in uwb_dbg_add_rc()
307 rc->dbg->accept_f = debugfs_create_bool("accept", 0644, in uwb_dbg_add_rc()
308 rc->dbg->root_d, in uwb_dbg_add_rc()
309 &rc->dbg->accept); in uwb_dbg_add_rc()
310 rc->dbg->drp_avail_f = debugfs_create_file("drp_avail", 0444, in uwb_dbg_add_rc()
311 rc->dbg->root_d, rc, in uwb_dbg_add_rc()
320 void uwb_dbg_del_rc(struct uwb_rc *rc) in uwb_dbg_del_rc() argument
324 if (rc->dbg == NULL) in uwb_dbg_del_rc()
327 list_for_each_entry_safe(rsv, t, &rc->dbg->rsvs, pal_node) { in uwb_dbg_del_rc()
331 uwb_pal_unregister(&rc->dbg->pal); in uwb_dbg_del_rc()
334 debugfs_remove(rc->dbg->drp_avail_f); in uwb_dbg_del_rc()
335 debugfs_remove(rc->dbg->accept_f); in uwb_dbg_del_rc()
336 debugfs_remove(rc->dbg->reservations_f); in uwb_dbg_del_rc()
337 debugfs_remove(rc->dbg->command_f); in uwb_dbg_del_rc()
338 debugfs_remove(rc->dbg->root_d); in uwb_dbg_del_rc()
364 struct uwb_rc *rc = pal->rc; in uwb_dbg_create_pal_dir() local
366 if (root_dir && rc->dbg && rc->dbg->root_d && pal->name) in uwb_dbg_create_pal_dir()
367 return debugfs_create_dir(pal->name, rc->dbg->root_d); in uwb_dbg_create_pal_dir()