Lines Matching refs:bce
112 struct uwb_beca_e *bce = container_of(_bce, struct uwb_beca_e, refcnt);
114 kfree(bce->be);
115 kfree(bce);
124 struct uwb_beca_e *bce, *next;
125 list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
126 if (!memcmp(&bce->dev_addr, dev_addr, sizeof(bce->dev_addr)))
129 bce = NULL;
131 return bce;
139 struct uwb_beca_e *bce, *next;
140 list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
141 if (!memcmp(bce->mac_addr, mac_addr->data,
145 bce = NULL;
147 return bce;
162 struct uwb_beca_e *bce;
165 bce = __uwb_beca_find_bydev(rc, devaddr);
166 if (bce)
167 found = uwb_dev_try_get(rc, bce->uwb_dev);
182 struct uwb_beca_e *bce;
185 bce = __uwb_beca_find_bymac(rc, macaddr);
186 if (bce)
187 found = uwb_dev_try_get(rc, bce->uwb_dev);
194 static void uwb_beca_e_init(struct uwb_beca_e *bce)
196 mutex_init(&bce->mutex);
197 kref_init(&bce->refcnt);
198 stats_init(&bce->lqe_stats);
199 stats_init(&bce->rssi_stats);
215 struct uwb_beca_e *bce;
217 bce = kzalloc(sizeof(*bce), GFP_KERNEL);
218 if (bce == NULL)
220 uwb_beca_e_init(bce);
221 bce->ts_jiffies = ts_jiffies;
222 bce->uwb_dev = NULL;
223 list_add(&bce->node, &rc->uwb_beca.list);
224 return bce;
234 struct uwb_beca_e *bce, *next;
238 list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
239 expires = bce->ts_jiffies + msecs_to_jiffies(beacon_timeout_ms);
241 uwbd_dev_offair(bce);
250 struct uwb_beca_e *bce, *next;
253 list_for_each_entry_safe(bce, next, &rc->uwb_beca.list, node) {
254 list_del(&bce->node);
255 uwb_bce_put(bce);
277 * @bce: beacon cache entry, referenced
279 ssize_t uwb_bce_print_IEs(struct uwb_dev *uwb_dev, struct uwb_beca_e *bce,
288 mutex_lock(&bce->mutex);
290 be = bce->be;
292 bf = (struct uwb_beacon_frame *)bce->be->BeaconInfo;
299 mutex_unlock(&bce->mutex);
343 struct uwb_beca_e *bce;
371 bce = __uwb_beca_find_bymac(rc, &bf->Device_Identifier);
372 if (bce == NULL) {
375 bce = __uwb_beca_add(rc, be, bf, evt->ts_jiffies);
376 if (bce == NULL) {
383 mutex_lock(&bce->mutex);
385 kfree(bce->be);
387 last_ts = bce->ts_jiffies;
390 bce->ts_jiffies = evt->ts_jiffies;
391 bce->be = be;
392 bce->dev_addr = bf->hdr.SrcAddr;
393 bce->mac_addr = &bf->Device_Identifier;
396 stats_add_sample(&bce->lqe_stats, be->bLQI - 7);
397 stats_add_sample(&bce->rssi_stats, be->bRSSI + 18);
402 if (bce->uwb_dev == NULL)
403 uwbd_dev_onair(evt->rc, bce);
405 mutex_unlock(&bce->mutex);