Lines Matching defs:rc
29 * Add callback @new to be called when an event occurs in @rc.
31 int uwb_notifs_register(struct uwb_rc *rc, struct uwb_notifs_handler *new)
33 if (mutex_lock_interruptible(&rc->notifs_chain.mutex))
35 list_add(&new->list_node, &rc->notifs_chain.list);
36 mutex_unlock(&rc->notifs_chain.mutex);
44 int uwb_notifs_deregister(struct uwb_rc *rc, struct uwb_notifs_handler *entry)
46 if (mutex_lock_interruptible(&rc->notifs_chain.mutex))
49 mutex_unlock(&rc->notifs_chain.mutex);
55 * Notify all event handlers of a given event on @rc
60 void uwb_notify(struct uwb_rc *rc, struct uwb_dev *uwb_dev, enum uwb_notifs event)
63 if (mutex_lock_interruptible(&rc->notifs_chain.mutex))
65 if (!list_empty(&rc->notifs_chain.list)) {
66 list_for_each_entry(handler, &rc->notifs_chain.list, list_node) {
70 mutex_unlock(&rc->notifs_chain.mutex);
253 if (&uwb_dev->rc->uwb_dev != uwb_dev)
279 * rc->uwb_dev->dev. Otherwise it is to be left NULL--a new one will
294 uwb_dev->rc = parent_rc;
331 struct uwb_dev *uwb_dev_try_get(struct uwb_rc *rc, struct uwb_dev *uwb_dev)
333 if (uwb_dev_for_each(rc, __uwb_dev_try_get, uwb_dev))
344 int __uwb_dev_offair(struct uwb_dev *uwb_dev, struct uwb_rc *rc)
353 rc ? rc->uwb_dev.dev.parent->bus->name : "n/a",
354 rc ? dev_name(rc->uwb_dev.dev.parent) : "");
382 uwb_notify(uwb_dev->rc, uwb_dev, UWB_NOTIF_OFFAIR);
383 __uwb_dev_offair(uwb_dev, uwb_dev->rc);
400 void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
403 struct device *dev = &rc->uwb_dev.dev;
419 result = uwb_dev_add(uwb_dev, &rc->uwb_dev.dev, rc);
430 macbuf, devbuf, rc->uwb_dev.dev.parent->bus->name,
431 dev_name(rc->uwb_dev.dev.parent));
432 uwb_notify(rc, uwb_dev, UWB_NOTIF_ONAIR);
445 * @rc: radio controller for the devices.
451 int uwb_dev_for_each(struct uwb_rc *rc, uwb_dev_for_each_f function, void *priv)
453 return device_for_each_child(&rc->uwb_dev.dev, priv, function);