Commit 6726212d authored by Daniel Ritz's avatar Daniel Ritz Committed by Jeff Garzik

[PATCH] netdev_priv for xirc2ps_cs, nmclan_cs

s/dev->priv/netdev_priv(dev)/ for xirc2ps_cs.c and nmclan_cs.c
xircom one is tested. against 2.6.4-bk
parent 75cf9891
...@@ -470,7 +470,7 @@ static dev_link_t *nmclan_attach(void) ...@@ -470,7 +470,7 @@ static dev_link_t *nmclan_attach(void)
dev = alloc_etherdev(sizeof(mace_private)); dev = alloc_etherdev(sizeof(mace_private));
if (!dev) if (!dev)
return NULL; return NULL;
lp = dev->priv; lp = netdev_priv(dev);
link = &lp->link; link = &lp->link;
link->priv = dev; link->priv = dev;
...@@ -707,7 +707,7 @@ static void nmclan_config(dev_link_t *link) ...@@ -707,7 +707,7 @@ static void nmclan_config(dev_link_t *link)
{ {
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
mace_private *lp = dev->priv; mace_private *lp = netdev_priv(dev);
tuple_t tuple; tuple_t tuple;
cisparse_t parse; cisparse_t parse;
u_char buf[64]; u_char buf[64];
...@@ -875,7 +875,7 @@ nmclan_reset ...@@ -875,7 +875,7 @@ nmclan_reset
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static void nmclan_reset(struct net_device *dev) static void nmclan_reset(struct net_device *dev)
{ {
mace_private *lp = dev->priv; mace_private *lp = netdev_priv(dev);
#if RESET_XILINX #if RESET_XILINX
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
...@@ -944,7 +944,7 @@ mace_open ...@@ -944,7 +944,7 @@ mace_open
static int mace_open(struct net_device *dev) static int mace_open(struct net_device *dev)
{ {
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
mace_private *lp = dev->priv; mace_private *lp = netdev_priv(dev);
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
if (!DEV_OK(link)) if (!DEV_OK(link))
...@@ -967,7 +967,7 @@ mace_close ...@@ -967,7 +967,7 @@ mace_close
static int mace_close(struct net_device *dev) static int mace_close(struct net_device *dev)
{ {
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
mace_private *lp = dev->priv; mace_private *lp = netdev_priv(dev);
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
DEBUG(2, "%s: shutting down ethercard.\n", dev->name); DEBUG(2, "%s: shutting down ethercard.\n", dev->name);
...@@ -1022,7 +1022,7 @@ mace_start_xmit ...@@ -1022,7 +1022,7 @@ mace_start_xmit
static void mace_tx_timeout(struct net_device *dev) static void mace_tx_timeout(struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name); printk(KERN_NOTICE "%s: transmit timed out -- ", dev->name);
...@@ -1038,7 +1038,7 @@ static void mace_tx_timeout(struct net_device *dev) ...@@ -1038,7 +1038,7 @@ static void mace_tx_timeout(struct net_device *dev)
static int mace_start_xmit(struct sk_buff *skb, struct net_device *dev) static int mace_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1099,7 +1099,7 @@ mace_interrupt ...@@ -1099,7 +1099,7 @@ mace_interrupt
static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *) dev_id; struct net_device *dev = (struct net_device *) dev_id;
mace_private *lp = dev->priv; mace_private *lp = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
int status; int status;
int IntrCnt = MACE_MAX_IR_ITERATIONS; int IntrCnt = MACE_MAX_IR_ITERATIONS;
...@@ -1241,7 +1241,7 @@ mace_rx ...@@ -1241,7 +1241,7 @@ mace_rx
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static int mace_rx(struct net_device *dev, unsigned char RxCnt) static int mace_rx(struct net_device *dev, unsigned char RxCnt)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
unsigned char rx_framecnt; unsigned char rx_framecnt;
unsigned short rx_status; unsigned short rx_status;
...@@ -1408,7 +1408,7 @@ update_stats ...@@ -1408,7 +1408,7 @@ update_stats
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static void update_stats(ioaddr_t ioaddr, struct net_device *dev) static void update_stats(ioaddr_t ioaddr, struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
lp->mace_stats.rcvcc += mace_read(lp, ioaddr, MACE_RCVCC); lp->mace_stats.rcvcc += mace_read(lp, ioaddr, MACE_RCVCC);
lp->mace_stats.rntpc += mace_read(lp, ioaddr, MACE_RNTPC); lp->mace_stats.rntpc += mace_read(lp, ioaddr, MACE_RNTPC);
...@@ -1454,7 +1454,7 @@ mace_get_stats ...@@ -1454,7 +1454,7 @@ mace_get_stats
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static struct net_device_stats *mace_get_stats(struct net_device *dev) static struct net_device_stats *mace_get_stats(struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
update_stats(dev->base_addr, dev); update_stats(dev->base_addr, dev);
...@@ -1549,7 +1549,7 @@ Input ...@@ -1549,7 +1549,7 @@ Input
---------------------------------------------------------------------------- */ ---------------------------------------------------------------------------- */
static void restore_multicast_list(struct net_device *dev) static void restore_multicast_list(struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
int num_addrs = lp->multicast_num_addrs; int num_addrs = lp->multicast_num_addrs;
int *ladrf = lp->multicast_ladrf; int *ladrf = lp->multicast_ladrf;
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
...@@ -1606,7 +1606,7 @@ Output ...@@ -1606,7 +1606,7 @@ Output
static void set_multicast_list(struct net_device *dev) static void set_multicast_list(struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
int adr[ETHER_ADDR_LEN] = {0}; /* Ethernet address */ int adr[ETHER_ADDR_LEN] = {0}; /* Ethernet address */
int i; int i;
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
...@@ -1645,10 +1645,10 @@ static void set_multicast_list(struct net_device *dev) ...@@ -1645,10 +1645,10 @@ static void set_multicast_list(struct net_device *dev)
static void restore_multicast_list(struct net_device *dev) static void restore_multicast_list(struct net_device *dev)
{ {
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", dev->name, DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", dev->name,
((mace_private *)(dev->priv))->multicast_num_addrs); lp->multicast_num_addrs);
if (dev->flags & IFF_PROMISC) { if (dev->flags & IFF_PROMISC) {
/* Promiscuous mode: receive all packets */ /* Promiscuous mode: receive all packets */
...@@ -1665,7 +1665,7 @@ static void restore_multicast_list(struct net_device *dev) ...@@ -1665,7 +1665,7 @@ static void restore_multicast_list(struct net_device *dev)
static void set_multicast_list(struct net_device *dev) static void set_multicast_list(struct net_device *dev)
{ {
mace_private *lp = (mace_private *)dev->priv; mace_private *lp = netdev_priv(dev);
#ifdef PCMCIA_DEBUG #ifdef PCMCIA_DEBUG
if (pc_debug > 1) { if (pc_debug > 1) {
......
...@@ -595,7 +595,7 @@ xirc2ps_attach(void) ...@@ -595,7 +595,7 @@ xirc2ps_attach(void)
dev = alloc_etherdev(sizeof(local_info_t)); dev = alloc_etherdev(sizeof(local_info_t));
if (!dev) if (!dev)
return NULL; return NULL;
local = dev->priv; local = netdev_priv(dev);
link = &local->link; link = &local->link;
link->priv = dev; link->priv = dev;
...@@ -710,7 +710,7 @@ static int ...@@ -710,7 +710,7 @@ static int
set_card_type(dev_link_t *link, const void *s) set_card_type(dev_link_t *link, const void *s)
{ {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
#ifdef PCMCIA_DEBUG #ifdef PCMCIA_DEBUG
unsigned cisrev = ((const unsigned char *)s)[2]; unsigned cisrev = ((const unsigned char *)s)[2];
#endif #endif
...@@ -805,7 +805,7 @@ xirc2ps_config(dev_link_t * link) ...@@ -805,7 +805,7 @@ xirc2ps_config(dev_link_t * link)
{ {
client_handle_t handle = link->handle; client_handle_t handle = link->handle;
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
tuple_t tuple; tuple_t tuple;
cisparse_t parse; cisparse_t parse;
ioaddr_t ioaddr; ioaddr_t ioaddr;
...@@ -1159,7 +1159,7 @@ xirc2ps_release(dev_link_t *link) ...@@ -1159,7 +1159,7 @@ xirc2ps_release(dev_link_t *link)
if (link->win) { if (link->win) {
struct net_device *dev = link->priv; struct net_device *dev = link->priv;
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
if (local->dingo) if (local->dingo)
iounmap(local->dingo_ccr - 0x0800); iounmap(local->dingo_ccr - 0x0800);
pcmcia_release_window(link->win); pcmcia_release_window(link->win);
...@@ -1246,7 +1246,7 @@ static irqreturn_t ...@@ -1246,7 +1246,7 @@ static irqreturn_t
xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs) xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
ioaddr_t ioaddr; ioaddr_t ioaddr;
u_char saved_page; u_char saved_page;
unsigned bytes_rcvd; unsigned bytes_rcvd;
...@@ -1468,7 +1468,7 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1468,7 +1468,7 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static void static void
do_tx_timeout(struct net_device *dev) do_tx_timeout(struct net_device *dev)
{ {
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
printk(KERN_NOTICE "%s: transmit timed out\n", dev->name); printk(KERN_NOTICE "%s: transmit timed out\n", dev->name);
lp->stats.tx_errors++; lp->stats.tx_errors++;
/* reset the card */ /* reset the card */
...@@ -1480,7 +1480,7 @@ do_tx_timeout(struct net_device *dev) ...@@ -1480,7 +1480,7 @@ do_tx_timeout(struct net_device *dev)
static int static int
do_start_xmit(struct sk_buff *skb, struct net_device *dev) do_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
int okay; int okay;
unsigned freespace; unsigned freespace;
...@@ -1537,7 +1537,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1537,7 +1537,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev)
static struct net_device_stats * static struct net_device_stats *
do_get_stats(struct net_device *dev) do_get_stats(struct net_device *dev)
{ {
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
/* lp->stats.rx_missed_errors = GetByte(?) */ /* lp->stats.rx_missed_errors = GetByte(?) */
return &lp->stats; return &lp->stats;
...@@ -1552,7 +1552,7 @@ static void ...@@ -1552,7 +1552,7 @@ static void
set_addresses(struct net_device *dev) set_addresses(struct net_device *dev)
{ {
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
struct dev_mc_list *dmi = dev->mc_list; struct dev_mc_list *dmi = dev->mc_list;
char *addr; char *addr;
int i,j,k,n; int i,j,k,n;
...@@ -1617,7 +1617,7 @@ set_multicast_list(struct net_device *dev) ...@@ -1617,7 +1617,7 @@ set_multicast_list(struct net_device *dev)
static int static int
do_config(struct net_device *dev, struct ifmap *map) do_config(struct net_device *dev, struct ifmap *map)
{ {
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
DEBUG(0, "do_config(%p)\n", dev); DEBUG(0, "do_config(%p)\n", dev);
if (map->port != 255 && map->port != dev->if_port) { if (map->port != 255 && map->port != dev->if_port) {
...@@ -1643,7 +1643,7 @@ do_config(struct net_device *dev, struct ifmap *map) ...@@ -1643,7 +1643,7 @@ do_config(struct net_device *dev, struct ifmap *map)
static int static int
do_open(struct net_device *dev) do_open(struct net_device *dev)
{ {
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
DEBUG(0, "do_open(%p)\n", dev); DEBUG(0, "do_open(%p)\n", dev);
...@@ -1676,7 +1676,7 @@ static struct ethtool_ops netdev_ethtool_ops = { ...@@ -1676,7 +1676,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
static int static int
do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
u16 *data = (u16 *)&rq->ifr_data; u16 *data = (u16 *)&rq->ifr_data;
...@@ -1708,7 +1708,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) ...@@ -1708,7 +1708,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
static void static void
hardreset(struct net_device *dev) hardreset(struct net_device *dev)
{ {
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
SelectPage(4); SelectPage(4);
...@@ -1725,7 +1725,7 @@ hardreset(struct net_device *dev) ...@@ -1725,7 +1725,7 @@ hardreset(struct net_device *dev)
static void static void
do_reset(struct net_device *dev, int full) do_reset(struct net_device *dev, int full)
{ {
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
unsigned value; unsigned value;
...@@ -1886,7 +1886,7 @@ do_reset(struct net_device *dev, int full) ...@@ -1886,7 +1886,7 @@ do_reset(struct net_device *dev, int full)
static int static int
init_mii(struct net_device *dev) init_mii(struct net_device *dev)
{ {
local_info_t *local = dev->priv; local_info_t *local = netdev_priv(dev);
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
unsigned control, status, linkpartner; unsigned control, status, linkpartner;
int i; int i;
...@@ -1973,7 +1973,7 @@ static int ...@@ -1973,7 +1973,7 @@ static int
do_stop(struct net_device *dev) do_stop(struct net_device *dev)
{ {
ioaddr_t ioaddr = dev->base_addr; ioaddr_t ioaddr = dev->base_addr;
local_info_t *lp = dev->priv; local_info_t *lp = netdev_priv(dev);
dev_link_t *link = &lp->link; dev_link_t *link = &lp->link;
DEBUG(0, "do_stop(%p)\n", dev); DEBUG(0, "do_stop(%p)\n", dev);
......
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