#define CISCO_ADDR_REPLY 1 /* Cisco address reply */
#define CISCO_KEEPALIVE_REQ 2 /* Cisco keepalive request */
-
struct hdlc_header {
u8 address;
u8 control;
__be16 protocol;
}__packed;
-
struct cisco_packet {
__be32 type; /* code */
__be32 par1;
#define CISCO_PACKET_LEN 18
#define CISCO_BIG_PACKET_LEN 20
-
struct cisco_state {
cisco_proto settings;
u32 rxseq; /* RX sequence number */
};
-
static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr);
-
static inline struct cisco_state* state(hdlc_device *hdlc)
{
return (struct cisco_state *)hdlc->state;
}
-
static int cisco_hard_header(struct sk_buff *skb, struct net_device *dev,
u16 type, const void *daddr, const void *saddr,
unsigned int len)
return sizeof(struct hdlc_header);
}
-
-
static void cisco_keepalive_send(struct net_device *dev, u32 type,
__be32 par1, __be32 par2)
{
dev_queue_xmit(skb);
}
-
-
static __be16 cisco_type_trans(struct sk_buff *skb, struct net_device *dev)
{
struct hdlc_header *data = (struct hdlc_header*)skb->data;
}
}
-
static int cisco_rx(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
return NET_RX_DROP;
}
-
-
static void cisco_timer(struct timer_list *t)
{
struct cisco_state *st = from_timer(st, t, timer);
add_timer(&st->timer);
}
-
-
static void cisco_start(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
add_timer(&st->timer);
}
-
-
static void cisco_stop(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
spin_unlock_irqrestore(&st->lock, flags);
}
-
static struct hdlc_proto proto = {
.start = cisco_start,
.stop = cisco_stop,
return -EINVAL;
}
-
static int __init mod_init(void)
{
register_hdlc_protocol(&proto);
return 0;
}
-
-
static void __exit mod_exit(void)
{
unregister_hdlc_protocol(&proto);
}
-
module_init(mod_init);
module_exit(mod_exit);