Searched refs:neh (Results 1 - 9 of 9) sorted by relevance

/linux-4.1.27/drivers/uwb/
H A Dneh.c43 * 4, Release the reference to the neh [uwb_rc_neh_put()]
75 * the handle [w/ neh->extra_size()].
122 struct uwb_rc_neh *neh = container_of(kref, struct uwb_rc_neh, kref); uwb_rc_neh_release() local
124 kfree(neh); uwb_rc_neh_release()
127 static void uwb_rc_neh_get(struct uwb_rc_neh *neh) uwb_rc_neh_get() argument
129 kref_get(&neh->kref); uwb_rc_neh_get()
133 * uwb_rc_neh_put - release reference to a neh
134 * @neh: the neh
136 void uwb_rc_neh_put(struct uwb_rc_neh *neh) uwb_rc_neh_put() argument
138 kref_put(&neh->kref, uwb_rc_neh_release); uwb_rc_neh_put()
143 * Assigns @neh a context id from @rc's pool
146 * @neh: Notification/Event Handle
157 * consecutive opened @neh's getting the same context ID assigned (to
163 int __uwb_rc_ctx_get(struct uwb_rc *rc, struct uwb_rc_neh *neh) __uwb_rc_ctx_get() argument
176 neh->context = result; __uwb_rc_ctx_get()
181 /** Releases @neh's context ID back to @rc (@rc->neh_lock is locked). */
183 void __uwb_rc_ctx_put(struct uwb_rc *rc, struct uwb_rc_neh *neh) __uwb_rc_ctx_put() argument
186 if (neh->context == 0) __uwb_rc_ctx_put()
188 if (test_bit(neh->context, rc->ctx_bm) == 0) { __uwb_rc_ctx_put()
190 neh->context); __uwb_rc_ctx_put()
193 clear_bit(neh->context, rc->ctx_bm); __uwb_rc_ctx_put()
194 neh->context = 0; __uwb_rc_ctx_put()
198 * uwb_rc_neh_add - add a neh for a radio controller command
206 * Creates a neh and adds it to the list of those waiting for an
216 struct uwb_rc_neh *neh; uwb_rc_neh_add() local
218 neh = kzalloc(sizeof(*neh), GFP_KERNEL); uwb_rc_neh_add()
219 if (neh == NULL) { uwb_rc_neh_add()
224 kref_init(&neh->kref); uwb_rc_neh_add()
225 INIT_LIST_HEAD(&neh->list_node); uwb_rc_neh_add()
226 init_timer(&neh->timer); uwb_rc_neh_add()
227 neh->timer.function = uwb_rc_neh_timer; uwb_rc_neh_add()
228 neh->timer.data = (unsigned long)neh; uwb_rc_neh_add()
230 neh->rc = rc; uwb_rc_neh_add()
231 neh->evt_type = expected_type; uwb_rc_neh_add()
232 neh->evt = cpu_to_le16(expected_event); uwb_rc_neh_add()
233 neh->cb = cb; uwb_rc_neh_add()
234 neh->arg = arg; uwb_rc_neh_add()
237 result = __uwb_rc_ctx_get(rc, neh); uwb_rc_neh_add()
239 cmd->bCommandContext = neh->context; uwb_rc_neh_add()
240 list_add_tail(&neh->list_node, &rc->neh_list); uwb_rc_neh_add()
241 uwb_rc_neh_get(neh); uwb_rc_neh_add()
247 return neh; uwb_rc_neh_add()
250 kfree(neh); uwb_rc_neh_add()
256 static void __uwb_rc_neh_rm(struct uwb_rc *rc, struct uwb_rc_neh *neh) __uwb_rc_neh_rm() argument
258 __uwb_rc_ctx_put(rc, neh); __uwb_rc_neh_rm()
259 list_del(&neh->list_node); __uwb_rc_neh_rm()
263 * uwb_rc_neh_rm - remove a neh.
265 * @neh: the neh to remove
267 * Remove an active neh immediately instead of waiting for the event
270 void uwb_rc_neh_rm(struct uwb_rc *rc, struct uwb_rc_neh *neh) uwb_rc_neh_rm() argument
275 __uwb_rc_neh_rm(rc, neh); uwb_rc_neh_rm()
278 del_timer_sync(&neh->timer); uwb_rc_neh_rm()
279 uwb_rc_neh_put(neh); uwb_rc_neh_rm()
286 * @neh: Notification/event handler for @rc
288 * The timer is only armed if the neh is active.
290 void uwb_rc_neh_arm(struct uwb_rc *rc, struct uwb_rc_neh *neh) uwb_rc_neh_arm() argument
295 if (neh->context) uwb_rc_neh_arm()
296 mod_timer(&neh->timer, uwb_rc_neh_arm()
301 static void uwb_rc_neh_cb(struct uwb_rc_neh *neh, struct uwb_rceb *rceb, size_t size) uwb_rc_neh_cb() argument
303 (*neh->cb)(neh->rc, neh->arg, rceb, size); uwb_rc_neh_cb()
304 uwb_rc_neh_put(neh); uwb_rc_neh_cb()
307 static bool uwb_rc_neh_match(struct uwb_rc_neh *neh, const struct uwb_rceb *rceb) uwb_rc_neh_match() argument
309 return neh->evt_type == rceb->bEventType uwb_rc_neh_match()
310 && neh->evt == rceb->wEvent uwb_rc_neh_match()
311 && neh->context == rceb->bEventContext; uwb_rc_neh_match()
320 * adjusted to take into account the @neh->extra_size
324 * the right size (the amount of data received). @neh->ptr will point
332 struct uwb_rc_neh *neh = NULL, *h; uwb_rc_neh_lookup() local
339 neh = h; uwb_rc_neh_lookup()
344 if (neh) uwb_rc_neh_lookup()
345 __uwb_rc_neh_rm(rc, neh); uwb_rc_neh_lookup()
349 return neh; uwb_rc_neh_lookup()
357 * @neh: Notification/Event Handler @neh->ptr points to
366 * handling code in neh.c [uwb_rc_neh_lookup()]. What is actually
411 struct uwb_rc_neh *neh; uwb_rc_neh_grok_event() local
425 neh = uwb_rc_neh_lookup(rc, rceb); uwb_rc_neh_grok_event()
426 if (neh) { uwb_rc_neh_grok_event()
429 neh->completed = 1; uwb_rc_neh_grok_event()
430 del_timer(&neh->timer); uwb_rc_neh_grok_event()
432 uwb_rc_neh_cb(neh, rceb, size); uwb_rc_neh_grok_event()
457 * tables, then looks for a neh that is waiting for that event and if
458 * found, copies the payload to the neh's buffer and calls it back. If
462 * still might find a size in the 'neh' handle in uwb_rc_neh_lookup().
550 struct uwb_rc_neh *neh; uwb_rc_neh_error() local
559 neh = list_first_entry(&rc->neh_list, struct uwb_rc_neh, list_node); uwb_rc_neh_error()
560 __uwb_rc_neh_rm(rc, neh); uwb_rc_neh_error()
563 del_timer_sync(&neh->timer); uwb_rc_neh_error()
564 uwb_rc_neh_cb(neh, NULL, error); uwb_rc_neh_error()
572 struct uwb_rc_neh *neh = (struct uwb_rc_neh *)arg; uwb_rc_neh_timer() local
573 struct uwb_rc *rc = neh->rc; uwb_rc_neh_timer()
577 if (neh->completed) { uwb_rc_neh_timer()
581 if (neh->context) uwb_rc_neh_timer()
582 __uwb_rc_neh_rm(rc, neh); uwb_rc_neh_timer()
584 neh = NULL; uwb_rc_neh_timer()
587 if (neh) uwb_rc_neh_timer()
588 uwb_rc_neh_cb(neh, NULL, -ETIMEDOUT); uwb_rc_neh_timer()
591 /** Initializes the @rc's neh subsystem
603 /** Release's the @rc's neh subsystem */ uwb_rc_neh_destroy()
607 struct uwb_rc_neh *neh; uwb_rc_neh_destroy() local
615 neh = list_first_entry(&rc->neh_list, struct uwb_rc_neh, list_node); uwb_rc_neh_destroy()
616 __uwb_rc_neh_rm(rc, neh); uwb_rc_neh_destroy()
619 del_timer_sync(&neh->timer); uwb_rc_neh_destroy()
620 uwb_rc_neh_put(neh); uwb_rc_neh_destroy()
H A DMakefile19 neh.o \
H A Dreset.c77 struct uwb_rc_neh *neh; uwb_rc_cmd_async() local
97 neh = uwb_rc_neh_add(rc, cmd, expected_type, expected_event, cb, arg); uwb_rc_cmd_async()
98 if (IS_ERR(neh)) { uwb_rc_cmd_async()
99 result = PTR_ERR(neh); uwb_rc_cmd_async()
107 uwb_rc_neh_rm(rc, neh); uwb_rc_cmd_async()
109 uwb_rc_neh_arm(rc, neh); uwb_rc_cmd_async()
110 uwb_rc_neh_put(neh); uwb_rc_cmd_async()
H A Duwb-internal.h107 void uwb_rc_neh_rm(struct uwb_rc *rc, struct uwb_rc_neh *neh);
108 void uwb_rc_neh_arm(struct uwb_rc *rc, struct uwb_rc_neh *neh);
109 void uwb_rc_neh_put(struct uwb_rc_neh *neh);
H A Dest.c348 * Note this size is *not* final--the neh (Notification/Event Handle)
425 * Note this size is *not* final--the neh (Notification/Event Handle)
H A Dhwa-rc.c630 * the notification/event handling mechanism (neh).
/linux-4.1.27/drivers/uwb/i1480/
H A Di1480-est.c36 * neh->extra_size to specify the real size that will
/linux-4.1.27/fs/ext4/
H A Dextents.c1029 struct ext4_extent_header *neh; ext4_ext_split() local
1102 neh = ext_block_hdr(bh); ext4_ext_split()
1103 neh->eh_entries = 0; ext4_ext_split()
1104 neh->eh_max = cpu_to_le16(ext4_ext_space_block(inode, 0)); ext4_ext_split()
1105 neh->eh_magic = EXT4_EXT_MAGIC; ext4_ext_split()
1106 neh->eh_depth = 0; ext4_ext_split()
1122 ex = EXT_FIRST_EXTENT(neh); ext4_ext_split()
1124 le16_add_cpu(&neh->eh_entries, m); ext4_ext_split()
1127 ext4_extent_block_csum_set(inode, neh); ext4_ext_split()
1175 neh = ext_block_hdr(bh); ext4_ext_split()
1176 neh->eh_entries = cpu_to_le16(1); ext4_ext_split()
1177 neh->eh_magic = EXT4_EXT_MAGIC; ext4_ext_split()
1178 neh->eh_max = cpu_to_le16(ext4_ext_space_block_idx(inode, 0)); ext4_ext_split()
1179 neh->eh_depth = cpu_to_le16(depth - i); ext4_ext_split()
1180 fidx = EXT_FIRST_INDEX(neh); ext4_ext_split()
1204 le16_add_cpu(&neh->eh_entries, m); ext4_ext_split()
1206 ext4_extent_block_csum_set(inode, neh); ext4_ext_split()
1266 struct ext4_extent_header *neh; ext4_ext_grow_indepth() local
1301 neh = ext_block_hdr(bh); ext4_ext_grow_indepth()
1305 neh->eh_max = cpu_to_le16(ext4_ext_space_block_idx(inode, 0)); ext4_ext_grow_indepth()
1307 neh->eh_max = cpu_to_le16(ext4_ext_space_block(inode, 0)); ext4_ext_grow_indepth()
1308 neh->eh_magic = EXT4_EXT_MAGIC; ext4_ext_grow_indepth()
1309 ext4_extent_block_csum_set(inode, neh); ext4_ext_grow_indepth()
1318 neh = ext_inode_hdr(inode); ext4_ext_grow_indepth()
1319 neh->eh_entries = cpu_to_le16(1); ext4_ext_grow_indepth()
1320 ext4_idx_store_pblock(EXT_FIRST_INDEX(neh), newblock); ext4_ext_grow_indepth()
1321 if (neh->eh_depth == 0) { ext4_ext_grow_indepth()
1323 neh->eh_max = cpu_to_le16(ext4_ext_space_root_idx(inode, 0)); ext4_ext_grow_indepth()
1324 EXT_FIRST_INDEX(neh)->ei_block = ext4_ext_grow_indepth()
1325 EXT_FIRST_EXTENT(neh)->ee_block; ext4_ext_grow_indepth()
1328 le16_to_cpu(neh->eh_entries), le16_to_cpu(neh->eh_max), ext4_ext_grow_indepth()
1329 le32_to_cpu(EXT_FIRST_INDEX(neh)->ei_block), ext4_ext_grow_indepth()
1330 ext4_idx_pblock(EXT_FIRST_INDEX(neh))); ext4_ext_grow_indepth()
1332 le16_add_cpu(&neh->eh_depth, 1); ext4_ext_grow_indepth()
/linux-4.1.27/drivers/uwb/i1480/dfu/
H A Dusb.c147 * memory address and size passed back in the @neh structure.

Completed in 371 milliseconds