Commit 49b7b788 authored by Randy Dunlap's avatar Randy Dunlap Committed by Jeff Garzik

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

parent 1ef020bf
...@@ -154,7 +154,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ ...@@ -154,7 +154,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
printk(":%2.2x", dev->dev_addr[i]); printk(":%2.2x", dev->dev_addr[i]);
printk("\n"); printk("\n");
tp = dev->priv; tp = netdev_priv(dev);
tp->setnselout = abyss_setnselout_pins; tp->setnselout = abyss_setnselout_pins;
tp->sifreadb = abyss_sifreadb; tp->sifreadb = abyss_sifreadb;
tp->sifreadw = abyss_sifreadw; tp->sifreadw = abyss_sifreadw;
...@@ -188,7 +188,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_ ...@@ -188,7 +188,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
static unsigned short abyss_setnselout_pins(struct net_device *dev) static unsigned short abyss_setnselout_pins(struct net_device *dev)
{ {
unsigned short val = 0; unsigned short val = 0;
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
if(tp->DataRate == SPEED_4) if(tp->DataRate == SPEED_4)
val |= 0x01; /* Set 4Mbps */ val |= 0x01; /* Set 4Mbps */
...@@ -398,7 +398,7 @@ static void abyss_read_eeprom(struct net_device *dev) ...@@ -398,7 +398,7 @@ static void abyss_read_eeprom(struct net_device *dev)
unsigned short val; unsigned short val;
int i; int i;
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
/* Must enable glue chip first */ /* Must enable glue chip first */
......
...@@ -365,7 +365,7 @@ static int __init madgemc_probe(void) ...@@ -365,7 +365,7 @@ static int __init madgemc_probe(void)
return 0; return 0;
return -1; return -1;
} }
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
/* /*
* The MC16 is physically a 32bit card. However, Madge * The MC16 is physically a 32bit card. However, Madge
...@@ -504,7 +504,7 @@ static irqreturn_t madgemc_interrupt(int irq, void *dev_id, struct pt_regs *regs ...@@ -504,7 +504,7 @@ static irqreturn_t madgemc_interrupt(int irq, void *dev_id, struct pt_regs *regs
unsigned short madgemc_setnselout_pins(struct net_device *dev) unsigned short madgemc_setnselout_pins(struct net_device *dev)
{ {
unsigned char reg1; unsigned char reg1;
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
reg1 = inb(dev->base_addr + MC_CONTROL_REG1); reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
...@@ -731,7 +731,7 @@ static int madgemc_mcaproc(char *buf, int slot, void *d) ...@@ -731,7 +731,7 @@ static int madgemc_mcaproc(char *buf, int slot, void *d)
} }
len += sprintf(buf+len, "-------\n"); len += sprintf(buf+len, "-------\n");
if (curcard) { if (curcard) {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
int i; int i;
len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev); len += sprintf(buf+len, "Card Revision: %d\n", curcard->cardrev);
......
...@@ -158,7 +158,7 @@ static int __init setup_card(struct net_device *dev) ...@@ -158,7 +158,7 @@ static int __init setup_card(struct net_device *dev)
printk(":%2.2x", dev->dev_addr[j]); printk(":%2.2x", dev->dev_addr[j]);
printk("\n"); printk("\n");
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
tp->setnselout = proteon_setnselout_pins; tp->setnselout = proteon_setnselout_pins;
tp->sifreadb = proteon_sifreadb; tp->sifreadb = proteon_sifreadb;
...@@ -316,7 +316,7 @@ unsigned short proteon_setnselout_pins(struct net_device *dev) ...@@ -316,7 +316,7 @@ unsigned short proteon_setnselout_pins(struct net_device *dev)
static int proteon_open(struct net_device *dev) static int proteon_open(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned short val = 0; unsigned short val = 0;
int i; int i;
......
...@@ -175,7 +175,7 @@ static int __init setup_card(struct net_device *dev) ...@@ -175,7 +175,7 @@ static int __init setup_card(struct net_device *dev)
printk(":%2.2x", dev->dev_addr[j]); printk(":%2.2x", dev->dev_addr[j]);
printk("\n"); printk("\n");
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
tp->setnselout = sk_isa_setnselout_pins; tp->setnselout = sk_isa_setnselout_pins;
tp->sifreadb = sk_isa_sifreadb; tp->sifreadb = sk_isa_sifreadb;
...@@ -332,7 +332,7 @@ unsigned short sk_isa_setnselout_pins(struct net_device *dev) ...@@ -332,7 +332,7 @@ unsigned short sk_isa_setnselout_pins(struct net_device *dev)
static int sk_isa_open(struct net_device *dev) static int sk_isa_open(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned short val = 0; unsigned short val = 0;
unsigned short oldval; unsigned short oldval;
int i; int i;
......
This diff is collapsed.
...@@ -243,7 +243,7 @@ static int madgemc_sifprobe(struct net_device *dev) ...@@ -243,7 +243,7 @@ static int madgemc_sifprobe(struct net_device *dev)
*/ */
int tms380tr_open(struct net_device *dev) int tms380tr_open(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
int err; int err;
/* init the spinlock */ /* init the spinlock */
...@@ -313,7 +313,7 @@ int tms380tr_open(struct net_device *dev) ...@@ -313,7 +313,7 @@ int tms380tr_open(struct net_device *dev)
static void tms380tr_timer_end_wait(unsigned long data) static void tms380tr_timer_end_wait(unsigned long data)
{ {
struct net_device *dev = (struct net_device*)data; struct net_device *dev = (struct net_device*)data;
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
if(tp->Sleeping) if(tp->Sleeping)
{ {
...@@ -329,7 +329,7 @@ static void tms380tr_timer_end_wait(unsigned long data) ...@@ -329,7 +329,7 @@ static void tms380tr_timer_end_wait(unsigned long data)
*/ */
static int tms380tr_chipset_init(struct net_device *dev) static int tms380tr_chipset_init(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
int err; int err;
tms380tr_init_ipb(tp); tms380tr_init_ipb(tp);
...@@ -364,7 +364,7 @@ static int tms380tr_chipset_init(struct net_device *dev) ...@@ -364,7 +364,7 @@ static int tms380tr_chipset_init(struct net_device *dev)
*/ */
static void tms380tr_init_net_local(struct net_device *dev) static void tms380tr_init_net_local(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
int i; int i;
dma_addr_t dmabuf; dma_addr_t dmabuf;
...@@ -492,7 +492,7 @@ static void tms380tr_init_opb(struct net_device *dev) ...@@ -492,7 +492,7 @@ static void tms380tr_init_opb(struct net_device *dev)
unsigned short BufferSize = BUFFER_SIZE; unsigned short BufferSize = BUFFER_SIZE;
int i; int i;
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
tp->ocpl.OPENOptions = 0; tp->ocpl.OPENOptions = 0;
tp->ocpl.OPENOptions |= ENABLE_FULL_DUPLEX_SELECTION; tp->ocpl.OPENOptions |= ENABLE_FULL_DUPLEX_SELECTION;
...@@ -531,7 +531,7 @@ static void tms380tr_init_opb(struct net_device *dev) ...@@ -531,7 +531,7 @@ static void tms380tr_init_opb(struct net_device *dev)
*/ */
static void tms380tr_open_adapter(struct net_device *dev) static void tms380tr_open_adapter(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
if(tp->OpenCommandIssued) if(tp->OpenCommandIssued)
return; return;
...@@ -569,7 +569,7 @@ static void tms380tr_enable_interrupts(struct net_device *dev) ...@@ -569,7 +569,7 @@ static void tms380tr_enable_interrupts(struct net_device *dev)
*/ */
static void tms380tr_exec_cmd(struct net_device *dev, unsigned short Command) static void tms380tr_exec_cmd(struct net_device *dev, unsigned short Command)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
tp->CMDqueue |= Command; tp->CMDqueue |= Command;
tms380tr_chk_outstanding_cmds(dev); tms380tr_chk_outstanding_cmds(dev);
...@@ -596,7 +596,7 @@ static void tms380tr_timeout(struct net_device *dev) ...@@ -596,7 +596,7 @@ static void tms380tr_timeout(struct net_device *dev)
*/ */
static int tms380tr_send_packet(struct sk_buff *skb, struct net_device *dev) static int tms380tr_send_packet(struct sk_buff *skb, struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
int err; int err;
err = tms380tr_hardware_send_packet(skb, dev); err = tms380tr_hardware_send_packet(skb, dev);
...@@ -616,7 +616,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device ...@@ -616,7 +616,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device
unsigned long flags; unsigned long flags;
int i; int i;
dma_addr_t dmabuf, newbuf; dma_addr_t dmabuf, newbuf;
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
/* Try to get a free TPL from the chain. /* Try to get a free TPL from the chain.
* *
...@@ -715,7 +715,7 @@ static void tms380tr_chk_src_addr(unsigned char *frame, unsigned char *hw_addr) ...@@ -715,7 +715,7 @@ static void tms380tr_chk_src_addr(unsigned char *frame, unsigned char *hw_addr)
static void tms380tr_timer_chk(unsigned long data) static void tms380tr_timer_chk(unsigned long data)
{ {
struct net_device *dev = (struct net_device*)data; struct net_device *dev = (struct net_device*)data;
struct net_local *tp = (struct net_local*)dev->priv; struct net_local *tp = netdev_priv(dev);
if(tp->HaltInProgress) if(tp->HaltInProgress)
return; return;
...@@ -755,7 +755,7 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -755,7 +755,7 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_NONE; return IRQ_NONE;
} }
tp = (struct net_local *)dev->priv; tp = netdev_priv(dev);
irq_type = SIFREADW(SIFSTS); irq_type = SIFREADW(SIFSTS);
...@@ -843,7 +843,7 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -843,7 +843,7 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*/ */
static void tms380tr_reset_interrupt(struct net_device *dev) static void tms380tr_reset_interrupt(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
SSB *ssb = &tp->ssb; SSB *ssb = &tp->ssb;
/* /*
...@@ -929,7 +929,7 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy ...@@ -929,7 +929,7 @@ static unsigned char tms380tr_chk_ssb(struct net_local *tp, unsigned short IrqTy
*/ */
static void tms380tr_cmd_status_irq(struct net_device *dev) static void tms380tr_cmd_status_irq(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned short ssb_cmd, ssb_parm_0; unsigned short ssb_cmd, ssb_parm_0;
unsigned short ssb_parm_1; unsigned short ssb_parm_1;
char *open_err = "Open error -"; char *open_err = "Open error -";
...@@ -1126,7 +1126,7 @@ static void tms380tr_cmd_status_irq(struct net_device *dev) ...@@ -1126,7 +1126,7 @@ static void tms380tr_cmd_status_irq(struct net_device *dev)
*/ */
int tms380tr_close(struct net_device *dev) int tms380tr_close(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
netif_stop_queue(dev); netif_stop_queue(dev);
del_timer(&tp->timer); del_timer(&tp->timer);
...@@ -1172,7 +1172,7 @@ int tms380tr_close(struct net_device *dev) ...@@ -1172,7 +1172,7 @@ int tms380tr_close(struct net_device *dev)
*/ */
static struct net_device_stats *tms380tr_get_stats(struct net_device *dev) static struct net_device_stats *tms380tr_get_stats(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
return ((struct net_device_stats *)&tp->MacStat); return ((struct net_device_stats *)&tp->MacStat);
} }
...@@ -1182,7 +1182,7 @@ static struct net_device_stats *tms380tr_get_stats(struct net_device *dev) ...@@ -1182,7 +1182,7 @@ static struct net_device_stats *tms380tr_get_stats(struct net_device *dev)
*/ */
static void tms380tr_set_multicast_list(struct net_device *dev) static void tms380tr_set_multicast_list(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned int OpenOptions; unsigned int OpenOptions;
OpenOptions = tp->ocpl.OPENOptions & OpenOptions = tp->ocpl.OPENOptions &
...@@ -1275,7 +1275,7 @@ static void tms380tr_exec_sifcmd(struct net_device *dev, unsigned int WriteValue ...@@ -1275,7 +1275,7 @@ static void tms380tr_exec_sifcmd(struct net_device *dev, unsigned int WriteValue
*/ */
static int tms380tr_reset_adapter(struct net_device *dev) static int tms380tr_reset_adapter(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned short *fw_ptr; unsigned short *fw_ptr;
unsigned short count, c, count2; unsigned short count, c, count2;
const struct firmware *fw_entry = NULL; const struct firmware *fw_entry = NULL;
...@@ -1428,7 +1428,7 @@ static int tms380tr_bringup_diags(struct net_device *dev) ...@@ -1428,7 +1428,7 @@ static int tms380tr_bringup_diags(struct net_device *dev)
*/ */
static int tms380tr_init_adapter(struct net_device *dev) static int tms380tr_init_adapter(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
const unsigned char SCB_Test[6] = {0x00, 0x00, 0xC1, 0xE2, 0xD4, 0x8B}; const unsigned char SCB_Test[6] = {0x00, 0x00, 0xC1, 0xE2, 0xD4, 0x8B};
const unsigned char SSB_Test[8] = {0xFF, 0xFF, 0xD1, 0xD7, const unsigned char SSB_Test[8] = {0xFF, 0xFF, 0xD1, 0xD7,
...@@ -1541,7 +1541,7 @@ static int tms380tr_init_adapter(struct net_device *dev) ...@@ -1541,7 +1541,7 @@ static int tms380tr_init_adapter(struct net_device *dev)
*/ */
static void tms380tr_chk_outstanding_cmds(struct net_device *dev) static void tms380tr_chk_outstanding_cmds(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned long Addr = 0; unsigned long Addr = 0;
if(tp->CMDqueue == 0) if(tp->CMDqueue == 0)
...@@ -1713,7 +1713,7 @@ static void tms380tr_chk_outstanding_cmds(struct net_device *dev) ...@@ -1713,7 +1713,7 @@ static void tms380tr_chk_outstanding_cmds(struct net_device *dev)
*/ */
static void tms380tr_ring_status_irq(struct net_device *dev) static void tms380tr_ring_status_irq(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
tp->CurrentRingStatus = be16_to_cpu((unsigned short)tp->ssb.Parm[0]); tp->CurrentRingStatus = be16_to_cpu((unsigned short)tp->ssb.Parm[0]);
...@@ -1785,7 +1785,7 @@ static void tms380tr_chk_irq(struct net_device *dev) ...@@ -1785,7 +1785,7 @@ static void tms380tr_chk_irq(struct net_device *dev)
{ {
int i; int i;
unsigned short AdapterCheckBlock[4]; unsigned short AdapterCheckBlock[4];
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
tp->AdapterOpenFlag = 0; /* Adapter closed now */ tp->AdapterOpenFlag = 0; /* Adapter closed now */
...@@ -1941,7 +1941,7 @@ static void tms380tr_chk_irq(struct net_device *dev) ...@@ -1941,7 +1941,7 @@ static void tms380tr_chk_irq(struct net_device *dev)
*/ */
static int tms380tr_read_ptr(struct net_device *dev) static int tms380tr_read_ptr(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned short adapterram; unsigned short adapterram;
tms380tr_read_ram(dev, (unsigned char *)&tp->intptrs.BurnedInAddrPtr, tms380tr_read_ram(dev, (unsigned char *)&tp->intptrs.BurnedInAddrPtr,
...@@ -2031,7 +2031,7 @@ static void tms380tr_cancel_tx_queue(struct net_local* tp) ...@@ -2031,7 +2031,7 @@ static void tms380tr_cancel_tx_queue(struct net_local* tp)
*/ */
static void tms380tr_tx_status_irq(struct net_device *dev) static void tms380tr_tx_status_irq(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned char HighByte, HighAc, LowAc; unsigned char HighByte, HighAc, LowAc;
TPL *tpl; TPL *tpl;
...@@ -2102,7 +2102,7 @@ static void tms380tr_tx_status_irq(struct net_device *dev) ...@@ -2102,7 +2102,7 @@ static void tms380tr_tx_status_irq(struct net_device *dev)
*/ */
static void tms380tr_rcv_status_irq(struct net_device *dev) static void tms380tr_rcv_status_irq(struct net_device *dev)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
unsigned char *ReceiveDataPtr; unsigned char *ReceiveDataPtr;
struct sk_buff *skb; struct sk_buff *skb;
unsigned int Length, Length2; unsigned int Length, Length2;
...@@ -2293,7 +2293,7 @@ static void tms380tr_update_rcv_stats(struct net_local *tp, unsigned char DataPt ...@@ -2293,7 +2293,7 @@ static void tms380tr_update_rcv_stats(struct net_local *tp, unsigned char DataPt
static int tms380tr_set_mac_address(struct net_device *dev, void *addr) static int tms380tr_set_mac_address(struct net_device *dev, void *addr)
{ {
struct net_local *tp = (struct net_local *)dev->priv; struct net_local *tp = netdev_priv(dev);
struct sockaddr *saddr = addr; struct sockaddr *saddr = addr;
if (tp->AdapterOpenFlag || tp->AdapterVirtOpenFlag) { if (tp->AdapterOpenFlag || tp->AdapterVirtOpenFlag) {
...@@ -2327,7 +2327,7 @@ void tmsdev_term(struct net_device *dev) ...@@ -2327,7 +2327,7 @@ void tmsdev_term(struct net_device *dev)
{ {
struct net_local *tp; struct net_local *tp;
tp = (struct net_local *) dev->priv; tp = netdev_priv(dev);
pci_unmap_single(tp->pdev, tp->dmabuffer, sizeof(struct net_local), pci_unmap_single(tp->pdev, tp->dmabuffer, sizeof(struct net_local),
PCI_DMA_BIDIRECTIONAL); PCI_DMA_BIDIRECTIONAL);
} }
...@@ -2338,7 +2338,7 @@ int tmsdev_init(struct net_device *dev, unsigned long dmalimit, ...@@ -2338,7 +2338,7 @@ int tmsdev_init(struct net_device *dev, unsigned long dmalimit,
struct net_local *tms_local; struct net_local *tms_local;
memset(dev->priv, 0, sizeof(struct net_local)); memset(dev->priv, 0, sizeof(struct net_local));
tms_local = (struct net_local *)dev->priv; tms_local = netdev_priv(dev);
init_waitqueue_head(&tms_local->wait_for_tok_int); init_waitqueue_head(&tms_local->wait_for_tok_int);
tms_local->dmalimit = dmalimit; tms_local->dmalimit = dmalimit;
tms_local->pdev = pdev; tms_local->pdev = pdev;
......
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