patch-2.4.10 linux/include/net/bluetooth/bluez.h
Next file: linux/include/net/bluetooth/hci.h
Previous file: linux/include/net/bluetooth/bluetooth.h
Back to the patch index
Back to the overall index
- Lines: 120
- Date:
Fri Sep 7 09:28:38 2001
- Orig file:
v2.4.9/linux/include/net/bluetooth/bluez.h
- Orig date:
Tue Jul 3 17:08:22 2001
diff -u --recursive --new-file v2.4.9/linux/include/net/bluetooth/bluez.h linux/include/net/bluetooth/bluez.h
@@ -23,7 +23,7 @@
*/
/*
- * $Id: bluez.h,v 1.1 2001/06/01 08:12:11 davem Exp $
+ * $Id: bluez.h,v 1.4 2001/08/03 04:19:49 maxk Exp $
*/
#ifndef __IF_BLUEZ_H
@@ -31,8 +31,6 @@
#include <net/sock.h>
-#define BLUEZ_VER "1.0"
-
#define BLUEZ_MAX_PROTO 2
/* Reserv for core and drivers use */
@@ -81,91 +79,41 @@
/* ----- SKB helpers ----- */
struct bluez_skb_cb {
- int incomming, fragmented;
- struct sk_buff_head frags;
+ int incomming;
};
#define bluez_cb(skb) ((struct bluez_skb_cb *)(skb->cb))
-static __inline__ struct sk_buff *bluez_skb_alloc(unsigned int len, int how)
+static inline struct sk_buff *bluez_skb_alloc(unsigned int len, int how)
{
struct sk_buff *skb;
if ((skb = alloc_skb(len + BLUEZ_SKB_RESERVE, how))) {
- bluez_cb(skb)->incomming = 0;
- bluez_cb(skb)->fragmented = 0;
skb_reserve(skb, BLUEZ_SKB_RESERVE);
+ bluez_cb(skb)->incomming = 0;
}
return skb;
}
-static __inline__ struct sk_buff *bluez_skb_clone(struct sk_buff *skb, int how)
-{
- struct sk_buff *new;
-
- if ((new = skb_clone(skb, how)))
- bluez_cb(new)->fragmented = 0;
- return new;
-}
-
-static __inline__ struct sk_buff *bluez_skb_send_alloc(struct sock *sk, unsigned long len,
+static inline struct sk_buff *bluez_skb_send_alloc(struct sock *sk, unsigned long len,
int nb, int *err)
{
struct sk_buff *skb;
if ((skb = sock_alloc_send_skb(sk, len + BLUEZ_SKB_RESERVE, nb, err))) {
- bluez_cb(skb)->incomming = 0;
- bluez_cb(skb)->fragmented = 0;
skb_reserve(skb, BLUEZ_SKB_RESERVE);
+ bluez_cb(skb)->incomming = 0;
}
return skb;
}
-static __inline__ int bluez_skb_frags(struct sk_buff *skb)
-{
- if (bluez_cb(skb)->fragmented)
- return skb_queue_len(&bluez_cb(skb)->frags);
- return 0;
-}
-
-static __inline__ void bluez_skb_add_frag(struct sk_buff *skb, struct sk_buff *frag)
-{
- if (!bluez_cb(skb)->fragmented) {
- skb_queue_head_init(&bluez_cb(skb)->frags);
- bluez_cb(skb)->fragmented = 1;
- }
- __skb_queue_tail(&bluez_cb(skb)->frags, frag);
-}
-
-static __inline__ struct sk_buff *bluez_skb_next_frag(struct sk_buff *skb)
+static inline int skb_frags_no(struct sk_buff *skb)
{
- if (bluez_cb(skb)->fragmented)
- return skb_peek(&bluez_cb(skb)->frags);
- if (skb->next == (void *) skb->list)
- return NULL;
- return skb->next;
-}
-
-static __inline__ struct sk_buff *bluez_skb_get_frag(struct sk_buff *skb)
-{
- if (bluez_cb(skb)->fragmented)
- return __skb_dequeue(&bluez_cb(skb)->frags);
- return NULL;
-}
-
-static __inline__ void bluez_skb_free(struct sk_buff *skb)
-{
- if (bluez_cb(skb)->fragmented)
- __skb_queue_purge(&bluez_cb(skb)->frags);
- kfree_skb(skb);
-}
-
-static __inline__ void bluez_skb_queue_purge(struct sk_buff_head *q)
-{
- struct sk_buff *skb;
+ register struct sk_buff *frag = skb_shinfo(skb)->frag_list;
+ register int n = 1;
- while((skb = skb_dequeue(q)))
- bluez_skb_free(skb);
+ for (; frag; frag=frag->next, n++);
+ return n;
}
extern int hci_core_init(void);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)