diff options
| author | Marcel Holtmann <marcel@holtmann.org> | 2005-03-18 17:10:40 +0100 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2005-03-18 17:10:40 +0100 |
| commit | ffb8a3cdfdd8be6a5870843361dae256db0c7f46 (patch) | |
| tree | 2546f5f6464d204fc9b757d17d17b46e93e4a8c7 /include/net | |
| parent | b924054c151ac0055973eab9e12d0a63ff845690 (diff) | |
[Bluetooth] Kill bt_sock_alloc() and its usage
Kill bt_sock_alloc() function and make the derived socks have
a struct bt_sock as its first member, so that the _pi() functions
can just cast the struct sock pointer to its respective types,
taking advantage of the fact that sk_alloc() now use kmalloc()
when no slab is passed.
This is another step, close to the final one, to kill sk_protinfo
and make further planned changes possible.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 4 | ||||
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 3 | ||||
| -rw-r--r-- | include/net/bluetooth/rfcomm.h | 3 | ||||
| -rw-r--r-- | include/net/bluetooth/sco.h | 3 |
5 files changed, 9 insertions, 5 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 02bdef01cc36..42a84c53678b 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h @@ -125,7 +125,6 @@ struct bt_sock_list { int bt_sock_register(int proto, struct net_proto_family *ops); int bt_sock_unregister(int proto); -struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio); void bt_sock_link(struct bt_sock_list *l, struct sock *s); void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 8dadaf8847e9..6d63a47c731b 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -595,8 +595,10 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data); void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); /* HCI info for socket */ -#define hci_pi(sk) ((struct hci_pinfo *)sk->sk_protinfo) +#define hci_pi(sk) ((struct hci_pinfo *) sk) + struct hci_pinfo { + struct bt_sock bt; struct hci_dev *hdev; struct hci_filter filter; __u32 cmsg_mask; diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 490a65609560..8242a0ee1f58 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h @@ -201,9 +201,10 @@ struct l2cap_conn { }; /* ----- L2CAP channel and socket info ----- */ -#define l2cap_pi(sk) ((struct l2cap_pinfo *)sk->sk_protinfo) +#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) struct l2cap_pinfo { + struct bt_sock bt; __u16 psm; __u16 dcid; __u16 scid; diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 31a70cee9c04..13669bad00b3 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h @@ -293,9 +293,10 @@ struct rfcomm_conninfo { #define RFCOMM_LM_RELIABLE 0x0010 #define RFCOMM_LM_SECURE 0x0020 -#define rfcomm_pi(sk) ((struct rfcomm_pinfo *)sk->sk_protinfo) +#define rfcomm_pi(sk) ((struct rfcomm_pinfo *) sk) struct rfcomm_pinfo { + struct bt_sock bt; struct rfcomm_dlc *dlc; u8 channel; u32 link_mode; diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h index bcd66c3feb1c..e28a2a771471 100644 --- a/include/net/bluetooth/sco.h +++ b/include/net/bluetooth/sco.h @@ -68,9 +68,10 @@ struct sco_conn { #define sco_conn_unlock(c) spin_unlock(&c->lock); /* ----- SCO socket info ----- */ -#define sco_pi(sk) ((struct sco_pinfo *)sk->sk_protinfo) +#define sco_pi(sk) ((struct sco_pinfo *) sk) struct sco_pinfo { + struct bt_sock bt; __u32 flags; struct sco_conn *conn; }; |
