#include <linux/in.h>
#include <linux/errno.h>
#include <linux/delay.h>
-#include <linux/lp.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_plip.h>
#include <linux/workqueue.h>
-#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/parport.h>
+#include <linux/bitops.h>
#include <net/neighbour.h>
#include <asm/system.h>
-#include <asm/bitops.h>
#include <asm/irq.h>
#include <asm/byteorder.h>
#include <asm/semaphore.h>
static int plip_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
static int plip_preempt(void *handle);
static void plip_wakeup(void *handle);
-\f
+
enum plip_connection_state {
PLIP_CN_NONE=0,
PLIP_CN_RECEIVE,
atomic_t kill_timer;
struct semaphore killed_timer_sem;
};
-\f
-inline static void enable_parport_interrupts (struct net_device *dev)
+
+static inline void enable_parport_interrupts (struct net_device *dev)
{
if (dev->irq != -1)
{
}
}
-inline static void disable_parport_interrupts (struct net_device *dev)
+static inline void disable_parport_interrupts (struct net_device *dev)
{
if (dev->irq != -1)
{
}
}
-inline static void write_data (struct net_device *dev, unsigned char data)
+static inline void write_data (struct net_device *dev, unsigned char data)
{
struct parport *port =
((struct net_local *)dev->priv)->pardev->port;
port->ops->write_data (port, data);
}
-inline static unsigned char read_status (struct net_device *dev)
+static inline unsigned char read_status (struct net_device *dev)
{
struct parport *port =
((struct net_local *)dev->priv)->pardev->port;
return port->ops->read_status (port);
}
-\f
+
/* Entry point of PLIP driver.
Probe the hardware, and register/initialize the driver.
spin_lock_init(&nl->lock);
}
-\f
+
/* Bottom half handler for the delayed request.
This routine is kicked by do_timer().
Request `plip_bh' to be invoked. */
return TIMEOUT;
}
-\f
+
static int
plip_none(struct net_device *dev, struct net_local *nl,
struct plip_local *snd, struct plip_local *rcv)
/* PLIP_RECEIVE --- receive a byte(two nibbles)
Returns OK on success, TIMEOUT on timeout */
-inline static int
+static inline int
plip_receive(unsigned short nibble_timeout, struct net_device *dev,
enum plip_nibble_state *ns_p, unsigned char *data_p)
{
* in far too many old systems not all even running Linux.
*/
-static unsigned short plip_type_trans(struct sk_buff *skb, struct net_device *dev)
+static __be16 plip_type_trans(struct sk_buff *skb, struct net_device *dev)
{
struct ethhdr *eth;
unsigned char *rawp;
skb->mac.raw=skb->data;
skb_pull(skb,dev->hard_header_len);
- eth= skb->mac.ethernet;
+ eth = eth_hdr(skb);
if(*eth->h_dest&1)
{
return htons(ETH_P_802_2);
}
-
/* PLIP_RECEIVE_PACKET --- receive a packet */
static int
plip_receive_packet(struct net_device *dev, struct net_local *nl,
/* PLIP_SEND --- send a byte (two nibbles)
Returns OK on success, TIMEOUT when timeout */
-inline static int
+static inline int
plip_send(unsigned short nibble_timeout, struct net_device *dev,
enum plip_nibble_state *ns_p, unsigned char data)
{
return OK;
}
-\f
+
/* Handle the parallel port interrupts. */
static void
plip_interrupt(int irq, void *dev_id, struct pt_regs * regs)
spin_unlock_irq(&nl->lock);
}
-\f
+
static int
plip_tx_packet(struct sk_buff *skb, struct net_device *dev)
{
plip_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct net_local *nl = netdev_priv(dev);
- struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
+ struct plipconf *pc = (struct plipconf *) &rq->ifr_ifru;
if (cmd != SIOCDEVPLIP)
return -EOPNOTSUPP;
}
return 0;
}
-\f
+
static int parport[PLIP_MAX] = { [0 ... PLIP_MAX-1] = -1 };
static int timid;
-MODULE_PARM(parport, "1-" __MODULE_STRING(PLIP_MAX) "i");
-MODULE_PARM(timid, "1i");
+module_param_array(parport, int, NULL, 0);
+module_param(timid, int, 0);
MODULE_PARM_DESC(parport, "List of parport device numbers to use by plip");
static struct net_device *dev_plip[PLIP_MAX] = { NULL, };