Commit 9fcdb63a authored by Randy Dunlap's avatar Randy Dunlap Committed by Jeff Garzik

[PATCH] use netdev_priv() in net/ intel drivers

parent a0e05a8c
...@@ -458,7 +458,7 @@ static inline int wait_cfg(struct net_device *dev, struct i596_cmd *cmd, int del ...@@ -458,7 +458,7 @@ static inline int wait_cfg(struct net_device *dev, struct i596_cmd *cmd, int del
static void i596_display_data(struct net_device *dev) static void i596_display_data(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_cmd *cmd; struct i596_cmd *cmd;
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
...@@ -528,7 +528,7 @@ static irqreturn_t i596_error(int irq, void *dev_id, struct pt_regs *regs) ...@@ -528,7 +528,7 @@ static irqreturn_t i596_error(int irq, void *dev_id, struct pt_regs *regs)
static inline void init_rx_bufs(struct net_device *dev) static inline void init_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
int i; int i;
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
...@@ -579,7 +579,7 @@ static inline void init_rx_bufs(struct net_device *dev) ...@@ -579,7 +579,7 @@ static inline void init_rx_bufs(struct net_device *dev)
static inline void remove_rx_bufs(struct net_device *dev) static inline void remove_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_rbd *rbd; struct i596_rbd *rbd;
int i; int i;
...@@ -593,7 +593,7 @@ static inline void remove_rx_bufs(struct net_device *dev) ...@@ -593,7 +593,7 @@ static inline void remove_rx_bufs(struct net_device *dev)
static void rebuild_rx_bufs(struct net_device *dev) static void rebuild_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int i; int i;
/* Ensure rx frame/buffer descriptors are tidy */ /* Ensure rx frame/buffer descriptors are tidy */
...@@ -612,7 +612,7 @@ static void rebuild_rx_bufs(struct net_device *dev) ...@@ -612,7 +612,7 @@ static void rebuild_rx_bufs(struct net_device *dev)
static int init_i596_mem(struct net_device *dev) static int init_i596_mem(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
#if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET) #if !defined(ENABLE_MVME16x_NET) && !defined(ENABLE_BVME6000_NET)
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
#endif #endif
...@@ -765,7 +765,7 @@ static int init_i596_mem(struct net_device *dev) ...@@ -765,7 +765,7 @@ static int init_i596_mem(struct net_device *dev)
static inline int i596_rx(struct net_device *dev) static inline int i596_rx(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
int frames = 0; int frames = 0;
...@@ -960,7 +960,7 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp, i ...@@ -960,7 +960,7 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp, i
static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
unsigned long flags; unsigned long flags;
...@@ -1030,7 +1030,7 @@ static int i596_open(struct net_device *dev) ...@@ -1030,7 +1030,7 @@ static int i596_open(struct net_device *dev)
static void i596_tx_timeout (struct net_device *dev) static void i596_tx_timeout (struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
/* Transmitter timeout, serious problems. */ /* Transmitter timeout, serious problems. */
...@@ -1059,7 +1059,7 @@ static void i596_tx_timeout (struct net_device *dev) ...@@ -1059,7 +1059,7 @@ static void i596_tx_timeout (struct net_device *dev)
static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
struct tx_cmd *tx_cmd; struct tx_cmd *tx_cmd;
struct i596_tbd *tbd; struct i596_tbd *tbd;
short length = skb->len; short length = skb->len;
...@@ -1245,7 +1245,7 @@ struct net_device * __init i82596_probe(int unit) ...@@ -1245,7 +1245,7 @@ struct net_device * __init i82596_probe(int unit)
dev->priv = (void *)(dev->mem_start); dev->priv = (void *)(dev->mem_start);
lp = (struct i596_private *) dev->priv; lp = netdev_priv(dev);
DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n", DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n",
dev->name, (unsigned long)lp, dev->name, (unsigned long)lp,
sizeof(struct i596_private), (unsigned long)&lp->scb)); sizeof(struct i596_private), (unsigned long)&lp->scb));
...@@ -1305,7 +1305,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1305,7 +1305,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
} }
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
lp = (struct i596_private *) dev->priv; lp = netdev_priv(dev);
spin_lock (&lp->lock); spin_lock (&lp->lock);
...@@ -1448,7 +1448,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1448,7 +1448,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static int i596_close(struct net_device *dev) static int i596_close(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1495,7 +1495,7 @@ static int i596_close(struct net_device *dev) ...@@ -1495,7 +1495,7 @@ static int i596_close(struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
i596_get_stats(struct net_device *dev) i596_get_stats(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
return &lp->stats; return &lp->stats;
} }
...@@ -1506,7 +1506,7 @@ static struct net_device_stats * ...@@ -1506,7 +1506,7 @@ static struct net_device_stats *
static void set_multicast_list(struct net_device *dev) static void set_multicast_list(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int config = 0, cnt; int config = 0, cnt;
DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n", DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
......
...@@ -662,7 +662,7 @@ static void eepro_recalc (struct net_device *dev) ...@@ -662,7 +662,7 @@ static void eepro_recalc (struct net_device *dev)
{ {
struct eepro_local * lp; struct eepro_local * lp;
lp = dev->priv; lp = netdev_priv(dev);
lp->xmt_ram = RAM_SIZE - lp->rcv_ram; lp->xmt_ram = RAM_SIZE - lp->rcv_ram;
if (lp->eepro == LAN595FX_10ISA) { if (lp->eepro == LAN595FX_10ISA) {
...@@ -682,7 +682,7 @@ static void eepro_recalc (struct net_device *dev) ...@@ -682,7 +682,7 @@ static void eepro_recalc (struct net_device *dev)
/* prints boot-time info */ /* prints boot-time info */
static void __init eepro_print_info (struct net_device *dev) static void __init eepro_print_info (struct net_device *dev)
{ {
struct eepro_local * lp = dev->priv; struct eepro_local * lp = netdev_priv(dev);
int i; int i;
const char * ifmap[] = {"AUI", "10Base2", "10BaseT"}; const char * ifmap[] = {"AUI", "10Base2", "10BaseT"};
...@@ -769,7 +769,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe) ...@@ -769,7 +769,7 @@ static int __init eepro_probe1(struct net_device *dev, int autoprobe)
if ((inb(ioaddr + ID_REG) & R_ROBIN_BITS) != (counter + 0x40)) if ((inb(ioaddr + ID_REG) & R_ROBIN_BITS) != (counter + 0x40))
goto exit; goto exit;
lp = (struct eepro_local *)dev->priv; lp = netdev_priv(dev);
memset(lp, 0, sizeof(struct eepro_local)); memset(lp, 0, sizeof(struct eepro_local));
lp->xmt_bar = XMT_BAR_PRO; lp->xmt_bar = XMT_BAR_PRO;
lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_PRO; lp->xmt_lower_limit_reg = XMT_LOWER_LIMIT_REG_PRO;
...@@ -932,7 +932,7 @@ static int eepro_open(struct net_device *dev) ...@@ -932,7 +932,7 @@ static int eepro_open(struct net_device *dev)
unsigned short temp_reg, old8, old9; unsigned short temp_reg, old8, old9;
int irqMask; int irqMask;
int i, ioaddr = dev->base_addr; int i, ioaddr = dev->base_addr;
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
if (net_debug > 3) if (net_debug > 3)
printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name);
...@@ -1106,7 +1106,7 @@ static int eepro_open(struct net_device *dev) ...@@ -1106,7 +1106,7 @@ static int eepro_open(struct net_device *dev)
static void eepro_tx_timeout (struct net_device *dev) static void eepro_tx_timeout (struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *) dev->priv; struct eepro_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
/* if (net_debug > 1) */ /* if (net_debug > 1) */
...@@ -1122,7 +1122,7 @@ static void eepro_tx_timeout (struct net_device *dev) ...@@ -1122,7 +1122,7 @@ static void eepro_tx_timeout (struct net_device *dev)
static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev) static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
short length = skb->len; short length = skb->len;
...@@ -1187,7 +1187,7 @@ eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -1187,7 +1187,7 @@ eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs)
return IRQ_NONE; return IRQ_NONE;
} }
lp = (struct eepro_local *)dev->priv; lp = netdev_priv(dev);
spin_lock(&lp->lock); spin_lock(&lp->lock);
...@@ -1235,7 +1235,7 @@ eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -1235,7 +1235,7 @@ eepro_interrupt(int irq, void *dev_id, struct pt_regs * regs)
static int eepro_close(struct net_device *dev) static int eepro_close(struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr; int ioaddr = dev->base_addr;
short temp_reg; short temp_reg;
...@@ -1280,7 +1280,7 @@ static int eepro_close(struct net_device *dev) ...@@ -1280,7 +1280,7 @@ static int eepro_close(struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
eepro_get_stats(struct net_device *dev) eepro_get_stats(struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
return &lp->stats; return &lp->stats;
} }
...@@ -1290,7 +1290,7 @@ eepro_get_stats(struct net_device *dev) ...@@ -1290,7 +1290,7 @@ eepro_get_stats(struct net_device *dev)
static void static void
set_multicast_list(struct net_device *dev) set_multicast_list(struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
unsigned short mode; unsigned short mode;
struct dev_mc_list *dmi=dev->mc_list; struct dev_mc_list *dmi=dev->mc_list;
...@@ -1424,7 +1424,7 @@ read_eeprom(int ioaddr, int location, struct net_device *dev) ...@@ -1424,7 +1424,7 @@ read_eeprom(int ioaddr, int location, struct net_device *dev)
{ {
int i; int i;
unsigned short retval = 0; unsigned short retval = 0;
struct eepro_local *lp = dev->priv; struct eepro_local *lp = netdev_priv(dev);
short ee_addr = ioaddr + lp->eeprom_reg; short ee_addr = ioaddr + lp->eeprom_reg;
int read_cmd = location | EE_READ_CMD; int read_cmd = location | EE_READ_CMD;
short ctrl_val = EECS ; short ctrl_val = EECS ;
...@@ -1468,7 +1468,7 @@ read_eeprom(int ioaddr, int location, struct net_device *dev) ...@@ -1468,7 +1468,7 @@ read_eeprom(int ioaddr, int location, struct net_device *dev)
static int static int
hardware_send_packet(struct net_device *dev, void *buf, short length) hardware_send_packet(struct net_device *dev, void *buf, short length)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
unsigned status, tx_available, last, end; unsigned status, tx_available, last, end;
...@@ -1553,7 +1553,7 @@ hardware_send_packet(struct net_device *dev, void *buf, short length) ...@@ -1553,7 +1553,7 @@ hardware_send_packet(struct net_device *dev, void *buf, short length)
static void static void
eepro_rx(struct net_device *dev) eepro_rx(struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
short boguscount = 20; short boguscount = 20;
short rcv_car = lp->rx_start; short rcv_car = lp->rx_start;
...@@ -1651,7 +1651,7 @@ eepro_rx(struct net_device *dev) ...@@ -1651,7 +1651,7 @@ eepro_rx(struct net_device *dev)
static void static void
eepro_transmit_interrupt(struct net_device *dev) eepro_transmit_interrupt(struct net_device *dev)
{ {
struct eepro_local *lp = (struct eepro_local *)dev->priv; struct eepro_local *lp = netdev_priv(dev);
short ioaddr = dev->base_addr; short ioaddr = dev->base_addr;
short boguscount = 25; short boguscount = 25;
short xmt_status; short xmt_status;
......
...@@ -839,7 +839,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev, ...@@ -839,7 +839,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
dev->irq = pdev->irq; dev->irq = pdev->irq;
sp = dev->priv; sp = netdev_priv(dev);
sp->pdev = pdev; sp->pdev = pdev;
sp->msg_enable = DEBUG; sp->msg_enable = DEBUG;
sp->acpi_pwr = acpi_idle_state; sp->acpi_pwr = acpi_idle_state;
...@@ -995,7 +995,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val ...@@ -995,7 +995,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
static int static int
speedo_open(struct net_device *dev) speedo_open(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int retval; int retval;
...@@ -1082,7 +1082,7 @@ speedo_open(struct net_device *dev) ...@@ -1082,7 +1082,7 @@ speedo_open(struct net_device *dev)
/* Start the chip hardware after a full reset. */ /* Start the chip hardware after a full reset. */
static void speedo_resume(struct net_device *dev) static void speedo_resume(struct net_device *dev)
{ {
struct speedo_private *sp = dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
/* Start with a Tx threshold of 256 (0x..20.... 8 byte units). */ /* Start with a Tx threshold of 256 (0x..20.... 8 byte units). */
...@@ -1162,7 +1162,7 @@ static void speedo_resume(struct net_device *dev) ...@@ -1162,7 +1162,7 @@ static void speedo_resume(struct net_device *dev)
static void static void
speedo_rx_soft_reset(struct net_device *dev) speedo_rx_soft_reset(struct net_device *dev)
{ {
struct speedo_private *sp = dev->priv; struct speedo_private *sp = netdev_priv(dev);
struct RxFD *rfd; struct RxFD *rfd;
long ioaddr; long ioaddr;
...@@ -1194,7 +1194,7 @@ speedo_rx_soft_reset(struct net_device *dev) ...@@ -1194,7 +1194,7 @@ speedo_rx_soft_reset(struct net_device *dev)
static void speedo_timer(unsigned long data) static void speedo_timer(unsigned long data)
{ {
struct net_device *dev = (struct net_device *)data; struct net_device *dev = (struct net_device *)data;
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int phy_num = sp->phy[0] & 0x1f; int phy_num = sp->phy[0] & 0x1f;
...@@ -1239,7 +1239,7 @@ static void speedo_timer(unsigned long data) ...@@ -1239,7 +1239,7 @@ static void speedo_timer(unsigned long data)
static void speedo_show_state(struct net_device *dev) static void speedo_show_state(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
int i; int i;
if (netif_msg_pktdata(sp)) { if (netif_msg_pktdata(sp)) {
...@@ -1282,7 +1282,7 @@ static void speedo_show_state(struct net_device *dev) ...@@ -1282,7 +1282,7 @@ static void speedo_show_state(struct net_device *dev)
static void static void
speedo_init_rx_ring(struct net_device *dev) speedo_init_rx_ring(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
struct RxFD *rxf, *last_rxf = NULL; struct RxFD *rxf, *last_rxf = NULL;
dma_addr_t last_rxf_dma = 0 /* to shut up the compiler */; dma_addr_t last_rxf_dma = 0 /* to shut up the compiler */;
int i; int i;
...@@ -1330,7 +1330,7 @@ speedo_init_rx_ring(struct net_device *dev) ...@@ -1330,7 +1330,7 @@ speedo_init_rx_ring(struct net_device *dev)
static void speedo_purge_tx(struct net_device *dev) static void speedo_purge_tx(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
int entry; int entry;
while ((int)(sp->cur_tx - sp->dirty_tx) > 0) { while ((int)(sp->cur_tx - sp->dirty_tx) > 0) {
...@@ -1362,7 +1362,7 @@ static void speedo_purge_tx(struct net_device *dev) ...@@ -1362,7 +1362,7 @@ static void speedo_purge_tx(struct net_device *dev)
static void reset_mii(struct net_device *dev) static void reset_mii(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
/* Reset the MII transceiver, suggested by Fred Young @ scalable.com. */ /* Reset the MII transceiver, suggested by Fred Young @ scalable.com. */
if ((sp->phy[0] & 0x8000) == 0) { if ((sp->phy[0] & 0x8000) == 0) {
...@@ -1385,7 +1385,7 @@ static void reset_mii(struct net_device *dev) ...@@ -1385,7 +1385,7 @@ static void reset_mii(struct net_device *dev)
static void speedo_tx_timeout(struct net_device *dev) static void speedo_tx_timeout(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int status = inw(ioaddr + SCBStatus); int status = inw(ioaddr + SCBStatus);
unsigned long flags; unsigned long flags;
...@@ -1447,7 +1447,7 @@ static void speedo_tx_timeout(struct net_device *dev) ...@@ -1447,7 +1447,7 @@ static void speedo_tx_timeout(struct net_device *dev)
static int static int
speedo_start_xmit(struct sk_buff *skb, struct net_device *dev) speedo_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
int entry; int entry;
...@@ -1518,7 +1518,7 @@ speedo_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1518,7 +1518,7 @@ speedo_start_xmit(struct sk_buff *skb, struct net_device *dev)
static void speedo_tx_buffer_gc(struct net_device *dev) static void speedo_tx_buffer_gc(struct net_device *dev)
{ {
unsigned int dirty_tx; unsigned int dirty_tx;
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
dirty_tx = sp->dirty_tx; dirty_tx = sp->dirty_tx;
while ((int)(sp->cur_tx - dirty_tx) > 0) { while ((int)(sp->cur_tx - dirty_tx) > 0) {
...@@ -1585,7 +1585,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs ...@@ -1585,7 +1585,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs
unsigned int handled = 0; unsigned int handled = 0;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
sp = (struct speedo_private *)dev->priv; sp = netdev_priv(dev);
#ifndef final_version #ifndef final_version
/* A lock to prevent simultaneous entry on SMP machines. */ /* A lock to prevent simultaneous entry on SMP machines. */
...@@ -1677,7 +1677,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs ...@@ -1677,7 +1677,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs
static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry) static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
struct RxFD *rxf; struct RxFD *rxf;
struct sk_buff *skb; struct sk_buff *skb;
/* Get a fresh skbuff to replace the consumed one. */ /* Get a fresh skbuff to replace the consumed one. */
...@@ -1704,7 +1704,7 @@ static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry) ...@@ -1704,7 +1704,7 @@ static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
static inline void speedo_rx_link(struct net_device *dev, int entry, static inline void speedo_rx_link(struct net_device *dev, int entry,
struct RxFD *rxf, dma_addr_t rxf_dma) struct RxFD *rxf, dma_addr_t rxf_dma)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
rxf->status = cpu_to_le32(0xC0000001); /* '1' for driver use only. */ rxf->status = cpu_to_le32(0xC0000001); /* '1' for driver use only. */
rxf->link = 0; /* None yet. */ rxf->link = 0; /* None yet. */
rxf->count = cpu_to_le32(PKT_BUF_SZ << 16); rxf->count = cpu_to_le32(PKT_BUF_SZ << 16);
...@@ -1718,7 +1718,7 @@ static inline void speedo_rx_link(struct net_device *dev, int entry, ...@@ -1718,7 +1718,7 @@ static inline void speedo_rx_link(struct net_device *dev, int entry,
static int speedo_refill_rx_buf(struct net_device *dev, int force) static int speedo_refill_rx_buf(struct net_device *dev, int force)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
int entry; int entry;
struct RxFD *rxf; struct RxFD *rxf;
...@@ -1760,7 +1760,7 @@ static int speedo_refill_rx_buf(struct net_device *dev, int force) ...@@ -1760,7 +1760,7 @@ static int speedo_refill_rx_buf(struct net_device *dev, int force)
static void speedo_refill_rx_buffers(struct net_device *dev, int force) static void speedo_refill_rx_buffers(struct net_device *dev, int force)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
/* Refill the RX ring. */ /* Refill the RX ring. */
while ((int)(sp->cur_rx - sp->dirty_rx) > 0 && while ((int)(sp->cur_rx - sp->dirty_rx) > 0 &&
...@@ -1770,7 +1770,7 @@ static void speedo_refill_rx_buffers(struct net_device *dev, int force) ...@@ -1770,7 +1770,7 @@ static void speedo_refill_rx_buffers(struct net_device *dev, int force)
static int static int
speedo_rx(struct net_device *dev) speedo_rx(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
int entry = sp->cur_rx % RX_RING_SIZE; int entry = sp->cur_rx % RX_RING_SIZE;
int rx_work_limit = sp->dirty_rx + RX_RING_SIZE - sp->cur_rx; int rx_work_limit = sp->dirty_rx + RX_RING_SIZE - sp->cur_rx;
int alloc_ok = 1; int alloc_ok = 1;
...@@ -1884,7 +1884,7 @@ static int ...@@ -1884,7 +1884,7 @@ static int
speedo_close(struct net_device *dev) speedo_close(struct net_device *dev)
{ {
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
int i; int i;
netdevice_stop(dev); netdevice_stop(dev);
...@@ -1962,7 +1962,7 @@ speedo_close(struct net_device *dev) ...@@ -1962,7 +1962,7 @@ speedo_close(struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
speedo_get_stats(struct net_device *dev) speedo_get_stats(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
/* Update only if the previous dump finished. */ /* Update only if the previous dump finished. */
...@@ -1995,7 +1995,7 @@ speedo_get_stats(struct net_device *dev) ...@@ -1995,7 +1995,7 @@ speedo_get_stats(struct net_device *dev)
static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
{ {
u32 ethcmd; u32 ethcmd;
struct speedo_private *sp = dev->priv; struct speedo_private *sp = netdev_priv(dev);
if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd))) if (copy_from_user(&ethcmd, useraddr, sizeof(ethcmd)))
return -EFAULT; return -EFAULT;
...@@ -2070,7 +2070,7 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr) ...@@ -2070,7 +2070,7 @@ static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data; struct mii_ioctl_data *data = (struct mii_ioctl_data *)&rq->ifr_data;
int phy = sp->phy[0] & 0x1f; int phy = sp->phy[0] & 0x1f;
int saved_acpi; int saved_acpi;
...@@ -2121,7 +2121,7 @@ static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -2121,7 +2121,7 @@ static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
*/ */
static void set_rx_mode(struct net_device *dev) static void set_rx_mode(struct net_device *dev)
{ {
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
struct descriptor *last_cmd; struct descriptor *last_cmd;
char new_rx_mode; char new_rx_mode;
...@@ -2313,7 +2313,7 @@ static void set_rx_mode(struct net_device *dev) ...@@ -2313,7 +2313,7 @@ static void set_rx_mode(struct net_device *dev)
static int eepro100_suspend(struct pci_dev *pdev, u32 state) static int eepro100_suspend(struct pci_dev *pdev, u32 state)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
pci_save_state(pdev, sp->pm_state); pci_save_state(pdev, sp->pm_state);
...@@ -2333,7 +2333,7 @@ static int eepro100_suspend(struct pci_dev *pdev, u32 state) ...@@ -2333,7 +2333,7 @@ static int eepro100_suspend(struct pci_dev *pdev, u32 state)
static int eepro100_resume(struct pci_dev *pdev) static int eepro100_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
pci_restore_state(pdev, sp->pm_state); pci_restore_state(pdev, sp->pm_state);
...@@ -2363,7 +2363,7 @@ static int eepro100_resume(struct pci_dev *pdev) ...@@ -2363,7 +2363,7 @@ static int eepro100_resume(struct pci_dev *pdev)
static void __devexit eepro100_remove_one (struct pci_dev *pdev) static void __devexit eepro100_remove_one (struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata (pdev); struct net_device *dev = pci_get_drvdata (pdev);
struct speedo_private *sp = (struct speedo_private *)dev->priv; struct speedo_private *sp = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
......
...@@ -452,7 +452,7 @@ static int eexp_open(struct net_device *dev) ...@@ -452,7 +452,7 @@ static int eexp_open(struct net_device *dev)
{ {
int ret; int ret;
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
#if NET_DEBUG > 6 #if NET_DEBUG > 6
printk(KERN_DEBUG "%s: eexp_open()\n", dev->name); printk(KERN_DEBUG "%s: eexp_open()\n", dev->name);
...@@ -515,7 +515,7 @@ static int eexp_open(struct net_device *dev) ...@@ -515,7 +515,7 @@ static int eexp_open(struct net_device *dev)
static int eexp_close(struct net_device *dev) static int eexp_close(struct net_device *dev)
{ {
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
struct net_local *lp = dev->priv; struct net_local *lp = netdev_priv(dev);
int irq = dev->irq; int irq = dev->irq;
...@@ -541,7 +541,7 @@ static int eexp_close(struct net_device *dev) ...@@ -541,7 +541,7 @@ static int eexp_close(struct net_device *dev)
static struct net_device_stats *eexp_stats(struct net_device *dev) static struct net_device_stats *eexp_stats(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
return &lp->stats; return &lp->stats;
} }
...@@ -553,7 +553,7 @@ static struct net_device_stats *eexp_stats(struct net_device *dev) ...@@ -553,7 +553,7 @@ static struct net_device_stats *eexp_stats(struct net_device *dev)
static void unstick_cu(struct net_device *dev) static void unstick_cu(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
if (lp->started) if (lp->started)
...@@ -627,7 +627,7 @@ static void unstick_cu(struct net_device *dev) ...@@ -627,7 +627,7 @@ static void unstick_cu(struct net_device *dev)
static void eexp_timeout(struct net_device *dev) static void eexp_timeout(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned long flags; unsigned long flags;
#endif #endif
...@@ -667,7 +667,7 @@ static void eexp_timeout(struct net_device *dev) ...@@ -667,7 +667,7 @@ static void eexp_timeout(struct net_device *dev)
*/ */
static int eexp_xmit(struct sk_buff *buf, struct net_device *dev) static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
short length = buf->len; short length = buf->len;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned long flags; unsigned long flags;
...@@ -728,7 +728,7 @@ static unsigned short eexp_start_irq(struct net_device *dev, ...@@ -728,7 +728,7 @@ static unsigned short eexp_start_irq(struct net_device *dev,
unsigned short status) unsigned short status)
{ {
unsigned short ack_cmd = SCB_ack(status); unsigned short ack_cmd = SCB_ack(status);
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
if ((dev->flags & IFF_UP) && !(lp->started & STARTED_CU)) { if ((dev->flags & IFF_UP) && !(lp->started & STARTED_CU)) {
short diag_status, tdr_status; short diag_status, tdr_status;
...@@ -806,7 +806,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs) ...@@ -806,7 +806,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
return IRQ_NONE; return IRQ_NONE;
} }
lp = (struct net_local *)dev->priv; lp = netdev_priv(dev);
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
spin_lock(&lp->lock); spin_lock(&lp->lock);
...@@ -925,7 +925,7 @@ static void eexp_hw_set_interface(struct net_device *dev) ...@@ -925,7 +925,7 @@ static void eexp_hw_set_interface(struct net_device *dev)
static void eexp_hw_rx_pio(struct net_device *dev) static void eexp_hw_rx_pio(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short rx_block = lp->rx_ptr; unsigned short rx_block = lp->rx_ptr;
unsigned short boguscount = lp->num_rx_bufs; unsigned short boguscount = lp->num_rx_bufs;
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
...@@ -1022,7 +1022,7 @@ static void eexp_hw_rx_pio(struct net_device *dev) ...@@ -1022,7 +1022,7 @@ static void eexp_hw_rx_pio(struct net_device *dev)
static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf, static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf,
unsigned short len) unsigned short len)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
if (LOCKUP16 || lp->width) { if (LOCKUP16 || lp->width) {
...@@ -1090,7 +1090,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr) ...@@ -1090,7 +1090,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
unsigned int memory_size; unsigned int memory_size;
int i; int i;
unsigned short xsum = 0; unsigned short xsum = 0;
struct net_local *lp = dev->priv; struct net_local *lp = netdev_priv(dev);
printk("%s: EtherExpress 16 at %#x ",dev->name,ioaddr); printk("%s: EtherExpress 16 at %#x ",dev->name,ioaddr);
...@@ -1262,7 +1262,7 @@ static unsigned short __init eexp_hw_readeeprom(unsigned short ioaddr, ...@@ -1262,7 +1262,7 @@ static unsigned short __init eexp_hw_readeeprom(unsigned short ioaddr,
static unsigned short eexp_hw_lasttxstat(struct net_device *dev) static unsigned short eexp_hw_lasttxstat(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short tx_block = lp->tx_reap; unsigned short tx_block = lp->tx_reap;
unsigned short status; unsigned short status;
...@@ -1332,7 +1332,7 @@ static unsigned short eexp_hw_lasttxstat(struct net_device *dev) ...@@ -1332,7 +1332,7 @@ static unsigned short eexp_hw_lasttxstat(struct net_device *dev)
static void eexp_hw_txrestart(struct net_device *dev) static void eexp_hw_txrestart(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
lp->last_tx_restart = lp->tx_link; lp->last_tx_restart = lp->tx_link;
...@@ -1377,7 +1377,7 @@ static void eexp_hw_txrestart(struct net_device *dev) ...@@ -1377,7 +1377,7 @@ static void eexp_hw_txrestart(struct net_device *dev)
static void eexp_hw_txinit(struct net_device *dev) static void eexp_hw_txinit(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short tx_block = TX_BUF_START; unsigned short tx_block = TX_BUF_START;
unsigned short curtbuf; unsigned short curtbuf;
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
...@@ -1419,7 +1419,7 @@ static void eexp_hw_txinit(struct net_device *dev) ...@@ -1419,7 +1419,7 @@ static void eexp_hw_txinit(struct net_device *dev)
static void eexp_hw_rxinit(struct net_device *dev) static void eexp_hw_rxinit(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short rx_block = lp->rx_buf_start; unsigned short rx_block = lp->rx_buf_start;
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
...@@ -1478,7 +1478,7 @@ static void eexp_hw_rxinit(struct net_device *dev) ...@@ -1478,7 +1478,7 @@ static void eexp_hw_rxinit(struct net_device *dev)
static void eexp_hw_init586(struct net_device *dev) static void eexp_hw_init586(struct net_device *dev)
{ {
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
int i; int i;
...@@ -1639,7 +1639,7 @@ static void ...@@ -1639,7 +1639,7 @@ static void
eexp_set_multicast(struct net_device *dev) eexp_set_multicast(struct net_device *dev)
{ {
unsigned short ioaddr = dev->base_addr; unsigned short ioaddr = dev->base_addr;
struct net_local *lp = (struct net_local *)dev->priv; struct net_local *lp = netdev_priv(dev);
int kick = 0, i; int kick = 0, i;
if ((dev->flags & IFF_PROMISC) != lp->was_promisc) { if ((dev->flags & IFF_PROMISC) != lp->was_promisc) {
outw(CONF_PROMISC & ~31, ioaddr+SM_PTR); outw(CONF_PROMISC & ~31, ioaddr+SM_PTR);
......
...@@ -426,7 +426,7 @@ static inline void CA(struct net_device *dev) ...@@ -426,7 +426,7 @@ static inline void CA(struct net_device *dev)
static inline void MPU_PORT(struct net_device *dev, int c, dma_addr_t x) static inline void MPU_PORT(struct net_device *dev, int c, dma_addr_t x)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
u32 v = (u32) (c) | (u32) (x); u32 v = (u32) (c) | (u32) (x);
u16 a, b; u16 a, b;
...@@ -481,7 +481,7 @@ static inline int wait_cmd(struct net_device *dev, struct i596_private *lp, int ...@@ -481,7 +481,7 @@ static inline int wait_cmd(struct net_device *dev, struct i596_private *lp, int
static void i596_display_data(struct net_device *dev) static void i596_display_data(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_cmd *cmd; struct i596_cmd *cmd;
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
...@@ -541,7 +541,7 @@ static void i596_error(int irq, void *dev_id, struct pt_regs *regs) ...@@ -541,7 +541,7 @@ static void i596_error(int irq, void *dev_id, struct pt_regs *regs)
static inline void init_rx_bufs(struct net_device *dev) static inline void init_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
int i; int i;
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
...@@ -595,7 +595,7 @@ static inline void init_rx_bufs(struct net_device *dev) ...@@ -595,7 +595,7 @@ static inline void init_rx_bufs(struct net_device *dev)
static inline void remove_rx_bufs(struct net_device *dev) static inline void remove_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_rbd *rbd; struct i596_rbd *rbd;
int i; int i;
...@@ -612,7 +612,7 @@ static inline void remove_rx_bufs(struct net_device *dev) ...@@ -612,7 +612,7 @@ static inline void remove_rx_bufs(struct net_device *dev)
static void rebuild_rx_bufs(struct net_device *dev) static void rebuild_rx_bufs(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int i; int i;
/* Ensure rx frame/buffer descriptors are tidy */ /* Ensure rx frame/buffer descriptors are tidy */
...@@ -633,7 +633,7 @@ static void rebuild_rx_bufs(struct net_device *dev) ...@@ -633,7 +633,7 @@ static void rebuild_rx_bufs(struct net_device *dev)
static int init_i596_mem(struct net_device *dev) static int init_i596_mem(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
disable_irq(dev->irq); /* disable IRQs from LAN */ disable_irq(dev->irq); /* disable IRQs from LAN */
...@@ -727,7 +727,7 @@ static int init_i596_mem(struct net_device *dev) ...@@ -727,7 +727,7 @@ static int init_i596_mem(struct net_device *dev)
static inline int i596_rx(struct net_device *dev) static inline int i596_rx(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *)dev->priv; struct i596_private *lp = netdev_priv(dev);
struct i596_rfd *rfd; struct i596_rfd *rfd;
struct i596_rbd *rbd; struct i596_rbd *rbd;
int frames = 0; int frames = 0;
...@@ -939,7 +939,7 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp) ...@@ -939,7 +939,7 @@ static inline void i596_reset(struct net_device *dev, struct i596_private *lp)
static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
DEB(DEB_ADDCMD,printk("i596_add_cmd cmd_head %p\n", lp->cmd_head)); DEB(DEB_ADDCMD,printk("i596_add_cmd cmd_head %p\n", lp->cmd_head));
...@@ -987,7 +987,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) ...@@ -987,7 +987,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd)
device list */ device list */
static int i596_test(struct net_device *dev) static int i596_test(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
volatile int *tint; volatile int *tint;
u32 data; u32 data;
...@@ -1041,7 +1041,7 @@ static int i596_open(struct net_device *dev) ...@@ -1041,7 +1041,7 @@ static int i596_open(struct net_device *dev)
static void i596_tx_timeout (struct net_device *dev) static void i596_tx_timeout (struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
/* Transmitter timeout, serious problems. */ /* Transmitter timeout, serious problems. */
DEB(DEB_ERRORS,printk("%s: transmit timed out, status resetting.\n", DEB(DEB_ERRORS,printk("%s: transmit timed out, status resetting.\n",
...@@ -1070,7 +1070,7 @@ static void i596_tx_timeout (struct net_device *dev) ...@@ -1070,7 +1070,7 @@ static void i596_tx_timeout (struct net_device *dev)
static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev) static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
struct tx_cmd *tx_cmd; struct tx_cmd *tx_cmd;
struct i596_tbd *tbd; struct i596_tbd *tbd;
short length = skb->len; short length = skb->len;
...@@ -1219,7 +1219,7 @@ static int __devinit i82596_probe(struct net_device *dev, ...@@ -1219,7 +1219,7 @@ static int __devinit i82596_probe(struct net_device *dev,
dev->priv = (void *)(dev->mem_start); dev->priv = (void *)(dev->mem_start);
lp = (struct i596_private *) dev->priv; lp = netdev_priv(dev);
DEB(DEB_INIT,printk ("%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n", DEB(DEB_INIT,printk ("%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n",
dev->name, (unsigned long)lp, dev->name, (unsigned long)lp,
sizeof(struct i596_private), (unsigned long)&lp->scb)); sizeof(struct i596_private), (unsigned long)&lp->scb));
...@@ -1249,7 +1249,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1249,7 +1249,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE; return IRQ_NONE;
} }
lp = (struct i596_private *) dev->priv; lp = netdev_priv(dev);
spin_lock (&lp->lock); spin_lock (&lp->lock);
...@@ -1395,7 +1395,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1395,7 +1395,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static int i596_close(struct net_device *dev) static int i596_close(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
unsigned long flags; unsigned long flags;
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1429,7 +1429,7 @@ static int i596_close(struct net_device *dev) ...@@ -1429,7 +1429,7 @@ static int i596_close(struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
i596_get_stats(struct net_device *dev) i596_get_stats(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
return &lp->stats; return &lp->stats;
} }
...@@ -1440,7 +1440,7 @@ static struct net_device_stats * ...@@ -1440,7 +1440,7 @@ static struct net_device_stats *
static void set_multicast_list(struct net_device *dev) static void set_multicast_list(struct net_device *dev)
{ {
struct i596_private *lp = (struct i596_private *) dev->priv; struct i596_private *lp = netdev_priv(dev);
int config = 0, cnt; int config = 0, cnt;
DEB(DEB_MULTI,printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n", dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF", dev->flags & IFF_ALLMULTI ? "ON" : "OFF")); DEB(DEB_MULTI,printk("%s: set multicast list, %d entries, promisc %s, allmulti %s\n", dev->name, dev->mc_count, dev->flags & IFF_PROMISC ? "ON" : "OFF", dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
...@@ -1540,7 +1540,7 @@ lan_init_chip(struct parisc_device *dev) ...@@ -1540,7 +1540,7 @@ lan_init_chip(struct parisc_device *dev)
retval = register_netdev(netdevice); retval = register_netdev(netdevice);
if (retval) { if (retval) {
struct i596_private *lp = netdevice->priv; struct i596_private *lp = netdev_priv(netdevice);
printk(KERN_WARNING __FILE__ ": register_netdevice ret'd %d\n", retval); printk(KERN_WARNING __FILE__ ": register_netdevice ret'd %d\n", retval);
dma_free_noncoherent(lp->dev, sizeof(struct i596_private), dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
(void *)netdevice->mem_start, lp->dma_addr); (void *)netdevice->mem_start, lp->dma_addr);
...@@ -1594,7 +1594,7 @@ static void __exit lasi_82596_exit(void) ...@@ -1594,7 +1594,7 @@ static void __exit lasi_82596_exit(void)
unregister_netdev(netdevice); unregister_netdev(netdevice);
lp = (struct i596_private *) netdevice->priv; lp = netdev_priv(netdevice);
dma_free_noncoherent(lp->dev, sizeof(struct i596_private), dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
(void *)netdevice->mem_start, lp->dma_addr); (void *)netdevice->mem_start, lp->dma_addr);
free_netdev(netdevice); free_netdev(netdevice);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment