/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010, 2011, 2012 Daniel Borkmann. * Copyright 2014, 2015 Tobias Klauser * Subject to the GPL, version 2. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include "xmalloc.h" #include "built_in.h" #include "die.h" #include "str.h" void *xmalloc(size_t size) { void *ptr; if (unlikely(size == 0)) panic("xmalloc: zero size\n"); ptr = malloc(size); if (unlikely(ptr == NULL)) panic("xmalloc: out of memory (allocating %zu bytes)\n", size); return ptr; } void *xcalloc(size_t nmemb, size_t size) { void *ptr; if (unlikely(nmemb == 0 || size == 0)) panic("xcalloc: zero size\n"); ptr = calloc(nmemb, size); if (unlikely(ptr == NULL)) panic("xcalloc: out of memory (allocating %zu members of " "%zu bytes)\n", nmemb, size); return ptr; } void *xzmalloc(size_t size) { void *ptr = xmalloc(size); memset(ptr, 0, size); return ptr; } void *xmalloc_aligned(size_t size, size_t alignment) { int ret; void *ptr; if (unlikely(size == 0)) panic("xmalloc_aligned: zero size\n"); ret = posix_memalign(&ptr, alignment, size); if (unlikely(ret != 0)) panic("xmalloc_aligned: out of memory (allocating %zu " "bytes)\n", size); return ptr; } void *xzmalloc_aligned(size_t size, size_t alignment) { void *ptr = xmalloc_aligned(size, alignment); memset(ptr, 0, size); return ptr; } void *xmallocz(size_t size) { void *ptr; if (unlikely(size + 1 < size)) panic("xmallocz: data too large to fit into virtual " "memory space\n"); ptr = xmalloc(size + 1); ((char*) ptr)[size] = 0; return ptr; } void *xmemdupz(const void *data, size_t len) { return memcpy(xmallocz(len), data, len); } void *xrealloc(void *ptr, size_t size) { void *new_ptr; if (unlikely(size == 0)) panic("xrealloc: zero size\n"); new_ptr = realloc(ptr, size); if (unlikely(new_ptr == NULL)) panic("xrealloc: out of memory (allocating %zu bytes)\n", size); return new_ptr; } void xfree_func(void *ptr) { if (unlikely(ptr == NULL)) panic("xfree: NULL pointer given as argument\n"); free(ptr); } char *xstrdup(const char *str) { size_t len; char *cp; len = strlen(str) + 1; cp = xmalloc(len); strlcpy(cp, str, len); return cp; } char *xstrndup(const char *str, size_t size) { size_t len; char *cp; len = strlen(str) + 1; if (size < len) len = size; cp = xmalloc(len); strlcpy(cp, str, len); return cp; } ion value='committer'>committer
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-05-03 12:08:43 +0300
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-05-04 20:59:55 +0300
commit5c08b0f5026fcc13efb947c4d1f2ca3558145f68 (patch)
tree17820fa70707a2078dc4605c8f075e9fbb2fe137 /Documentation/devicetree/bindings/input
parentf742aaf36edf0390c54d0614bc4d20fd4cd3762a (diff)
iwlwifi: mvm: don't override the rate with the AMSDU len
The TSO code creates A-MSDUs from a single large send. Each A-MSDU is an skb and skb->len doesn't include the number of bytes which need to be added for the headers being added (subframe header, TCP header, IP header, SNAP, padding). To be able to set the right value in the Tx command, we put the number of bytes added by those headers in driver_data in iwl_mvm_tx_tso and use this value in iwl_mvm_set_tx_cmd. The problem by setting this value in driver_data is that it overrides the ieee80211_tx_info. The bug manifested itself when we send P2P related frames in CCK since the rate in ieee80211_tx_info is zero-ed. This of course is a violation of the P2P specification. To fix this, copy the original ieee80211_tx_info to the stack and pass it to the functions which need it. Assign the number of bytes added by the headers to the driver_data inside the skb itself. Fixes: a6d5e32f247c ("iwlwifi: mvm: send large SKBs to the transport") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'Documentation/devicetree/bindings/input')