/* * u_f.h * * Utility definitions for USB functions * * Copyright (c) 2013 Samsung Electronics Co., Ltd. * http://www.samsung.com * * Author: Andrzej Pietrasiewicz * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __U_F_H__ #define __U_F_H__ #include /* Variable Length Array Macros **********************************************/ #define vla_group(groupname) size_t groupname##__next = 0 #define vla_group_size(groupname) groupname##__next #define vla_item(groupname, type, name, n) \ size_t groupname##_##name##__offset = ({ \ size_t align_mask = __alignof__(type) - 1; \ size_t offset = (groupname##__next + align_mask) & ~align_mask;\ size_t size = (n) * sizeof(type); \ groupname##__next = offset + size; \ offset; \ }) #define vla_item_with_sz(groupname, type, name, n) \ size_t groupname##_##name##__sz = (n) * sizeof(type); \ size_t groupname##_##name##__offset = ({ \ size_t align_mask = __alignof__(type) - 1; \ size_t offset = (groupname##__next + align_mask) & ~align_mask;\ size_t size = groupname##_##name##__sz; \ groupname##__next = offset + size; \ offset; \ }) #define vla_ptr(ptr, groupname, name) \ ((void *) ((char *)ptr + groupname##_##name##__offset)) struct usb_ep; struct usb_request; /** * alloc_ep_req - returns a usb_request allocated by the gadget driver and * allocates the request's buffer. * * @ep: the endpoint to allocate a usb_request * @len: usb_requests's buffer suggested size * * In case @ep direction is OUT, the @len will be aligned to ep's * wMaxPacketSize. In order to avoid memory leaks or drops, *always* use * usb_requests's length (req->length) to refer to the allocated buffer size. * Requests allocated via alloc_ep_req() *must* be freed by free_ep_req(). */ struct usb_request *alloc_ep_req(struct usb_ep *ep, size_t len); /* Frees a usb_request previously allocated by alloc_ep_req() */ static inline void free_ep_req(struct usb_ep *ep, struct usb_request *req) { kfree(req->buf); usb_ep_free_request(ep, req); } #endif /* __U_F_H__ */ 5fe2586db'>diff
diff options
context:
space:
mode:
authorSowmini Varadhan <sowmini.varadhan@oracle.com>2017-01-10 07:47:15 -0800
committerDavid S. Miller <davem@davemloft.net>2017-01-10 21:02:42 -0500
commita505e58252715bbc18a0ee1abae23615fe2586db (patch)
treed816d838641ba1082b2356f4e3a365039e63b14d /tools/include/asm/barrier.h
parent3bf003335ba356aac5a43e28640159d4ae8a2a60 (diff)
packet: pdiag_put_ring() should return TX_RING info for TPACKET_V3
Commit 7f953ab2ba46 ("af_packet: TX_RING support for TPACKET_V3") now makes it possible to use TX_RING with TPACKET_V3, so make the the relevant information available via 'ss -e -a --packet' Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/include/asm/barrier.h')