]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wilink8-wlan/compat.git/commitdiff
comapt: add skb_frag_size() and hex_byte_pack()
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 6 Nov 2011 21:25:04 +0000 (22:25 +0100)
committerLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Tue, 8 Nov 2011 19:21:03 +0000 (11:21 -0800)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
include/linux/compat-2.6.26.h
include/linux/compat-3.2.h

index 9a67e9d6cdd13a8e87588290222e09487e4c3c4d..177792a3753e336501d0182b86b4cbd13ff29e7b 100644 (file)
@@ -447,6 +447,9 @@ static inline u64 div_u64(u64 dividend, u32 divisor)
 #endif
 /* source: include/math64.h */
 
+#define hex_asc_lo(x)  hex_asc((x) & 0x0f)
+#define hex_asc_hi(x)  hex_asc(((x) & 0xf0) >> 4)
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) */
 
 #endif /* LINUX_26_26_COMPAT_H */
index 859a2e3397e4fe3ddde16e30f07ba3f338cd8a43..ceaaecc4307ecc57c0ee55fa4139701f691047aa 100644 (file)
@@ -60,6 +60,18 @@ static inline dma_addr_t skb_frag_dma_map(struct device *dev,
 
 #define ETH_P_TDLS     0x890D          /* TDLS */
 
+static inline unsigned int skb_frag_size(const skb_frag_t *frag)
+{
+       return frag->size;
+}
+
+static inline char *hex_byte_pack(char *buf, u8 byte)
+{
+       *buf++ = hex_asc_hi(byte);
+       *buf++ = hex_asc_lo(byte);
+       return buf;
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)) */
 
 #endif /* LINUX_3_2_COMPAT_H */