#include <linux/if_arp.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/module.h>
#include <linux/debugfs.h>
#include <net/ipv6.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/pkt_sched.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h>
#include <net/6lowpan.h>
#define VERSION …
static struct dentry *lowpan_enable_debugfs;
static struct dentry *lowpan_control_debugfs;
#define IFACE_NAME_TEMPLATE …
struct skb_cb { … };
#define lowpan_cb(skb) …
static LIST_HEAD(bt_6lowpan_devices);
static DEFINE_SPINLOCK(devices_lock);
static bool enable_6lowpan;
static struct l2cap_chan *listen_chan;
static DEFINE_MUTEX(set_lock);
struct lowpan_peer { … };
struct lowpan_btle_dev { … };
static inline struct lowpan_btle_dev *
lowpan_btle_dev(const struct net_device *netdev)
{ … }
static inline void peer_add(struct lowpan_btle_dev *dev,
struct lowpan_peer *peer)
{ … }
static inline bool peer_del(struct lowpan_btle_dev *dev,
struct lowpan_peer *peer)
{ … }
static inline struct lowpan_peer *
__peer_lookup_chan(struct lowpan_btle_dev *dev, struct l2cap_chan *chan)
{ … }
static inline struct lowpan_peer *
__peer_lookup_conn(struct lowpan_btle_dev *dev, struct l2cap_conn *conn)
{ … }
static inline struct lowpan_peer *peer_lookup_dst(struct lowpan_btle_dev *dev,
struct in6_addr *daddr,
struct sk_buff *skb)
{ … }
static struct lowpan_peer *lookup_peer(struct l2cap_conn *conn)
{ … }
static struct lowpan_btle_dev *lookup_dev(struct l2cap_conn *conn)
{ … }
static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
{ … }
static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev,
struct lowpan_peer *peer)
{ … }
static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
struct lowpan_peer *peer)
{ … }
static int chan_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb)
{ … }
static int setup_header(struct sk_buff *skb, struct net_device *netdev,
bdaddr_t *peer_addr, u8 *peer_addr_type)
{ … }
static int header_create(struct sk_buff *skb, struct net_device *netdev,
unsigned short type, const void *_daddr,
const void *_saddr, unsigned int len)
{ … }
static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb,
struct net_device *netdev)
{ … }
static int send_mcast_pkt(struct sk_buff *skb, struct net_device *netdev)
{ … }
static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
{ … }
static int bt_dev_init(struct net_device *dev)
{ … }
static const struct net_device_ops netdev_ops = …;
static const struct header_ops header_ops = …;
static void netdev_setup(struct net_device *dev)
{ … }
static const struct device_type bt_type = …;
static void ifup(struct net_device *netdev)
{ … }
static void ifdown(struct net_device *netdev)
{ … }
static void do_notify_peers(struct work_struct *work)
{ … }
static bool is_bt_6lowpan(struct hci_conn *hcon)
{ … }
static struct l2cap_chan *chan_create(void)
{ … }
static struct l2cap_chan *add_peer_chan(struct l2cap_chan *chan,
struct lowpan_btle_dev *dev,
bool new_netdev)
{ … }
static int setup_netdev(struct l2cap_chan *chan, struct lowpan_btle_dev **dev)
{ … }
static inline void chan_ready_cb(struct l2cap_chan *chan)
{ … }
static inline struct l2cap_chan *chan_new_conn_cb(struct l2cap_chan *pchan)
{ … }
static void delete_netdev(struct work_struct *work)
{ … }
static void chan_close_cb(struct l2cap_chan *chan)
{ … }
static void chan_state_change_cb(struct l2cap_chan *chan, int state, int err)
{ … }
static struct sk_buff *chan_alloc_skb_cb(struct l2cap_chan *chan,
unsigned long hdr_len,
unsigned long len, int nb)
{ … }
static void chan_suspend_cb(struct l2cap_chan *chan)
{ … }
static void chan_resume_cb(struct l2cap_chan *chan)
{ … }
static long chan_get_sndtimeo_cb(struct l2cap_chan *chan)
{ … }
static const struct l2cap_ops bt_6lowpan_chan_ops = …;
static int bt_6lowpan_connect(bdaddr_t *addr, u8 dst_type)
{ … }
static int bt_6lowpan_disconnect(struct l2cap_conn *conn, u8 dst_type)
{ … }
static struct l2cap_chan *bt_6lowpan_listen(void)
{ … }
static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type,
struct l2cap_conn **conn)
{ … }
static void disconnect_all_peers(void)
{ … }
struct set_enable { … };
static void do_enable_set(struct work_struct *work)
{ … }
static int lowpan_enable_set(void *data, u64 val)
{ … }
static int lowpan_enable_get(void *data, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static ssize_t lowpan_control_write(struct file *fp,
const char __user *user_buffer,
size_t count,
loff_t *position)
{ … }
static int lowpan_control_show(struct seq_file *f, void *ptr)
{ … }
static int lowpan_control_open(struct inode *inode, struct file *file)
{ … }
static const struct file_operations lowpan_control_fops = …;
static void disconnect_devices(void)
{ … }
static int device_event(struct notifier_block *unused,
unsigned long event, void *ptr)
{ … }
static struct notifier_block bt_6lowpan_dev_notifier = …;
static int __init bt_6lowpan_init(void)
{ … }
static void __exit bt_6lowpan_exit(void)
{ … }
module_init(…) …;
module_exit(bt_6lowpan_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;