Lines Matching defs:buf
43 static inline u8 __mlxsw_item_get8(const char *buf,
48 u8 *b = (u8 *) buf;
59 static inline void __mlxsw_item_set8(char *buf, const struct mlxsw_item *item,
64 u8 *b = (u8 *) buf;
77 static inline u16 __mlxsw_item_get16(const char *buf,
82 __be16 *b = (__be16 *) buf;
93 static inline void __mlxsw_item_set16(char *buf, const struct mlxsw_item *item,
98 __be16 *b = (__be16 *) buf;
111 static inline u32 __mlxsw_item_get32(const char *buf,
116 __be32 *b = (__be32 *) buf;
127 static inline void __mlxsw_item_set32(char *buf, const struct mlxsw_item *item,
132 __be32 *b = (__be32 *) buf;
145 static inline u64 __mlxsw_item_get64(const char *buf,
150 __be64 *b = (__be64 *) buf;
161 static inline void __mlxsw_item_set64(char *buf, const struct mlxsw_item *item,
165 __be64 *b = (__be64 *) buf;
178 static inline void __mlxsw_item_memcpy_from(const char *buf, char *dst,
184 memcpy(dst, &buf[offset], item->size.bytes);
187 static inline void __mlxsw_item_memcpy_to(char *buf, const char *src,
193 memcpy(&buf[offset], src, item->size.bytes);
196 static inline char *__mlxsw_item_data(char *buf, const struct mlxsw_item *item,
201 return &buf[offset];
229 static inline u8 __mlxsw_item_bit_array_get(const char *buf,
236 tmp = buf[offset];
242 static inline void __mlxsw_item_bit_array_set(char *buf,
252 tmp = buf[offset];
255 buf[offset] = tmp;
273 static inline u8 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf) \
275 return __mlxsw_item_get8(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \
277 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u8 val)\
279 __mlxsw_item_set8(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \
294 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf, unsigned short index)\
296 return __mlxsw_item_get8(buf, &__ITEM_NAME(_type, _cname, _iname), \
300 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \
303 __mlxsw_item_set8(buf, &__ITEM_NAME(_type, _cname, _iname), \
314 static inline u16 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf) \
316 return __mlxsw_item_get16(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \
318 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u16 val)\
320 __mlxsw_item_set16(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \
335 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf, unsigned short index)\
337 return __mlxsw_item_get16(buf, &__ITEM_NAME(_type, _cname, _iname), \
341 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \
344 __mlxsw_item_set16(buf, &__ITEM_NAME(_type, _cname, _iname), \
355 static inline u32 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf) \
357 return __mlxsw_item_get32(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \
359 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u32 val)\
361 __mlxsw_item_set32(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \
376 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf, unsigned short index)\
378 return __mlxsw_item_get32(buf, &__ITEM_NAME(_type, _cname, _iname), \
382 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \
385 __mlxsw_item_set32(buf, &__ITEM_NAME(_type, _cname, _iname), \
396 static inline u64 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf) \
398 return __mlxsw_item_get64(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \
400 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u64 val)\
402 __mlxsw_item_set64(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \
417 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf, unsigned short index)\
419 return __mlxsw_item_get64(buf, &__ITEM_NAME(_type, _cname, _iname), \
423 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \
426 __mlxsw_item_set64(buf, &__ITEM_NAME(_type, _cname, _iname), \
437 mlxsw_##_type##_##_cname##_##_iname##_memcpy_from(const char *buf, char *dst) \
439 __mlxsw_item_memcpy_from(buf, dst, \
443 mlxsw_##_type##_##_cname##_##_iname##_memcpy_to(char *buf, const char *src) \
445 __mlxsw_item_memcpy_to(buf, src, \
449 mlxsw_##_type##_##_cname##_##_iname##_data(char *buf) \
451 return __mlxsw_item_data(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \
464 mlxsw_##_type##_##_cname##_##_iname##_memcpy_from(const char *buf, \
468 __mlxsw_item_memcpy_from(buf, dst, \
472 mlxsw_##_type##_##_cname##_##_iname##_memcpy_to(char *buf, \
476 __mlxsw_item_memcpy_to(buf, src, \
480 mlxsw_##_type##_##_cname##_##_iname##_data(char *buf, unsigned short index) \
482 return __mlxsw_item_data(buf, \
495 mlxsw_##_type##_##_cname##_##_iname##_get(const char *buf, u16 index) \
497 return __mlxsw_item_bit_array_get(buf, \
502 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u16 index, u8 val) \
504 return __mlxsw_item_bit_array_set(buf, \