/* * 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__ */ selftests/ipc/config'>
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-01-17 13:46:29 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2017-01-23 22:41:33 +0800
commit11e3b725cfc282efe9d4a354153e99d86a16af08 (patch)
tree8b5b9e0e1bcae1ab98ee652ffb7b13b05c209bd6 /tools/testing/selftests/ipc/config
parentd6040764adcb5cb6de1489422411d701c158bb69 (diff)
crypto: arm64/aes-blk - honour iv_out requirement in CBC and CTR modes
Update the ARMv8 Crypto Extensions and the plain NEON AES implementations in CBC and CTR modes to return the next IV back to the skcipher API client. This is necessary for chaining to work correctly. Note that for CTR, this is only done if the request is a round multiple of the block size, since otherwise, chaining is impossible anyway. Cc: <stable@vger.kernel.org> # v3.16+ Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/testing/selftests/ipc/config')