static const char version[] = …;
#include <linux/compat.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/if_ether.h>
#include <linux/in.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/inetdevice.h>
#include <linux/skbuff.h>
#include <linux/if_plip.h>
#include <linux/workqueue.h>
#include <linux/spinlock.h>
#include <linux/completion.h>
#include <linux/parport.h>
#include <linux/bitops.h>
#include <net/neighbour.h>
#include <asm/irq.h>
#include <asm/byteorder.h>
#define PLIP_MAX …
#ifndef NET_DEBUG
#define NET_DEBUG …
#endif
static const unsigned int net_debug = …;
#define ENABLE(irq) …
#define DISABLE(irq) …
#define PLIP_DELAY_UNIT …
#define PLIP_TRIGGER_WAIT …
#define PLIP_NIBBLE_WAIT …
static void plip_kick_bh(struct work_struct *work);
static void plip_bh(struct work_struct *work);
static void plip_timer_bh(struct work_struct *work);
static void plip_interrupt(void *dev_id);
static netdev_tx_t plip_tx_packet(struct sk_buff *skb, struct net_device *dev);
static int plip_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len);
static int plip_hard_header_cache(const struct neighbour *neigh,
struct hh_cache *hh, __be16 type);
static int plip_open(struct net_device *dev);
static int plip_close(struct net_device *dev);
static int plip_siocdevprivate(struct net_device *dev, struct ifreq *ifr,
void __user *data, int cmd);
static int plip_preempt(void *handle);
static void plip_wakeup(void *handle);
enum plip_connection_state { … };
enum plip_packet_state { … };
enum plip_nibble_state { … };
struct plip_local { … };
struct net_local { … };
static inline void enable_parport_interrupts (struct net_device *dev)
{ … }
static inline void disable_parport_interrupts (struct net_device *dev)
{ … }
static inline void write_data (struct net_device *dev, unsigned char data)
{ … }
static inline unsigned char read_status (struct net_device *dev)
{ … }
static const struct header_ops plip_header_ops = …;
static const struct net_device_ops plip_netdev_ops = …;
static void
plip_init_netdev(struct net_device *dev)
{ … }
static void
plip_kick_bh(struct work_struct *work)
{ … }
static int plip_none(struct net_device *, struct net_local *,
struct plip_local *, struct plip_local *);
static int plip_receive_packet(struct net_device *, struct net_local *,
struct plip_local *, struct plip_local *);
static int plip_send_packet(struct net_device *, struct net_local *,
struct plip_local *, struct plip_local *);
static int plip_connection_close(struct net_device *, struct net_local *,
struct plip_local *, struct plip_local *);
static int plip_error(struct net_device *, struct net_local *,
struct plip_local *, struct plip_local *);
static int plip_bh_timeout_error(struct net_device *dev, struct net_local *nl,
struct plip_local *snd,
struct plip_local *rcv,
int error);
#define OK …
#define TIMEOUT …
#define ERROR …
#define HS_TIMEOUT …
plip_func;
static const plip_func connection_state_table[] = …;
static void
plip_bh(struct work_struct *work)
{ … }
static void
plip_timer_bh(struct work_struct *work)
{ … }
static int
plip_bh_timeout_error(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv,
int error)
{ … }
static int
plip_none(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
{ … }
static inline int
plip_receive(unsigned short nibble_timeout, struct net_device *dev,
enum plip_nibble_state *ns_p, unsigned char *data_p)
{ … }
static __be16 plip_type_trans(struct sk_buff *skb, struct net_device *dev)
{ … }
static int
plip_receive_packet(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
{ … }
static inline int
plip_send(unsigned short nibble_timeout, struct net_device *dev,
enum plip_nibble_state *ns_p, unsigned char data)
{ … }
static int
plip_send_packet(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
{ … }
static int
plip_connection_close(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
{ … }
static int
plip_error(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
{ … }
static void
plip_interrupt(void *dev_id)
{ … }
static netdev_tx_t
plip_tx_packet(struct sk_buff *skb, struct net_device *dev)
{ … }
static void
plip_rewrite_address(const struct net_device *dev, struct ethhdr *eth)
{ … }
static int
plip_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len)
{ … }
static int plip_hard_header_cache(const struct neighbour *neigh,
struct hh_cache *hh, __be16 type)
{ … }
static int
plip_open(struct net_device *dev)
{ … }
static int
plip_close(struct net_device *dev)
{ … }
static int
plip_preempt(void *handle)
{ … }
static void
plip_wakeup(void *handle)
{ … }
static int
plip_siocdevprivate(struct net_device *dev, struct ifreq *rq,
void __user *data, int cmd)
{ … }
static int parport[PLIP_MAX] = …;
static int timid;
module_param_array(…);
module_param(timid, int, 0);
MODULE_PARM_DESC(…) …;
static struct net_device *dev_plip[PLIP_MAX] = …;
static inline int
plip_searchfor(int list[], int a)
{ … }
static void plip_attach (struct parport *port)
{ … }
static void plip_detach (struct parport *port)
{ … }
static int plip_probe(struct pardevice *par_dev)
{ … }
static struct parport_driver plip_driver = …;
static void __exit plip_cleanup_module (void)
{ … }
#ifndef MODULE
static int parport_ptr;
static int __init plip_setup(char *str)
{ … }
__setup(…);
#endif
static int __init plip_init (void)
{ … }
module_init(…) …;
module_exit(plip_cleanup_module);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;