aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux/skbuff.h
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-07-29 15:21:48 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2022-07-29 15:21:48 +0000
commit89c32dafa560fe0e0259f14185ceefbcee3dcec6 (patch)
treefb51a5ab3740009c845dc952ee21e545125cf81b /sys/compat/linuxkpi/common/include/linux/skbuff.h
parent195733401f431622df3185897cd04c1aeb113e0d (diff)
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/skbuff.h')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/skbuff.h86
1 files changed, 79 insertions, 7 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h
index 3caf7059dd15..d3a795344f86 100644
--- a/sys/compat/linuxkpi/common/include/linux/skbuff.h
+++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h
@@ -124,11 +124,15 @@ struct skb_shared_info {
};
struct sk_buff {
- /* XXX TODO */
- /* struct sk_buff_head */
- struct sk_buff *next;
- struct sk_buff *prev;
- int list; /* XXX TYPE */
+ /* XXX TODO */
+ union {
+ /* struct sk_buff_head */
+ struct {
+ struct sk_buff *next;
+ struct sk_buff *prev;
+ };
+ struct list_head list;
+ };
uint32_t _alloc_len; /* Length of alloc data-buf. XXX-BZ give up for truesize? */
uint32_t len; /* ? */
uint32_t data_len; /* ? If we have frags? */
@@ -266,7 +270,7 @@ skb_reserve(struct sk_buff *skb, size_t len)
* front to copy data in (manually).
*/
static inline void *
-skb_push(struct sk_buff *skb, size_t len)
+__skb_push(struct sk_buff *skb, size_t len)
{
SKB_TRACE(skb);
KASSERT(((skb->data - len) >= skb->head), ("%s: skb %p (data %p - "
@@ -276,6 +280,14 @@ skb_push(struct sk_buff *skb, size_t len)
return (skb->data);
}
+static inline void *
+skb_push(struct sk_buff *skb, size_t len)
+{
+
+ SKB_TRACE(skb);
+ return (__skb_push(skb, len));
+}
+
/*
* Length of the data on the skb (without any frags)???
*/
@@ -324,7 +336,7 @@ skb_headroom(struct sk_buff *skb)
* the end to copy data in (manually). See also skb_put_data() below.
*/
static inline void *
-skb_put(struct sk_buff *skb, size_t len)
+__skb_put(struct sk_buff *skb, size_t len)
{
void *s;
@@ -347,6 +359,14 @@ skb_put(struct sk_buff *skb, size_t len)
return (s);
}
+static inline void *
+skb_put(struct sk_buff *skb, size_t len)
+{
+
+ SKB_TRACE(skb);
+ return (__skb_put(skb, len));
+}
+
/* skb_put() + copying data in. */
static inline void *
skb_put_data(struct sk_buff *skb, const void *buf, size_t len)
@@ -749,6 +769,13 @@ skb_frag_address(const skb_frag_t *frag)
return (NULL);
}
+static inline void
+skb_free_frag(void *frag)
+{
+
+ SKB_TODO();
+}
+
static inline struct sk_buff *
skb_gso_segment(struct sk_buff *skb, netdev_features_t netdev_flags)
{
@@ -938,4 +965,49 @@ skb_copy_from_linear_data(const struct sk_buff *skb, void *dst, size_t len)
memcpy(dst, skb->data, len);
}
+static inline struct sk_buff *
+build_skb(void *data, unsigned int fragsz)
+{
+
+ SKB_TODO();
+ return (NULL);
+}
+
+static inline int
+skb_pad(struct sk_buff *skb, int pad)
+{
+
+ SKB_TRACE(skb);
+ SKB_TODO();
+ return (-1);
+}
+
+static inline void
+skb_list_del_init(struct sk_buff *skb)
+{
+
+ SKB_TRACE(skb);
+ SKB_TODO();
+}
+
+static inline void
+napi_consume_skb(struct sk_buff *skb, int budget)
+{
+
+ SKB_TRACE(skb);
+ SKB_TODO();
+}
+
+static inline bool
+skb_linearize(struct sk_buff *skb)
+{
+
+ SKB_TRACE(skb);
+ SKB_TODO();
+ return (false);
+}
+
+#define SKB_WITH_OVERHEAD(_s) \
+ (_s) - ALIGN(sizeof(struct skb_shared_info), CACHE_LINE_SIZE)
+
#endif /* _LINUXKPI_LINUX_SKBUFF_H */