diff options
author | David S. Miller <davem@davemloft.net> | 2013-08-04 04:36:46 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-04 04:36:46 (GMT) |
commit | 0e76a3a587fc7abda2badf249053b427baad255e (patch) | |
tree | 646a1da67dc25654552028225ca4b7a0a8043cc9 /drivers/staging/csr/csr_serialize_primitive_types.c | |
parent | fba3679d34511c42bf452e89dda457a1219eb43a (diff) | |
parent | 72a67a94bcba71a5fddd6b3596a20604d2b5dcd6 (diff) | |
download | linux-fsl-qoriq-0e76a3a587fc7abda2badf249053b427baad255e.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge net into net-next to setup some infrastructure Eric
Dumazet needs for usbnet changes.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/staging/csr/csr_serialize_primitive_types.c')
-rw-r--r-- | drivers/staging/csr/csr_serialize_primitive_types.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/drivers/staging/csr/csr_serialize_primitive_types.c b/drivers/staging/csr/csr_serialize_primitive_types.c deleted file mode 100644 index 9713b9a..0000000 --- a/drivers/staging/csr/csr_serialize_primitive_types.c +++ /dev/null @@ -1,100 +0,0 @@ -/***************************************************************************** - - (c) Cambridge Silicon Radio Limited 2010 - All rights reserved and confidential information of CSR - - Refer to LICENSE.txt included with this source for details - on the license terms. - -*****************************************************************************/ - -#include <linux/module.h> -#include <linux/slab.h> -#include "csr_prim_defs.h" -#include "csr_msgconv.h" -#include "csr_macro.h" - -void CsrUint8Des(u8 *value, u8 *buffer, size_t *offset) -{ - *value = buffer[*offset]; - *offset += sizeof(*value); -} -EXPORT_SYMBOL_GPL(CsrUint8Des); - -void CsrUint16Des(u16 *value, u8 *buffer, size_t *offset) -{ - *value = (buffer[*offset + 0] << 0) | - (buffer[*offset + 1] << 8); - *offset += sizeof(*value); -} -EXPORT_SYMBOL_GPL(CsrUint16Des); - -void CsrUint32Des(u32 *value, u8 *buffer, size_t *offset) -{ - *value = (buffer[*offset + 0] << 0) | - (buffer[*offset + 1] << 8) | - (buffer[*offset + 2] << 16) | - (buffer[*offset + 3] << 24); - *offset += sizeof(*value); -} -EXPORT_SYMBOL_GPL(CsrUint32Des); - -void CsrMemCpyDes(void *value, u8 *buffer, size_t *offset, size_t length) -{ - memcpy(value, &buffer[*offset], length); - *offset += length; -} -EXPORT_SYMBOL_GPL(CsrMemCpyDes); - -void CsrCharStringDes(char **value, u8 *buffer, size_t *offset) -{ - *value = kstrdup((char *) &buffer[*offset], GFP_KERNEL); - *offset += strlen(*value) + 1; -} -EXPORT_SYMBOL_GPL(CsrCharStringDes); - -void CsrUint8Ser(u8 *buffer, size_t *offset, u8 value) -{ - buffer[*offset] = value; - *offset += sizeof(value); -} -EXPORT_SYMBOL_GPL(CsrUint8Ser); - -void CsrUint16Ser(u8 *buffer, size_t *offset, u16 value) -{ - buffer[*offset + 0] = (u8) ((value >> 0) & 0xFF); - buffer[*offset + 1] = (u8) ((value >> 8) & 0xFF); - *offset += sizeof(value); -} -EXPORT_SYMBOL_GPL(CsrUint16Ser); - -void CsrUint32Ser(u8 *buffer, size_t *offset, u32 value) -{ - buffer[*offset + 0] = (u8) ((value >> 0) & 0xFF); - buffer[*offset + 1] = (u8) ((value >> 8) & 0xFF); - buffer[*offset + 2] = (u8) ((value >> 16) & 0xFF); - buffer[*offset + 3] = (u8) ((value >> 24) & 0xFF); - *offset += sizeof(value); -} -EXPORT_SYMBOL_GPL(CsrUint32Ser); - -void CsrMemCpySer(u8 *buffer, size_t *offset, const void *value, size_t length) -{ - memcpy(&buffer[*offset], value, length); - *offset += length; -} -EXPORT_SYMBOL_GPL(CsrMemCpySer); - -void CsrCharStringSer(u8 *buffer, size_t *offset, const char *value) -{ - if (value) - { - strcpy(((char *) &buffer[*offset]), value); - *offset += strlen(value) + 1; - } - else - { - CsrUint8Ser(buffer, offset, 0); - } -} -EXPORT_SYMBOL_GPL(CsrCharStringSer); |