Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] TI DaVinci EMAC: delay DaVinci EMAC initialization
From: Kevin Hilman @ 2009-08-25 11:21 UTC (permalink / raw)
  To: Sudhakar Rajashekhara; +Cc: netdev, davinci-linux-open-source, davem
In-Reply-To: <1250714395-9588-1-git-send-email-sudhakar.raj@ti.com>

Sudhakar Rajashekhara <sudhakar.raj@ti.com> writes:

> On TI's DA850/OMAP-L138 EVM, MAC address is stored in SPI
> flash which is accessed using MTD interface.
>
> This patch delays the initialization of DaVinci EMAC driver
> by changing module_init to late_initcall. This helps SPI and
> MTD drivers to get initialized before EMAC thereby enabling
> EMAC driver to read the MAC address while booting and use it.
>
> Tested with NFS on DM644x, DM6467, DA830/OMAP-L137 and
> DA850/OMAP-L138 EVMs.
>
> Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Reviewed-by: Chaithrika U S <chaithrika@ti.com>

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>

> ---
>  drivers/net/davinci_emac.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
> index 12fd446..5e6652b 100644
> --- a/drivers/net/davinci_emac.c
> +++ b/drivers/net/davinci_emac.c
> @@ -2817,7 +2817,7 @@ static int __init davinci_emac_init(void)
>  {
>  	return platform_driver_register(&davinci_emac_driver);
>  }
> -module_init(davinci_emac_init);
> +late_initcall(davinci_emac_init);
>  
>  /**
>   * davinci_emac_exit: EMAC driver module exit
> -- 
> 1.5.6
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

^ permalink raw reply

* Re: [RFC] defer skb allocation in virtio_net -- mergable buff part
From: Michael S. Tsirkin @ 2009-08-25 11:41 UTC (permalink / raw)
  To: Shirley Ma; +Cc: netdev, kvm, linux-kernel
In-Reply-To: <1250145231.6653.29.camel@localhost.localdomain>

Wanted to try this awhile now, good to see this worked on!
Some comments inline.

On Wed, Aug 12, 2009 at 11:33:51PM -0700, Shirley Ma wrote:
> Guest virtio_net receives packets from its pre-allocated vring 
> buffers, then it delivers these packets to upper layer protocols
> as skb buffs. So it's not necessary to pre-allocate skb for each
> mergable buffer, then frees it when it's useless. 
> 
> This patch has deferred skb allocation to when receiving packets, 
> it reduces skb pre-allocations and skb_frees. And it induces two 
> page list: freed_pages and used_page list, used_pages is used to 
> track pages pre-allocated, it is only useful when removing virtio_net.
> 
> This patch has tested and measured against 2.6.31-rc4 git,
> I thought this patch will improve large packet performance, but I saw
> netperf TCP_STREAM performance improved for small packet for both 
> local guest to host and host to local guest cases. It also reduces 
> UDP packets drop rate from host to local guest. I am not fully understand 
> why.
> 
> The netperf results from my laptop are:
> 
> mtu=1500
> netperf -H xxx -l 120
> 
> 		w/o patch	w/i patch (two runs)	
> guest to host:  3336.84Mb/s   3730.14Mb/s ~ 3582.88Mb/s
> 
> host to guest:  3165.10Mb/s   3370.39Mb/s ~ 3407.96Mb/s
> 
> Here is the patch for your review. The same approach can apply to non-mergable
> buffs too, so we can use code in common.

Yes, we should do that. The way to test is to hack virtio to ignore
host support for mergeable buffers.

> If there is no objection, I will 
> submit the non-mergable buffs patch later.
> 

The whole page cache management in virtio net is too complex.
Since it seems you bypass it for some cases, this might be where
savings come from?

> Signed-off-by: Shirley Ma <xma@us.ibm.com>
> ---
> 
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 2a6e81d..e31ebc9 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -17,6 +17,7 @@
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */
>  //#define DEBUG
> +#include <linux/list.h>
>  #include <linux/netdevice.h>
>  #include <linux/etherdevice.h>
>  #include <linux/ethtool.h>
> @@ -39,6 +40,12 @@ module_param(gso, bool, 0444);
>  
>  #define VIRTNET_SEND_COMMAND_SG_MAX    2
>  
> +struct page_list
> +{

Kernel style is "struct page_list {".
Also, prefix with virtnet_?

> +	struct page *page;
> +	struct list_head list;
> +};
> +
>  struct virtnet_info
>  {
>  	struct virtio_device *vdev;
> @@ -72,6 +79,8 @@ struct virtnet_info
>  
>  	/* Chain pages by the private ptr. */
>  	struct page *pages;

Do we need the pages list now? Can we do without?

Pls document fields below.

> +	struct list_head used_pages;

Seems a waste to have this list just for dev down.
Extend virtio to give us all buffers from vq
on shutdown?

> +	struct list_head freed_pages;
>  };
>  
>  static inline void *skb_vnet_hdr(struct sk_buff *skb)
> @@ -106,6 +115,26 @@ static struct page *get_a_page(struct virtnet_info *vi, gfp_t gfp_mask)
>  	return p;
>  }
>  
> +static struct page_list *get_a_free_page(struct virtnet_info *vi, gfp_t gfp_mask)

always called with gfp_mask GFP_ATOMIC?
Also - line too long here and elsewere. Run checkpatch?

> +{
> +	struct page_list *plist;
> +
> +	if (list_empty(&vi->freed_pages)) {

special handling for empty list looks a bit ugly
really necessary?

> +		plist = kmalloc(sizeof(struct page_list), gfp_mask);

sizeof *plist

> +		if (!plist)
> +			return NULL;
> +		list_add_tail(&plist->list, &vi->freed_pages);
> +		plist->page = alloc_page(gfp_mask);
> +	} else {
> +		plist = list_first_entry(&vi->freed_pages, struct page_list, list);

is the first entry special? pls document in struct definition

> +		if (!plist->page)
> +			plist->page = alloc_page(gfp_mask);

what does it mean plist->page == NULL? Please document this
in struct definition.

> +	}
> +	if (plist->page)
> +		list_move_tail(&plist->list, &vi->used_pages);
> +	return plist;
> +}
> +
>  static void skb_xmit_done(struct virtqueue *svq)
>  {
>  	struct virtnet_info *vi = svq->vdev->priv;
> @@ -121,14 +150,14 @@ static void skb_xmit_done(struct virtqueue *svq)
>  	tasklet_schedule(&vi->tasklet);
>  }
>  
> -static void receive_skb(struct net_device *dev, struct sk_buff *skb,
> +static void receive_skb(struct net_device *dev, void *buf,

what is buf, here? can it have proper type and not void*?

>  			unsigned len)
>  {
>  	struct virtnet_info *vi = netdev_priv(dev);
> -	struct virtio_net_hdr *hdr = skb_vnet_hdr(skb);
>  	int err;
>  	int i;
> -
> +	struct sk_buff *skb = NULL;
> +	struct virtio_net_hdr *hdr = NULL;

do we have to init these to NULL?

>  	if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) {
>  		pr_debug("%s: short packet %i\n", dev->name, len);
>  		dev->stats.rx_length_errors++;
> @@ -136,15 +165,30 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
>  	}
>  
>  	if (vi->mergeable_rx_bufs) {
> -		struct virtio_net_hdr_mrg_rxbuf *mhdr = skb_vnet_hdr(skb);
> +		struct virtio_net_hdr_mrg_rxbuf *mhdr;
>  		unsigned int copy;
> -		char *p = page_address(skb_shinfo(skb)->frags[0].page);
> +		skb_frag_t *f;
> +		struct page_list *plist = (struct page_list *)buf;

cast not necessary

> +		char *p = page_address(plist->page);
> +
> +		skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN);
> +		if (unlikely(!skb)) {
> +			/* drop the packet */

obvious, but okay ...

> +			dev->stats.rx_dropped++;

but what does the below do? Maybe add a comment ...

> +			list_move_tail(&plist->list, &vi->freed_pages);
> +			return;
> +		}
> +
> +		skb_reserve(skb, NET_IP_ALIGN);
>  
>  		if (len > PAGE_SIZE)
>  			len = PAGE_SIZE;
>  		len -= sizeof(struct virtio_net_hdr_mrg_rxbuf);
>  
> -		memcpy(hdr, p, sizeof(*mhdr));
> +		mhdr = skb_vnet_hdr(skb);
> +		memcpy(mhdr, p, sizeof(*mhdr));
> +		hdr = (struct virtio_net_hdr *)mhdr;
> +
>  		p += sizeof(*mhdr);
>  
>  		copy = len;
> @@ -155,20 +199,20 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
>  
>  		len -= copy;
>  
> -		if (!len) {
> -			give_a_page(vi, skb_shinfo(skb)->frags[0].page);
> -			skb_shinfo(skb)->nr_frags--;
> -		} else {
> -			skb_shinfo(skb)->frags[0].page_offset +=
> +		if (len) {
> +			f = &skb_shinfo(skb)->frags[0];
> +			f->page = plist->page;
> +			skb_shinfo(skb)->frags[0].page_offset =
>  				sizeof(*mhdr) + copy;
>  			skb_shinfo(skb)->frags[0].size = len;
>  			skb->data_len += len;
>  			skb->len += len;
> +			skb_shinfo(skb)->nr_frags++;
> +			plist->page = NULL;
>  		}
> +		list_move_tail(&plist->list, &vi->freed_pages);
>  
>  		while (--mhdr->num_buffers) {
> -			struct sk_buff *nskb;
> -
>  			i = skb_shinfo(skb)->nr_frags;
>  			if (i >= MAX_SKB_FRAGS) {
>  				pr_debug("%s: packet too long %d\n", dev->name,
> @@ -177,30 +221,30 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
>  				goto drop;
>  			}
>  
> -			nskb = vi->rvq->vq_ops->get_buf(vi->rvq, &len);
> -			if (!nskb) {
> +			plist = vi->rvq->vq_ops->get_buf(vi->rvq, &len);
> +			if (!plist) {
>  				pr_debug("%s: rx error: %d buffers missing\n",
>  					 dev->name, mhdr->num_buffers);
>  				dev->stats.rx_length_errors++;
>  				goto drop;
>  			}
> -
> -			__skb_unlink(nskb, &vi->recv);
>  			vi->num--;
> -
> -			skb_shinfo(skb)->frags[i] = skb_shinfo(nskb)->frags[0];
> -			skb_shinfo(nskb)->nr_frags = 0;
> -			kfree_skb(nskb);
> -
> +			f = &skb_shinfo(skb)->frags[i];
> +			f->page = plist->page;
> +			f->page_offset = 0;

I though skb is pre-zeroed anyway. No?

> +			
>  			if (len > PAGE_SIZE)
>  				len = PAGE_SIZE;
> -

please don't change empty lines arbitrarily

>  			skb_shinfo(skb)->frags[i].size = len;
>  			skb_shinfo(skb)->nr_frags++;
>  			skb->data_len += len;
>  			skb->len += len;
> +			plist->page = NULL;
> +			list_move_tail(&plist->list, &vi->freed_pages);

did we set all fields here? how about truesize?
Does skb_add_rx_frag do what we want by any chance?

>  		}
>  	} else {
> +		skb = (struct sk_buff *)buf;

don't cast away void

> +		hdr = skb_vnet_hdr(skb);
>  		len -= sizeof(struct virtio_net_hdr);
>  
>  		if (len <= MAX_PACKET_LEN)
> @@ -329,7 +373,6 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)
>  
>  static void try_fill_recv(struct virtnet_info *vi)
>  {
> -	struct sk_buff *skb;
>  	struct scatterlist sg[1];
>  	int err;
>  
> @@ -339,39 +382,21 @@ static void try_fill_recv(struct virtnet_info *vi)
>  	}
>  
>  	for (;;) {
> -		skb_frag_t *f;
> -
> -		skb = netdev_alloc_skb(vi->dev, GOOD_COPY_LEN + NET_IP_ALIGN);
> -		if (unlikely(!skb))
> -			break;
> -
> -		skb_reserve(skb, NET_IP_ALIGN);
> -
> -		f = &skb_shinfo(skb)->frags[0];
> -		f->page = get_a_page(vi, GFP_ATOMIC);
> -		if (!f->page) {
> -			kfree_skb(skb);
> +		struct page_list *plist = get_a_free_page(vi, GFP_ATOMIC);
> +		if (!plist || !plist->page)
>  			break;
> -		}
> -
> -		f->page_offset = 0;
> -		f->size = PAGE_SIZE;
> -
> -		skb_shinfo(skb)->nr_frags++;
> -
> -		sg_init_one(sg, page_address(f->page), PAGE_SIZE);
> -		skb_queue_head(&vi->recv, skb);
> -
> -		err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, 1, skb);
> +		sg_init_one(sg, page_address(plist->page), PAGE_SIZE);
> +		err = vi->rvq->vq_ops->add_buf(vi->rvq, sg, 0, 1, plist);
>  		if (err) {
> -			skb_unlink(skb, &vi->recv);
> -			kfree_skb(skb);
> +			list_move_tail(&plist->list, &vi->freed_pages);
>  			break;
>  		}
>  		vi->num++;
>  	}
> +
>  	if (unlikely(vi->num > vi->max))
>  		vi->max = vi->num;
> +	


unnecessary empty lines - if you like them, make a
separate patch. and seems to have trailing whitespace.

>  	vi->rvq->vq_ops->kick(vi->rvq);
>  }
>  
> @@ -388,14 +413,15 @@ static void skb_recv_done(struct virtqueue *rvq)
>  static int virtnet_poll(struct napi_struct *napi, int budget)
>  {
>  	struct virtnet_info *vi = container_of(napi, struct virtnet_info, napi);
> -	struct sk_buff *skb = NULL;
> +	void *buf = NULL;

Does it need to be initialized?

>  	unsigned int len, received = 0;
>  
>  again:
>  	while (received < budget &&
> -	       (skb = vi->rvq->vq_ops->get_buf(vi->rvq, &len)) != NULL) {
> -		__skb_unlink(skb, &vi->recv);
> -		receive_skb(vi->dev, skb, len);
> +	       (buf = vi->rvq->vq_ops->get_buf(vi->rvq, &len)) != NULL) {
> +		if (!vi->mergeable_rx_bufs)
> +			__skb_unlink((struct sk_buff *)buf, &vi->recv);

cast not necessary

> +		receive_skb(vi->dev, buf, len);
>  		vi->num--;
>  		received++;
>  	}
> @@ -893,6 +919,8 @@ static int virtnet_probe(struct virtio_device *vdev)
>  	vi->vdev = vdev;
>  	vdev->priv = vi;
>  	vi->pages = NULL;
> +	INIT_LIST_HEAD(&vi->used_pages);
> +	INIT_LIST_HEAD(&vi->freed_pages);
>  
>  	/* If they give us a callback when all buffers are done, we don't need
>  	 * the timer. */
> @@ -969,6 +997,7 @@ static void virtnet_remove(struct virtio_device *vdev)
>  {
>  	struct virtnet_info *vi = vdev->priv;
>  	struct sk_buff *skb;
> +	struct page_list *plist, *tp;
>  
>  	/* Stop all the virtqueues. */
>  	vdev->config->reset(vdev);
> @@ -977,14 +1006,23 @@ static void virtnet_remove(struct virtio_device *vdev)
>  		del_timer_sync(&vi->xmit_free_timer);
>  
>  	/* Free our skbs in send and recv queues, if any. */
> -	while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
> -		kfree_skb(skb);
> -		vi->num--;
> +	if (!vi->mergeable_rx_bufs) {
> +		while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
> +			kfree_skb(skb);
> +			vi->num--;
> +		}
> +		BUG_ON(vi->num != 0);
> +	} else {
> +		list_splice_init(&vi->used_pages, &vi->freed_pages);
> +		list_for_each_entry_safe(plist, tp, &vi->freed_pages, list) {
> +			vi->num--;
> +			if (plist->page)
> +				__free_pages(plist->page, 0);
> +			kfree(plist);
> +		}

BUG_ON here as well?

>  	}

So, you are fixing this to share code. Good.

>  	__skb_queue_purge(&vi->send);
>  
> -	BUG_ON(vi->num != 0);
> -
>  	unregister_netdev(vi->dev);
>  
>  	vdev->config->del_vqs(vi->vdev);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: TSecr != 0 check in inet_lro.c
From: Octavian Purdila @ 2009-08-25 11:50 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Jan-Bernd Themann, netdev, Christoph Raisch
In-Reply-To: <4A9379C9.6050108@gmail.com>

On Tuesday 25 August 2009 08:42:33 Eric Dumazet wrote:
> Octavian Purdila a écrit :
> > Hi,
> >
> > We are seeing a performance issue with TSO/LRO which we tracked down to
> > the TSecr !=0 check in lro_tcp_ip_check.
>
> ouch...
>
> > It happens when the LRO side's TSval wraps around and gets to 0. That
> > triggers the TSO side to send packets with TSecr set to 0, which means
> > that such packets won't be aggregated - and that will put a lot of burden
> > on the stack which will result in lots of drops.
>
> Probability of such event is 1 / 2^32 or so ?
>

Yes, its pretty low, but the timestamps are taken from jiffies and jiffies are 
initialized to -300*HZ so it will happen in 5 minutes after every reboot :)

> > I'm failing to understand the purpose of this check. Any hints? :)
>
> rfc1323 badly interpreted ?
>
> I remember tsecr=0 was forbidden by Linux, while apparently rfc is not
> so clear.
>
> rfc1323 : 3.2
>          The Timestamp Echo Reply field (TSecr) is only valid if the ACK
>          bit is set in the TCP header; if it is valid, it echos a times-
>          tamp value that was sent by the remote TCP in the TSval field
>          of a Timestamps option.  When TSecr is not valid, its value
>          must be zero.  The TSecr value will generally be from the most
>          recent Timestamp option that was received; however, there are
>          exceptions that are explained below.
>
> Note how this is not saying "a zero Tsecr value is not valid"

That is my understanding as well.

> I could not find why : "When TSecr is not valid, its value
> must be zero", and why we consider a zero value to be not meaningfull...
>
> ...
>
> So we dont have a bit saying we received a tsecr, we use the
> 'if saw_tstamp AND tsecr is not null' convention...

Alright, its starting to make sense. So, it looks like we can remove the check 
from inet_lro, and that may even reduce the probability of receiving a zero 
TSecr in the stack. Right?

Thanks for you help!

tavi

^ permalink raw reply

* Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server
From: Rusty Russell @ 2009-08-25 12:10 UTC (permalink / raw)
  To: virtualization
  Cc: Michael S. Tsirkin, netdev, kvm, linux-kernel, mingo, linux-mm,
	akpm, hpa, gregory.haskins
In-Reply-To: <20090819150309.GC4236@redhat.com>

On Thu, 20 Aug 2009 12:33:09 am Michael S. Tsirkin wrote:
> What it is: vhost net is a character device that can be used to reduce
> the number of system calls involved in virtio networking.
> Existing virtio net code is used in the guest without modification.

...

> +config VHOST_NET
> +	tristate "Host kernel accelerator for virtio net"
> +	depends on NET && EVENTFD
> +	---help---
> +	  This kernel module can be loaded in host kernel to accelerate
> +	  guest networking with virtio_net. Not to be confused with virtio_net
> +	  module itself which needs to be loaded in guest kernel.
> +
> +	  To compile this driver as a module, choose M here: the module will
> +	  be called vhost_net.

Just want to note that the patch explanation and the Kconfig help text are
exceptional examples of reader-oriented text.  Nice!

> +		/* Sanity check */
> +		if (vq->iov->iov_len != sizeof(struct virtio_net_hdr)) {
> +			vq_err(vq, "Unexpected header len for TX: "
> +			       "%ld expected %zd\n", vq->iov->iov_len,
> +			       sizeof(struct virtio_net_hdr));
> +			break;
> +		}

OK, this check, which is in the qemu version, is *wrong*.  There should be
no assumption on sg boundaries.  For example, the guest should be able to
put the virtio_net_hdr in the front of the skbuf data if there is room.

You should try to explicitly "consume" sizeof(struct virtio_net_hdr) of the
iov, and if fail, do this message.  You can skip the out <= 1 test then,
too.

Anyway, I really prefer vq->iov[0]. to vq->iov-> here.

> +		/* Sanity check */
> +		if (vq->iov->iov_len != sizeof(struct virtio_net_hdr)) {
> +			vq_err(vq, "Unexpected header len for RX: "
> +			       "%ld expected %zd\n",
> +			       vq->iov->iov_len, sizeof(struct virtio_net_hdr));
> +			break;

Here too.

> +	u32 __user *featurep = argp;
> +	int __user *fdp = argp;
> +	u32 features;
> +	int fd, r;
> +	switch (ioctl) {
> +	case VHOST_NET_SET_SOCKET:
> +		r = get_user(fd, fdp);
> +		if (r < 0)
> +			return r;
> +		return vhost_net_set_socket(n, fd);
> +	case VHOST_GET_FEATURES:
> +		/* No features for now */
> +		features = 0;
> +		return put_user(features, featurep);

We may well get more than 32 feature bits, at least for virtio_net, which will
force us to do some trickery in virtio_pci.  I'd like to avoid that here,
though it's kind of ugly.  We'd need VHOST_GET_FEATURES (and ACK) to take a
struct like:

	u32 feature_size;
	u32 features[];

> +int vhost_net_init(void)

static?

> +void vhost_net_exit(void)

static?

> +/* Start polling a file. We add ourselves to file's wait queue. The user must
> + * keep a reference to a file until after vhost_poll_stop is called. */

I experienced minor confusion from the comments in this file.  Where you said
"user" I think "caller".  No biggie though.

> +	memory->nregions = 2;
> +	memory->regions[0].guest_phys_addr = 1;
> +	memory->regions[0].userspace_addr = 1;
> +	memory->regions[0].memory_size = ~0ULL;
> +	memory->regions[1].guest_phys_addr = 0;
> +	memory->regions[1].userspace_addr = 0;
> +	memory->regions[1].memory_size = 1;

Not sure I understand why there are two regions to start?

> +	case VHOST_SET_VRING_BASE:
> +		r = copy_from_user(&s, argp, sizeof s);
> +		if (r < 0)
> +			break;
> +		if (s.num > 0xffff) {
> +			r = -EINVAL;
> +			break;
> +		}
> +		vq->last_avail_idx = s.num;
> +		break;
> +	case VHOST_GET_VRING_BASE:
> +		s.index = idx;
> +		s.num = vq->last_avail_idx;
> +		r = copy_to_user(argp, &s, sizeof s);
> +		break;

Ah, this is my fault.  I didn't expose the last_avail_idx in the ring
because the other side doesn't need it; but without it the ring state is not
fully observable from outside (no external save / restore!).

I have a patch which published these indices (we have room), see:
	http://ozlabs.org/~rusty/kernel/rr-2009-08-12-1/virtio:ring-publish-indices.patch

Perhaps we should use that mechanism instead?  We don't actually have to
offer the feature (we don't care about the guest state), but it's nice as
documentation.  I've been waiting for an excuse to use that patch.

> +long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, unsigned long arg)
> +{
> +	void __user *argp = (void __user *)arg;
> +	long r;
> +
> +	mutex_lock(&d->mutex);
> +	if (ioctl == VHOST_SET_OWNER) {
> +		r = vhost_dev_set_owner(d);
> +		goto done;
> +	}
> +
> +	r = vhost_dev_check_owner(d);

You can do a VHOST_SET_OWNER without being the owner?  So really,
the -EPERM from all the vhost_dev_check_owner() is not a security thing,
but a "I don't think you mean to do that" thing?

If so, a comment above it might help?

> +static const struct vhost_memory_region *find_region(struct vhost_memory *mem,
> +						     __u64 addr, __u32 len)
> +{
> +	struct vhost_memory_region *reg;
> +	int i;
> +	/* linear search is not brilliant, but we really have on the order of 6
> +	 * regions in practice */

Ah, you actually mean "this code has been carefully cache-optimized for the
common case" :)

> +/* FIXME: this does not handle a region that spans multiple
> + * address/len pairs */
> +int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
> +		   struct iovec iov[], int iov_count, int iov_size,
> +		   unsigned *num)
> +{
> +	const struct vhost_memory_region *reg;
> +	struct vhost_memory *mem;
> +	struct iovec *_iov;
> +	u64 s = 0;
> +	int ret = 0;

Would this be neater if it returned the num iovecs used?  And offsetting
iov in the caller, rather than passing iov_count?

> +	/* If their number is silly, that's a fatal mistake. */
> +	if (head >= vq->num) {
> +		vq_err(vq, "Guest says index %u > %u is available",
> +		       head, vq->num);
> +		return vq->num;
> +	}

Not a fatal mistake in this code/

> +	vq->inflight++;

vq->inflight was a brain fart in the old lguest code.  See
commit ebf9a5a99c1a464afe0b4dfa64416fc8b273bc5c.

Also, see other fixes to the lguest launcher since then which might
be relevant to this code:
	lguest: get more serious about wmb() in example Launcher code
	lguest: clean up length-used value in example launcher

> +	/* If they don't want an interrupt, don't send one, unless empty. */
> +	if ((flags & VRING_AVAIL_F_NO_INTERRUPT) && vq->inflight)
> +		return;

And I wouldn't support notify on empty at all, TBH.  It should
definitely be conditional on the guest accepting the NOTIFY_ON_EMPTY
feature.

> +/* The virtqueue structure describes a queue attached to a device. */
> +struct vhost_virtqueue {
...
> +} ____cacheline_aligned;

Really?  I'd want to see numbers on this one.  False sharing vs. more cache
utilization.

> +#define vq_err(vq, fmt, ...) do {                                  \
> +		printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__);       \
> +		if ((vq)->error_ctx)                               \
> +				eventfd_signal((vq)->error_ctx, 1);\
> +	} while (0)

Mmm... guests should not be able to create unlimited printks in the host.

But really, nothing major to object to in here...

Thanks!
Rusty.

^ permalink raw reply

* Re: iproute2 / tbf with large burst seems broken again
From: Jarek Poplawski @ 2009-08-25 12:13 UTC (permalink / raw)
  To: Denys Fedoryschenko; +Cc: netdev
In-Reply-To: <200908251416.13888.denys@visp.net.lb>

On Tue, Aug 25, 2009 at 02:16:13PM +0300, Denys Fedoryschenko wrote:
> Done, tested, it doesn't stale and fix the issue but:
> 
> PPPoE_146 ~ # ./tc qdisc del dev ppp13 root;./tc qdisc add dev ppp13 root tbf 
> rate 96000 burst 2048000 latency 500ms                                               
> 
> This one is ok
> PPPoE_146 ~ # ./tc -s -d qdisc show dev ppp13
> qdisc tbf 8005: root rate 96000bit burst 2000Kb/8 mpu 0b lat 500.0ms
>  Sent 55260 bytes 65 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 0bit 0pps backlog 0b 0p requeues 0
> qdisc ingress ffff: parent ffff:fff1 ----------------
>  Sent 641055 bytes 2485 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 0bit 0pps backlog 0b 0p requeues 0
> 
> PPPoE_146 ~ # ./tc qdisc del dev ppp13 root;./tc qdisc add dev ppp13 root tbf 
> rate 96000 burst 4096000 latency 500ms                                               
> 
> But this one maybe will overflow because of limitations in iproute2.

Sure, as I wrote before:
"It shouldn't be so difficult just for 2000kb buffer here, but of course
there're some limits."
I tried to optimize sch_tbf variables usage only, but this is still
mostly within 32 bits.

> 
> PPoE_146 ~ # ./tc -s -d qdisc show dev ppp13
> qdisc tbf 8004: root rate 96000bit burst 797465b/8 mpu 0b lat 275.4s
>  Sent 82867 bytes 123 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 0bit 0pps backlog 0b 0p requeues 0
> qdisc ingress ffff: parent ffff:fff1 ----------------
>  Sent 506821 bytes 1916 pkt (dropped 0, overlimits 0 requeues 0)
>  rate 0bit 0pps backlog 0b 0p requeues 0
> 
> So maybe all of that just wrong way of using TBF.
> At same time this means, if HTB and policers in filters done same way, that 
> QoS in Linux cannot do similar to squid delay pools feature:
> 
> First 10Mb give with 1Mbit/s, then slow 64Kbit/s. If user use less than 64K - 
> recharge with that unused bandwidth a "10 Mb / 1Mbit bucket".

I'll need to find more time to rethink your problem (and this patch),
because it really looks like your tbf usage is very uncommon. Anyway,
I guess these changes aren't for 2.6.31, unless there're similar
requests from other users soon.

Thanks for testing,
Jarek P.

> 
> On Tuesday 25 August 2009 12:41:20 Jarek Poplawski wrote:
> > On Tue, Aug 25, 2009 at 09:00:35AM +0000, Jarek Poplawski wrote:
> > > On Tue, Aug 25, 2009 at 08:43:06AM +0000, Jarek Poplawski wrote:
> > > ...
> > >
> > > > since these 64 bits will be needed soon for higher rates anyway, I
> > > > guess we could try some change like the patch below, if you find it
> > > > works for you (I didn't test it yet.)
> >
> > I hope this time it works...
> >
> > Jarek P.
> >
> > --- (take 2)
> >
> >  net/sched/sch_tbf.c |   14 +++++++-------
> >  1 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
> > index e22dfe8..7d0fe69 100644
> > --- a/net/sched/sch_tbf.c
> > +++ b/net/sched/sch_tbf.c
> > @@ -108,8 +108,8 @@ struct tbf_sched_data
> >  	struct qdisc_rate_table	*P_tab;
> >
> >  /* Variables */
> > -	long	tokens;			/* Current number of B tokens */
> > -	long	ptokens;		/* Current number of P tokens */
> > +	u32	tokens;			/* Current number of B tokens */
> > +	u32	ptokens;		/* Current number of P tokens */
> >  	psched_time_t	t_c;		/* Time check-point */
> >  	struct Qdisc	*qdisc;		/* Inner qdisc, default - bfifo queue */
> >  	struct qdisc_watchdog watchdog;	/* Watchdog timer */
> > @@ -160,21 +160,21 @@ static struct sk_buff *tbf_dequeue(struct Qdisc* sch)
> >
> >  	if (skb) {
> >  		psched_time_t now;
> > -		long toks;
> > -		long ptoks = 0;
> > +		long long toks;
> > +		long long ptoks = 0;
> >  		unsigned int len = qdisc_pkt_len(skb);
> >
> >  		now = psched_get_time();
> > -		toks = psched_tdiff_bounded(now, q->t_c, q->buffer);
> > +		toks = min_t(u32, now - q->t_c, q->buffer);
> >
> >  		if (q->P_tab) {
> >  			ptoks = toks + q->ptokens;
> > -			if (ptoks > (long)q->mtu)
> > +			if (ptoks > q->mtu)
> >  				ptoks = q->mtu;
> >  			ptoks -= L2T_P(q, len);
> >  		}
> >  		toks += q->tokens;
> > -		if (toks > (long)q->buffer)
> > +		if (toks > q->buffer)
> >  			toks = q->buffer;
> >  		toks -= L2T(q, len);
> 
> 

^ permalink raw reply

* Re: iproute2 / tbf with large burst seems broken again
From: Denys Fedoryschenko @ 2009-08-25 12:18 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: netdev
In-Reply-To: <20090825121344.GA12320@ff.dom.local>

On Tuesday 25 August 2009 15:13:44 Jarek Poplawski wrote:
> I'll need to find more time to rethink your problem (and this patch),
> because it really looks like your tbf usage is very uncommon. Anyway,
> I guess these changes aren't for 2.6.31, unless there're similar
> requests from other users soon.
>
>Thanks for testing,
>Jarek P.
I guess even no need for any kernel :-)

Just maybe good idea in next kernels to document this or handle overflow, that 
it will give warning in kernel. Otherwise user will have non-functional qdisc 
that will not pass traffic.

^ permalink raw reply

* Re: TCP keepalive timer problem
From: Eric Dumazet @ 2009-08-25 13:13 UTC (permalink / raw)
  To: Li_Xin2; +Cc: linux-kernel, Linux Netdev List
In-Reply-To: <0939B589FC103041945B9F13274963E303B1A9D4@CORPUSMX90A.corp.emc.com>

Li_Xin2@emc.com a écrit :
> Greetings,
> 
> I found one problem in Linux TCP keepalive timer processing, after
> searching on google, I found Daniel Stempel reported the same problem in
> 2007 (http://lkml.indiana.edu/hypermail/linux/kernel/0702.2/1136.html),
> but got no answer. So I have to reraise it.
> 
> Can anyone help answer this two-years long question?
> 
>

You should explain your problem in detail, since Daniel one was probably different.

He mentioned "(timeout is set to e.g. 30 seconds)" which is kind of nasty, given normal one is 7200

If some packets are in flight, keepalive is not fired at all, since normal
retransmits should take place (check tcp_retries2 sysctl).

TCP Keepalive is only fired when no trafic occurred for a long time, only if 
SO_KEEPALIVE socket option was enabled by application.

tcp_retries2 (integer; default: 15)
    The maximum number of times a TCP packet is retransmitted in established state
before giving up. The default value is 15, which corresponds to a duration of
approximately between 13 to 30 minutes, depending on the retransmission timeout.
The RFC 1122 specified minimum limit of 100 seconds is typically deemed too short. 

^ permalink raw reply

* Re: [PATCHv4 2/2] vhost_net: a kernel-level virtio server
From: Michael S. Tsirkin @ 2009-08-25 13:16 UTC (permalink / raw)
  To: Rusty Russell
  Cc: virtualization, netdev, kvm, linux-kernel, mingo, linux-mm, akpm,
	hpa, gregory.haskins
In-Reply-To: <200908252140.41295.rusty@rustcorp.com.au>

Thanks for the comments, I'll work on them ASAP.
Answers to questions and more comments below.

On Tue, Aug 25, 2009 at 09:40:40PM +0930, Rusty Russell wrote:
> On Thu, 20 Aug 2009 12:33:09 am Michael S. Tsirkin wrote:
> > What it is: vhost net is a character device that can be used to reduce
> > the number of system calls involved in virtio networking.
> > Existing virtio net code is used in the guest without modification.
> 
> ...
> 
> > +config VHOST_NET
> > +	tristate "Host kernel accelerator for virtio net"
> > +	depends on NET && EVENTFD
> > +	---help---
> > +	  This kernel module can be loaded in host kernel to accelerate
> > +	  guest networking with virtio_net. Not to be confused with virtio_net
> > +	  module itself which needs to be loaded in guest kernel.
> > +
> > +	  To compile this driver as a module, choose M here: the module will
> > +	  be called vhost_net.
> 
> Just want to note that the patch explanation and the Kconfig help text are
> exceptional examples of reader-oriented text.  Nice!

High praise indeed from the author of the lguest Quest :).

> > +		/* Sanity check */
> > +		if (vq->iov->iov_len != sizeof(struct virtio_net_hdr)) {
> > +			vq_err(vq, "Unexpected header len for TX: "
> > +			       "%ld expected %zd\n", vq->iov->iov_len,
> > +			       sizeof(struct virtio_net_hdr));
> > +			break;
> > +		}
> 
> OK, this check, which is in the qemu version, is *wrong*.  There should be
> no assumption on sg boundaries.  For example, the guest should be able to
> put the virtio_net_hdr in the front of the skbuf data if there is room.
> 
> You should try to explicitly "consume" sizeof(struct virtio_net_hdr) of the
> iov, and if fail, do this message.  You can skip the out <= 1 test then,
> too.
> 
> Anyway, I really prefer vq->iov[0]. to vq->iov-> here.

I'll fix that. Probably should fix qemu as well.

> > +		/* Sanity check */
> > +		if (vq->iov->iov_len != sizeof(struct virtio_net_hdr)) {
> > +			vq_err(vq, "Unexpected header len for RX: "
> > +			       "%ld expected %zd\n",
> > +			       vq->iov->iov_len, sizeof(struct virtio_net_hdr));
> > +			break;
> 
> Here too.
> 
> > +	u32 __user *featurep = argp;
> > +	int __user *fdp = argp;
> > +	u32 features;
> > +	int fd, r;
> > +	switch (ioctl) {
> > +	case VHOST_NET_SET_SOCKET:
> > +		r = get_user(fd, fdp);
> > +		if (r < 0)
> > +			return r;
> > +		return vhost_net_set_socket(n, fd);
> > +	case VHOST_GET_FEATURES:
> > +		/* No features for now */
> > +		features = 0;
> > +		return put_user(features, featurep);
> 
> We may well get more than 32 feature bits, at least for virtio_net, which will
> force us to do some trickery in virtio_pci.  I'd like to avoid that here,
> though it's kind of ugly.  We'd need VHOST_GET_FEATURES (and ACK) to take a
> struct like:
> 
> 	u32 feature_size;
> 	u32 features[];

Do you feel just making it 64 bit won't be enough?  How about 128 bit?

> > +int vhost_net_init(void)
> 
> static?
> 
> > +void vhost_net_exit(void)
> 
> static?

Good catch.

> > +/* Start polling a file. We add ourselves to file's wait queue. The user must
> > + * keep a reference to a file until after vhost_poll_stop is called. */
> 
> I experienced minor confusion from the comments in this file.  Where you said
> "user" I think "caller".  No biggie though.
> 
> > +	memory->nregions = 2;
> > +	memory->regions[0].guest_phys_addr = 1;
> > +	memory->regions[0].userspace_addr = 1;
> > +	memory->regions[0].memory_size = ~0ULL;
> > +	memory->regions[1].guest_phys_addr = 0;
> > +	memory->regions[1].userspace_addr = 0;
> > +	memory->regions[1].memory_size = 1;
> 
> Not sure I understand why there are two regions to start?

We are trying to cover a whole 2^64 range here.  It's size does not fit
in a single 64 bit length value.  I could special case 0 length to mean
2^64, but decided against it.

> > +	case VHOST_SET_VRING_BASE:
> > +		r = copy_from_user(&s, argp, sizeof s);
> > +		if (r < 0)
> > +			break;
> > +		if (s.num > 0xffff) {
> > +			r = -EINVAL;
> > +			break;
> > +		}
> > +		vq->last_avail_idx = s.num;
> > +		break;
> > +	case VHOST_GET_VRING_BASE:
> > +		s.index = idx;
> > +		s.num = vq->last_avail_idx;
> > +		r = copy_to_user(argp, &s, sizeof s);
> > +		break;
> 
> Ah, this is my fault.  I didn't expose the last_avail_idx in the ring
> because the other side doesn't need it; but without it the ring state is not
> fully observable from outside (no external save / restore!).
> 
> I have a patch which published these indices (we have room), see:
> 	http://ozlabs.org/~rusty/kernel/rr-2009-08-12-1/virtio:ring-publish-indices.patch
> 
> Perhaps we should use that mechanism instead?  We don't actually have to
> offer the feature (we don't care about the guest state), but it's nice as
> documentation.  I've been waiting for an excuse to use that patch.

Good idea and might be handy for optimizations as well, and I
would have used it if it was there.  I'd like to support existing guests
in vhost though, so I think we need to support this ioctl for now.

> > +long vhost_dev_ioctl(struct vhost_dev *d, unsigned int ioctl, unsigned long arg)
> > +{
> > +	void __user *argp = (void __user *)arg;
> > +	long r;
> > +
> > +	mutex_lock(&d->mutex);
> > +	if (ioctl == VHOST_SET_OWNER) {
> > +		r = vhost_dev_set_owner(d);
> > +		goto done;
> > +	}
> > +
> > +	r = vhost_dev_check_owner(d);
> 
> You can do a VHOST_SET_OWNER without being the owner?

Only if no one else is the owner.  It has a mutual exclusion
mechanism.

> So really,
> the -EPERM from all the vhost_dev_check_owner() is not a security thing,
> but a "I don't think you mean to do that" thing?

Mostly that.  I started by assuming that an open fd can't be
passed around at all, but talking with management guys here,
they really like being able to open fds and pass them around
through unix domain sockets.

Since using this fd from multiple processes does not work well,
I decided to make this explicit in the interface.  I find it quite
possible that there's no security thing here, but this is just a simpler
model to think about than guessing whether some crash is exploitable or
not.

> If so, a comment above it might help?

Yes.

> > +static const struct vhost_memory_region *find_region(struct vhost_memory *mem,
> > +						     __u64 addr, __u32 len)
> > +{
> > +	struct vhost_memory_region *reg;
> > +	int i;
> > +	/* linear search is not brilliant, but we really have on the order of 6
> > +	 * regions in practice */
> 
> Ah, you actually mean "this code has been carefully cache-optimized for the
> common case" :)
> 
> > +/* FIXME: this does not handle a region that spans multiple
> > + * address/len pairs */
> > +int translate_desc(struct vhost_dev *dev, u64 addr, u32 len,
> > +		   struct iovec iov[], int iov_count, int iov_size,
> > +		   unsigned *num)
> > +{
> > +	const struct vhost_memory_region *reg;
> > +	struct vhost_memory *mem;
> > +	struct iovec *_iov;
> > +	u64 s = 0;
> > +	int ret = 0;
> 
> Would this be neater if it returned the num iovecs used?  And offsetting
> iov in the caller, rather than passing iov_count?

iov_size would have to be tweaked instead as well.

> > +	/* If their number is silly, that's a fatal mistake. */
> > +	if (head >= vq->num) {
> > +		vq_err(vq, "Guest says index %u > %u is available",
> > +		       head, vq->num);
> > +		return vq->num;
> > +	}
> 
> Not a fatal mistake in this code/
> 
> > +	vq->inflight++;
> 
> vq->inflight was a brain fart in the old lguest code.  See
> commit ebf9a5a99c1a464afe0b4dfa64416fc8b273bc5c.

I wondered about that. OK.

> Also, see other fixes to the lguest launcher since then which might
> be relevant to this code:
> 	lguest: get more serious about wmb() in example Launcher code
> 	lguest: clean up length-used value in example launcher

I'll go over them, thanks!
I did look over barriers, but this is tricky stuff.

> > +	/* If they don't want an interrupt, don't send one, unless empty. */
> > +	if ((flags & VRING_AVAIL_F_NO_INTERRUPT) && vq->inflight)
> > +		return;
> 
> And I wouldn't support notify on empty at all, TBH.

If I don't, virtio net in guest uses a timer, which might be expensive.
Will need to check what this does.

>  It should
> definitely be conditional on the guest accepting the NOTIFY_ON_EMPTY
> feature.

Good point.

> > +/* The virtqueue structure describes a queue attached to a device. */
> > +struct vhost_virtqueue {
> ...
> > +} ____cacheline_aligned;
> 
> Really?  I'd want to see numbers on this one.  False sharing vs. more cache
> utilization.

I don't yet want to focus on micro optimizations.  What's your guess?
That it's better without? I'll kill it then ...


> > +#define vq_err(vq, fmt, ...) do {                                  \
> > +		printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__);       \
> > +		if ((vq)->error_ctx)                               \
> > +				eventfd_signal((vq)->error_ctx, 1);\
> > +	} while (0)
> 
> Mmm... guests should not be able to create unlimited printks in the host.

Yes, but handy for debugging :)
I guess I'll just make it use pr_debug instead?

> But really, nothing major to object to in here...
> 
> Thanks!
> Rusty.

^ permalink raw reply

* Re: [PATCH v2] sctp: fix the check for path failure detection
From: Vlad Yasevich @ 2009-08-25 13:31 UTC (permalink / raw)
  To: Luo Chunbo; +Cc: Wei Yongjun, davem, netdev, linux-sctp, linux-kernel
In-Reply-To: <1251188548.6498.28.camel@pek-cluo-desktop>

Luo Chunbo wrote:
> On Tue, 2009-08-25 at 15:36 +0800, Wei Yongjun wrote:
>> Chunbo Luo wrote:
>>> The transport error count should be incremented when an outstanding
>>> HB is not acknowledged. And the path failure detection should be done
>>> before sending out the HB.
>>>   
>>> Signed-off-by: Chunbo Luo <chunbo.luo@windriver.com>
>>> ---
>>>  net/sctp/sm_sideeffect.c |    6 +++++-
>>>  net/sctp/sm_statefuns.c  |    8 ++++----
>>>  2 files changed, 9 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
>>> index 86426aa..fbdf4de 100644
>>> --- a/net/sctp/sm_sideeffect.c
>>> +++ b/net/sctp/sm_sideeffect.c
>>> @@ -446,7 +446,11 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
>>>  	if (transport->state != SCTP_UNCONFIRMED)
>>>  		asoc->overall_error_count++;
>>>  
>>> -	if (transport->state != SCTP_INACTIVE &&
>>> +	/*
>>> +	 * The transport error count is incremented when an outstanding HB
>>> +	 * is not acknowledged. 
>>> +	 */
>>>   
>> T3-rtx timer expires also need to increment error count.
> 
> Yes, T3-rtx timer expires need to increment error count.
> 
>>> +	if (transport->hb_sent && transport->state != SCTP_INACTIVE &&
>>>  	    (transport->error_count++ >= transport->pathmaxrxt)) {
>>>  		SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
>>>  					 " transport IP: port:%d failed.\n",
>>> diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
>>> index 7288192..7f77099 100644
>>> --- a/net/sctp/sm_statefuns.c
>>> +++ b/net/sctp/sm_statefuns.c
>>> @@ -981,10 +981,6 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
>>>  	 */
>>>  
>>>  	if (transport->param_flags & SPP_HB_ENABLE) {
>>> -		if (SCTP_DISPOSITION_NOMEM ==
>>> -				sctp_sf_heartbeat(ep, asoc, type, arg,
>>> -						  commands))
>>> -			return SCTP_DISPOSITION_NOMEM;
>>>  		/* Set transport error counter and association error counter
>>>  		 * when sending heartbeat.
>>>  		 */
>>> @@ -992,6 +988,10 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
>>>  				SCTP_TRANSPORT(transport));
>>>  		sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_HB_SENT,
>>>  				SCTP_TRANSPORT(transport));
>>> +		if (SCTP_DISPOSITION_NOMEM ==
>>> +				sctp_sf_heartbeat(ep, asoc, type, arg,
>>> +						  commands))
>>> +			return SCTP_DISPOSITION_NOMEM;
>>>  	}
>>>  	sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE,
>>>  			SCTP_TRANSPORT(transport));
>>>   
>> How about this one:
> 
> It is ok to increment the error count. But the path failure detection
> should be done before send HB. Otherwise, an extra HB chunk will be sent
> out before the transport is marked DOWN . So the changes in
> net/sctp/sm_statefuns.c is also needed.

After running a few simulations with all the different patches from this thread,
what we are really after was achieved by the original patch.  Looking back over
the code history, it looks like this was try to implement the old text of
section 8.3 (prior to errata that fixed it).

We still have to send HB on an INACTIVE transport to see if it comes back, so
that comment of my was entirely wrong.  Sorry, don't know what I was thinking at
that time...

So I'll take the original patch Luo submitted.

Thanks
-vlad

> 
> 
> 
>> diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
>> index 86426aa..fb723dd 100644
>> --- a/net/sctp/sm_sideeffect.c
>> +++ b/net/sctp/sm_sideeffect.c
>> @@ -447,7 +447,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
>>  		asoc->overall_error_count++;
>>  
>>  	if (transport->state != SCTP_INACTIVE &&
>> -	    (transport->error_count++ >= transport->pathmaxrxt)) {
>> +	    (transport->error_count >= transport->pathmaxrxt)) {
>>  		SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
>>  					 " transport IP: port:%d failed.\n",
>>  					 asoc,
>> @@ -468,6 +468,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
>>  	 * that indicates that we have an outstanding HB.
>>  	 */
>>  	if (!is_hb || transport->hb_sent) {
>> +		transport->error_count++;
>>  		transport->last_rto = transport->rto;
>>  		transport->rto = min((transport->rto * 2), transport->asoc->rto_max);
>>  	}
>>
>>
>>
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: UDP multicast packet loss not reported if TX ring overrun?
From: Christoph Lameter @ 2009-08-25 13:45 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Sridhar Samudrala, Nivedita Singhvi, netdev
In-Reply-To: <4A931ED3.1090206@gmail.com>

On Tue, 25 Aug 2009, Eric Dumazet wrote:

> Thread model: posix
> gcc version 4.4.1 (GCC)
> # pwd
> /opt/src/lldiag-0.14
> # make
> gcc -Wall -omcast mcast.c -lrt -lm
> mcast.c: In function ?set_ip?:
> mcast.c:121: warning: implicit declaration of function ?htons?
> mcast.c: In function ?build_pattern_array?:
> mcast.c:168: warning: implicit declaration of function ?htonl?
> /tmp/cc4sYCDr.o: In function `lock':
> mcast.c:(.text+0xcad): undefined reference to `__sync_fetch_and_add_4'
> collect2: ld returned 1 exit status
> make: *** [mcast] Error 1
>
>
> I have no idea where is defined sync_fetch_and_add

Its a GCC builtin for x86 sigh. Ok will put out 0.15 that disables their
use by default.


^ permalink raw reply

* Re: UDP multicast packet loss not reported if TX ring overrun?
From: Christoph Lameter @ 2009-08-25 13:46 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Sridhar Samudrala, Nivedita Singhvi, netdev, David S. Miller
In-Reply-To: <4A930DEF.5000008@gmail.com>

On Tue, 25 Aug 2009, Eric Dumazet wrote:

> NET_XMIT_CN strikes again :)
>
> Well, if ip_local_out() returns a negative error (say -EPERM for example),
>  your patch disables OUTDISCARDS increments.
>
> Maybe a simpler patch like this one ?

Yes looks good. Can we get this in soon?


^ permalink raw reply

* Re: UDP multicast packet loss not reported if TX ring overrun?
From: Christoph Lameter @ 2009-08-25 13:48 UTC (permalink / raw)
  To: Sridhar Samudrala; +Cc: Eric Dumazet, Nivedita Singhvi, netdev, David S. Miller
In-Reply-To: <1251153361.29173.25.camel@w-sridhar.beaverton.ibm.com>

On Mon, 24 Aug 2009, Sridhar Samudrala wrote:

> So are you hitting this case with your workload and does this account for all the
> packet losses you are seeing?

Yes.

> If we are dropping the packet and returing NET_XMIT_DROP, should
> we also increment qdisc drop stats (sch->qstats.drops)?

I think so but I am no expert. I was surprised to not even see counter
increments at that level. But I was content to fix up the higher level
tracking to have at least one counter that showed the packet loss.

> If we count these drops as qdisc drops, should we also count them as IP OUTDISCARDS?

Yes.


^ permalink raw reply

* Re: UDP multicast packet loss not reported if TX ring overrun?
From: Eric Dumazet @ 2009-08-25 13:48 UTC (permalink / raw)
  To: Christoph Lameter
  Cc: Sridhar Samudrala, Nivedita Singhvi, netdev, David S. Miller
In-Reply-To: <alpine.DEB.1.10.0908250945460.5972@gentwo.org>

Christoph Lameter a écrit :
> On Tue, 25 Aug 2009, Eric Dumazet wrote:
> 
>> NET_XMIT_CN strikes again :)
>>
>> Well, if ip_local_out() returns a negative error (say -EPERM for example),
>>  your patch disables OUTDISCARDS increments.
>>
>> Maybe a simpler patch like this one ?
> 
> Yes looks good. Can we get this in soon?
> 

Please hold on, I would like to fully understand what's happening,
and test the patch :)



^ permalink raw reply

* Re: UDP multicast packet loss not reported if TX ring overrun?
From: Christoph Lameter @ 2009-08-25 14:00 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Sridhar Samudrala, Nivedita Singhvi, netdev, David S. Miller
In-Reply-To: <4A93EB9B.5020600@gmail.com>

On Tue, 25 Aug 2009, Eric Dumazet wrote:

> Please hold on, I would like to fully understand what's happening,
> and test the patch :)

Ok. It would be good if the drops would also be somehow noted by the UDP
subsystem (one should see something with netstat -su) and may be even the
socket. I see a drops column in /proc/net/udp. rx_drops, tx_drops?

^ permalink raw reply

* Re: [Bridge] VLANs and bridge
From: Patrick McHardy @ 2009-08-25 14:00 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: Simon Barber, bridge, netdev
In-Reply-To: <OF7400A5E8.F4AC001F-ONC125761C.00674A25-C125761C.00679758@transmode.se>

Joakim Tjernlund wrote:
> Simon Barber <simon@superduper.net> wrote on 22/08/2009 19:12:10:
>> Looking through B.1.3 it looks like the patch would need some
>> enhancement. It provides a good basis - handling tagging/untagging and
>> filtering, but would need a way to specify the untagged vlan separately
>> for in and out.
> 
> I see. Perhaps the VLAN maintainer(CC:ed) can comment too. Especially about extending
> the VLAN code to allowed several VLANs in one interface?

Just accepting additional VIDs on one VLAN device should be
a relatively trivial change, all you need to do is call
vlan_group_set_device() with the additional VIDs.

I'd suggest to add something similar to the QoS-mapping lists
in vlan_netlink.c for the additional VIDs.





^ permalink raw reply

* Re: TCP keepalive timer problem
From: Andi Kleen @ 2009-08-25 14:04 UTC (permalink / raw)
  To: Li_Xin2; +Cc: linux-kernel, netdev
In-Reply-To: <0939B589FC103041945B9F13274963E303B1A9D4@CORPUSMX90A.corp.emc.com>

<Li_Xin2@emc.com> writes:

[cc netdev]

> Greetings,
>
> I found one problem in Linux TCP keepalive timer processing, after
> searching on google, I found Daniel Stempel reported the same problem in
> 2007 (http://lkml.indiana.edu/hypermail/linux/kernel/0702.2/1136.html),
> but got no answer. So I have to reraise it.
>
> Can anyone help answer this two-years long question?

I think the idea behind the tcp_keepalive_timer check referrenced in the 
other mail is: when there are outstanding non acked packets then 
the normal retransmit timer will do keep alive because it will
retransmit and retransmit in exponential backoff and eventually notice 
something is wrong.

The obvious hole is that if the keepalive is shorter than the worst
case retransmit timeout then you'll have to wait for the longer
timeout.  I presume that's what is happening for you? You set the 
keep alive timeout very low and expect the timeout to be very low,
but it's 30+mins (default retransmit timeout)?

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply

* RE: TCP keepalive timer problem
From: Li_Xin2 @ 2009-08-25 14:05 UTC (permalink / raw)
  To: eric.dumazet; +Cc: linux-kernel, netdev
In-Reply-To: <4A93E36C.8070502@gmail.com>

 
Thanks for your quick reply, let me explain my problem in detail.

Suppose the client side of communication sets the keep alive socket option, connects to server, then we pulls out the network cable of server box. After the connection is idle for TCP_KEEPIDLE seconds, the first keepalive probe packet is sent, and of course no reply is received. Just after the first probe packet, the client sends some data. No response is received, and as you said, the normal retransmission takes place and no further keepalive probe will be sent. 

	The problem is: application that tries the keepalive mechanism expects communication peer crash detection within TCP_KEEPIDLE + TCP_KEEPCNT * TCP_KEEPINTVL seconds. Application may set relative smaller TCP_KEEPIDLE, TCP_KEEPCNT and TCP_KEEPINTVL value so that peer crash can be detected quickly, for example, 60 seconds. But if the keepalive is intervened with retransmission, the latter takes higher priority, so that peer crash will be detected after 13 to 30 minutes, which may not be acceptable for some applications.

We tried TCP implementation on Windows XP SP3, the keepalive and retransmission don't intervene.

Regards,
Xin Li
EMC Shanghai R&D Centre
Email: Li_Xin2@emc.com
Tel: 86 21 6095 1100 x 2257

-----Original Message-----
From: Eric Dumazet [mailto:eric.dumazet@gmail.com] 
Sent: 2009年8月25日 21:13
To: Li, Xin
Cc: linux-kernel@vger.kernel.org; Linux Netdev List
Subject: Re: TCP keepalive timer problem

Li_Xin2@emc.com a écrit :
> Greetings,
> 
> I found one problem in Linux TCP keepalive timer processing, after
> searching on google, I found Daniel Stempel reported the same problem in
> 2007 (http://lkml.indiana.edu/hypermail/linux/kernel/0702.2/1136.html),
> but got no answer. So I have to reraise it.
> 
> Can anyone help answer this two-years long question?
> 
>

You should explain your problem in detail, since Daniel one was probably different.

He mentioned "(timeout is set to e.g. 30 seconds)" which is kind of nasty, given normal one is 7200

If some packets are in flight, keepalive is not fired at all, since normal
retransmits should take place (check tcp_retries2 sysctl).

TCP Keepalive is only fired when no trafic occurred for a long time, only if 
SO_KEEPALIVE socket option was enabled by application.

tcp_retries2 (integer; default: 15)
    The maximum number of times a TCP packet is retransmitted in established state
before giving up. The default value is 15, which corresponds to a duration of
approximately between 13 to 30 minutes, depending on the retransmission timeout.
The RFC 1122 specified minimum limit of 100 seconds is typically deemed too short. 

^ permalink raw reply

* [net-next PATCH] e1000: Remove unused function e1000_mta_set.
From: Jeff Kirsher @ 2009-08-25 14:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Dave Graham, Jeff Kirsher

From: Graham, David <david.graham@intel.com>

Remove function e1000_mta_set, as it is no longer called

Signed-off-by: Dave Graham <david.graham@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/e1000/e1000_hw.c |   46 ------------------------------------------
 1 files changed, 0 insertions(+), 46 deletions(-)

diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 1e5ae11..cda6b39 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -5759,52 +5759,6 @@ u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
 }
 
 /******************************************************************************
- * Sets the bit in the multicast table corresponding to the hash value.
- *
- * hw - Struct containing variables accessed by shared code
- * hash_value - Multicast address hash value
- *****************************************************************************/
-void e1000_mta_set(struct e1000_hw *hw, u32 hash_value)
-{
-    u32 hash_bit, hash_reg;
-    u32 mta;
-    u32 temp;
-
-    /* The MTA is a register array of 128 32-bit registers.
-     * It is treated like an array of 4096 bits.  We want to set
-     * bit BitArray[hash_value]. So we figure out what register
-     * the bit is in, read it, OR in the new bit, then write
-     * back the new value.  The register is determined by the
-     * upper 7 bits of the hash value and the bit within that
-     * register are determined by the lower 5 bits of the value.
-     */
-    hash_reg = (hash_value >> 5) & 0x7F;
-    if (hw->mac_type == e1000_ich8lan)
-        hash_reg &= 0x1F;
-
-    hash_bit = hash_value & 0x1F;
-
-    mta = E1000_READ_REG_ARRAY(hw, MTA, hash_reg);
-
-    mta |= (1 << hash_bit);
-
-    /* If we are on an 82544 and we are trying to write an odd offset
-     * in the MTA, save off the previous entry before writing and
-     * restore the old value after writing.
-     */
-    if ((hw->mac_type == e1000_82544) && ((hash_reg & 0x1) == 1)) {
-        temp = E1000_READ_REG_ARRAY(hw, MTA, (hash_reg - 1));
-        E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta);
-        E1000_WRITE_FLUSH();
-        E1000_WRITE_REG_ARRAY(hw, MTA, (hash_reg - 1), temp);
-        E1000_WRITE_FLUSH();
-    } else {
-        E1000_WRITE_REG_ARRAY(hw, MTA, hash_reg, mta);
-        E1000_WRITE_FLUSH();
-    }
-}
-
-/******************************************************************************
  * Puts an ethernet address into a receive address register.
  *
  * hw - Struct containing variables accessed by shared code


^ permalink raw reply related

* [net-next PATCH 1/3] ixgbe: Fix isues while reporting 8259x backplane link capabilities
From: Jeff Kirsher @ 2009-08-25 14:47 UTC (permalink / raw)
  To: davem
  Cc: netdev, gospo, Mallikarjuna R Chilakala, Peter P Waskiewicz Jr,
	Jeff Kirsher

From: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>

Fix ethtool get_settings logic to report 10G & 1G advertised and
supported link modes in all 8259x 10G backplane connection types
except for 82598EB BX network connection type.

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe_ethtool.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index dd221bb..1444ec5 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -169,23 +169,20 @@ static int ixgbe_get_settings(struct net_device *netdev,
 		}
 	} else if (hw->phy.media_type == ixgbe_media_type_backplane) {
 		/* Set as FIBRE until SERDES defined in kernel */
-		switch (hw->device_id) {
-		case IXGBE_DEV_ID_82598:
-			ecmd->supported |= (SUPPORTED_1000baseT_Full |
-				SUPPORTED_FIBRE);
-			ecmd->advertising = (ADVERTISED_10000baseT_Full |
-				ADVERTISED_1000baseT_Full |
-				ADVERTISED_FIBRE);
-			ecmd->port = PORT_FIBRE;
-			break;
-		case IXGBE_DEV_ID_82598_BX:
+		if (hw->device_id == IXGBE_DEV_ID_82598_BX) {
 			ecmd->supported = (SUPPORTED_1000baseT_Full |
 					   SUPPORTED_FIBRE);
 			ecmd->advertising = (ADVERTISED_1000baseT_Full |
 					     ADVERTISED_FIBRE);
 			ecmd->port = PORT_FIBRE;
 			ecmd->autoneg = AUTONEG_DISABLE;
-			break;
+		} else {
+			ecmd->supported |= (SUPPORTED_1000baseT_Full |
+					    SUPPORTED_FIBRE);
+			ecmd->advertising = (ADVERTISED_10000baseT_Full |
+					     ADVERTISED_1000baseT_Full |
+					     ADVERTISED_FIBRE);
+			ecmd->port = PORT_FIBRE;
 		}
 	} else {
 		ecmd->supported |= SUPPORTED_FIBRE;


^ permalink raw reply related

* [net-next PATCH 2/3] ixgbe: cleanup functions that should have been defined static
From: Jeff Kirsher @ 2009-08-25 14:47 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Don Skidmore, Jeff Kirsher
In-Reply-To: <20090825144709.15560.28811.stgit@localhost.localdomain>

From: Don Skidmore <donald.c.skidmore@intel.com>

We have some ~40 functions that were being called out with 'make
namespacecheck'.  This patch changes these functions to be static.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/ixgbe/ixgbe.h        |   35 ---------
 drivers/net/ixgbe/ixgbe_82598.c  |    6 +
 drivers/net/ixgbe/ixgbe_82599.c  |  156 ++++++++++++++++++--------------------
 drivers/net/ixgbe/ixgbe_common.c |    3 -
 drivers/net/ixgbe/ixgbe_common.h |    1 
 drivers/net/ixgbe/ixgbe_main.c   |    2 
 6 files changed, 81 insertions(+), 122 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 8f1f8ba..c983c89 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -424,55 +424,20 @@ extern s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc);
 extern s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
                                                  struct ixgbe_atr_input *input,
                                                  u8 queue);
-extern s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
-                                               struct ixgbe_atr_input *input,
-                                               u16 soft_id,
-                                               u8 queue);
-extern u16 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *input, u32 key);
 extern s32 ixgbe_atr_set_vlan_id_82599(struct ixgbe_atr_input *input,
                                        u16 vlan_id);
 extern s32 ixgbe_atr_set_src_ipv4_82599(struct ixgbe_atr_input *input,
                                         u32 src_addr);
 extern s32 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input,
                                         u32 dst_addr);
-extern s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
-                                        u32 src_addr_1, u32 src_addr_2,
-                                        u32 src_addr_3, u32 src_addr_4);
-extern s32 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input,
-                                        u32 dst_addr_1, u32 dst_addr_2,
-                                        u32 dst_addr_3, u32 dst_addr_4);
 extern s32 ixgbe_atr_set_src_port_82599(struct ixgbe_atr_input *input,
                                         u16 src_port);
 extern s32 ixgbe_atr_set_dst_port_82599(struct ixgbe_atr_input *input,
                                         u16 dst_port);
 extern s32 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input,
                                          u16 flex_byte);
-extern s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input,
-                                       u8 vm_pool);
 extern s32 ixgbe_atr_set_l4type_82599(struct ixgbe_atr_input *input,
                                       u8 l4type);
-extern s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input,
-                                       u16 *vlan_id);
-extern s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input,
-                                        u32 *src_addr);
-extern s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input,
-                                        u32 *dst_addr);
-extern s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
-                                        u32 *src_addr_1, u32 *src_addr_2,
-                                        u32 *src_addr_3, u32 *src_addr_4);
-extern s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
-                                        u32 *dst_addr_1, u32 *dst_addr_2,
-                                        u32 *dst_addr_3, u32 *dst_addr_4);
-extern s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input,
-                                        u16 *src_port);
-extern s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input,
-                                        u16 *dst_port);
-extern s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input,
-                                         u16 *flex_byte);
-extern s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input,
-                                       u8 *vm_pool);
-extern s32 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input,
-                                      u8 *l4type);
 #ifdef IXGBE_FCOE
 extern void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter);
 extern int ixgbe_fso(struct ixgbe_adapter *adapter,
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 1c227b0..916430f 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -59,7 +59,7 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
  *  increase the value to either 10ms to 250ms for capability version 1 config,
  *  or 16ms to 55ms for version 2.
  **/
-void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
+static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
 {
 	struct ixgbe_adapter *adapter = hw->back;
 	u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR);
@@ -143,7 +143,7 @@ static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
  *  not known.  Perform the SFP init if necessary.
  *
  **/
-s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
+static s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw)
 {
 	struct ixgbe_mac_info *mac = &hw->mac;
 	struct ixgbe_phy_info *phy = &hw->phy;
@@ -204,7 +204,7 @@ out:
  *  Starts the hardware using the generic start_hw function.
  *  Then set pcie completion timeout
  **/
-s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
+static s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
 {
 	s32 ret_val = 0;
 
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 1984cab..364b6d2 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -38,22 +38,15 @@
 #define IXGBE_82599_MC_TBL_SIZE   128
 #define IXGBE_82599_VFT_TBL_SIZE  128
 
-s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
-                                      ixgbe_link_speed *speed,
-                                      bool *autoneg);
-enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw);
-s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw);
-s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
+static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw);
+static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
                                      ixgbe_link_speed speed, bool autoneg,
                                      bool autoneg_wait_to_complete);
-s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw);
-s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw,
-                               ixgbe_link_speed *speed,
-                               bool *link_up, bool link_up_wait_to_complete);
-s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
-                                     ixgbe_link_speed speed,
-                                     bool autoneg,
-                                     bool autoneg_wait_to_complete);
+static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw);
+static s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
+                                            ixgbe_link_speed speed,
+                                            bool autoneg,
+                                            bool autoneg_wait_to_complete);
 static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw,
                                              ixgbe_link_speed *speed,
                                              bool *autoneg);
@@ -62,21 +55,9 @@ static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw,
                                                ixgbe_link_speed speed,
                                                bool autoneg,
                                                bool autoneg_wait_to_complete);
-s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw);
-s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
-s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
-s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan,
-                         u32 vind, bool vlan_on);
-s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw);
-s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw);
-s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
-s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
-s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw);
-s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw);
-u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw);
 static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
 
-void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
+static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
 {
 	struct ixgbe_mac_info *mac = &hw->mac;
 	if (hw->phy.multispeed_fiber) {
@@ -93,7 +74,7 @@ void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
 	}
 }
 
-s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw)
 {
 	s32 ret_val = 0;
 	u16 list_offset, data_offset, data_value;
@@ -143,7 +124,7 @@ setup_sfp_out:
  *  Read PCIe configuration space, and get the MSI-X vector count from
  *  the capabilities table.
  **/
-u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw)
+static u32 ixgbe_get_pcie_msix_count_82599(struct ixgbe_hw *hw)
 {
 	struct ixgbe_adapter *adapter = hw->back;
 	u16 msix_count;
@@ -182,7 +163,7 @@ static s32 ixgbe_get_invariants_82599(struct ixgbe_hw *hw)
  *  not known.  Perform the SFP init if necessary.
  *
  **/
-s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
 {
 	struct ixgbe_mac_info *mac = &hw->mac;
 	struct ixgbe_phy_info *phy = &hw->phy;
@@ -225,9 +206,9 @@ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw)
  *
  *  Determines the link capabilities by reading the AUTOC register.
  **/
-s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
-                                      ixgbe_link_speed *speed,
-                                      bool *negotiation)
+static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
+                                             ixgbe_link_speed *speed,
+                                             bool *negotiation)
 {
 	s32 status = 0;
 	u32 autoc = 0;
@@ -344,7 +325,7 @@ static s32 ixgbe_get_copper_link_capabilities_82599(struct ixgbe_hw *hw,
  *
  *  Returns the media type (fiber, copper, backplane)
  **/
-enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
+static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
 {
 	enum ixgbe_media_type media_type;
 
@@ -379,7 +360,7 @@ out:
  *  Configures link settings based on values in the ixgbe_hw struct.
  *  Restarts the link.  Performs autonegotiation if needed.
  **/
-s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw)
 {
 	u32 autoc_reg;
 	u32 links_reg;
@@ -428,7 +409,7 @@ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw)
  *  fails at 10G.
  *  Performs autonegotiation if needed.
  **/
-s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw)
+static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw)
 {
 	s32 status = 0;
 	ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_82599_AUTONEG;
@@ -446,7 +427,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw)
  *
  *  Set the link speed in the AUTOC register and restarts link.
  **/
-s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
+static s32 ixgbe_setup_mac_link_speed_multispeed_fiber(struct ixgbe_hw *hw,
                                                 ixgbe_link_speed speed,
                                                 bool autoneg,
                                                 bool autoneg_wait_to_complete)
@@ -613,8 +594,10 @@ out:
  *
  *  Reads the links register to determine if link is up and the current speed
  **/
-s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
-                               bool *link_up, bool link_up_wait_to_complete)
+static s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw,
+                                      ixgbe_link_speed *speed,
+                                      bool *link_up,
+                                      bool link_up_wait_to_complete)
 {
 	u32 links_reg;
 	u32 i;
@@ -665,9 +648,10 @@ s32 ixgbe_check_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
  *
  *  Set the link speed in the AUTOC register and restarts link.
  **/
-s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
-                                     ixgbe_link_speed speed, bool autoneg,
-                                     bool autoneg_wait_to_complete)
+static s32 ixgbe_setup_mac_link_speed_82599(struct ixgbe_hw *hw,
+                                            ixgbe_link_speed speed,
+                                            bool autoneg,
+                                            bool autoneg_wait_to_complete)
 {
 	s32 status = 0;
 	u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
@@ -818,7 +802,7 @@ static s32 ixgbe_setup_copper_link_speed_82599(struct ixgbe_hw *hw,
  *  and clears all interrupts, perform a PHY reset, and perform a link (MAC)
  *  reset.
  **/
-s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
 {
 	s32 status = 0;
 	u32 ctrl, ctrl_ext;
@@ -943,7 +927,7 @@ reset_hw_out:
  *  @rar: receive address register index to disassociate
  *  @vmdq: VMDq pool index to remove from the rar
  **/
-s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
+static s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
 {
 	u32 mpsar_lo, mpsar_hi;
 	u32 rar_entries = hw->mac.num_rar_entries;
@@ -989,7 +973,7 @@ done:
  *  @rar: receive address register index to associate with a VMDq index
  *  @vmdq: VMDq pool index
  **/
-s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
+static s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
 {
 	u32 mpsar;
 	u32 rar_entries = hw->mac.num_rar_entries;
@@ -1019,8 +1003,8 @@ s32 ixgbe_set_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
  *
  *  Turn on/off specified VLAN in the VLAN filter table.
  **/
-s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, u32 vind,
-                         bool vlan_on)
+static s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, u32 vind,
+                                bool vlan_on)
 {
 	u32 regindex;
 	u32 bitindex;
@@ -1133,7 +1117,7 @@ out:
  *
  *  Clears the VLAN filer table, and the VMDq index associated with the filter
  **/
-s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw)
 {
 	u32 offset;
 
@@ -1153,7 +1137,7 @@ s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw)
  *  ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array
  *  @hw: pointer to hardware structure
  **/
-s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw)
 {
 	int i;
 	hw_dbg(hw, " Clearing UTA\n");
@@ -1430,7 +1414,8 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc)
  *  @stream: input bitstream to compute the hash on
  *  @key: 32-bit hash key
  **/
-u16 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *atr_input, u32 key)
+static u16 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *atr_input,
+                                        u32 key)
 {
 	/*
 	 * The algorithm is as follows:
@@ -1602,8 +1587,8 @@ s32 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 dst_addr)
  *  @src_addr_4: the fourth 4 bytes of the IP address to load
  **/
 s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
-                                 u32 src_addr_1, u32 src_addr_2,
-                                 u32 src_addr_3, u32 src_addr_4)
+                                        u32 src_addr_1, u32 src_addr_2,
+                                        u32 src_addr_3, u32 src_addr_4)
 {
 	input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET] = src_addr_4 & 0xff;
 	input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 1] =
@@ -1645,8 +1630,8 @@ s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input,
  *  @dst_addr_4: the fourth 4 bytes of the IP address to load
  **/
 s32 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input,
-                                 u32 dst_addr_1, u32 dst_addr_2,
-                                 u32 dst_addr_3, u32 dst_addr_4)
+                                        u32 dst_addr_1, u32 dst_addr_2,
+                                        u32 dst_addr_3, u32 dst_addr_4)
 {
 	input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET] = dst_addr_4 & 0xff;
 	input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 1] =
@@ -1723,7 +1708,8 @@ s32 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input, u16 flex_byte)
  *  @input: input stream to modify
  *  @vm_pool: the Virtual Machine pool to load
  **/
-s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input, u8 vm_pool)
+s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input,
+                                       u8 vm_pool)
 {
 	input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET] = vm_pool;
 
@@ -1747,7 +1733,8 @@ s32 ixgbe_atr_set_l4type_82599(struct ixgbe_atr_input *input, u8 l4type)
  *  @input: input stream to search
  *  @vlan: the VLAN id to load
  **/
-s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input, u16 *vlan)
+static s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input,
+                                       u16 *vlan)
 {
 	*vlan = input->byte_stream[IXGBE_ATR_VLAN_OFFSET];
 	*vlan |= input->byte_stream[IXGBE_ATR_VLAN_OFFSET + 1] << 8;
@@ -1760,7 +1747,8 @@ s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input, u16 *vlan)
  *  @input: input stream to search
  *  @src_addr: the IP address to load
  **/
-s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input, u32 *src_addr)
+static s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input,
+                                        u32 *src_addr)
 {
 	*src_addr = input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET];
 	*src_addr |= input->byte_stream[IXGBE_ATR_SRC_IPV4_OFFSET + 1] << 8;
@@ -1775,7 +1763,8 @@ s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input, u32 *src_addr)
  *  @input: input stream to search
  *  @dst_addr: the IP address to load
  **/
-s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 *dst_addr)
+static s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input,
+                                        u32 *dst_addr)
 {
 	*dst_addr = input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET];
 	*dst_addr |= input->byte_stream[IXGBE_ATR_DST_IPV4_OFFSET + 1] << 8;
@@ -1793,9 +1782,9 @@ s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 *dst_addr)
  *  @src_addr_3: the third 4 bytes of the IP address to load
  *  @src_addr_4: the fourth 4 bytes of the IP address to load
  **/
-s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
-                                 u32 *src_addr_1, u32 *src_addr_2,
-                                 u32 *src_addr_3, u32 *src_addr_4)
+static s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
+                                        u32 *src_addr_1, u32 *src_addr_2,
+                                        u32 *src_addr_3, u32 *src_addr_4)
 {
 	*src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 12];
 	*src_addr_1 = input->byte_stream[IXGBE_ATR_SRC_IPV6_OFFSET + 13] << 8;
@@ -1829,8 +1818,8 @@ s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input,
  *  @dst_addr_4: the fourth 4 bytes of the IP address to load
  **/
 s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
-                                 u32 *dst_addr_1, u32 *dst_addr_2,
-                                 u32 *dst_addr_3, u32 *dst_addr_4)
+                                        u32 *dst_addr_1, u32 *dst_addr_2,
+                                        u32 *dst_addr_3, u32 *dst_addr_4)
 {
 	*dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 12];
 	*dst_addr_1 = input->byte_stream[IXGBE_ATR_DST_IPV6_OFFSET + 13] << 8;
@@ -1865,7 +1854,8 @@ s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input,
  *  endianness when retrieving the data.  This can be confusing since the
  *  internal hash engine expects it to be big-endian.
  **/
-s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input, u16 *src_port)
+static s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input,
+                                        u16 *src_port)
 {
 	*src_port = input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET] << 8;
 	*src_port |= input->byte_stream[IXGBE_ATR_SRC_PORT_OFFSET + 1];
@@ -1883,7 +1873,8 @@ s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input, u16 *src_port)
  *  endianness when retrieving the data.  This can be confusing since the
  *  internal hash engine expects it to be big-endian.
  **/
-s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input, u16 *dst_port)
+static s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input,
+                                        u16 *dst_port)
 {
 	*dst_port = input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET] << 8;
 	*dst_port |= input->byte_stream[IXGBE_ATR_DST_PORT_OFFSET + 1];
@@ -1896,7 +1887,8 @@ s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input, u16 *dst_port)
  *  @input: input stream to modify
  *  @flex_bytes: the flexible bytes to load
  **/
-s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input, u16 *flex_byte)
+static s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input,
+                                         u16 *flex_byte)
 {
 	*flex_byte = input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET];
 	*flex_byte |= input->byte_stream[IXGBE_ATR_FLEX_BYTE_OFFSET + 1] << 8;
@@ -1909,7 +1901,8 @@ s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input, u16 *flex_byte)
  *  @input: input stream to modify
  *  @vm_pool: the Virtual Machine pool to load
  **/
-s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input, u8 *vm_pool)
+s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input,
+                                       u8 *vm_pool)
 {
 	*vm_pool = input->byte_stream[IXGBE_ATR_VM_POOL_OFFSET];
 
@@ -1921,7 +1914,8 @@ s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input, u8 *vm_pool)
  *  @input: input stream to modify
  *  @l4type: the layer 4 type value to load
  **/
-s32 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input, u8 *l4type)
+static s32 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input,
+                                      u8 *l4type)
 {
 	*l4type = input->byte_stream[IXGBE_ATR_L4TYPE_OFFSET];
 
@@ -2002,9 +1996,9 @@ s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
  *  hardware writes must be protected from one another.
  **/
 s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
-                                        struct ixgbe_atr_input *input,
-                                        u16 soft_id,
-                                        u8 queue)
+                                               struct ixgbe_atr_input *input,
+                                               u16 soft_id,
+                                               u8 queue)
 {
 	u32 fdircmd = 0;
 	u32 fdirhash;
@@ -2097,7 +2091,7 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
  *
  *  Performs read operation to Omer analog register specified.
  **/
-s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val)
+static s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val)
 {
 	u32  core_ctl;
 
@@ -2119,7 +2113,7 @@ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val)
  *
  *  Performs write operation to Omer analog register specified.
  **/
-s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val)
+static s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val)
 {
 	u32  core_ctl;
 
@@ -2139,7 +2133,7 @@ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val)
  *  Then performs device-specific:
  *  Clears the rate limiter registers.
  **/
-s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
 {
 	u32 q_num;
 	s32 ret_val;
@@ -2168,7 +2162,7 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
  *
  *  Determines the physical layer module found on the current adapter.
  **/
-s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
+static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
 {
 	s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
 	status = ixgbe_identify_phy_generic(hw);
@@ -2183,7 +2177,7 @@ s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
  *
  *  Determines physical layer capabilities of the current configuration.
  **/
-u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
+static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
 {
 	u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
 	u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
@@ -2290,7 +2284,7 @@ out:
  *
  *  Enables the Rx DMA unit for 82599
  **/
-s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
+static s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
 {
 #define IXGBE_MAX_SECRX_POLL 30
 	int i;
@@ -2335,7 +2329,7 @@ s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval)
  *  This function will read the EEPROM location for the device capabilities,
  *  and return the word through device_caps.
  **/
-s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps)
+static s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps)
 {
 	hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
 
@@ -2351,8 +2345,8 @@ s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps)
  *  pointer, and returns the value at that location.  This is used in both
  *  get and set mac_addr routines.
  **/
-s32 ixgbe_get_san_mac_addr_offset_82599(struct ixgbe_hw *hw,
-                                        u16 *san_mac_offset)
+static s32 ixgbe_get_san_mac_addr_offset_82599(struct ixgbe_hw *hw,
+                                               u16 *san_mac_offset)
 {
 	/*
 	 * First read the EEPROM pointer to see if the MAC addresses are
@@ -2373,7 +2367,7 @@ s32 ixgbe_get_san_mac_addr_offset_82599(struct ixgbe_hw *hw,
  *  set_lan_id() is called by identify_sfp(), but this cannot be relied
  *  upon for non-SFP connections, so we must call it here.
  **/
-s32 ixgbe_get_san_mac_addr_82599(struct ixgbe_hw *hw, u8 *san_mac_addr)
+static s32 ixgbe_get_san_mac_addr_82599(struct ixgbe_hw *hw, u8 *san_mac_addr)
 {
 	u16 san_mac_data, san_mac_offset;
 	u8 i;
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c
index 96a1859..6621e17 100644
--- a/drivers/net/ixgbe/ixgbe_common.c
+++ b/drivers/net/ixgbe/ixgbe_common.c
@@ -53,6 +53,7 @@ static void ixgbe_enable_rar(struct ixgbe_hw *hw, u32 index);
 static void ixgbe_disable_rar(struct ixgbe_hw *hw, u32 index);
 static s32 ixgbe_mta_vector(struct ixgbe_hw *hw, u8 *mc_addr);
 static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
+static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
 
 /**
  *  ixgbe_start_hw_generic - Prepare hardware for Tx/Rx
@@ -1815,7 +1816,7 @@ out:
  *
  *  Called at init time to set up flow control.
  **/
-s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num)
+static s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num)
 {
 	s32 ret_val = 0;
 	u32 reg;
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h
index 0d34d4d..27f3214 100644
--- a/drivers/net/ixgbe/ixgbe_common.h
+++ b/drivers/net/ixgbe/ixgbe_common.h
@@ -64,7 +64,6 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw,
 s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw);
 s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw);
 s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval);
-s32 ixgbe_setup_fc(struct ixgbe_hw *hw, s32 packetbuf_num);
 s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw, s32 packtetbuf_num);
 s32 ixgbe_fc_autoneg(struct ixgbe_hw *hw);
 
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index d69d277..3f17706 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3615,7 +3615,7 @@ static void ixgbe_free_q_vectors(struct ixgbe_adapter *adapter)
 	}
 }
 
-void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter)
+static void ixgbe_reset_interrupt_capability(struct ixgbe_adapter *adapter)
 {
 	if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
 		adapter->flags &= ~IXGBE_FLAG_MSIX_ENABLED;


^ permalink raw reply related

* [net-next PATCH 3/3] igb/ixgbe: add IPV6_CSUM support to vlan_features
From: Jeff Kirsher @ 2009-08-25 14:47 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, Alexander Duyck, Jeff Kirsher
In-Reply-To: <20090825144709.15560.28811.stgit@localhost.localdomain>

From: Alexander Duyck <alexander.h.duyck@intel.com>

We were already exporting TSO6 to the vlan, but we weren't exporting the
checksum support for IPV6 which was causing warning messages to be
displayed when doing IPv6 TSO over a vlan.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/igb_main.c     |    1 +
 drivers/net/ixgbe/ixgbe_main.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index fb32735..cef4289 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1380,6 +1380,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 	netdev->vlan_features |= NETIF_F_TSO;
 	netdev->vlan_features |= NETIF_F_TSO6;
 	netdev->vlan_features |= NETIF_F_IP_CSUM;
+	netdev->vlan_features |= NETIF_F_IPV6_CSUM;
 	netdev->vlan_features |= NETIF_F_SG;
 
 	if (pci_using_dac)
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 3f17706..0bea096 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5575,6 +5575,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
 	netdev->vlan_features |= NETIF_F_TSO;
 	netdev->vlan_features |= NETIF_F_TSO6;
 	netdev->vlan_features |= NETIF_F_IP_CSUM;
+	netdev->vlan_features |= NETIF_F_IPV6_CSUM;
 	netdev->vlan_features |= NETIF_F_SG;
 
 	if (adapter->flags & IXGBE_FLAG_DCB_ENABLED)


^ permalink raw reply related

* Congratulation
From: charles.nichols @ 2009-08-25 14:50 UTC (permalink / raw)
  To: contact

750,000 GBP has been Awarded to your Email. send your Names/Tel/Address/Country to slyvester.howard01@gala.net


^ permalink raw reply

* [PATCH 00/26] et131x cleanups - phase 1
From: Alan Cox @ 2009-08-25 14:57 UTC (permalink / raw)
  To: greg, netdev

Begin turning the et131x driver into something presentable. The only hairy
bit is the DMA10 stuff. Has all been lightly tested.

---

Alan Cox (26):
      et131x: clean up MP_FLAG macros
      et131x: clean up DMA10/DMA4 types
      et131x: clean up PM_CSR_t
      et131x: kill the Q_ADDR struct
      et131x: quick tidy of the debug code
      et131x: clean up MMC_SRAM_
      et131x: sort out the mmc enable routine
      et131x: eeprom remove features
      et131x: remove unused PCI identifiers
      et131x: continue pruning unused fields
      et131x: de-hungarianise a bit
      et131x: fold the diet config into the other code
      et131x: config is already zeroed
      et131x: attack the config stuff
      et131x: clean up constant rx/tx registry fields
      et131x: eliminate write only registry fields
      et131x: Eliminate RegistryDMA Cache
      et131x: CSRAddress to regs
      et131x: Take a kref for the PCI pointer we cache
      et131x: kill copied PCI fields
      et131x: MPSend macros
      et131x: kill refcount
      et131x: kill unused RCV_REF macros
      et131x: power state
      et131x: spinlocks
      et1310: kill pAdapter in favour of a sane name


 drivers/staging/et131x/Makefile             |    1 
 drivers/staging/et131x/et1310_address_map.h |  311 ++++----------
 drivers/staging/et131x/et1310_eeprom.c      |  190 ++++-----
 drivers/staging/et131x/et1310_eeprom.h      |   16 -
 drivers/staging/et131x/et1310_jagcore.c     |   73 +--
 drivers/staging/et131x/et1310_jagcore.h     |   19 -
 drivers/staging/et131x/et1310_mac.c         |  228 +++++------
 drivers/staging/et131x/et1310_phy.c         |  524 ++++++++++++------------
 drivers/staging/et131x/et1310_phy.h         |   37 --
 drivers/staging/et131x/et1310_pm.c          |   65 +--
 drivers/staging/et131x/et1310_pm.h          |   40 --
 drivers/staging/et131x/et1310_rx.c          |  365 ++++++++---------
 drivers/staging/et131x/et1310_rx.h          |    4 
 drivers/staging/et131x/et1310_tx.c          |  580 +++++++++++++--------------
 drivers/staging/et131x/et1310_tx.h          |    6 
 drivers/staging/et131x/et131x_adapter.h     |   74 ---
 drivers/staging/et131x/et131x_config.c      |  323 ---------------
 drivers/staging/et131x/et131x_debug.c       |  107 ++---
 drivers/staging/et131x/et131x_defs.h        |   16 -
 drivers/staging/et131x/et131x_initpci.c     |  300 ++++++++------
 drivers/staging/et131x/et131x_isr.c         |   60 +--
 drivers/staging/et131x/et131x_netdev.c      |   72 ++-

 delete mode 100644 drivers/staging/et131x/et131x_config.c


^ permalink raw reply

* [PATCH 01/26] et1310: kill pAdapter in favour of a sane name
From: Alan Cox @ 2009-08-25 14:57 UTC (permalink / raw)
  To: greg, netdev
In-Reply-To: <20090825145619.16176.68780.stgit@localhost.localdomain>

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/et131x/et1310_eeprom.c  |   14 -
 drivers/staging/et131x/et1310_jagcore.c |   20 +
 drivers/staging/et131x/et1310_mac.c     |  220 ++++++++-------
 drivers/staging/et131x/et1310_phy.c     |  370 +++++++++++++-------------
 drivers/staging/et131x/et1310_pm.c      |   46 ++-
 drivers/staging/et131x/et1310_rx.c      |  202 +++++++-------
 drivers/staging/et131x/et1310_tx.c      |  442 ++++++++++++++++---------------
 drivers/staging/et131x/et131x_config.c  |   90 +++---
 drivers/staging/et131x/et131x_debug.c   |   20 +
 drivers/staging/et131x/et131x_initpci.c |   82 +++---
 drivers/staging/et131x/et131x_isr.c     |   44 ++-
 drivers/staging/et131x/et131x_netdev.c  |   38 +--
 12 files changed, 794 insertions(+), 794 deletions(-)


diff --git a/drivers/staging/et131x/et1310_eeprom.c b/drivers/staging/et131x/et1310_eeprom.c
index 3a81a85..9a6dbd6 100644
--- a/drivers/staging/et131x/et1310_eeprom.c
+++ b/drivers/staging/et131x/et1310_eeprom.c
@@ -143,7 +143,7 @@
 
 /**
  * EepromWriteByte - Write a byte to the ET1310's EEPROM
- * @pAdapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
  * @unAddress: the address to write
  * @bData: the value to write
  * @unEepronId: the ID of the EEPROM
@@ -151,11 +151,11 @@
  *
  * Returns SUCCESS or FAILURE
  */
-int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,
+int32_t EepromWriteByte(struct et131x_adapter *etdev, uint32_t unAddress,
 			uint8_t bData, uint32_t unEepromId,
 			uint32_t unAddressingMode)
 {
-	struct pci_dev *pdev = pAdapter->pdev;
+	struct pci_dev *pdev = etdev->pdev;
 	int32_t nIndex;
 	int32_t nRetries;
 	int32_t nError = false;
@@ -292,7 +292,7 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,
 		 *	   so we do a blind write for load bug.
 		 */
 		if (bStatus & LBCIF_STATUS_GENERAL_ERROR
-		    && pAdapter->RevisionID == 0) {
+		    && etdev->RevisionID == 0) {
 			break;
 		}
 
@@ -349,7 +349,7 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,
 
 /**
  * EepromReadByte - Read a byte from the ET1310's EEPROM
- * @pAdapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
  * @unAddress: the address from which to read
  * @pbData: a pointer to a byte in which to store the value of the read
  * @unEepronId: the ID of the EEPROM
@@ -357,11 +357,11 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,
  *
  * Returns SUCCESS or FAILURE
  */
-int32_t EepromReadByte(struct et131x_adapter *pAdapter, uint32_t unAddress,
+int32_t EepromReadByte(struct et131x_adapter *etdev, uint32_t unAddress,
 		       uint8_t *pbData, uint32_t unEepromId,
 		       uint32_t unAddressingMode)
 {
-	struct pci_dev *pdev = pAdapter->pdev;
+	struct pci_dev *pdev = etdev->pdev;
 	int32_t nIndex;
 	int32_t nError = 0;
 	uint8_t bControl;
diff --git a/drivers/staging/et131x/et1310_jagcore.c b/drivers/staging/et131x/et1310_jagcore.c
index 6fb2c6d..3b4b273 100644
--- a/drivers/staging/et131x/et1310_jagcore.c
+++ b/drivers/staging/et131x/et1310_jagcore.c
@@ -99,27 +99,27 @@ extern dbg_info_t *et131x_dbginfo;
  * ConfigGlobalRegs - Used to configure the global registers on the JAGCore
  * @pAdpater: pointer to our adapter structure
  */
-void ConfigGlobalRegs(struct et131x_adapter *pAdapter)
+void ConfigGlobalRegs(struct et131x_adapter *etdev)
 {
-	struct _GLOBAL_t __iomem *pGbl = &pAdapter->CSRAddress->global;
+	struct _GLOBAL_t __iomem *pGbl = &etdev->CSRAddress->global;
 
 	DBG_ENTER(et131x_dbginfo);
 
-	if (pAdapter->RegistryPhyLoopbk == false) {
-		if (pAdapter->RegistryJumboPacket < 2048) {
+	if (etdev->RegistryPhyLoopbk == false) {
+		if (etdev->RegistryJumboPacket < 2048) {
 			/* Tx / RxDMA and Tx/Rx MAC interfaces have a 1k word
 			 * block of RAM that the driver can split between Tx
 			 * and Rx as it desires.  Our default is to split it
 			 * 50/50:
 			 */
 			writel(0, &pGbl->rxq_start_addr.value);
-			writel(pAdapter->RegistryRxMemEnd,
+			writel(etdev->RegistryRxMemEnd,
 			       &pGbl->rxq_end_addr.value);
-			writel(pAdapter->RegistryRxMemEnd + 1,
+			writel(etdev->RegistryRxMemEnd + 1,
 			       &pGbl->txq_start_addr.value);
 			writel(INTERNAL_MEM_SIZE - 1,
 			       &pGbl->txq_end_addr.value);
-		} else if (pAdapter->RegistryJumboPacket < 8192) {
+		} else if (etdev->RegistryJumboPacket < 8192) {
 			/* For jumbo packets > 2k but < 8k, split 50-50. */
 			writel(0, &pGbl->rxq_start_addr.value);
 			writel(INTERNAL_MEM_RX_OFFSET,
@@ -171,9 +171,9 @@ void ConfigGlobalRegs(struct et131x_adapter *pAdapter)
 
 /**
  * ConfigMMCRegs - Used to configure the main memory registers in the JAGCore
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void ConfigMMCRegs(struct et131x_adapter *pAdapter)
+void ConfigMMCRegs(struct et131x_adapter *etdev)
 {
 	MMC_CTRL_t mmc_ctrl = { 0 };
 
@@ -188,7 +188,7 @@ void ConfigMMCRegs(struct et131x_adapter *pAdapter)
 	mmc_ctrl.bits.arb_disable = 0x0;
 	mmc_ctrl.bits.mmc_enable = 0x1;
 
-	writel(mmc_ctrl.value, &pAdapter->CSRAddress->mmc.mmc_ctrl.value);
+	writel(mmc_ctrl.value, &etdev->CSRAddress->mmc.mmc_ctrl.value);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
diff --git a/drivers/staging/et131x/et1310_mac.c b/drivers/staging/et131x/et1310_mac.c
index 5200dbf..4cb4cfc 100644
--- a/drivers/staging/et131x/et1310_mac.c
+++ b/drivers/staging/et131x/et1310_mac.c
@@ -101,9 +101,9 @@ extern dbg_info_t *et131x_dbginfo;
  * ConfigMacRegs1 - Initialize the first part of MAC regs
  * @pAdpater: pointer to our adapter structure
  */
-void ConfigMACRegs1(struct et131x_adapter *pAdapter)
+void ConfigMACRegs1(struct et131x_adapter *etdev)
 {
-	struct _MAC_t __iomem *pMac = &pAdapter->CSRAddress->mac;
+	struct _MAC_t __iomem *pMac = &etdev->CSRAddress->mac;
 	MAC_STATION_ADDR1_t station1;
 	MAC_STATION_ADDR2_t station2;
 	MAC_IPG_t ipg;
@@ -151,12 +151,12 @@ void ConfigMACRegs1(struct et131x_adapter *pAdapter)
 	 * station address is used for generating and checking pause control
 	 * packets.
 	 */
-	station2.bits.Octet1 = pAdapter->CurrentAddress[0];
-	station2.bits.Octet2 = pAdapter->CurrentAddress[1];
-	station1.bits.Octet3 = pAdapter->CurrentAddress[2];
-	station1.bits.Octet4 = pAdapter->CurrentAddress[3];
-	station1.bits.Octet5 = pAdapter->CurrentAddress[4];
-	station1.bits.Octet6 = pAdapter->CurrentAddress[5];
+	station2.bits.Octet1 = etdev->CurrentAddress[0];
+	station2.bits.Octet2 = etdev->CurrentAddress[1];
+	station1.bits.Octet3 = etdev->CurrentAddress[2];
+	station1.bits.Octet4 = etdev->CurrentAddress[3];
+	station1.bits.Octet5 = etdev->CurrentAddress[4];
+	station1.bits.Octet6 = etdev->CurrentAddress[5];
 	writel(station1.value, &pMac->station_addr_1.value);
 	writel(station2.value, &pMac->station_addr_2.value);
 
@@ -167,7 +167,7 @@ void ConfigMACRegs1(struct et131x_adapter *pAdapter)
 	 * Packets larger than (RegistryJumboPacket) that do not contain a
 	 * VLAN ID will be dropped by the Rx function.
 	 */
-	writel(pAdapter->RegistryJumboPacket + 4, &pMac->max_fm_len.value);
+	writel(etdev->RegistryJumboPacket + 4, &pMac->max_fm_len.value);
 
 	/* clear out MAC config reset */
 	writel(0, &pMac->cfg1.value);
@@ -179,10 +179,10 @@ void ConfigMACRegs1(struct et131x_adapter *pAdapter)
  * ConfigMacRegs2 - Initialize the second part of MAC regs
  * @pAdpater: pointer to our adapter structure
  */
-void ConfigMACRegs2(struct et131x_adapter *pAdapter)
+void ConfigMACRegs2(struct et131x_adapter *etdev)
 {
 	int32_t delay = 0;
-	struct _MAC_t __iomem *pMac = &pAdapter->CSRAddress->mac;
+	struct _MAC_t __iomem *pMac = &etdev->CSRAddress->mac;
 	MAC_CFG1_t cfg1;
 	MAC_CFG2_t cfg2;
 	MAC_IF_CTRL_t ifctrl;
@@ -190,12 +190,12 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 
 	DBG_ENTER(et131x_dbginfo);
 
-	ctl.value = readl(&pAdapter->CSRAddress->txmac.ctl.value);
+	ctl.value = readl(&etdev->CSRAddress->txmac.ctl.value);
 	cfg1.value = readl(&pMac->cfg1.value);
 	cfg2.value = readl(&pMac->cfg2.value);
 	ifctrl.value = readl(&pMac->if_ctrl.value);
 
-	if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
+	if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
 		cfg2.bits.if_mode = 0x2;
 		ifctrl.bits.phy_mode = 0x0;
 	} else {
@@ -210,8 +210,8 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 	/* Set up flow control */
 	cfg1.bits.tx_flow = 0x1;
 
-	if ((pAdapter->FlowControl == RxOnly) ||
-	    (pAdapter->FlowControl == Both)) {
+	if ((etdev->FlowControl == RxOnly) ||
+	    (etdev->FlowControl == Both)) {
 		cfg1.bits.rx_flow = 0x1;
 	} else {
 		cfg1.bits.rx_flow = 0x0;
@@ -232,7 +232,7 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 	 */
 	cfg2.bits.len_check = 0x1;
 
-	if (pAdapter->RegistryPhyLoopbk == false) {
+	if (etdev->RegistryPhyLoopbk == false) {
 		cfg2.bits.pad_crc = 0x1;
 		cfg2.bits.crc_enable = 0x1;
 	} else {
@@ -241,8 +241,8 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 	}
 
 	/* 1 - full duplex, 0 - half-duplex */
-	cfg2.bits.full_duplex = pAdapter->uiDuplexMode;
-	ifctrl.bits.ghd_mode = !pAdapter->uiDuplexMode;
+	cfg2.bits.full_duplex = etdev->uiDuplexMode;
+	ifctrl.bits.ghd_mode = !etdev->uiDuplexMode;
 
 	writel(ifctrl.value, &pMac->if_ctrl.value);
 	writel(cfg2.value, &pMac->cfg2.value);
@@ -262,19 +262,19 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 
 	DBG_TRACE(et131x_dbginfo,
 		"Speed %d, Dup %d, CFG1 0x%08x, CFG2 0x%08x, if_ctrl 0x%08x\n",
-		pAdapter->uiLinkSpeed, pAdapter->uiDuplexMode,
+		etdev->uiLinkSpeed, etdev->uiDuplexMode,
 		readl(&pMac->cfg1.value), readl(&pMac->cfg2.value),
 		readl(&pMac->if_ctrl.value));
 
 	/* Enable TXMAC */
 	ctl.bits.txmac_en = 0x1;
 	ctl.bits.fc_disable = 0x1;
-	writel(ctl.value, &pAdapter->CSRAddress->txmac.ctl.value);
+	writel(ctl.value, &etdev->CSRAddress->txmac.ctl.value);
 
 	/* Ready to start the RXDMA/TXDMA engine */
-	if (!MP_TEST_FLAG(pAdapter, fMP_ADAPTER_LOWER_POWER)) {
-		et131x_rx_dma_enable(pAdapter);
-		et131x_tx_dma_enable(pAdapter);
+	if (!MP_TEST_FLAG(etdev, fMP_ADAPTER_LOWER_POWER)) {
+		et131x_rx_dma_enable(etdev);
+		et131x_tx_dma_enable(etdev);
 	} else {
 		DBG_WARNING(et131x_dbginfo,
 			    "Didn't enable Rx/Tx due to low-power mode\n");
@@ -283,9 +283,9 @@ void ConfigMACRegs2(struct et131x_adapter *pAdapter)
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void ConfigRxMacRegs(struct et131x_adapter *pAdapter)
+void ConfigRxMacRegs(struct et131x_adapter *etdev)
 {
-	struct _RXMAC_t __iomem *pRxMac = &pAdapter->CSRAddress->rxmac;
+	struct _RXMAC_t __iomem *pRxMac = &etdev->CSRAddress->rxmac;
 	RXMAC_WOL_SA_LO_t sa_lo;
 	RXMAC_WOL_SA_HI_t sa_hi;
 	RXMAC_PF_CTRL_t pf_ctrl = { 0 };
@@ -330,22 +330,22 @@ void ConfigRxMacRegs(struct et131x_adapter *pAdapter)
 	writel(0, &pRxMac->mask4_word3);
 
 	/* Lets setup the WOL Source Address */
-	sa_lo.bits.sa3 = pAdapter->CurrentAddress[2];
-	sa_lo.bits.sa4 = pAdapter->CurrentAddress[3];
-	sa_lo.bits.sa5 = pAdapter->CurrentAddress[4];
-	sa_lo.bits.sa6 = pAdapter->CurrentAddress[5];
+	sa_lo.bits.sa3 = etdev->CurrentAddress[2];
+	sa_lo.bits.sa4 = etdev->CurrentAddress[3];
+	sa_lo.bits.sa5 = etdev->CurrentAddress[4];
+	sa_lo.bits.sa6 = etdev->CurrentAddress[5];
 	writel(sa_lo.value, &pRxMac->sa_lo.value);
 
-	sa_hi.bits.sa1 = pAdapter->CurrentAddress[0];
-	sa_hi.bits.sa2 = pAdapter->CurrentAddress[1];
+	sa_hi.bits.sa1 = etdev->CurrentAddress[0];
+	sa_hi.bits.sa2 = etdev->CurrentAddress[1];
 	writel(sa_hi.value, &pRxMac->sa_hi.value);
 
 	/* Disable all Packet Filtering */
 	writel(0, &pRxMac->pf_ctrl.value);
 
 	/* Let's initialize the Unicast Packet filtering address */
-	if (pAdapter->PacketFilter & ET131X_PACKET_TYPE_DIRECTED) {
-		SetupDeviceForUnicast(pAdapter);
+	if (etdev->PacketFilter & ET131X_PACKET_TYPE_DIRECTED) {
+		SetupDeviceForUnicast(etdev);
 		pf_ctrl.bits.filter_uni_en = 1;
 	} else {
 		writel(0, &pRxMac->uni_pf_addr1.value);
@@ -354,18 +354,18 @@ void ConfigRxMacRegs(struct et131x_adapter *pAdapter)
 	}
 
 	/* Let's initialize the Multicast hash */
-	if (pAdapter->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST) {
+	if (etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST) {
 		pf_ctrl.bits.filter_multi_en = 0;
 	} else {
 		pf_ctrl.bits.filter_multi_en = 1;
-		SetupDeviceForMulticast(pAdapter);
+		SetupDeviceForMulticast(etdev);
 	}
 
 	/* Runt packet filtering.  Didn't work in version A silicon. */
 	pf_ctrl.bits.min_pkt_size = NIC_MIN_PACKET_SIZE + 4;
 	pf_ctrl.bits.filter_frag_en = 1;
 
-	if (pAdapter->RegistryJumboPacket > 8192) {
+	if (etdev->RegistryJumboPacket > 8192) {
 		RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg;
 
 		/* In order to transmit jumbo packets greater than 8k, the
@@ -408,7 +408,7 @@ void ConfigRxMacRegs(struct et131x_adapter *pAdapter)
 	 * bit 16: Receive frame truncated.
 	 * bit 17: Drop packet enable
 	 */
-	if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_100MBPS)
+	if (etdev->uiLinkSpeed == TRUEPHY_SPEED_100MBPS)
 		writel(0x30038, &pRxMac->mif_ctrl.value);
 	else
 		writel(0x30030, &pRxMac->mif_ctrl.value);
@@ -425,9 +425,9 @@ void ConfigRxMacRegs(struct et131x_adapter *pAdapter)
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void ConfigTxMacRegs(struct et131x_adapter *pAdapter)
+void ConfigTxMacRegs(struct et131x_adapter *etdev)
 {
-	struct _TXMAC_t __iomem *pTxMac = &pAdapter->CSRAddress->txmac;
+	struct _TXMAC_t __iomem *pTxMac = &etdev->CSRAddress->txmac;
 	TXMAC_CF_PARAM_t Local;
 
 	DBG_ENTER(et131x_dbginfo);
@@ -436,7 +436,7 @@ void ConfigTxMacRegs(struct et131x_adapter *pAdapter)
 	 * cfpt - control frame pause timer set to 64 (0x40)
 	 * cfep - control frame extended pause timer set to 0x0
 	 */
-	if (pAdapter->FlowControl == None) {
+	if (etdev->FlowControl == None) {
 		writel(0, &pTxMac->cf_param.value);
 	} else {
 		Local.bits.cfpt = 0x40;
@@ -447,10 +447,10 @@ void ConfigTxMacRegs(struct et131x_adapter *pAdapter)
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void ConfigMacStatRegs(struct et131x_adapter *pAdapter)
+void ConfigMacStatRegs(struct et131x_adapter *etdev)
 {
 	struct _MAC_STAT_t __iomem *pDevMacStat =
-		&pAdapter->CSRAddress->macStat;
+		&etdev->CSRAddress->macStat;
 
 	DBG_ENTER(et131x_dbginfo);
 
@@ -538,50 +538,50 @@ void ConfigMacStatRegs(struct et131x_adapter *pAdapter)
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void ConfigFlowControl(struct et131x_adapter *pAdapter)
+void ConfigFlowControl(struct et131x_adapter *etdev)
 {
-	if (pAdapter->uiDuplexMode == 0) {
-		pAdapter->FlowControl = None;
+	if (etdev->uiDuplexMode == 0) {
+		etdev->FlowControl = None;
 	} else {
 		char RemotePause, RemoteAsyncPause;
 
-		ET1310_PhyAccessMiBit(pAdapter,
+		ET1310_PhyAccessMiBit(etdev,
 				      TRUEPHY_BIT_READ, 5, 10, &RemotePause);
-		ET1310_PhyAccessMiBit(pAdapter,
+		ET1310_PhyAccessMiBit(etdev,
 				      TRUEPHY_BIT_READ, 5, 11,
 				      &RemoteAsyncPause);
 
 		if ((RemotePause == TRUEPHY_BIT_SET) &&
 		    (RemoteAsyncPause == TRUEPHY_BIT_SET)) {
-			pAdapter->FlowControl = pAdapter->RegistryFlowControl;
+			etdev->FlowControl = etdev->RegistryFlowControl;
 		} else if ((RemotePause == TRUEPHY_BIT_SET) &&
 			   (RemoteAsyncPause == TRUEPHY_BIT_CLEAR)) {
-			if (pAdapter->RegistryFlowControl == Both)
-				pAdapter->FlowControl = Both;
+			if (etdev->RegistryFlowControl == Both)
+				etdev->FlowControl = Both;
 			else
-				pAdapter->FlowControl = None;
+				etdev->FlowControl = None;
 		} else if ((RemotePause == TRUEPHY_BIT_CLEAR) &&
 			   (RemoteAsyncPause == TRUEPHY_BIT_CLEAR)) {
-			pAdapter->FlowControl = None;
+			etdev->FlowControl = None;
 		} else {/* if (RemotePause == TRUEPHY_CLEAR_BIT &&
 			       RemoteAsyncPause == TRUEPHY_SET_BIT) */
-			if (pAdapter->RegistryFlowControl == Both)
-				pAdapter->FlowControl = RxOnly;
+			if (etdev->RegistryFlowControl == Both)
+				etdev->FlowControl = RxOnly;
 			else
-				pAdapter->FlowControl = None;
+				etdev->FlowControl = None;
 		}
 	}
 }
 
 /**
  * UpdateMacStatHostCounters - Update the local copy of the statistics
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  */
-void UpdateMacStatHostCounters(struct et131x_adapter *pAdapter)
+void UpdateMacStatHostCounters(struct et131x_adapter *etdev)
 {
-	struct _ce_stats_t *stats = &pAdapter->Stats;
+	struct _ce_stats_t *stats = &etdev->Stats;
 	struct _MAC_STAT_t __iomem *pDevMacStat =
-		&pAdapter->CSRAddress->macStat;
+		&etdev->CSRAddress->macStat;
 
 	stats->collisions += readl(&pDevMacStat->TNcl);
 	stats->first_collision += readl(&pDevMacStat->TScl);
@@ -603,13 +603,13 @@ void UpdateMacStatHostCounters(struct et131x_adapter *pAdapter)
 
 /**
  * HandleMacStatInterrupt
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * One of the MACSTAT counters has wrapped.  Update the local copy of
  * the statistics held in the adapter structure, checking the "wrap"
  * bit for each counter.
  */
-void HandleMacStatInterrupt(struct et131x_adapter *pAdapter)
+void HandleMacStatInterrupt(struct et131x_adapter *etdev)
 {
 	MAC_STAT_REG_1_t Carry1;
 	MAC_STAT_REG_2_t Carry2;
@@ -619,11 +619,11 @@ void HandleMacStatInterrupt(struct et131x_adapter *pAdapter)
 	/* Read the interrupt bits from the register(s).  These are Clear On
 	 * Write.
 	 */
-	Carry1.value = readl(&pAdapter->CSRAddress->macStat.Carry1.value);
-	Carry2.value = readl(&pAdapter->CSRAddress->macStat.Carry2.value);
+	Carry1.value = readl(&etdev->CSRAddress->macStat.Carry1.value);
+	Carry2.value = readl(&etdev->CSRAddress->macStat.Carry2.value);
 
-	writel(Carry1.value, &pAdapter->CSRAddress->macStat.Carry1.value);
-	writel(Carry2.value, &pAdapter->CSRAddress->macStat.Carry2.value);
+	writel(Carry1.value, &etdev->CSRAddress->macStat.Carry1.value);
+	writel(Carry2.value, &etdev->CSRAddress->macStat.Carry2.value);
 
 	/* We need to do update the host copy of all the MAC_STAT counters.
 	 * For each counter, check it's overflow bit.  If the overflow bit is
@@ -632,40 +632,40 @@ void HandleMacStatInterrupt(struct et131x_adapter *pAdapter)
 	 * block indicates that one of the counters has wrapped.
 	 */
 	if (Carry1.bits.rfcs)
-		pAdapter->Stats.code_violations += COUNTER_WRAP_16_BIT;
+		etdev->Stats.code_violations += COUNTER_WRAP_16_BIT;
 	if (Carry1.bits.raln)
-		pAdapter->Stats.alignment_err += COUNTER_WRAP_12_BIT;
+		etdev->Stats.alignment_err += COUNTER_WRAP_12_BIT;
 	if (Carry1.bits.rflr)
-		pAdapter->Stats.length_err += COUNTER_WRAP_16_BIT;
+		etdev->Stats.length_err += COUNTER_WRAP_16_BIT;
 	if (Carry1.bits.rfrg)
-		pAdapter->Stats.other_errors += COUNTER_WRAP_16_BIT;
+		etdev->Stats.other_errors += COUNTER_WRAP_16_BIT;
 	if (Carry1.bits.rcde)
-		pAdapter->Stats.crc_err += COUNTER_WRAP_16_BIT;
+		etdev->Stats.crc_err += COUNTER_WRAP_16_BIT;
 	if (Carry1.bits.rovr)
-		pAdapter->Stats.rx_ov_flow += COUNTER_WRAP_16_BIT;
+		etdev->Stats.rx_ov_flow += COUNTER_WRAP_16_BIT;
 	if (Carry1.bits.rdrp)
-		pAdapter->Stats.norcvbuf += COUNTER_WRAP_16_BIT;
+		etdev->Stats.norcvbuf += COUNTER_WRAP_16_BIT;
 	if (Carry2.bits.tovr)
-		pAdapter->Stats.max_pkt_error += COUNTER_WRAP_12_BIT;
+		etdev->Stats.max_pkt_error += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tund)
-		pAdapter->Stats.tx_uflo += COUNTER_WRAP_12_BIT;
+		etdev->Stats.tx_uflo += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tscl)
-		pAdapter->Stats.first_collision += COUNTER_WRAP_12_BIT;
+		etdev->Stats.first_collision += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tdfr)
-		pAdapter->Stats.tx_deferred += COUNTER_WRAP_12_BIT;
+		etdev->Stats.tx_deferred += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tmcl)
-		pAdapter->Stats.excessive_collisions += COUNTER_WRAP_12_BIT;
+		etdev->Stats.excessive_collisions += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tlcl)
-		pAdapter->Stats.late_collisions += COUNTER_WRAP_12_BIT;
+		etdev->Stats.late_collisions += COUNTER_WRAP_12_BIT;
 	if (Carry2.bits.tncl)
-		pAdapter->Stats.collisions += COUNTER_WRAP_12_BIT;
+		etdev->Stats.collisions += COUNTER_WRAP_12_BIT;
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void SetupDeviceForMulticast(struct et131x_adapter *pAdapter)
+void SetupDeviceForMulticast(struct et131x_adapter *etdev)
 {
-	struct _RXMAC_t __iomem *rxmac = &pAdapter->CSRAddress->rxmac;
+	struct _RXMAC_t __iomem *rxmac = &etdev->CSRAddress->rxmac;
 	uint32_t nIndex;
 	uint32_t result;
 	uint32_t hash1 = 0;
@@ -681,24 +681,24 @@ void SetupDeviceForMulticast(struct et131x_adapter *pAdapter)
 	 * specified) then we should pass NO multi-cast addresses to the
 	 * driver.
 	 */
-	if (pAdapter->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) {
+	if (etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) {
 		DBG_VERBOSE(et131x_dbginfo,
 			    "MULTICAST flag is set, MCCount: %d\n",
-			    pAdapter->MCAddressCount);
+			    etdev->MCAddressCount);
 
 		/* Loop through our multicast array and set up the device */
-		for (nIndex = 0; nIndex < pAdapter->MCAddressCount; nIndex++) {
+		for (nIndex = 0; nIndex < etdev->MCAddressCount; nIndex++) {
 			DBG_VERBOSE(et131x_dbginfo,
 			    "MCList[%d]: %02x:%02x:%02x:%02x:%02x:%02x\n",
 			    nIndex,
-			    pAdapter->MCList[nIndex][0],
-			    pAdapter->MCList[nIndex][1],
-			    pAdapter->MCList[nIndex][2],
-			    pAdapter->MCList[nIndex][3],
-			    pAdapter->MCList[nIndex][4],
-			    pAdapter->MCList[nIndex][5]);
+			    etdev->MCList[nIndex][0],
+			    etdev->MCList[nIndex][1],
+			    etdev->MCList[nIndex][2],
+			    etdev->MCList[nIndex][3],
+			    etdev->MCList[nIndex][4],
+			    etdev->MCList[nIndex][5]);
 
-			result = ether_crc(6, pAdapter->MCList[nIndex]);
+			result = ether_crc(6, etdev->MCList[nIndex]);
 
 			result = (result & 0x3F800000) >> 23;
 
@@ -718,7 +718,7 @@ void SetupDeviceForMulticast(struct et131x_adapter *pAdapter)
 	}
 
 	/* Write out the new hash to the device */
-	pm_csr.value = readl(&pAdapter->CSRAddress->global.pm_csr.value);
+	pm_csr.value = readl(&etdev->CSRAddress->global.pm_csr.value);
 	if (pm_csr.bits.pm_phy_sw_coma == 0) {
 		writel(hash1, &rxmac->multi_hash1);
 		writel(hash2, &rxmac->multi_hash2);
@@ -729,9 +729,9 @@ void SetupDeviceForMulticast(struct et131x_adapter *pAdapter)
 	DBG_LEAVE(et131x_dbginfo);
 }
 
-void SetupDeviceForUnicast(struct et131x_adapter *pAdapter)
+void SetupDeviceForUnicast(struct et131x_adapter *etdev)
 {
-	struct _RXMAC_t __iomem *rxmac = &pAdapter->CSRAddress->rxmac;
+	struct _RXMAC_t __iomem *rxmac = &etdev->CSRAddress->rxmac;
 	RXMAC_UNI_PF_ADDR1_t uni_pf1;
 	RXMAC_UNI_PF_ADDR2_t uni_pf2;
 	RXMAC_UNI_PF_ADDR3_t uni_pf3;
@@ -748,22 +748,22 @@ void SetupDeviceForUnicast(struct et131x_adapter *pAdapter)
 	 * Set up unicast packet filter reg 3 to be the octets 2 - 5 of the
 	 * MAC address for first address
 	 */
-	uni_pf3.bits.addr1_1 = pAdapter->CurrentAddress[0];
-	uni_pf3.bits.addr1_2 = pAdapter->CurrentAddress[1];
-	uni_pf3.bits.addr2_1 = pAdapter->CurrentAddress[0];
-	uni_pf3.bits.addr2_2 = pAdapter->CurrentAddress[1];
-
-	uni_pf2.bits.addr2_3 = pAdapter->CurrentAddress[2];
-	uni_pf2.bits.addr2_4 = pAdapter->CurrentAddress[3];
-	uni_pf2.bits.addr2_5 = pAdapter->CurrentAddress[4];
-	uni_pf2.bits.addr2_6 = pAdapter->CurrentAddress[5];
-
-	uni_pf1.bits.addr1_3 = pAdapter->CurrentAddress[2];
-	uni_pf1.bits.addr1_4 = pAdapter->CurrentAddress[3];
-	uni_pf1.bits.addr1_5 = pAdapter->CurrentAddress[4];
-	uni_pf1.bits.addr1_6 = pAdapter->CurrentAddress[5];
-
-	pm_csr.value = readl(&pAdapter->CSRAddress->global.pm_csr.value);
+	uni_pf3.bits.addr1_1 = etdev->CurrentAddress[0];
+	uni_pf3.bits.addr1_2 = etdev->CurrentAddress[1];
+	uni_pf3.bits.addr2_1 = etdev->CurrentAddress[0];
+	uni_pf3.bits.addr2_2 = etdev->CurrentAddress[1];
+
+	uni_pf2.bits.addr2_3 = etdev->CurrentAddress[2];
+	uni_pf2.bits.addr2_4 = etdev->CurrentAddress[3];
+	uni_pf2.bits.addr2_5 = etdev->CurrentAddress[4];
+	uni_pf2.bits.addr2_6 = etdev->CurrentAddress[5];
+
+	uni_pf1.bits.addr1_3 = etdev->CurrentAddress[2];
+	uni_pf1.bits.addr1_4 = etdev->CurrentAddress[3];
+	uni_pf1.bits.addr1_5 = etdev->CurrentAddress[4];
+	uni_pf1.bits.addr1_6 = etdev->CurrentAddress[5];
+
+	pm_csr.value = readl(&etdev->CSRAddress->global.pm_csr.value);
 	if (pm_csr.bits.pm_phy_sw_coma == 0) {
 		writel(uni_pf1.value, &rxmac->uni_pf_addr1.value);
 		writel(uni_pf2.value, &rxmac->uni_pf_addr2.value);
diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
index 326d389..82fcb66 100644
--- a/drivers/staging/et131x/et1310_phy.c
+++ b/drivers/staging/et131x/et1310_phy.c
@@ -474,7 +474,7 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
 	}
 }
 
-void et131x_Mii_check(struct et131x_adapter *pAdapter,
+void et131x_Mii_check(struct et131x_adapter *etdev,
 		      MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints)
 {
 	uint8_t ucLinkStatus;
@@ -490,37 +490,37 @@ void et131x_Mii_check(struct et131x_adapter *pAdapter,
 
 	if (bmsr_ints.bits.link_status) {
 		if (bmsr.bits.link_status) {
-			pAdapter->PoMgmt.TransPhyComaModeOnBoot = 20;
+			etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
 
 			/* Update our state variables and indicate the
 			 * connected state
 			 */
-			spin_lock_irqsave(&pAdapter->Lock, lockflags);
+			spin_lock_irqsave(&etdev->Lock, lockflags);
 
-			pAdapter->MediaState = NETIF_STATUS_MEDIA_CONNECT;
-			MP_CLEAR_FLAG(pAdapter, fMP_ADAPTER_LINK_DETECTION);
+			etdev->MediaState = NETIF_STATUS_MEDIA_CONNECT;
+			MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
 
-			spin_unlock_irqrestore(&pAdapter->Lock, lockflags);
+			spin_unlock_irqrestore(&etdev->Lock, lockflags);
 
 			/* Don't indicate state if we're in loopback mode */
-			if (pAdapter->RegistryPhyLoopbk == false)
-				netif_carrier_on(pAdapter->netdev);
+			if (etdev->RegistryPhyLoopbk == false)
+				netif_carrier_on(etdev->netdev);
 		} else {
 			DBG_WARNING(et131x_dbginfo,
 				    "Link down cable problem\n");
 
-			if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_10MBPS) {
+			if (etdev->uiLinkSpeed == TRUEPHY_SPEED_10MBPS) {
 				/* NOTE - Is there a way to query this without
 				 * TruePHY?
-				 * && TRU_QueryCoreType(pAdapter->hTruePhy, 0) == EMI_TRUEPHY_A13O) {
+				 * && TRU_QueryCoreType(etdev->hTruePhy, 0) == EMI_TRUEPHY_A13O) {
 				 */
 				uint16_t Register18;
 
-				MiRead(pAdapter, 0x12, &Register18);
-				MiWrite(pAdapter, 0x12, Register18 | 0x4);
-				MiWrite(pAdapter, 0x10, Register18 | 0x8402);
-				MiWrite(pAdapter, 0x11, Register18 | 511);
-				MiWrite(pAdapter, 0x12, Register18);
+				MiRead(etdev, 0x12, &Register18);
+				MiWrite(etdev, 0x12, Register18 | 0x4);
+				MiWrite(etdev, 0x10, Register18 | 0x8402);
+				MiWrite(etdev, 0x11, Register18 | 511);
+				MiWrite(etdev, 0x12, Register18);
 			}
 
 			/* For the first N seconds of life, we are in "link
@@ -530,33 +530,33 @@ void et131x_Mii_check(struct et131x_adapter *pAdapter,
 			 * in the LinkDetectionDPC).
 			 */
 			if ((MP_IS_FLAG_CLEAR
-			     (pAdapter, fMP_ADAPTER_LINK_DETECTION))
-			    || (pAdapter->MediaState ==
+			     (etdev, fMP_ADAPTER_LINK_DETECTION))
+			    || (etdev->MediaState ==
 				NETIF_STATUS_MEDIA_DISCONNECT)) {
-				spin_lock_irqsave(&pAdapter->Lock, lockflags);
-				pAdapter->MediaState =
+				spin_lock_irqsave(&etdev->Lock, lockflags);
+				etdev->MediaState =
 				    NETIF_STATUS_MEDIA_DISCONNECT;
-				spin_unlock_irqrestore(&pAdapter->Lock,
+				spin_unlock_irqrestore(&etdev->Lock,
 						       lockflags);
 
 				/* Only indicate state if we're in loopback
 				 * mode
 				 */
-				if (pAdapter->RegistryPhyLoopbk == false)
-					netif_carrier_off(pAdapter->netdev);
+				if (etdev->RegistryPhyLoopbk == false)
+					netif_carrier_off(etdev->netdev);
 			}
 
-			pAdapter->uiLinkSpeed = 0;
-			pAdapter->uiDuplexMode = 0;
+			etdev->uiLinkSpeed = 0;
+			etdev->uiDuplexMode = 0;
 
 			/* Free the packets being actively sent & stopped */
-			et131x_free_busy_send_packets(pAdapter);
+			et131x_free_busy_send_packets(etdev);
 
 			/* Re-initialize the send structures */
-			et131x_init_send(pAdapter);
+			et131x_init_send(etdev);
 
 			/* Reset the RFD list and re-start RU */
-			et131x_reset_recv(pAdapter);
+			et131x_reset_recv(etdev);
 
 			/*
 			 * Bring the device back to the state it was during
@@ -564,61 +564,61 @@ void et131x_Mii_check(struct et131x_adapter *pAdapter,
 			 * way, when we get the auto-neg complete interrupt,
 			 * we can complete init by calling ConfigMacREGS2.
 			 */
-			et131x_soft_reset(pAdapter);
+			et131x_soft_reset(etdev);
 
 			/* Setup ET1310 as per the documentation */
-			et131x_adapter_setup(pAdapter);
+			et131x_adapter_setup(etdev);
 
 			/* Setup the PHY into coma mode until the cable is
 			 * plugged back in
 			 */
-			if (pAdapter->RegistryPhyComa == 1)
-				EnablePhyComa(pAdapter);
+			if (etdev->RegistryPhyComa == 1)
+				EnablePhyComa(etdev);
 		}
 	}
 
 	if (bmsr_ints.bits.auto_neg_complete ||
-	    (pAdapter->AiForceDpx == 3 && bmsr_ints.bits.link_status)) {
-		if (bmsr.bits.auto_neg_complete || pAdapter->AiForceDpx == 3) {
-			ET1310_PhyLinkStatus(pAdapter,
+	    (etdev->AiForceDpx == 3 && bmsr_ints.bits.link_status)) {
+		if (bmsr.bits.auto_neg_complete || etdev->AiForceDpx == 3) {
+			ET1310_PhyLinkStatus(etdev,
 					     &ucLinkStatus, &uiAutoNegStatus,
 					     &uiSpeed, &uiDuplex, &uiMdiMdix,
 					     &uiMasterSlave, &uiPolarity);
 
-			pAdapter->uiLinkSpeed = uiSpeed;
-			pAdapter->uiDuplexMode = uiDuplex;
+			etdev->uiLinkSpeed = uiSpeed;
+			etdev->uiDuplexMode = uiDuplex;
 
 			DBG_TRACE(et131x_dbginfo,
-				"pAdapter->uiLinkSpeed 0x%04x, pAdapter->uiDuplex 0x%08x\n",
-				pAdapter->uiLinkSpeed,
-				pAdapter->uiDuplexMode);
+				"etdev->uiLinkSpeed 0x%04x, etdev->uiDuplex 0x%08x\n",
+				etdev->uiLinkSpeed,
+				etdev->uiDuplexMode);
 
-			pAdapter->PoMgmt.TransPhyComaModeOnBoot = 20;
+			etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
 
-			if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_10MBPS) {
+			if (etdev->uiLinkSpeed == TRUEPHY_SPEED_10MBPS) {
 				/*
 				 * NOTE - Is there a way to query this without
 				 * TruePHY?
-				 * && TRU_QueryCoreType(pAdapter->hTruePhy, 0)== EMI_TRUEPHY_A13O) {
+				 * && TRU_QueryCoreType(etdev->hTruePhy, 0)== EMI_TRUEPHY_A13O) {
 				 */
 				uint16_t Register18;
 
-				MiRead(pAdapter, 0x12, &Register18);
-				MiWrite(pAdapter, 0x12, Register18 | 0x4);
-				MiWrite(pAdapter, 0x10, Register18 | 0x8402);
-				MiWrite(pAdapter, 0x11, Register18 | 511);
-				MiWrite(pAdapter, 0x12, Register18);
+				MiRead(etdev, 0x12, &Register18);
+				MiWrite(etdev, 0x12, Register18 | 0x4);
+				MiWrite(etdev, 0x10, Register18 | 0x8402);
+				MiWrite(etdev, 0x11, Register18 | 511);
+				MiWrite(etdev, 0x12, Register18);
 			}
 
-			ConfigFlowControl(pAdapter);
+			ConfigFlowControl(etdev);
 
-			if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS &&
-					pAdapter->RegistryJumboPacket > 2048)
-				ET1310_PhyAndOrReg(pAdapter, 0x16, 0xcfff,
+			if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS &&
+					etdev->RegistryJumboPacket > 2048)
+				ET1310_PhyAndOrReg(etdev, 0x16, 0xcfff,
 								   0x2000);
 
-			SetRxDmaTimer(pAdapter);
-			ConfigMACRegs2(pAdapter);
+			SetRxDmaTimer(etdev);
+			ConfigMACRegs2(etdev);
 		}
 	}
 
@@ -627,230 +627,230 @@ void et131x_Mii_check(struct et131x_adapter *pAdapter,
 
 /**
  * TPAL_SetPhy10HalfDuplex - Force the phy into 10 Base T Half Duplex mode.
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * Also sets the MAC so it is syncd up properly
  */
-void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* First we need to turn off all other advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Set our advertise values accordingly */
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_HALF);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy10FullDuplex - Force the phy into 10 Base T Full Duplex mode.
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * Also sets the MAC so it is syncd up properly
  */
-void TPAL_SetPhy10FullDuplex(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy10FullDuplex(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* First we need to turn off all other advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Set our advertise values accordingly */
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_FULL);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy10Force - Force Base-T FD mode WITHOUT using autonegotiation
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  */
-void TPAL_SetPhy10Force(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy10Force(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* Disable autoneg */
-	ET1310_PhyAutoNeg(pAdapter, false);
+	ET1310_PhyAutoNeg(etdev, false);
 
 	/* Disable all advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Force 10 Mbps */
-	ET1310_PhySpeedSelect(pAdapter, TRUEPHY_SPEED_10MBPS);
+	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_10MBPS);
 
 	/* Force Full duplex */
-	ET1310_PhyDuplexMode(pAdapter, TRUEPHY_DUPLEX_FULL);
+	ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy100HalfDuplex - Force 100 Base T Half Duplex mode.
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * Also sets the MAC so it is syncd up properly.
  */
-void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* first we need to turn off all other advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Set our advertise values accordingly */
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_HALF);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);
 
 	/* Set speed */
-	ET1310_PhySpeedSelect(pAdapter, TRUEPHY_SPEED_100MBPS);
+	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy100FullDuplex - Force 100 Base T Full Duplex mode.
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * Also sets the MAC so it is syncd up properly
  */
-void TPAL_SetPhy100FullDuplex(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy100FullDuplex(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* First we need to turn off all other advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Set our advertise values accordingly */
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_FULL);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy100Force - Force 100 BaseT FD mode WITHOUT using autonegotiation
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  */
-void TPAL_SetPhy100Force(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* Disable autoneg */
-	ET1310_PhyAutoNeg(pAdapter, false);
+	ET1310_PhyAutoNeg(etdev, false);
 
 	/* Disable all advertisement */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Force 100 Mbps */
-	ET1310_PhySpeedSelect(pAdapter, TRUEPHY_SPEED_100MBPS);
+	ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
 
 	/* Force Full duplex */
-	ET1310_PhyDuplexMode(pAdapter, TRUEPHY_DUPLEX_FULL);
+	ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhy1000FullDuplex - Force 1000 Base T Full Duplex mode
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  *
  * Also sets the MAC so it is syncd up properly.
  */
-void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *pAdapter)
+void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* first we need to turn off all other advertisement */
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* set our advertise values accordingly */
-	ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_FULL);
+	ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
 
 	/* power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * TPAL_SetPhyAutoNeg - Set phy to autonegotiation mode.
- * @pAdapter: pointer to the adapter structure
+ * @etdev: pointer to the adapter structure
  */
-void TPAL_SetPhyAutoNeg(struct et131x_adapter *pAdapter)
+void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/* Turn on advertisement of all capabilities */
-	ET1310_PhyAdvertise10BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_BOTH);
+	ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);
 
-	ET1310_PhyAdvertise100BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_BOTH);
+	ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);
 
-	if (pAdapter->DeviceID != ET131X_PCI_DEVICE_ID_FAST)
-		ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_FULL);
+	if (etdev->DeviceID != ET131X_PCI_DEVICE_ID_FAST)
+		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
 	else
-		ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Make sure auto-neg is ON (it is disabled in FORCE modes) */
-	ET1310_PhyAutoNeg(pAdapter, true);
+	ET1310_PhyAutoNeg(etdev, true);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
@@ -903,135 +903,135 @@ static const uint16_t ConfigPhy[25][2] = {
 };
 
 /* condensed version of the phy initialization routine */
-void ET1310_PhyInit(struct et131x_adapter *pAdapter)
+void ET1310_PhyInit(struct et131x_adapter *etdev)
 {
 	uint16_t usData, usIndex;
 
-	if (pAdapter == NULL)
+	if (etdev == NULL)
 		return;
 
 	/* get the identity (again ?) */
-	MiRead(pAdapter, PHY_ID_1, &usData);
-	MiRead(pAdapter, PHY_ID_2, &usData);
+	MiRead(etdev, PHY_ID_1, &usData);
+	MiRead(etdev, PHY_ID_2, &usData);
 
 	/* what does this do/achieve ? */
-	MiRead(pAdapter, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG,	0x0006);
+	MiRead(etdev, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG,	0x0006);
 
 	/* read modem register 0402, should I do something with the return
 	   data ? */
-	MiWrite(pAdapter, PHY_INDEX_REG, 0x0402);
-	MiRead(pAdapter, PHY_DATA_REG, &usData);
+	MiWrite(etdev, PHY_INDEX_REG, 0x0402);
+	MiRead(etdev, PHY_DATA_REG, &usData);
 
 	/* what does this do/achieve ? */
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG, 0x0002);
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0002);
 
 	/* get the identity (again ?) */
-	MiRead(pAdapter, PHY_ID_1, &usData);
-	MiRead(pAdapter, PHY_ID_2, &usData);
+	MiRead(etdev, PHY_ID_1, &usData);
+	MiRead(etdev, PHY_ID_2, &usData);
 
 	/* what does this achieve ? */
-	MiRead(pAdapter, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG, 0x0006);
+	MiRead(etdev, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0006);
 
 	/* read modem register 0402, should I do something with
 	   the return data? */
-	MiWrite(pAdapter, PHY_INDEX_REG, 0x0402);
-	MiRead(pAdapter, PHY_DATA_REG, &usData);
+	MiWrite(etdev, PHY_INDEX_REG, 0x0402);
+	MiRead(etdev, PHY_DATA_REG, &usData);
 
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG, 0x0002);
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0002);
 
 	/* what does this achieve (should return 0x1040) */
-	MiRead(pAdapter, PHY_CONTROL, &usData);
-	MiRead(pAdapter, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
-	MiWrite(pAdapter, PHY_CONTROL, 0x1840);
+	MiRead(etdev, PHY_CONTROL, &usData);
+	MiRead(etdev, PHY_MPHY_CONTROL_REG, &usData); /* should read 0002 */
+	MiWrite(etdev, PHY_CONTROL, 0x1840);
 
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG, 0x0007);
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0007);
 
 	/* here the writing of the array starts.... */
 	usIndex = 0;
 	while (ConfigPhy[usIndex][0] != 0x0000) {
 		/* write value */
-		MiWrite(pAdapter, PHY_INDEX_REG, ConfigPhy[usIndex][0]);
-		MiWrite(pAdapter, PHY_DATA_REG, ConfigPhy[usIndex][1]);
+		MiWrite(etdev, PHY_INDEX_REG, ConfigPhy[usIndex][0]);
+		MiWrite(etdev, PHY_DATA_REG, ConfigPhy[usIndex][1]);
 
 		/* read it back */
-		MiWrite(pAdapter, PHY_INDEX_REG, ConfigPhy[usIndex][0]);
-		MiRead(pAdapter, PHY_DATA_REG, &usData);
+		MiWrite(etdev, PHY_INDEX_REG, ConfigPhy[usIndex][0]);
+		MiRead(etdev, PHY_DATA_REG, &usData);
 
 		/* do a check on the value read back ? */
 		usIndex++;
 	}
 	/* here the writing of the array ends... */
 
-	MiRead(pAdapter, PHY_CONTROL, &usData);		/* 0x1840 */
-	MiRead(pAdapter, PHY_MPHY_CONTROL_REG, &usData);/* should read 0007 */
-	MiWrite(pAdapter, PHY_CONTROL, 0x1040);
-	MiWrite(pAdapter, PHY_MPHY_CONTROL_REG, 0x0002);
+	MiRead(etdev, PHY_CONTROL, &usData);		/* 0x1840 */
+	MiRead(etdev, PHY_MPHY_CONTROL_REG, &usData);/* should read 0007 */
+	MiWrite(etdev, PHY_CONTROL, 0x1040);
+	MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0002);
 }
 
-void ET1310_PhyReset(struct et131x_adapter *pAdapter)
+void ET1310_PhyReset(struct et131x_adapter *etdev)
 {
-	MiWrite(pAdapter, PHY_CONTROL, 0x8000);
+	MiWrite(etdev, PHY_CONTROL, 0x8000);
 }
 
-void ET1310_PhyPowerDown(struct et131x_adapter *pAdapter, bool down)
+void ET1310_PhyPowerDown(struct et131x_adapter *etdev, bool down)
 {
 	uint16_t usData;
 
-	MiRead(pAdapter, PHY_CONTROL, &usData);
+	MiRead(etdev, PHY_CONTROL, &usData);
 
 	if (down == false) {
 		/* Power UP */
 		usData &= ~0x0800;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	} else {
 		/* Power DOWN */
 		usData |= 0x0800;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	}
 }
 
-void ET1310_PhyAutoNeg(struct et131x_adapter *pAdapter, bool enable)
+void ET1310_PhyAutoNeg(struct et131x_adapter *etdev, bool enable)
 {
 	uint16_t usData;
 
-	MiRead(pAdapter, PHY_CONTROL, &usData);
+	MiRead(etdev, PHY_CONTROL, &usData);
 
 	if (enable == true) {
 		/* Autonegotiation ON */
 		usData |= 0x1000;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	} else {
 		/* Autonegotiation OFF */
 		usData &= ~0x1000;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	}
 }
 
-void ET1310_PhyDuplexMode(struct et131x_adapter *pAdapter, uint16_t duplex)
+void ET1310_PhyDuplexMode(struct et131x_adapter *etdev, uint16_t duplex)
 {
 	uint16_t usData;
 
-	MiRead(pAdapter, PHY_CONTROL, &usData);
+	MiRead(etdev, PHY_CONTROL, &usData);
 
 	if (duplex == TRUEPHY_DUPLEX_FULL) {
 		/* Set Full Duplex */
 		usData |= 0x100;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	} else {
 		/* Set Half Duplex */
 		usData &= ~0x100;
-		MiWrite(pAdapter, PHY_CONTROL, usData);
+		MiWrite(etdev, PHY_CONTROL, usData);
 	}
 }
 
-void ET1310_PhySpeedSelect(struct et131x_adapter *pAdapter, uint16_t speed)
+void ET1310_PhySpeedSelect(struct et131x_adapter *etdev, uint16_t speed)
 {
 	uint16_t usData;
 
 	/* Read the PHY control register */
-	MiRead(pAdapter, PHY_CONTROL, &usData);
+	MiRead(etdev, PHY_CONTROL, &usData);
 
 	/* Clear all Speed settings (Bits 6, 13) */
 	usData &= ~0x2040;
@@ -1054,16 +1054,16 @@ void ET1310_PhySpeedSelect(struct et131x_adapter *pAdapter, uint16_t speed)
 	}
 
 	/* Write back the new speed */
-	MiWrite(pAdapter, PHY_CONTROL, usData);
+	MiWrite(etdev, PHY_CONTROL, usData);
 }
 
-void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *pAdapter,
+void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *etdev,
 				  uint16_t duplex)
 {
 	uint16_t usData;
 
 	/* Read the PHY 1000 Base-T Control Register */
-	MiRead(pAdapter, PHY_1000_CONTROL, &usData);
+	MiRead(etdev, PHY_1000_CONTROL, &usData);
 
 	/* Clear Bits 8,9 */
 	usData &= ~0x0300;
@@ -1090,16 +1090,16 @@ void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *pAdapter,
 	}
 
 	/* Write back advertisement */
-	MiWrite(pAdapter, PHY_1000_CONTROL, usData);
+	MiWrite(etdev, PHY_1000_CONTROL, usData);
 }
 
-void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *pAdapter,
+void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *etdev,
 				 uint16_t duplex)
 {
 	uint16_t usData;
 
 	/* Read the Autonegotiation Register (10/100) */
-	MiRead(pAdapter, PHY_AUTO_ADVERTISEMENT, &usData);
+	MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &usData);
 
 	/* Clear bits 7,8 */
 	usData &= ~0x0180;
@@ -1127,16 +1127,16 @@ void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *pAdapter,
 	}
 
 	/* Write back advertisement */
-	MiWrite(pAdapter, PHY_AUTO_ADVERTISEMENT, usData);
+	MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, usData);
 }
 
-void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *pAdapter,
+void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *etdev,
 				uint16_t duplex)
 {
 	uint16_t usData;
 
 	/* Read the Autonegotiation Register (10/100) */
-	MiRead(pAdapter, PHY_AUTO_ADVERTISEMENT, &usData);
+	MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &usData);
 
 	/* Clear bits 5,6 */
 	usData &= ~0x0060;
@@ -1164,10 +1164,10 @@ void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *pAdapter,
 	}
 
 	/* Write back advertisement */
-	MiWrite(pAdapter, PHY_AUTO_ADVERTISEMENT, usData);
+	MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, usData);
 }
 
-void ET1310_PhyLinkStatus(struct et131x_adapter *pAdapter,
+void ET1310_PhyLinkStatus(struct et131x_adapter *etdev,
 			  uint8_t *ucLinkStatus,
 			  uint32_t *uiAutoNeg,
 			  uint32_t *uiLinkSpeed,
@@ -1180,10 +1180,10 @@ void ET1310_PhyLinkStatus(struct et131x_adapter *pAdapter,
 	uint16_t usVmiPhyStatus = 0;
 	uint16_t usControl = 0;
 
-	MiRead(pAdapter, PHY_STATUS, &usMiStatus);
-	MiRead(pAdapter, PHY_1000_STATUS, &us1000BaseT);
-	MiRead(pAdapter, PHY_PHY_STATUS, &usVmiPhyStatus);
-	MiRead(pAdapter, PHY_CONTROL, &usControl);
+	MiRead(etdev, PHY_STATUS, &usMiStatus);
+	MiRead(etdev, PHY_1000_STATUS, &us1000BaseT);
+	MiRead(etdev, PHY_PHY_STATUS, &usVmiPhyStatus);
+	MiRead(etdev, PHY_CONTROL, &usControl);
 
 	if (ucLinkStatus) {
 		*ucLinkStatus =
@@ -1221,13 +1221,13 @@ void ET1310_PhyLinkStatus(struct et131x_adapter *pAdapter,
 	}
 }
 
-void ET1310_PhyAndOrReg(struct et131x_adapter *pAdapter,
+void ET1310_PhyAndOrReg(struct et131x_adapter *etdev,
 			uint16_t regnum, uint16_t andMask, uint16_t orMask)
 {
 	uint16_t reg;
 
 	/* Read the requested register */
-	MiRead(pAdapter, regnum, &reg);
+	MiRead(etdev, regnum, &reg);
 
 	/* Apply the AND mask */
 	reg &= andMask;
@@ -1236,10 +1236,10 @@ void ET1310_PhyAndOrReg(struct et131x_adapter *pAdapter,
 	reg |= orMask;
 
 	/* Write the value back to the register */
-	MiWrite(pAdapter, regnum, reg);
+	MiWrite(etdev, regnum, reg);
 }
 
-void ET1310_PhyAccessMiBit(struct et131x_adapter *pAdapter, uint16_t action,
+void ET1310_PhyAccessMiBit(struct et131x_adapter *etdev, uint16_t action,
 			   uint16_t regnum, uint16_t bitnum, uint8_t *value)
 {
 	uint16_t reg;
@@ -1249,7 +1249,7 @@ void ET1310_PhyAccessMiBit(struct et131x_adapter *pAdapter, uint16_t action,
 	mask = 0x0001 << bitnum;
 
 	/* Read the requested register */
-	MiRead(pAdapter, regnum, &reg);
+	MiRead(etdev, regnum, &reg);
 
 	switch (action) {
 	case TRUEPHY_BIT_READ:
@@ -1259,12 +1259,12 @@ void ET1310_PhyAccessMiBit(struct et131x_adapter *pAdapter, uint16_t action,
 
 	case TRUEPHY_BIT_SET:
 		reg |= mask;
-		MiWrite(pAdapter, regnum, reg);
+		MiWrite(etdev, regnum, reg);
 		break;
 
 	case TRUEPHY_BIT_CLEAR:
 		reg &= ~mask;
-		MiWrite(pAdapter, regnum, reg);
+		MiWrite(etdev, regnum, reg);
 		break;
 
 	default:
diff --git a/drivers/staging/et131x/et1310_pm.c b/drivers/staging/et131x/et1310_pm.c
index 5d652ca..864d3ad 100644
--- a/drivers/staging/et131x/et1310_pm.c
+++ b/drivers/staging/et131x/et1310_pm.c
@@ -99,7 +99,7 @@ extern dbg_info_t *et131x_dbginfo;
 
 /**
  * EnablePhyComa - called when network cable is unplugged
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  *
  * driver receive an phy status change interrupt while in D0 and check that
  * phy_status is down.
@@ -117,7 +117,7 @@ extern dbg_info_t *et131x_dbginfo;
  *       indicating linkup status, call the MPDisablePhyComa routine to
  *             restore JAGCore and gigE PHY
  */
-void EnablePhyComa(struct et131x_adapter *pAdapter)
+void EnablePhyComa(struct et131x_adapter *etdev)
 {
 	unsigned long lockflags;
 	PM_CSR_t GlobalPmCSR;
@@ -125,81 +125,81 @@ void EnablePhyComa(struct et131x_adapter *pAdapter)
 
 	DBG_ENTER(et131x_dbginfo);
 
-	GlobalPmCSR.value = readl(&pAdapter->CSRAddress->global.pm_csr.value);
+	GlobalPmCSR.value = readl(&etdev->CSRAddress->global.pm_csr.value);
 
 	/* Save the GbE PHY speed and duplex modes. Need to restore this
 	 * when cable is plugged back in
 	 */
-	pAdapter->PoMgmt.PowerDownSpeed = pAdapter->AiForceSpeed;
-	pAdapter->PoMgmt.PowerDownDuplex = pAdapter->AiForceDpx;
+	etdev->PoMgmt.PowerDownSpeed = etdev->AiForceSpeed;
+	etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;
 
 	/* Stop sending packets. */
-	spin_lock_irqsave(&pAdapter->SendHWLock, lockflags);
-	MP_SET_FLAG(pAdapter, fMP_ADAPTER_LOWER_POWER);
-	spin_unlock_irqrestore(&pAdapter->SendHWLock, lockflags);
+	spin_lock_irqsave(&etdev->SendHWLock, lockflags);
+	MP_SET_FLAG(etdev, fMP_ADAPTER_LOWER_POWER);
+	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags);
 
 	/* Wait for outstanding Receive packets */
-	while ((MP_GET_RCV_REF(pAdapter) != 0) && (LoopCounter-- > 0))
+	while ((MP_GET_RCV_REF(etdev) != 0) && (LoopCounter-- > 0))
 		mdelay(2);
 
 	/* Gate off JAGCore 3 clock domains */
 	GlobalPmCSR.bits.pm_sysclk_gate = 0;
 	GlobalPmCSR.bits.pm_txclk_gate = 0;
 	GlobalPmCSR.bits.pm_rxclk_gate = 0;
-	writel(GlobalPmCSR.value, &pAdapter->CSRAddress->global.pm_csr.value);
+	writel(GlobalPmCSR.value, &etdev->CSRAddress->global.pm_csr.value);
 
 	/* Program gigE PHY in to Coma mode */
 	GlobalPmCSR.bits.pm_phy_sw_coma = 1;
-	writel(GlobalPmCSR.value, &pAdapter->CSRAddress->global.pm_csr.value);
+	writel(GlobalPmCSR.value, &etdev->CSRAddress->global.pm_csr.value);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * DisablePhyComa - Disable the Phy Coma Mode
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void DisablePhyComa(struct et131x_adapter *pAdapter)
+void DisablePhyComa(struct et131x_adapter *etdev)
 {
 	PM_CSR_t GlobalPmCSR;
 
 	DBG_ENTER(et131x_dbginfo);
 
-	GlobalPmCSR.value = readl(&pAdapter->CSRAddress->global.pm_csr.value);
+	GlobalPmCSR.value = readl(&etdev->CSRAddress->global.pm_csr.value);
 
 	/* Disable phy_sw_coma register and re-enable JAGCore clocks */
 	GlobalPmCSR.bits.pm_sysclk_gate = 1;
 	GlobalPmCSR.bits.pm_txclk_gate = 1;
 	GlobalPmCSR.bits.pm_rxclk_gate = 1;
 	GlobalPmCSR.bits.pm_phy_sw_coma = 0;
-	writel(GlobalPmCSR.value, &pAdapter->CSRAddress->global.pm_csr.value);
+	writel(GlobalPmCSR.value, &etdev->CSRAddress->global.pm_csr.value);
 
 	/* Restore the GbE PHY speed and duplex modes;
 	 * Reset JAGCore; re-configure and initialize JAGCore and gigE PHY
 	 */
-	pAdapter->AiForceSpeed = pAdapter->PoMgmt.PowerDownSpeed;
-	pAdapter->AiForceDpx = pAdapter->PoMgmt.PowerDownDuplex;
+	etdev->AiForceSpeed = etdev->PoMgmt.PowerDownSpeed;
+	etdev->AiForceDpx = etdev->PoMgmt.PowerDownDuplex;
 
 	/* Re-initialize the send structures */
-	et131x_init_send(pAdapter);
+	et131x_init_send(etdev);
 
 	/* Reset the RFD list and re-start RU  */
-	et131x_reset_recv(pAdapter);
+	et131x_reset_recv(etdev);
 
 	/* Bring the device back to the state it was during init prior to
 	 * autonegotiation being complete.  This way, when we get the auto-neg
 	 * complete interrupt, we can complete init by calling ConfigMacREGS2.
 	 */
-	et131x_soft_reset(pAdapter);
+	et131x_soft_reset(etdev);
 
 	/* setup et1310 as per the documentation ?? */
-	et131x_adapter_setup(pAdapter);
+	et131x_adapter_setup(etdev);
 
 	/* Allow Tx to restart */
-	MP_CLEAR_FLAG(pAdapter, fMP_ADAPTER_LOWER_POWER);
+	MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LOWER_POWER);
 
 	/* Need to re-enable Rx. */
-	et131x_rx_dma_enable(pAdapter);
+	et131x_rx_dma_enable(etdev);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index 9b9e773..f8cc6a6 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -99,7 +99,7 @@ extern dbg_info_t *et131x_dbginfo;
 #endif /* CONFIG_ET131X_DEBUG */
 
 
-void nic_return_rfd(struct et131x_adapter *pAdapter, PMP_RFD pMpRfd);
+void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd);
 
 /**
  * et131x_rx_dma_memory_alloc
@@ -676,12 +676,12 @@ void et131x_rfd_resources_free(struct et131x_adapter *adapter, MP_RFD *pMpRfd)
 
 /**
  * ConfigRxDmaRegs - Start of Rx_DMA init sequence
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void ConfigRxDmaRegs(struct et131x_adapter *pAdapter)
+void ConfigRxDmaRegs(struct et131x_adapter *etdev)
 {
-	struct _RXDMA_t __iomem *pRxDma = &pAdapter->CSRAddress->rxdma;
-	struct _rx_ring_t *pRxLocal = &pAdapter->RxRing;
+	struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma;
+	struct _rx_ring_t *pRxLocal = &etdev->RxRing;
 	PFBR_DESC_t pFbrEntry;
 	uint32_t iEntry;
 	RXDMA_PSR_NUM_DES_t psr_num_des;
@@ -690,7 +690,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *pAdapter)
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Halt RXDMA to perform the reconfigure.  */
-	et131x_rx_dma_disable(pAdapter);
+	et131x_rx_dma_disable(etdev);
 
 	/* Load the completion writeback physical address
 	 *
@@ -718,7 +718,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *pAdapter)
 	writel((psr_num_des.bits.psr_ndes * LO_MARK_PERCENT_FOR_PSR) / 100,
 	       &pRxDma->psr_min_des.value);
 
-	spin_lock_irqsave(&pAdapter->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, lockflags);
 
 	/* These local variables track the PSR in the adapter structure */
 	pRxLocal->local_psr_full.bits.psr_full = 0;
@@ -792,52 +792,52 @@ void ConfigRxDmaRegs(struct et131x_adapter *pAdapter)
 	 * For version B silicon, this value gets updated once autoneg is
 	 *complete.
 	 */
-	writel(pAdapter->RegistryRxNumBuffers, &pRxDma->num_pkt_done.value);
+	writel(etdev->RegistryRxNumBuffers, &pRxDma->num_pkt_done.value);
 
 	/* The "time_done" is not working correctly to coalesce interrupts
 	 * after a given time period, but rather is giving us an interrupt
 	 * regardless of whether we have received packets.
 	 * This value gets updated once autoneg is complete.
 	 */
-	writel(pAdapter->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value);
+	writel(etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value);
 
-	spin_unlock_irqrestore(&pAdapter->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * SetRxDmaTimer - Set the heartbeat timer according to line rate.
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void SetRxDmaTimer(struct et131x_adapter *pAdapter)
+void SetRxDmaTimer(struct et131x_adapter *etdev)
 {
 	/* For version B silicon, we do not use the RxDMA timer for 10 and 100
 	 * Mbits/s line rates. We do not enable and RxDMA interrupt coalescing.
 	 */
-	if ((pAdapter->uiLinkSpeed == TRUEPHY_SPEED_100MBPS) ||
-	    (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_10MBPS)) {
-		writel(0, &pAdapter->CSRAddress->rxdma.max_pkt_time.value);
-		writel(1, &pAdapter->CSRAddress->rxdma.num_pkt_done.value);
+	if ((etdev->uiLinkSpeed == TRUEPHY_SPEED_100MBPS) ||
+	    (etdev->uiLinkSpeed == TRUEPHY_SPEED_10MBPS)) {
+		writel(0, &etdev->CSRAddress->rxdma.max_pkt_time.value);
+		writel(1, &etdev->CSRAddress->rxdma.num_pkt_done.value);
 	}
 }
 
 /**
  * et131x_rx_dma_disable - Stop of Rx_DMA on the ET1310
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void et131x_rx_dma_disable(struct et131x_adapter *pAdapter)
+void et131x_rx_dma_disable(struct et131x_adapter *etdev)
 {
 	RXDMA_CSR_t csr;
 
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Setup the receive dma configuration register */
-	writel(0x00002001, &pAdapter->CSRAddress->rxdma.csr.value);
-	csr.value = readl(&pAdapter->CSRAddress->rxdma.csr.value);
+	writel(0x00002001, &etdev->CSRAddress->rxdma.csr.value);
+	csr.value = readl(&etdev->CSRAddress->rxdma.csr.value);
 	if (csr.bits.halt_status != 1) {
 		udelay(5);
-		csr.value = readl(&pAdapter->CSRAddress->rxdma.csr.value);
+		csr.value = readl(&etdev->CSRAddress->rxdma.csr.value);
 		if (csr.bits.halt_status != 1)
 			DBG_ERROR(et131x_dbginfo,
 				"RX Dma failed to enter halt state. CSR 0x%08x\n",
@@ -849,41 +849,41 @@ void et131x_rx_dma_disable(struct et131x_adapter *pAdapter)
 
 /**
  * et131x_rx_dma_enable - re-start of Rx_DMA on the ET1310.
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void et131x_rx_dma_enable(struct et131x_adapter *pAdapter)
+void et131x_rx_dma_enable(struct et131x_adapter *etdev)
 {
 	DBG_RX_ENTER(et131x_dbginfo);
 
-	if (pAdapter->RegistryPhyLoopbk)
+	if (etdev->RegistryPhyLoopbk)
 		/* RxDMA is disabled for loopback operation. */
-		writel(0x1, &pAdapter->CSRAddress->rxdma.csr.value);
+		writel(0x1, &etdev->CSRAddress->rxdma.csr.value);
 	else {
 	/* Setup the receive dma configuration register for normal operation */
 		RXDMA_CSR_t csr = { 0 };
 
 		csr.bits.fbr1_enable = 1;
-		if (pAdapter->RxRing.Fbr1BufferSize == 4096)
+		if (etdev->RxRing.Fbr1BufferSize == 4096)
 			csr.bits.fbr1_size = 1;
-		else if (pAdapter->RxRing.Fbr1BufferSize == 8192)
+		else if (etdev->RxRing.Fbr1BufferSize == 8192)
 			csr.bits.fbr1_size = 2;
-		else if (pAdapter->RxRing.Fbr1BufferSize == 16384)
+		else if (etdev->RxRing.Fbr1BufferSize == 16384)
 			csr.bits.fbr1_size = 3;
 #ifdef USE_FBR0
 		csr.bits.fbr0_enable = 1;
-		if (pAdapter->RxRing.Fbr0BufferSize == 256)
+		if (etdev->RxRing.Fbr0BufferSize == 256)
 			csr.bits.fbr0_size = 1;
-		else if (pAdapter->RxRing.Fbr0BufferSize == 512)
+		else if (etdev->RxRing.Fbr0BufferSize == 512)
 			csr.bits.fbr0_size = 2;
-		else if (pAdapter->RxRing.Fbr0BufferSize == 1024)
+		else if (etdev->RxRing.Fbr0BufferSize == 1024)
 			csr.bits.fbr0_size = 3;
 #endif
-		writel(csr.value, &pAdapter->CSRAddress->rxdma.csr.value);
+		writel(csr.value, &etdev->CSRAddress->rxdma.csr.value);
 
-		csr.value = readl(&pAdapter->CSRAddress->rxdma.csr.value);
+		csr.value = readl(&etdev->CSRAddress->rxdma.csr.value);
 		if (csr.bits.halt_status != 0) {
 			udelay(5);
-			csr.value = readl(&pAdapter->CSRAddress->rxdma.csr.value);
+			csr.value = readl(&etdev->CSRAddress->rxdma.csr.value);
 			if (csr.bits.halt_status != 0) {
 				DBG_ERROR(et131x_dbginfo,
 					"RX Dma failed to exit halt state.  CSR 0x%08x\n",
@@ -897,7 +897,7 @@ void et131x_rx_dma_enable(struct et131x_adapter *pAdapter)
 
 /**
  * nic_rx_pkts - Checks the hardware for available packets
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Returns pMpRfd, a pointer to our MPRFD.
  *
@@ -906,9 +906,9 @@ void et131x_rx_dma_enable(struct et131x_adapter *pAdapter)
  * the packet to it, puts the RFD in the RecvPendList, and also returns
  * the pointer to the RFD.
  */
-PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
+PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
 {
-	struct _rx_ring_t *pRxLocal = &pAdapter->RxRing;
+	struct _rx_ring_t *pRxLocal = &etdev->RxRing;
 	PRX_STATUS_BLOCK_t pRxStatusBlock;
 	PPKT_STAT_DESC_t pPSREntry;
 	PMP_RFD pMpRfd;
@@ -978,7 +978,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 	}
 
 	writel(pRxLocal->local_psr_full.value,
-	       &pAdapter->CSRAddress->rxdma.psr_full_offset.value);
+	       &etdev->CSRAddress->rxdma.psr_full_offset.value);
 
 #ifndef USE_FBR0
 	if (ringIndex != 1) {
@@ -1013,7 +1013,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 	}
 
 	/* Get and fill the RFD. */
-	spin_lock_irqsave(&pAdapter->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, lockflags);
 
 	pMpRfd = NULL;
 	element = pRxLocal->RecvList.next;
@@ -1023,14 +1023,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 		DBG_RX(et131x_dbginfo,
 		       "NULL RFD returned from RecvList via list_entry()\n");
 		DBG_RX_LEAVE(et131x_dbginfo);
-		spin_unlock_irqrestore(&pAdapter->RcvLock, lockflags);
+		spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
 		return NULL;
 	}
 
 	list_del(&pMpRfd->list_node);
 	pRxLocal->nReadyRecv--;
 
-	spin_unlock_irqrestore(&pAdapter->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
 
 	pMpRfd->iBufferIndex = bufferIndex;
 	pMpRfd->iRingIndex = ringIndex;
@@ -1041,19 +1041,19 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 	 * also counted here.
 	 */
 	if (localLen < (NIC_MIN_PACKET_SIZE + 4)) {
-		pAdapter->Stats.other_errors++;
+		etdev->Stats.other_errors++;
 		localLen = 0;
 	}
 
 	if (localLen) {
-		if (pAdapter->ReplicaPhyLoopbk == 1) {
+		if (etdev->ReplicaPhyLoopbk == 1) {
 			pBufVa = pRxLocal->Fbr[ringIndex]->Va[bufferIndex];
 
-			if (memcmp(&pBufVa[6], &pAdapter->CurrentAddress[0],
+			if (memcmp(&pBufVa[6], &etdev->CurrentAddress[0],
 				   ETH_ALEN) == 0) {
 				if (memcmp(&pBufVa[42], "Replica packet",
 					   ETH_HLEN)) {
-					pAdapter->ReplicaPhyLoopbkPF = 1;
+					etdev->ReplicaPhyLoopbkPF = 1;
 				}
 			}
 			DBG_WARNING(et131x_dbginfo,
@@ -1063,12 +1063,12 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 
 			DBG_WARNING(et131x_dbginfo,
 				    "CurrentAddr:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
-				    pAdapter->CurrentAddress[0],
-				    pAdapter->CurrentAddress[1],
-				    pAdapter->CurrentAddress[2],
-				    pAdapter->CurrentAddress[3],
-				    pAdapter->CurrentAddress[4],
-				    pAdapter->CurrentAddress[5]);
+				    etdev->CurrentAddress[0],
+				    etdev->CurrentAddress[1],
+				    etdev->CurrentAddress[2],
+				    etdev->CurrentAddress[3],
+				    etdev->CurrentAddress[4],
+				    etdev->CurrentAddress[5]);
 		}
 
 		/* Determine if this is a multicast packet coming in */
@@ -1081,9 +1081,9 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 			 * filters. Generally filter is 0x2b when in
 			 * promiscuous mode.
 			 */
-			if ((pAdapter->PacketFilter & ET131X_PACKET_TYPE_MULTICAST)
-			    && !(pAdapter->PacketFilter & ET131X_PACKET_TYPE_PROMISCUOUS)
-			    && !(pAdapter->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
+			if ((etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST)
+			    && !(etdev->PacketFilter & ET131X_PACKET_TYPE_PROMISCUOUS)
+			    && !(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
 				pBufVa = pRxLocal->Fbr[ringIndex]->
 						Va[bufferIndex];
 
@@ -1092,20 +1092,20 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 				 * matches one in our list.
 				 */
 				for (nIndex = 0;
-				     nIndex < pAdapter->MCAddressCount;
+				     nIndex < etdev->MCAddressCount;
 				     nIndex++) {
 					if (pBufVa[0] ==
-					    pAdapter->MCList[nIndex][0]
+					    etdev->MCList[nIndex][0]
 					    && pBufVa[1] ==
-					    pAdapter->MCList[nIndex][1]
+					    etdev->MCList[nIndex][1]
 					    && pBufVa[2] ==
-					    pAdapter->MCList[nIndex][2]
+					    etdev->MCList[nIndex][2]
 					    && pBufVa[3] ==
-					    pAdapter->MCList[nIndex][3]
+					    etdev->MCList[nIndex][3]
 					    && pBufVa[4] ==
-					    pAdapter->MCList[nIndex][4]
+					    etdev->MCList[nIndex][4]
 					    && pBufVa[5] ==
-					    pAdapter->MCList[nIndex][5]) {
+					    etdev->MCList[nIndex][5]) {
 						break;
 					}
 				}
@@ -1118,21 +1118,21 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 				 * so we free our RFD when we return
 				 * from this function.
 				 */
-				if (nIndex == pAdapter->MCAddressCount)
+				if (nIndex == etdev->MCAddressCount)
 					localLen = 0;
 			}
 
 			if (localLen > 0)
-				pAdapter->Stats.multircv++;
+				etdev->Stats.multircv++;
 		} else if (Word0.value & ALCATEL_BROADCAST_PKT)
-			pAdapter->Stats.brdcstrcv++;
+			etdev->Stats.brdcstrcv++;
 		else
 			/* Not sure what this counter measures in
 			 * promiscuous mode. Perhaps we should check
 			 * the MAC address to see if it is directed
 			 * to us in promiscuous mode.
 			 */
-			pAdapter->Stats.unircv++;
+			etdev->Stats.unircv++;
 	}
 
 	if (localLen > 0) {
@@ -1149,14 +1149,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 			return NULL;
 		}
 
-		pAdapter->net_stats.rx_bytes += pMpRfd->PacketSize;
+		etdev->net_stats.rx_bytes += pMpRfd->PacketSize;
 
 		memcpy(skb_put(skb, pMpRfd->PacketSize),
 		       pRxLocal->Fbr[ringIndex]->Va[bufferIndex],
 		       pMpRfd->PacketSize);
 
-		skb->dev = pAdapter->netdev;
-		skb->protocol = eth_type_trans(skb, pAdapter->netdev);
+		skb->dev = etdev->netdev;
+		skb->protocol = eth_type_trans(skb, etdev->netdev);
 		skb->ip_summed = CHECKSUM_NONE;
 
 		netif_rx(skb);
@@ -1164,7 +1164,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 		pMpRfd->PacketSize = 0;
 	}
 
-	nic_return_rfd(pAdapter, pMpRfd);
+	nic_return_rfd(etdev, pMpRfd);
 
 	DBG_RX(et131x_dbginfo, "(1)\n");
 	DBG_RX_LEAVE(et131x_dbginfo);
@@ -1173,28 +1173,28 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *pAdapter)
 
 /**
  * et131x_reset_recv - Reset the receive list
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Assumption, Rcv spinlock has been acquired.
  */
-void et131x_reset_recv(struct et131x_adapter *pAdapter)
+void et131x_reset_recv(struct et131x_adapter *etdev)
 {
 	PMP_RFD pMpRfd;
 	struct list_head *element;
 
 	DBG_ENTER(et131x_dbginfo);
 
-	DBG_ASSERT(!list_empty(&pAdapter->RxRing.RecvList));
+	DBG_ASSERT(!list_empty(&etdev->RxRing.RecvList));
 
 	/* Take all the RFD's from the pending list, and stick them on the
 	 * RecvList.
 	 */
-	while (!list_empty(&pAdapter->RxRing.RecvPendingList)) {
-		element = pAdapter->RxRing.RecvPendingList.next;
+	while (!list_empty(&etdev->RxRing.RecvPendingList)) {
+		element = etdev->RxRing.RecvPendingList.next;
 
 		pMpRfd = (PMP_RFD) list_entry(element, MP_RFD, list_node);
 
-		list_move_tail(&pMpRfd->list_node, &pAdapter->RxRing.RecvList);
+		list_move_tail(&pMpRfd->list_node, &etdev->RxRing.RecvList);
 	}
 
 	DBG_LEAVE(et131x_dbginfo);
@@ -1202,11 +1202,11 @@ void et131x_reset_recv(struct et131x_adapter *pAdapter)
 
 /**
  * et131x_handle_recv_interrupt - Interrupt handler for receive processing
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Assumption, Rcv spinlock has been acquired.
  */
-void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
+void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
 {
 	PMP_RFD pMpRfd = NULL;
 	struct sk_buff *PacketArray[NUM_PACKETS_HANDLED];
@@ -1222,14 +1222,14 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
 
 	/* Process up to available RFD's */
 	while (PacketArrayCount < PacketsToHandle) {
-		if (list_empty(&pAdapter->RxRing.RecvList)) {
-			DBG_ASSERT(pAdapter->RxRing.nReadyRecv == 0);
+		if (list_empty(&etdev->RxRing.RecvList)) {
+			DBG_ASSERT(etdev->RxRing.nReadyRecv == 0);
 			DBG_ERROR(et131x_dbginfo, "NO RFD's !!!!!!!!!!!!!\n");
 			TempUnfinishedRec = true;
 			break;
 		}
 
-		pMpRfd = nic_rx_pkts(pAdapter);
+		pMpRfd = nic_rx_pkts(etdev);
 
 		if (pMpRfd == NULL)
 			break;
@@ -1240,18 +1240,18 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
 		 * If length is zero, return the RFD in order to advance the
 		 * Free buffer ring.
 		 */
-		if ((!pAdapter->PacketFilter) ||
-		    (pAdapter->PoMgmt.PowerState != NdisDeviceStateD0) ||
-		    (!MP_LINK_DETECTED(pAdapter)) ||
+		if ((!etdev->PacketFilter) ||
+		    (etdev->PoMgmt.PowerState != NdisDeviceStateD0) ||
+		    (!MP_LINK_DETECTED(etdev)) ||
 		    (pMpRfd->PacketSize == 0)) {
 			continue;
 		}
 
 		/* Increment the number of packets we received */
-		pAdapter->Stats.ipackets++;
+		etdev->Stats.ipackets++;
 
 		/* Set the status on the packet, either resources or success */
-		if (pAdapter->RxRing.nReadyRecv >= RFD_LOW_WATER_MARK) {
+		if (etdev->RxRing.nReadyRecv >= RFD_LOW_WATER_MARK) {
 			/* Put this RFD on the pending list
 			 *
 			 * NOTE: nic_rx_pkts() above is already returning the
@@ -1260,13 +1260,13 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
 			 * Besides, we don't really need (at this point) the
 			 * pending list anyway.
 			 */
-			/* spin_lock_irqsave( &pAdapter->RcvPendLock, lockflags );
-			 * list_add_tail( &pMpRfd->list_node, &pAdapter->RxRing.RecvPendingList );
-			 * spin_unlock_irqrestore( &pAdapter->RcvPendLock, lockflags );
+			/* spin_lock_irqsave( &etdev->RcvPendLock, lockflags );
+			 * list_add_tail( &pMpRfd->list_node, &etdev->RxRing.RecvPendingList );
+			 * spin_unlock_irqrestore( &etdev->RcvPendLock, lockflags );
 			 */
 
 			/* Update the number of outstanding Recvs */
-			/* MP_INC_RCV_REF( pAdapter ); */
+			/* MP_INC_RCV_REF( etdev ); */
 		} else {
 			RFDFreeArray[PacketFreeCount] = pMpRfd;
 			PacketFreeCount++;
@@ -1280,12 +1280,12 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
 	}
 
 	if ((PacketArrayCount == NUM_PACKETS_HANDLED) || TempUnfinishedRec) {
-		pAdapter->RxRing.UnfinishedReceives = true;
-		writel(pAdapter->RegistryTxTimeInterval * NANO_IN_A_MICRO,
-		       &pAdapter->CSRAddress->global.watchdog_timer);
+		etdev->RxRing.UnfinishedReceives = true;
+		writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO,
+		       &etdev->CSRAddress->global.watchdog_timer);
 	} else {
 		/* Watchdog timer will disable itself if appropriate. */
-		pAdapter->RxRing.UnfinishedReceives = false;
+		etdev->RxRing.UnfinishedReceives = false;
 	}
 
 	DBG_RX_LEAVE(et131x_dbginfo);
@@ -1293,13 +1293,13 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *pAdapter)
 
 /**
  * NICReturnRFD - Recycle a RFD and put it back onto the receive list
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  * @pMpRfd: pointer to the RFD
  */
-void nic_return_rfd(struct et131x_adapter *pAdapter, PMP_RFD pMpRfd)
+void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
 {
-	struct _rx_ring_t *pRxLocal = &pAdapter->RxRing;
-	struct _RXDMA_t __iomem *pRxDma = &pAdapter->CSRAddress->rxdma;
+	struct _rx_ring_t *pRxLocal = &etdev->RxRing;
+	struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma;
 	uint16_t bi = pMpRfd->iBufferIndex;
 	uint8_t ri = pMpRfd->iRingIndex;
 	unsigned long lockflags;
@@ -1314,7 +1314,7 @@ void nic_return_rfd(struct et131x_adapter *pAdapter, PMP_RFD pMpRfd)
 	    (ri == 0 && bi < pRxLocal->Fbr0NumEntries) ||
 #endif
 	    (ri == 1 && bi < pRxLocal->Fbr1NumEntries)) {
-		spin_lock_irqsave(&pAdapter->FbrLock, lockflags);
+		spin_lock_irqsave(&etdev->FbrLock, lockflags);
 
 		if (ri == 1) {
 			PFBR_DESC_t pNextDesc =
@@ -1362,7 +1362,7 @@ void nic_return_rfd(struct et131x_adapter *pAdapter, PMP_RFD pMpRfd)
 			       &pRxDma->fbr0_full_offset.value);
 		}
 #endif
-		spin_unlock_irqrestore(&pAdapter->FbrLock, lockflags);
+		spin_unlock_irqrestore(&etdev->FbrLock, lockflags);
 	} else {
 		DBG_ERROR(et131x_dbginfo,
 			  "NICReturnRFD illegal Buffer Index returned\n");
@@ -1371,10 +1371,10 @@ void nic_return_rfd(struct et131x_adapter *pAdapter, PMP_RFD pMpRfd)
 	/* The processing on this RFD is done, so put it back on the tail of
 	 * our list
 	 */
-	spin_lock_irqsave(&pAdapter->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, lockflags);
 	list_add_tail(&pMpRfd->list_node, &pRxLocal->RecvList);
 	pRxLocal->nReadyRecv++;
-	spin_unlock_irqrestore(&pAdapter->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
 
 	DBG_ASSERT(pRxLocal->nReadyRecv <= pRxLocal->NumRfd);
 	DBG_RX_LEAVE(et131x_dbginfo);
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index b4e7726..db0f538 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -99,13 +99,13 @@
 extern dbg_info_t *et131x_dbginfo;
 #endif /* CONFIG_ET131X_DEBUG */
 
-static void et131x_update_tcb_list(struct et131x_adapter *pAdapter);
-static void et131x_check_send_wait_list(struct et131x_adapter *pAdapter);
-static inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
+static void et131x_update_tcb_list(struct et131x_adapter *etdev);
+static void et131x_check_send_wait_list(struct et131x_adapter *etdev);
+static inline void et131x_free_send_packet(struct et131x_adapter *etdev,
 					   PMP_TCB pMpTcb);
 static int et131x_send_packet(struct sk_buff *skb,
-			      struct et131x_adapter *pAdapter);
-static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb);
+			      struct et131x_adapter *etdev);
+static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb);
 
 /**
  * et131x_tx_dma_memory_alloc
@@ -247,16 +247,16 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
  * ConfigTxDmaRegs - Set up the tx dma section of the JAGCore.
  * @adapter: pointer to our private adapter structure
  */
-void ConfigTxDmaRegs(struct et131x_adapter *pAdapter)
+void ConfigTxDmaRegs(struct et131x_adapter *etdev)
 {
-	struct _TXDMA_t __iomem *pTxDma = &pAdapter->CSRAddress->txdma;
+	struct _TXDMA_t __iomem *pTxDma = &etdev->CSRAddress->txdma;
 
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Load the hardware with the start of the transmit descriptor ring. */
-	writel((uint32_t) (pAdapter->TxRing.pTxDescRingAdjustedPa >> 32),
+	writel((uint32_t) (etdev->TxRing.pTxDescRingAdjustedPa >> 32),
 	       &pTxDma->pr_base_hi);
-	writel((uint32_t) pAdapter->TxRing.pTxDescRingAdjustedPa,
+	writel((uint32_t) etdev->TxRing.pTxDescRingAdjustedPa,
 	       &pTxDma->pr_base_lo);
 
 	/* Initialise the transmit DMA engine */
@@ -270,43 +270,43 @@ void ConfigTxDmaRegs(struct et131x_adapter *pAdapter)
 	 * storing the adjusted address.
 	 */
 	writel(0, &pTxDma->dma_wb_base_hi);
-	writel(pAdapter->TxRing.pTxStatusPa, &pTxDma->dma_wb_base_lo);
+	writel(etdev->TxRing.pTxStatusPa, &pTxDma->dma_wb_base_lo);
 
-	memset(pAdapter->TxRing.pTxStatusVa, 0, sizeof(TX_STATUS_BLOCK_t));
+	memset(etdev->TxRing.pTxStatusVa, 0, sizeof(TX_STATUS_BLOCK_t));
 
 	writel(0, &pTxDma->service_request.value);
-	pAdapter->TxRing.txDmaReadyToSend.value = 0;
+	etdev->TxRing.txDmaReadyToSend.value = 0;
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * et131x_tx_dma_disable - Stop of Tx_DMA on the ET1310
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void et131x_tx_dma_disable(struct et131x_adapter *pAdapter)
+void et131x_tx_dma_disable(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Setup the tramsmit dma configuration register */
-	writel(0x101, &pAdapter->CSRAddress->txdma.csr.value);
+	writel(0x101, &etdev->CSRAddress->txdma.csr.value);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * et131x_tx_dma_enable - re-start of Tx_DMA on the ET1310.
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  *
  * Mainly used after a return to the D0 (full-power) state from a lower state.
  */
-void et131x_tx_dma_enable(struct et131x_adapter *pAdapter)
+void et131x_tx_dma_enable(struct et131x_adapter *etdev)
 {
 	DBG_ENTER(et131x_dbginfo);
 
-	if (pAdapter->RegistryPhyLoopbk) {
+	if (etdev->RegistryPhyLoopbk) {
 		/* TxDMA is disabled for loopback operation. */
-		writel(0x101, &pAdapter->CSRAddress->txdma.csr.value);
+		writel(0x101, &etdev->CSRAddress->txdma.csr.value);
 	} else {
 		TXDMA_CSR_t csr = { 0 };
 
@@ -315,8 +315,8 @@ void et131x_tx_dma_enable(struct et131x_adapter *pAdapter)
 		 */
 		csr.bits.sngl_epkt_mode = 1;
 		csr.bits.halt = 0;
-		csr.bits.cache_thrshld = pAdapter->RegistryDMACache;
-		writel(csr.value, &pAdapter->CSRAddress->txdma.csr.value);
+		csr.bits.cache_thrshld = etdev->RegistryDMACache;
+		writel(csr.value, &etdev->CSRAddress->txdma.csr.value);
 	}
 
 	DBG_LEAVE(et131x_dbginfo);
@@ -377,11 +377,11 @@ void et131x_init_send(struct et131x_adapter *adapter)
 int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 {
 	int status = 0;
-	struct et131x_adapter *pAdapter = NULL;
+	struct et131x_adapter *etdev = NULL;
 
 	DBG_TX_ENTER(et131x_dbginfo);
 
-	pAdapter = netdev_priv(netdev);
+	etdev = netdev_priv(netdev);
 
 	/* Send these packets
 	 *
@@ -390,8 +390,8 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 	 */
 
 	/* Queue is not empty or TCB is not available */
-	if (!list_empty(&pAdapter->TxRing.SendWaitQueue) ||
-	    MP_TCB_RESOURCES_NOT_AVAILABLE(pAdapter)) {
+	if (!list_empty(&etdev->TxRing.SendWaitQueue) ||
+	    MP_TCB_RESOURCES_NOT_AVAILABLE(etdev)) {
 		/* NOTE: If there's an error on send, no need to queue the
 		 * packet under Linux; if we just send an error up to the
 		 * netif layer, it will resend the skb to us.
@@ -403,10 +403,10 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 		 * netif layer think we're good and drop the packet
 		 */
 		/*
-		 * if( MP_SHOULD_FAIL_SEND( pAdapter ) ||
-		 *  pAdapter->DriverNoPhyAccess )
+		 * if( MP_SHOULD_FAIL_SEND( etdev ) ||
+		 *  etdev->DriverNoPhyAccess )
 		 */
-		if (MP_SHOULD_FAIL_SEND(pAdapter) || pAdapter->DriverNoPhyAccess
+		if (MP_SHOULD_FAIL_SEND(etdev) || etdev->DriverNoPhyAccess
 		    || !netif_carrier_ok(netdev)) {
 			DBG_VERBOSE(et131x_dbginfo,
 				"Can't Tx, Link is DOWN; drop the packet\n");
@@ -414,9 +414,9 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 			dev_kfree_skb_any(skb);
 			skb = NULL;
 
-			pAdapter->net_stats.tx_dropped++;
+			etdev->net_stats.tx_dropped++;
 		} else {
-			status = et131x_send_packet(skb, pAdapter);
+			status = et131x_send_packet(skb, etdev);
 
 			if (status == -ENOMEM) {
 
@@ -437,7 +437,7 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 				dev_kfree_skb_any(skb);
 				skb = NULL;
 
-				pAdapter->net_stats.tx_dropped++;
+				etdev->net_stats.tx_dropped++;
 			}
 		}
 	}
@@ -449,14 +449,14 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
 /**
  * et131x_send_packet - Do the work to send a packet
  * @skb: the packet(s) to send
- * @pAdapter: a pointer to the device's private adapter structure
+ * @etdev: a pointer to the device's private adapter structure
  *
  * Return 0 in almost all cases; non-zero value in extreme hard failure only.
  *
  * Assumption: Send spinlock has been acquired
  */
 static int et131x_send_packet(struct sk_buff *skb,
-			      struct et131x_adapter *pAdapter)
+			      struct et131x_adapter *etdev)
 {
 	int status = 0;
 	PMP_TCB pMpTcb = NULL;
@@ -482,24 +482,24 @@ static int et131x_send_packet(struct sk_buff *skb,
 	}
 
 	/* Get a TCB for this packet */
-	spin_lock_irqsave(&pAdapter->TCBReadyQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
 
-	pMpTcb = pAdapter->TxRing.TCBReadyQueueHead;
+	pMpTcb = etdev->TxRing.TCBReadyQueueHead;
 
 	if (pMpTcb == NULL) {
-		spin_unlock_irqrestore(&pAdapter->TCBReadyQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
 
 		DBG_WARNING(et131x_dbginfo, "Can't obtain a TCB\n");
 		DBG_TX_LEAVE(et131x_dbginfo);
 		return -ENOMEM;
 	}
 
-	pAdapter->TxRing.TCBReadyQueueHead = pMpTcb->Next;
+	etdev->TxRing.TCBReadyQueueHead = pMpTcb->Next;
 
-	if (pAdapter->TxRing.TCBReadyQueueHead == NULL)
-		pAdapter->TxRing.TCBReadyQueueTail = NULL;
+	if (etdev->TxRing.TCBReadyQueueHead == NULL)
+		etdev->TxRing.TCBReadyQueueTail = NULL;
 
-	spin_unlock_irqrestore(&pAdapter->TCBReadyQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
 
 	pMpTcb->PacketLength = skb->len;
 	pMpTcb->Packet = skb;
@@ -519,27 +519,27 @@ static int et131x_send_packet(struct sk_buff *skb,
 
 	/* Call the NIC specific send handler. */
 	if (status == 0)
-		status = nic_send_packet(pAdapter, pMpTcb);
+		status = nic_send_packet(etdev, pMpTcb);
 
 	if (status != 0) {
-		spin_lock_irqsave(&pAdapter->TCBReadyQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
 
-		if (pAdapter->TxRing.TCBReadyQueueTail) {
-			pAdapter->TxRing.TCBReadyQueueTail->Next = pMpTcb;
+		if (etdev->TxRing.TCBReadyQueueTail) {
+			etdev->TxRing.TCBReadyQueueTail->Next = pMpTcb;
 		} else {
 			/* Apparently ready Q is empty. */
-			pAdapter->TxRing.TCBReadyQueueHead = pMpTcb;
+			etdev->TxRing.TCBReadyQueueHead = pMpTcb;
 		}
 
-		pAdapter->TxRing.TCBReadyQueueTail = pMpTcb;
+		etdev->TxRing.TCBReadyQueueTail = pMpTcb;
 
-		spin_unlock_irqrestore(&pAdapter->TCBReadyQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
 
 		DBG_TX_LEAVE(et131x_dbginfo);
 		return status;
 	}
 
-	DBG_ASSERT(pAdapter->TxRing.nBusySend <= NUM_TCB);
+	DBG_ASSERT(etdev->TxRing.nBusySend <= NUM_TCB);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 	return 0;
@@ -547,12 +547,12 @@ static int et131x_send_packet(struct sk_buff *skb,
 
 /**
  * nic_send_packet - NIC specific send handler for version B silicon.
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  * @pMpTcb: pointer to MP_TCB
  *
  * Returns 0 or errno.
  */
-static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
+static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 {
 	uint32_t loopIndex;
 	TX_DESC_ENTRY_t CurDesc[24];
@@ -600,7 +600,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				       "filling desc entry %d, "
 				       "TCB: 0x%p\n",
 				       (pPacket->len - pPacket->data_len),
-				       pAdapter->TxRing.txDmaReadyToSend.bits.
+				       etdev->TxRing.txDmaReadyToSend.bits.
 				       val, pMpTcb);
 
 				CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
@@ -618,7 +618,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				 * subsystem)
 				 */
 				CurDesc[FragmentNumber++].DataBufferPtrLow =
-				    pci_map_single(pAdapter->pdev,
+				    pci_map_single(etdev->pdev,
 						   pPacket->data,
 						   pPacket->len -
 						   pPacket->data_len,
@@ -629,7 +629,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				       "filling desc entry %d, "
 				       "TCB: 0x%p\n",
 				       (pPacket->len - pPacket->data_len),
-				       pAdapter->TxRing.txDmaReadyToSend.bits.
+				       etdev->TxRing.txDmaReadyToSend.bits.
 				       val, pMpTcb);
 
 				CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
@@ -647,7 +647,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				 * subsystem)
 				 */
 				CurDesc[FragmentNumber++].DataBufferPtrLow =
-				    pci_map_single(pAdapter->pdev,
+				    pci_map_single(etdev->pdev,
 						   pPacket->data,
 						   ((pPacket->len -
 						     pPacket->data_len) / 2),
@@ -667,7 +667,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				 * subsystem)
 				 */
 				CurDesc[FragmentNumber++].DataBufferPtrLow =
-				    pci_map_single(pAdapter->pdev,
+				    pci_map_single(etdev->pdev,
 						   pPacket->data +
 						   ((pPacket->len -
 						     pPacket->data_len) / 2),
@@ -681,7 +681,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 			       "filling desc entry %d\n"
 			       "TCB: 0x%p\n",
 			       pFragList[loopIndex].size,
-			       pAdapter->TxRing.txDmaReadyToSend.bits.val,
+			       etdev->TxRing.txDmaReadyToSend.bits.val,
 			       pMpTcb);
 
 			CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
@@ -696,7 +696,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 			 * addressable (as defined by the pci/dma subsystem)
 			 */
 			CurDesc[FragmentNumber++].DataBufferPtrLow =
-			    pci_map_page(pAdapter->pdev,
+			    pci_map_page(etdev->pdev,
 					 pFragList[loopIndex - 1].page,
 					 pFragList[loopIndex - 1].page_offset,
 					 pFragList[loopIndex - 1].size,
@@ -709,11 +709,11 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		return -EIO;
 	}
 
-	if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
-		if (++pAdapter->TxRing.TxPacketsSinceLastinterrupt ==
-		    pAdapter->RegistryTxNumBuffers) {
+	if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
+		if (++etdev->TxRing.TxPacketsSinceLastinterrupt ==
+		    etdev->RegistryTxNumBuffers) {
 			CurDesc[FragmentNumber - 1].word3.value = 0x5;
-			pAdapter->TxRing.TxPacketsSinceLastinterrupt = 0;
+			etdev->TxRing.TxPacketsSinceLastinterrupt = 0;
 		} else {
 			CurDesc[FragmentNumber - 1].word3.value = 0x1;
 		}
@@ -723,13 +723,13 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 
 	CurDesc[0].word3.bits.f = 1;
 
-	pMpTcb->WrIndexStart = pAdapter->TxRing.txDmaReadyToSend;
+	pMpTcb->WrIndexStart = etdev->TxRing.txDmaReadyToSend;
 	pMpTcb->PacketStaleCount = 0;
 
-	spin_lock_irqsave(&pAdapter->SendHWLock, lockflags1);
+	spin_lock_irqsave(&etdev->SendHWLock, lockflags1);
 
 	iThisCopy =
-	    NUM_DESC_PER_RING_TX - pAdapter->TxRing.txDmaReadyToSend.bits.val;
+	    NUM_DESC_PER_RING_TX - etdev->TxRing.txDmaReadyToSend.bits.val;
 
 	if (iThisCopy >= FragmentNumber) {
 		iRemainder = 0;
@@ -738,67 +738,67 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		iRemainder = FragmentNumber - iThisCopy;
 	}
 
-	memcpy(pAdapter->TxRing.pTxDescRingVa +
-	       pAdapter->TxRing.txDmaReadyToSend.bits.val, CurDesc,
+	memcpy(etdev->TxRing.pTxDescRingVa +
+	       etdev->TxRing.txDmaReadyToSend.bits.val, CurDesc,
 	       sizeof(TX_DESC_ENTRY_t) * iThisCopy);
 
-	pAdapter->TxRing.txDmaReadyToSend.bits.val += iThisCopy;
+	etdev->TxRing.txDmaReadyToSend.bits.val += iThisCopy;
 
-	if ((pAdapter->TxRing.txDmaReadyToSend.bits.val == 0) ||
-	    (pAdapter->TxRing.txDmaReadyToSend.bits.val ==
+	if ((etdev->TxRing.txDmaReadyToSend.bits.val == 0) ||
+	    (etdev->TxRing.txDmaReadyToSend.bits.val ==
 	     NUM_DESC_PER_RING_TX)) {
-		if (pAdapter->TxRing.txDmaReadyToSend.bits.wrap)
-			pAdapter->TxRing.txDmaReadyToSend.value = 0;
+		if (etdev->TxRing.txDmaReadyToSend.bits.wrap)
+			etdev->TxRing.txDmaReadyToSend.value = 0;
 		else
-			pAdapter->TxRing.txDmaReadyToSend.value = 0x400;
+			etdev->TxRing.txDmaReadyToSend.value = 0x400;
 	}
 
 	if (iRemainder) {
-		memcpy(pAdapter->TxRing.pTxDescRingVa,
+		memcpy(etdev->TxRing.pTxDescRingVa,
 		       CurDesc + iThisCopy,
 		       sizeof(TX_DESC_ENTRY_t) * iRemainder);
 
-		pAdapter->TxRing.txDmaReadyToSend.bits.val += iRemainder;
+		etdev->TxRing.txDmaReadyToSend.bits.val += iRemainder;
 	}
 
-	if (pAdapter->TxRing.txDmaReadyToSend.bits.val == 0) {
-		if (pAdapter->TxRing.txDmaReadyToSend.value)
+	if (etdev->TxRing.txDmaReadyToSend.bits.val == 0) {
+		if (etdev->TxRing.txDmaReadyToSend.value)
 			pMpTcb->WrIndex.value = NUM_DESC_PER_RING_TX - 1;
 		else
 			pMpTcb->WrIndex.value =
 			    0x400 | (NUM_DESC_PER_RING_TX - 1);
 	} else
 		pMpTcb->WrIndex.value =
-		    pAdapter->TxRing.txDmaReadyToSend.value - 1;
+		    etdev->TxRing.txDmaReadyToSend.value - 1;
 
-	spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags2);
+	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags2);
 
-	if (pAdapter->TxRing.CurrSendTail)
-		pAdapter->TxRing.CurrSendTail->Next = pMpTcb;
+	if (etdev->TxRing.CurrSendTail)
+		etdev->TxRing.CurrSendTail->Next = pMpTcb;
 	else
-		pAdapter->TxRing.CurrSendHead = pMpTcb;
+		etdev->TxRing.CurrSendHead = pMpTcb;
 
-	pAdapter->TxRing.CurrSendTail = pMpTcb;
+	etdev->TxRing.CurrSendTail = pMpTcb;
 
 	DBG_ASSERT(pMpTcb->Next == NULL);
 
-	pAdapter->TxRing.nBusySend++;
+	etdev->TxRing.nBusySend++;
 
-	spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags2);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags2);
 
 	/* Write the new write pointer back to the device. */
-	writel(pAdapter->TxRing.txDmaReadyToSend.value,
-	       &pAdapter->CSRAddress->txdma.service_request.value);
+	writel(etdev->TxRing.txDmaReadyToSend.value,
+	       &etdev->CSRAddress->txdma.service_request.value);
 
 	/* For Gig only, we use Tx Interrupt coalescing.  Enable the software
 	 * timer to wake us up if this packet isn't followed by N more.
 	 */
-	if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
-		writel(pAdapter->RegistryTxTimeInterval * NANO_IN_A_MICRO,
-		       &pAdapter->CSRAddress->global.watchdog_timer);
+	if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
+		writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO,
+		       &etdev->CSRAddress->global.watchdog_timer);
 	}
 
-	spin_unlock_irqrestore(&pAdapter->SendHWLock, lockflags1);
+	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 	return 0;
@@ -812,7 +812,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 
 /**
  * NICSendPacket - NIC specific send handler.
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  * @pMpTcb: pointer to MP_TCB
  *
  * Returns 0 on succes, errno on failure.
@@ -820,7 +820,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
  * This version of the send routine is designed for version A silicon.
  * Assumption - Send spinlock has been acquired.
  */
-static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
+static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 {
 	uint32_t loopIndex, fragIndex, loopEnd;
 	uint32_t iSplitFirstElement = 0;
@@ -837,7 +837,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 	DBG_TX_ENTER(et131x_dbginfo);
 
 	ServiceComplete.value =
-		readl(&pAdapter->CSRAddress->txdma.NewServiceComplete.value);
+		readl(&etdev->CSRAddress->txdma.NewServiceComplete.value);
 
 	/*
 	 * Attempt to fix TWO hardware bugs:
@@ -856,7 +856,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 	DBG_TX(et131x_dbginfo,
 	       "pMpTcb->PacketLength: %d\n", pMpTcb->PacketLength);
 
-	if ((pAdapter->uiDuplexMode == 0)
+	if ((etdev->uiDuplexMode == 0)
 	    && (pMpTcb->PacketLength < NIC_MIN_PACKET_SIZE)) {
 		DBG_TX(et131x_dbginfo,
 		       "HALF DUPLEX mode AND len < MIN_PKT_SIZE\n");
@@ -875,28 +875,28 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		SegmentSize = (pPacket->len - pPacket->data_len) / 2;
 	}
 
-	spin_lock_irqsave(&pAdapter->SendHWLock, lockflags1);
+	spin_lock_irqsave(&etdev->SendHWLock, lockflags1);
 
-	if (pAdapter->TxRing.txDmaReadyToSend.bits.serv_req_wrap ==
+	if (etdev->TxRing.txDmaReadyToSend.bits.serv_req_wrap ==
 	    ServiceComplete.bits.serv_cpl_wrap) {
 		/* The ring hasn't wrapped.  Slots available should be
 		 * (RING_SIZE) -  the difference between the two pointers.
 		 */
 		SlotsAvailable = NUM_DESC_PER_RING_TX -
-		    (pAdapter->TxRing.txDmaReadyToSend.bits.serv_req -
+		    (etdev->TxRing.txDmaReadyToSend.bits.serv_req -
 		     ServiceComplete.bits.serv_cpl);
 	} else {
 		/* The ring has wrapped.  Slots available should be the
 		 * difference between the two pointers.
 		 */
 		SlotsAvailable = ServiceComplete.bits.serv_cpl -
-		    pAdapter->TxRing.txDmaReadyToSend.bits.serv_req;
+		    etdev->TxRing.txDmaReadyToSend.bits.serv_req;
 	}
 
 	if ((FragListCount + iSplitFirstElement) > SlotsAvailable) {
 		DBG_WARNING(et131x_dbginfo,
 			    "Not Enough Space in Tx Desc Ring\n");
-		spin_unlock_irqrestore(&pAdapter->SendHWLock, lockflags1);
+		spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
 		return -ENOMEM;
 	}
 
@@ -926,7 +926,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		       "Packet Length %d,"
 		       "filling desc entry %d\n",
 		       pPacket->len,
-		       pAdapter->TxRing.txDmaReadyToSend.bits.serv_req);
+		       etdev->TxRing.txDmaReadyToSend.bits.serv_req);
 
 		/*
 		 * NOTE - Should we do a paranoia check here to make sure the fragment
@@ -962,7 +962,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 						    length_in_bytes =
 						    SegmentSize;
 						CurDesc.DataBufferPtrLow =
-						    pci_map_single(pAdapter->
+						    pci_map_single(etdev->
 								   pdev,
 								   pPacket->
 								   data,
@@ -990,7 +990,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 						      pPacket->data_len) -
 						     SegmentSize);
 						CurDesc.DataBufferPtrLow =
-						    pci_map_single(pAdapter->
+						    pci_map_single(etdev->
 								   pdev,
 								   (pPacket->
 								    data +
@@ -1014,7 +1014,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 					    pPacket->len - pPacket->data_len;
 
 					CurDesc.DataBufferPtrLow =
-					    pci_map_single(pAdapter->pdev,
+					    pci_map_single(etdev->pdev,
 							   pPacket->data,
 							   (pPacket->len -
 							    pPacket->data_len),
@@ -1028,7 +1028,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				CurDesc.word2.bits.length_in_bytes =
 				    pFragList[fragIndex - 1].size;
 				CurDesc.DataBufferPtrLow =
-				    pci_map_page(pAdapter->pdev,
+				    pci_map_page(etdev->pdev,
 						 pFragList[fragIndex - 1].page,
 						 pFragList[fragIndex -
 							   1].page_offset,
@@ -1050,23 +1050,23 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				CurDesc.word3.bits.f = 1;
 
 				pMpTcb->WrIndexStart =
-				    pAdapter->TxRing.txDmaReadyToSend;
+				    etdev->TxRing.txDmaReadyToSend;
 			}
 
 			if ((loopIndex == (loopEnd - 1)) &&
-			    (pAdapter->uiDuplexMode ||
+			    (etdev->uiDuplexMode ||
 			     (pMpTcb->PacketLength >= NIC_MIN_PACKET_SIZE))) {
 				/* This is the Last descriptor of the packet */
 				DBG_TX(et131x_dbginfo,
 				       "THIS is our LAST descriptor\n");
 
-				if (pAdapter->uiLinkSpeed ==
+				if (etdev->uiLinkSpeed ==
 				    TRUEPHY_SPEED_1000MBPS) {
-					if (++pAdapter->TxRing.
+					if (++etdev->TxRing.
 					    TxPacketsSinceLastinterrupt >=
-					    pAdapter->RegistryTxNumBuffers) {
+					    etdev->RegistryTxNumBuffers) {
 						CurDesc.word3.value = 0x5;
-						pAdapter->TxRing.
+						etdev->TxRing.
 						    TxPacketsSinceLastinterrupt
 						    = 0;
 					} else {
@@ -1080,7 +1080,7 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 				 * of packet
 				 */
 				pMpTcb->WrIndex =
-				    pAdapter->TxRing.txDmaReadyToSend;
+				    etdev->TxRing.txDmaReadyToSend;
 				pMpTcb->PacketStaleCount = 0;
 			}
 
@@ -1088,13 +1088,13 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 			 * descriptor ring at the next free entry.  Advance
 			 * the "next free entry" variable
 			 */
-			memcpy(pAdapter->TxRing.pTxDescRingVa +
-			       pAdapter->TxRing.txDmaReadyToSend.bits.serv_req,
+			memcpy(etdev->TxRing.pTxDescRingVa +
+			       etdev->TxRing.txDmaReadyToSend.bits.serv_req,
 			       &CurDesc, sizeof(TX_DESC_ENTRY_t));
 
 			CurDescPostCopy =
-			    pAdapter->TxRing.pTxDescRingVa +
-			    pAdapter->TxRing.txDmaReadyToSend.bits.serv_req;
+			    etdev->TxRing.pTxDescRingVa +
+			    etdev->TxRing.txDmaReadyToSend.bits.serv_req;
 
 			DBG_TX(et131x_dbginfo,
 			       "CURRENT DESCRIPTOR\n"
@@ -1109,32 +1109,32 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 			       CurDescPostCopy->word2.value,
 			       CurDescPostCopy->word3.value);
 
-			if (++pAdapter->TxRing.txDmaReadyToSend.bits.serv_req >=
+			if (++etdev->TxRing.txDmaReadyToSend.bits.serv_req >=
 			    NUM_DESC_PER_RING_TX) {
-				if (pAdapter->TxRing.txDmaReadyToSend.bits.
+				if (etdev->TxRing.txDmaReadyToSend.bits.
 				    serv_req_wrap) {
-					pAdapter->TxRing.txDmaReadyToSend.
+					etdev->TxRing.txDmaReadyToSend.
 					    value = 0;
 				} else {
-					pAdapter->TxRing.txDmaReadyToSend.
+					etdev->TxRing.txDmaReadyToSend.
 					    value = 0x400;
 				}
 			}
 		}
 	}
 
-	if (pAdapter->uiDuplexMode == 0 &&
+	if (etdev->uiDuplexMode == 0 &&
 	    pMpTcb->PacketLength < NIC_MIN_PACKET_SIZE) {
 		/* NOTE - Same 32/64-bit issue as above... */
 		CurDesc.DataBufferPtrHigh = 0x0;
-		CurDesc.DataBufferPtrLow = pAdapter->TxRing.pTxDummyBlkPa;
+		CurDesc.DataBufferPtrLow = etdev->TxRing.pTxDummyBlkPa;
 		CurDesc.word2.value = 0;
 
-		if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
-			if (++pAdapter->TxRing.TxPacketsSinceLastinterrupt >=
-			    pAdapter->RegistryTxNumBuffers) {
+		if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
+			if (++etdev->TxRing.TxPacketsSinceLastinterrupt >=
+			    etdev->RegistryTxNumBuffers) {
 				CurDesc.word3.value = 0x5;
-				pAdapter->TxRing.TxPacketsSinceLastinterrupt =
+				etdev->TxRing.TxPacketsSinceLastinterrupt =
 				    0;
 			} else {
 				CurDesc.word3.value = 0x1;
@@ -1146,15 +1146,15 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		CurDesc.word2.bits.length_in_bytes =
 		    NIC_MIN_PACKET_SIZE - pMpTcb->PacketLength;
 
-		pMpTcb->WrIndex = pAdapter->TxRing.txDmaReadyToSend;
+		pMpTcb->WrIndex = etdev->TxRing.txDmaReadyToSend;
 
-		memcpy(pAdapter->TxRing.pTxDescRingVa +
-		       pAdapter->TxRing.txDmaReadyToSend.bits.serv_req,
+		memcpy(etdev->TxRing.pTxDescRingVa +
+		       etdev->TxRing.txDmaReadyToSend.bits.serv_req,
 		       &CurDesc, sizeof(TX_DESC_ENTRY_t));
 
 		CurDescPostCopy =
-		    pAdapter->TxRing.pTxDescRingVa +
-		    pAdapter->TxRing.txDmaReadyToSend.bits.serv_req;
+		    etdev->TxRing.pTxDescRingVa +
+		    etdev->TxRing.txDmaReadyToSend.bits.serv_req;
 
 		DBG_TX(et131x_dbginfo,
 		       "CURRENT DESCRIPTOR\n"
@@ -1169,54 +1169,54 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 		       CurDescPostCopy->word2.value,
 		       CurDescPostCopy->word3.value);
 
-		if (++pAdapter->TxRing.txDmaReadyToSend.bits.serv_req >=
+		if (++etdev->TxRing.txDmaReadyToSend.bits.serv_req >=
 		    NUM_DESC_PER_RING_TX) {
-			if (pAdapter->TxRing.txDmaReadyToSend.bits.
+			if (etdev->TxRing.txDmaReadyToSend.bits.
 			    serv_req_wrap) {
-				pAdapter->TxRing.txDmaReadyToSend.value = 0;
+				etdev->TxRing.txDmaReadyToSend.value = 0;
 			} else {
-				pAdapter->TxRing.txDmaReadyToSend.value = 0x400;
+				etdev->TxRing.txDmaReadyToSend.value = 0x400;
 			}
 		}
 
 		DBG_TX(et131x_dbginfo, "Padding descriptor %d by %d bytes\n",
-		       /* pAdapter->TxRing.txDmaReadyToSend.value, */
-		       pAdapter->TxRing.txDmaReadyToSend.bits.serv_req,
+		       /* etdev->TxRing.txDmaReadyToSend.value, */
+		       etdev->TxRing.txDmaReadyToSend.bits.serv_req,
 		       NIC_MIN_PACKET_SIZE - pMpTcb->PacketLength);
 	}
 
-	spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags2);
+	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags2);
 
-	if (pAdapter->TxRing.CurrSendTail)
-		pAdapter->TxRing.CurrSendTail->Next = pMpTcb;
+	if (etdev->TxRing.CurrSendTail)
+		etdev->TxRing.CurrSendTail->Next = pMpTcb;
 	else
-		pAdapter->TxRing.CurrSendHead = pMpTcb;
+		etdev->TxRing.CurrSendHead = pMpTcb;
 
-	pAdapter->TxRing.CurrSendTail = pMpTcb;
+	etdev->TxRing.CurrSendTail = pMpTcb;
 
 	DBG_ASSERT(pMpTcb->Next == NULL);
 
-	pAdapter->TxRing.nBusySend++;
+	etdev->TxRing.nBusySend++;
 
-	spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags2);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags2);
 
 	/* Write the new write pointer back to the device. */
-	writel(pAdapter->TxRing.txDmaReadyToSend.value,
-	       &pAdapter->CSRAddress->txdma.service_request.value);
+	writel(etdev->TxRing.txDmaReadyToSend.value,
+	       &etdev->CSRAddress->txdma.service_request.value);
 
 #ifdef CONFIG_ET131X_DEBUG
-	DumpDeviceBlock(DBG_TX_ON, pAdapter, 1);
+	DumpDeviceBlock(DBG_TX_ON, etdev, 1);
 #endif
 
 	/* For Gig only, we use Tx Interrupt coalescing.  Enable the software
 	 * timer to wake us up if this packet isn't followed by N more.
 	 */
-	if (pAdapter->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
-		writel(pAdapter->RegistryTxTimeInterval * NANO_IN_A_MICRO,
-		       &pAdapter->CSRAddress->global.watchdog_timer);
+	if (etdev->uiLinkSpeed == TRUEPHY_SPEED_1000MBPS) {
+		writel(etdev->RegistryTxTimeInterval * NANO_IN_A_MICRO,
+		       &etdev->CSRAddress->global.watchdog_timer);
 	}
 
-	spin_unlock_irqrestore(&pAdapter->SendHWLock, lockflags1);
+	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 	return 0;
@@ -1226,24 +1226,24 @@ static int nic_send_packet(struct et131x_adapter *pAdapter, PMP_TCB pMpTcb)
 
 /**
  * et131x_free_send_packet - Recycle a MP_TCB, complete the packet if necessary
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  * @pMpTcb: pointer to MP_TCB
  *
  * Assumption - Send spinlock has been acquired
  */
-inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
+inline void et131x_free_send_packet(struct et131x_adapter *etdev,
 							PMP_TCB pMpTcb)
 {
 	unsigned long lockflags;
 	TX_DESC_ENTRY_t *desc = NULL;
-	struct net_device_stats *stats = &pAdapter->net_stats;
+	struct net_device_stats *stats = &etdev->net_stats;
 
 	if (MP_TEST_FLAG(pMpTcb, fMP_DEST_BROAD))
-		atomic_inc(&pAdapter->Stats.brdcstxmt);
+		atomic_inc(&etdev->Stats.brdcstxmt);
 	else if (MP_TEST_FLAG(pMpTcb, fMP_DEST_MULTI))
-		atomic_inc(&pAdapter->Stats.multixmt);
+		atomic_inc(&etdev->Stats.multixmt);
 	else
-		atomic_inc(&pAdapter->Stats.unixmt);
+		atomic_inc(&etdev->Stats.unixmt);
 
 	if (pMpTcb->Packet) {
 		stats->tx_bytes += pMpTcb->Packet->len;
@@ -1271,7 +1271,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
 
 		do {
 			desc =
-			    (TX_DESC_ENTRY_t *) (pAdapter->TxRing.
+			    (TX_DESC_ENTRY_t *) (etdev->TxRing.
 						 pTxDescRingVa +
 						 pMpTcb->WrIndexStart.bits.val);
 
@@ -1288,7 +1288,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
 			       desc->word2.value,
 			       desc->word3.value);
 
-			pci_unmap_single(pAdapter->pdev,
+			pci_unmap_single(etdev->pdev,
 					 desc->DataBufferPtrLow,
 					 desc->word2.value, PCI_DMA_TODEVICE);
 
@@ -1299,7 +1299,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
 				else
 					pMpTcb->WrIndexStart.value = 0x400;
 			}
-		} while (desc != (pAdapter->TxRing.pTxDescRingVa +
+		} while (desc != (etdev->TxRing.pTxDescRingVa +
 				pMpTcb->WrIndex.bits.val));
 
 		DBG_TX(et131x_dbginfo,
@@ -1311,31 +1311,31 @@ inline void et131x_free_send_packet(struct et131x_adapter *pAdapter,
 	memset(pMpTcb, 0, sizeof(MP_TCB));
 
 	/* Add the TCB to the Ready Q */
-	spin_lock_irqsave(&pAdapter->TCBReadyQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
 
-	pAdapter->Stats.opackets++;
+	etdev->Stats.opackets++;
 
-	if (pAdapter->TxRing.TCBReadyQueueTail) {
-		pAdapter->TxRing.TCBReadyQueueTail->Next = pMpTcb;
+	if (etdev->TxRing.TCBReadyQueueTail) {
+		etdev->TxRing.TCBReadyQueueTail->Next = pMpTcb;
 	} else {
 		/* Apparently ready Q is empty. */
-		pAdapter->TxRing.TCBReadyQueueHead = pMpTcb;
+		etdev->TxRing.TCBReadyQueueHead = pMpTcb;
 	}
 
-	pAdapter->TxRing.TCBReadyQueueTail = pMpTcb;
+	etdev->TxRing.TCBReadyQueueTail = pMpTcb;
 
-	spin_unlock_irqrestore(&pAdapter->TCBReadyQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
 
-	DBG_ASSERT(pAdapter->TxRing.nBusySend >= 0);
+	DBG_ASSERT(etdev->TxRing.nBusySend >= 0);
 }
 
 /**
  * et131x_free_busy_send_packets - Free and complete the stopped active sends
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Assumption - Send spinlock has been acquired
  */
-void et131x_free_busy_send_packets(struct et131x_adapter *pAdapter)
+void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
 {
 	PMP_TCB pMpTcb;
 	struct list_head *pEntry;
@@ -1344,42 +1344,42 @@ void et131x_free_busy_send_packets(struct et131x_adapter *pAdapter)
 
 	DBG_ENTER(et131x_dbginfo);
 
-	while (!list_empty(&pAdapter->TxRing.SendWaitQueue)) {
-		spin_lock_irqsave(&pAdapter->SendWaitLock, lockflags);
+	while (!list_empty(&etdev->TxRing.SendWaitQueue)) {
+		spin_lock_irqsave(&etdev->SendWaitLock, lockflags);
 
-		pAdapter->TxRing.nWaitSend--;
-		spin_unlock_irqrestore(&pAdapter->SendWaitLock, lockflags);
+		etdev->TxRing.nWaitSend--;
+		spin_unlock_irqrestore(&etdev->SendWaitLock, lockflags);
 
-		pEntry = pAdapter->TxRing.SendWaitQueue.next;
+		pEntry = etdev->TxRing.SendWaitQueue.next;
 	}
 
-	pAdapter->TxRing.nWaitSend = 0;
+	etdev->TxRing.nWaitSend = 0;
 
 	/* Any packets being sent? Check the first TCB on the send list */
-	spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
-	pMpTcb = pAdapter->TxRing.CurrSendHead;
+	pMpTcb = etdev->TxRing.CurrSendHead;
 
 	while ((pMpTcb != NULL) && (FreeCounter < NUM_TCB)) {
 		PMP_TCB pNext = pMpTcb->Next;
 
-		pAdapter->TxRing.CurrSendHead = pNext;
+		etdev->TxRing.CurrSendHead = pNext;
 
 		if (pNext == NULL)
-			pAdapter->TxRing.CurrSendTail = NULL;
+			etdev->TxRing.CurrSendTail = NULL;
 
-		pAdapter->TxRing.nBusySend--;
+		etdev->TxRing.nBusySend--;
 
-		spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
 
 		DBG_VERBOSE(et131x_dbginfo, "pMpTcb = 0x%p\n", pMpTcb);
 
 		FreeCounter++;
-		MP_FREE_SEND_PACKET_FUN(pAdapter, pMpTcb);
+		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
 
-		spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
-		pMpTcb = pAdapter->TxRing.CurrSendHead;
+		pMpTcb = etdev->TxRing.CurrSendHead;
 	}
 
 	if (FreeCounter == NUM_TCB) {
@@ -1388,125 +1388,125 @@ void et131x_free_busy_send_packets(struct et131x_adapter *pAdapter)
 		BUG();
 	}
 
-	spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
 
-	pAdapter->TxRing.nBusySend = 0;
+	etdev->TxRing.nBusySend = 0;
 
 	DBG_LEAVE(et131x_dbginfo);
 }
 
 /**
  * et131x_handle_send_interrupt - Interrupt handler for sending processing
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Re-claim the send resources, complete sends and get more to send from
  * the send wait queue.
  *
  * Assumption - Send spinlock has been acquired
  */
-void et131x_handle_send_interrupt(struct et131x_adapter *pAdapter)
+void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
 {
 	DBG_TX_ENTER(et131x_dbginfo);
 
 	/* Mark as completed any packets which have been sent by the device. */
-	et131x_update_tcb_list(pAdapter);
+	et131x_update_tcb_list(etdev);
 
 	/* If we queued any transmits because we didn't have any TCBs earlier,
 	 * dequeue and send those packets now, as long as we have free TCBs.
 	 */
-	et131x_check_send_wait_list(pAdapter);
+	et131x_check_send_wait_list(etdev);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 }
 
 /**
  * et131x_update_tcb_list - Helper routine for Send Interrupt handler
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Re-claims the send resources and completes sends.  Can also be called as
  * part of the NIC send routine when the "ServiceComplete" indication has
  * wrapped.
  */
-static void et131x_update_tcb_list(struct et131x_adapter *pAdapter)
+static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 {
 	unsigned long lockflags;
 	DMA10W_t ServiceComplete;
 	PMP_TCB pMpTcb;
 
 	ServiceComplete.value =
-	    readl(&pAdapter->CSRAddress->txdma.NewServiceComplete.value);
+	    readl(&etdev->CSRAddress->txdma.NewServiceComplete.value);
 
 	/* Has the ring wrapped?  Process any descriptors that do not have
 	 * the same "wrap" indicator as the current completion indicator
 	 */
-	spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
-	pMpTcb = pAdapter->TxRing.CurrSendHead;
+	pMpTcb = etdev->TxRing.CurrSendHead;
 	while (pMpTcb &&
 	       ServiceComplete.bits.wrap != pMpTcb->WrIndex.bits.wrap  &&
 	       ServiceComplete.bits.val < pMpTcb->WrIndex.bits.val) {
-		pAdapter->TxRing.nBusySend--;
-		pAdapter->TxRing.CurrSendHead = pMpTcb->Next;
+		etdev->TxRing.nBusySend--;
+		etdev->TxRing.CurrSendHead = pMpTcb->Next;
 		if (pMpTcb->Next == NULL)
-			pAdapter->TxRing.CurrSendTail = NULL;
+			etdev->TxRing.CurrSendTail = NULL;
 
-		spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
-		MP_FREE_SEND_PACKET_FUN(pAdapter, pMpTcb);
-		spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
+		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
 		/* Goto the next packet */
-		pMpTcb = pAdapter->TxRing.CurrSendHead;
+		pMpTcb = etdev->TxRing.CurrSendHead;
 	}
 	while (pMpTcb &&
 	       ServiceComplete.bits.wrap == pMpTcb->WrIndex.bits.wrap &&
 	       ServiceComplete.bits.val > pMpTcb->WrIndex.bits.val) {
-		pAdapter->TxRing.nBusySend--;
-		pAdapter->TxRing.CurrSendHead = pMpTcb->Next;
+		etdev->TxRing.nBusySend--;
+		etdev->TxRing.CurrSendHead = pMpTcb->Next;
 		if (pMpTcb->Next == NULL)
-			pAdapter->TxRing.CurrSendTail = NULL;
+			etdev->TxRing.CurrSendTail = NULL;
 
-		spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
-		MP_FREE_SEND_PACKET_FUN(pAdapter, pMpTcb);
-		spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
+		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
 		/* Goto the next packet */
-		pMpTcb = pAdapter->TxRing.CurrSendHead;
+		pMpTcb = etdev->TxRing.CurrSendHead;
 	}
 
 	/* Wake up the queue when we hit a low-water mark */
-	if (pAdapter->TxRing.nBusySend <= (NUM_TCB / 3))
-		netif_wake_queue(pAdapter->netdev);
+	if (etdev->TxRing.nBusySend <= (NUM_TCB / 3))
+		netif_wake_queue(etdev->netdev);
 
-	spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
 }
 
 /**
  * et131x_check_send_wait_list - Helper routine for the interrupt handler
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Takes packets from the send wait queue and posts them to the device (if
  * room available).
  */
-static void et131x_check_send_wait_list(struct et131x_adapter *pAdapter)
+static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
 {
 	unsigned long lockflags;
 
-	spin_lock_irqsave(&pAdapter->SendWaitLock, lockflags);
+	spin_lock_irqsave(&etdev->SendWaitLock, lockflags);
 
-	while (!list_empty(&pAdapter->TxRing.SendWaitQueue) &&
-				MP_TCB_RESOURCES_AVAILABLE(pAdapter)) {
+	while (!list_empty(&etdev->TxRing.SendWaitQueue) &&
+				MP_TCB_RESOURCES_AVAILABLE(etdev)) {
 		struct list_head *pEntry;
 
 		DBG_VERBOSE(et131x_dbginfo, "Tx packets on the wait queue\n");
 
-		pEntry = pAdapter->TxRing.SendWaitQueue.next;
+		pEntry = etdev->TxRing.SendWaitQueue.next;
 
-		pAdapter->TxRing.nWaitSend--;
+		etdev->TxRing.nWaitSend--;
 
 		DBG_WARNING(et131x_dbginfo,
 		    "MpHandleSendInterrupt - sent a queued pkt. Waiting %d\n",
-				pAdapter->TxRing.nWaitSend);
+				etdev->TxRing.nWaitSend);
 	}
 
-	spin_unlock_irqrestore(&pAdapter->SendWaitLock, lockflags);
+	spin_unlock_irqrestore(&etdev->SendWaitLock, lockflags);
 }
diff --git a/drivers/staging/et131x/et131x_config.c b/drivers/staging/et131x/et131x_config.c
index 15e6d4e..148672b 100644
--- a/drivers/staging/et131x/et131x_config.c
+++ b/drivers/staging/et131x/et131x_config.c
@@ -202,12 +202,12 @@ MODULE_PARM_DESC(et131x_speed_set,
 
 /**
  * et131x_config_parse
- * @pAdapter: pointer to the private adapter struct
+ * @etdev: pointer to the private adapter struct
  *
  * Parses a configuration from some location (module parameters, for example)
  * into the private adapter struct
  */
-void et131x_config_parse(struct et131x_adapter *pAdapter)
+void et131x_config_parse(struct et131x_adapter *etdev)
 {
 	uint8_t macAddrDef[] = PARM_MAC_ADDRESS_DEF;
 
@@ -237,85 +237,85 @@ void et131x_config_parse(struct et131x_adapter *pAdapter)
 	if (et131x_speed_set != PARM_SPEED_DUPLEX_DEF) {
 		DBG_VERBOSE(et131x_dbginfo, "Speed set manually to : %d \n",
 			    et131x_speed_set);
-		pAdapter->SpeedDuplex = et131x_speed_set;
+		etdev->SpeedDuplex = et131x_speed_set;
 	} else {
-		pAdapter->SpeedDuplex = PARM_SPEED_DUPLEX_DEF;
+		etdev->SpeedDuplex = PARM_SPEED_DUPLEX_DEF;
 	}
 
-	/*  pAdapter->SpeedDuplex            = PARM_SPEED_DUPLEX_DEF; */
-
-	pAdapter->RegistryVlanTag = PARM_VLAN_TAG_DEF;
-	pAdapter->RegistryFlowControl = PARM_FLOW_CTL_DEF;
-	pAdapter->RegistryWOLLink = PARM_WOL_LINK_DEF;
-	pAdapter->RegistryWOLMatch = PARM_WOL_MATCH_DEF;
-	pAdapter->RegistryJumboPacket = PARM_JUMBO_PKT_DEF;
-	pAdapter->RegistryPhyComa = PARM_PHY_COMA_DEF;
-	pAdapter->RegistryRxNumBuffers = PARM_RX_NUM_BUFS_DEF;
-	pAdapter->RegistryRxTimeInterval = PARM_RX_TIME_INT_DEF;
-	pAdapter->RegistryTxNumBuffers = PARM_TX_NUM_BUFS_DEF;
-	pAdapter->RegistryTxTimeInterval = PARM_TX_TIME_INT_DEF;
-	pAdapter->RegistryRxMemEnd = PARM_RX_MEM_END_DEF;
-	pAdapter->RegistryMACStat = PARM_MAC_STAT_DEF;
-	pAdapter->RegistrySCGain = PARM_SC_GAIN_DEF;
-	pAdapter->RegistryPMWOL = PARM_PM_WOL_DEF;
+	/*  etdev->SpeedDuplex            = PARM_SPEED_DUPLEX_DEF; */
+
+	etdev->RegistryVlanTag = PARM_VLAN_TAG_DEF;
+	etdev->RegistryFlowControl = PARM_FLOW_CTL_DEF;
+	etdev->RegistryWOLLink = PARM_WOL_LINK_DEF;
+	etdev->RegistryWOLMatch = PARM_WOL_MATCH_DEF;
+	etdev->RegistryJumboPacket = PARM_JUMBO_PKT_DEF;
+	etdev->RegistryPhyComa = PARM_PHY_COMA_DEF;
+	etdev->RegistryRxNumBuffers = PARM_RX_NUM_BUFS_DEF;
+	etdev->RegistryRxTimeInterval = PARM_RX_TIME_INT_DEF;
+	etdev->RegistryTxNumBuffers = PARM_TX_NUM_BUFS_DEF;
+	etdev->RegistryTxTimeInterval = PARM_TX_TIME_INT_DEF;
+	etdev->RegistryRxMemEnd = PARM_RX_MEM_END_DEF;
+	etdev->RegistryMACStat = PARM_MAC_STAT_DEF;
+	etdev->RegistrySCGain = PARM_SC_GAIN_DEF;
+	etdev->RegistryPMWOL = PARM_PM_WOL_DEF;
 
 	if (et131x_nmi_disable != PARM_NMI_DISABLE_DEF)
-		pAdapter->RegistryNMIDisable = et131x_nmi_disable;
+		etdev->RegistryNMIDisable = et131x_nmi_disable;
 	else
-		pAdapter->RegistryNMIDisable = PARM_NMI_DISABLE_DEF;
+		etdev->RegistryNMIDisable = PARM_NMI_DISABLE_DEF;
 
-	pAdapter->RegistryDMACache = PARM_DMA_CACHE_DEF;
-	pAdapter->RegistryPhyLoopbk = PARM_PHY_LOOPBK_DEF;
+	etdev->RegistryDMACache = PARM_DMA_CACHE_DEF;
+	etdev->RegistryPhyLoopbk = PARM_PHY_LOOPBK_DEF;
 
 	/* Set the MAC address to a default */
-	memcpy(pAdapter->CurrentAddress, macAddrDef, ETH_ALEN);
-	pAdapter->bOverrideAddress = false;
+	memcpy(etdev->CurrentAddress, macAddrDef, ETH_ALEN);
+	etdev->bOverrideAddress = false;
 
 	DBG_TRACE(et131x_dbginfo,
 		  "Default MAC Address  : %02x:%02x:%02x:%02x:%02x:%02x\n",
-		  pAdapter->CurrentAddress[0], pAdapter->CurrentAddress[1],
-		  pAdapter->CurrentAddress[2], pAdapter->CurrentAddress[3],
-		  pAdapter->CurrentAddress[4], pAdapter->CurrentAddress[5]);
+		  etdev->CurrentAddress[0], etdev->CurrentAddress[1],
+		  etdev->CurrentAddress[2], etdev->CurrentAddress[3],
+		  etdev->CurrentAddress[4], etdev->CurrentAddress[5]);
 
 	/* Decode SpeedDuplex
 	 *
 	 * Set up as if we are auto negotiating always and then change if we
 	 * go into force mode
 	 */
-	pAdapter->AiForceSpeed = 0;	/* Auto speed */
-	pAdapter->AiForceDpx = 0;	/* Auto FDX */
+	etdev->AiForceSpeed = 0;	/* Auto speed */
+	etdev->AiForceDpx = 0;	/* Auto FDX */
 
 	/* If we are the 10/100 device, and gigabit is somehow requested then
 	 * knock it down to 100 full.
 	 */
-	if (pAdapter->DeviceID == ET131X_PCI_DEVICE_ID_FAST &&
-	    pAdapter->SpeedDuplex == 5)
-		pAdapter->SpeedDuplex = 4;
+	if (etdev->DeviceID == ET131X_PCI_DEVICE_ID_FAST &&
+	    etdev->SpeedDuplex == 5)
+		etdev->SpeedDuplex = 4;
 
-	switch (pAdapter->SpeedDuplex) {
+	switch (etdev->SpeedDuplex) {
 	case 1:		/* 10Mb   Half-Duplex */
-		pAdapter->AiForceSpeed = 10;
-		pAdapter->AiForceDpx = 1;
+		etdev->AiForceSpeed = 10;
+		etdev->AiForceDpx = 1;
 		break;
 
 	case 2:		/* 10Mb   Full-Duplex */
-		pAdapter->AiForceSpeed = 10;
-		pAdapter->AiForceDpx = 2;
+		etdev->AiForceSpeed = 10;
+		etdev->AiForceDpx = 2;
 		break;
 
 	case 3:		/* 100Mb  Half-Duplex */
-		pAdapter->AiForceSpeed = 100;
-		pAdapter->AiForceDpx = 1;
+		etdev->AiForceSpeed = 100;
+		etdev->AiForceDpx = 1;
 		break;
 
 	case 4:		/* 100Mb  Full-Duplex */
-		pAdapter->AiForceSpeed = 100;
-		pAdapter->AiForceDpx = 2;
+		etdev->AiForceSpeed = 100;
+		etdev->AiForceDpx = 2;
 		break;
 
 	case 5:		/* 1000Mb Full-Duplex */
-		pAdapter->AiForceSpeed = 1000;
-		pAdapter->AiForceDpx = 2;
+		etdev->AiForceSpeed = 1000;
+		etdev->AiForceDpx = 2;
 		break;
 	}
 
diff --git a/drivers/staging/et131x/et131x_debug.c b/drivers/staging/et131x/et131x_debug.c
index c7f64a8..2730b9c 100644
--- a/drivers/staging/et131x/et131x_debug.c
+++ b/drivers/staging/et131x/et131x_debug.c
@@ -106,11 +106,11 @@ extern dbg_info_t *et131x_dbginfo;
 
 /**
  * DumpTxQueueContents - Dump out the tx queue and the shadow pointers
- * @pAdapter: pointer to our adapter structure
+ * @etdev: pointer to our adapter structure
  */
-void DumpTxQueueContents(int dbgLvl, struct et131x_adapter *pAdapter)
+void DumpTxQueueContents(int dbgLvl, struct et131x_adapter *etdev)
 {
-	MMC_t __iomem *mmc = &pAdapter->CSRAddress->mmc;
+	MMC_t __iomem *mmc = &etdev->CSRAddress->mmc;
 	uint32_t TxQueueAddr;
 
 	if (DBG_FLAGS(et131x_dbginfo) & dbgLvl) {
@@ -134,24 +134,24 @@ void DumpTxQueueContents(int dbgLvl, struct et131x_adapter *pAdapter)
 		}
 
 		DBG_PRINT("Shadow Pointers 0x%08x\n",
-			  readl(&pAdapter->CSRAddress->txmac.shadow_ptr.value));
+			  readl(&etdev->CSRAddress->txmac.shadow_ptr.value));
 	}
 }
 
 /**
  * DumpDeviceBlock
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Dumps the first 64 regs of each block of the et-1310 (each block is
  * mapped to a new page, each page is 4096 bytes).
  */
 #define NUM_BLOCKS 8
-void DumpDeviceBlock(int dbgLvl, struct et131x_adapter *pAdapter,
+void DumpDeviceBlock(int dbgLvl, struct et131x_adapter *etdev,
 		     uint32_t Block)
 {
 	uint32_t Address1, Address2;
 	uint32_t __iomem *BigDevicePointer =
-		(uint32_t __iomem *) pAdapter->CSRAddress;
+		(uint32_t __iomem *) etdev->CSRAddress;
 	const char *BlockNames[NUM_BLOCKS] = {
 		"Global", "Tx DMA", "Rx DMA", "Tx MAC",
 		"Rx MAC", "MAC", "MAC Stat", "MMC"
@@ -179,17 +179,17 @@ void DumpDeviceBlock(int dbgLvl, struct et131x_adapter *pAdapter,
 
 /**
  * DumpDeviceReg
- * @pAdapter: pointer to our adapter
+ * @etdev: pointer to our adapter
  *
  * Dumps the first 64 regs of each block of the et-1310 (each block is
  * mapped to a new page, each page is 4096 bytes).
  */
-void DumpDeviceReg(int dbgLvl, struct et131x_adapter *pAdapter)
+void DumpDeviceReg(int dbgLvl, struct et131x_adapter *etdev)
 {
 	uint32_t Address1, Address2;
 	uint32_t Block;
 	uint32_t __iomem *BigDevicePointer =
-		(uint32_t __iomem *) pAdapter->CSRAddress;
+		(uint32_t __iomem *) etdev->CSRAddress;
 	uint32_t __iomem *Pointer;
 	const char *BlockNames[NUM_BLOCKS] = {
 		"Global", "Tx DMA", "Rx DMA", "Tx MAC",
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index c934589..8455e0a 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -447,40 +447,40 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
  */
 void et131x_error_timer_handler(unsigned long data)
 {
-	struct et131x_adapter *pAdapter = (struct et131x_adapter *) data;
+	struct et131x_adapter *etdev = (struct et131x_adapter *) data;
 	PM_CSR_t pm_csr;
 
-	pm_csr.value = readl(&pAdapter->CSRAddress->global.pm_csr.value);
+	pm_csr.value = readl(&etdev->CSRAddress->global.pm_csr.value);
 
 	if (pm_csr.bits.pm_phy_sw_coma == 0) {
-		if (pAdapter->RegistryMACStat)
-			UpdateMacStatHostCounters(pAdapter);
+		if (etdev->RegistryMACStat)
+			UpdateMacStatHostCounters(etdev);
 	} else
 		DBG_VERBOSE(et131x_dbginfo,
 			    "No interrupts, in PHY coma, pm_csr = 0x%x\n",
 			    pm_csr.value);
 
-	if (!pAdapter->Bmsr.bits.link_status &&
-	    pAdapter->RegistryPhyComa &&
-	    pAdapter->PoMgmt.TransPhyComaModeOnBoot < 11) {
-		pAdapter->PoMgmt.TransPhyComaModeOnBoot++;
+	if (!etdev->Bmsr.bits.link_status &&
+	    etdev->RegistryPhyComa &&
+	    etdev->PoMgmt.TransPhyComaModeOnBoot < 11) {
+		etdev->PoMgmt.TransPhyComaModeOnBoot++;
 	}
 
-	if (pAdapter->PoMgmt.TransPhyComaModeOnBoot == 10) {
-		if (!pAdapter->Bmsr.bits.link_status
-		    && pAdapter->RegistryPhyComa) {
+	if (etdev->PoMgmt.TransPhyComaModeOnBoot == 10) {
+		if (!etdev->Bmsr.bits.link_status
+		    && etdev->RegistryPhyComa) {
 			if (pm_csr.bits.pm_phy_sw_coma == 0) {
 				/* NOTE - This was originally a 'sync with
 				 *  interrupt'. How to do that under Linux?
 				 */
-				et131x_enable_interrupts(pAdapter);
-				EnablePhyComa(pAdapter);
+				et131x_enable_interrupts(etdev);
+				EnablePhyComa(etdev);
 			}
 		}
 	}
 
 	/* This is a periodic timer, so reschedule */
-	mod_timer(&pAdapter->ErrorTimer, jiffies +
+	mod_timer(&etdev->ErrorTimer, jiffies +
 					  TX_ERROR_PERIOD * HZ / 1000);
 }
 
@@ -491,23 +491,23 @@ void et131x_error_timer_handler(unsigned long data)
  */
 void et131x_link_detection_handler(unsigned long data)
 {
-	struct et131x_adapter *pAdapter = (struct et131x_adapter *) data;
+	struct et131x_adapter *etdev = (struct et131x_adapter *) data;
 	unsigned long lockflags;
 
 	/* Let everyone know that we have run */
-	pAdapter->bLinkTimerActive = false;
+	etdev->bLinkTimerActive = false;
 
-	if (pAdapter->MediaState == 0) {
-		spin_lock_irqsave(&pAdapter->Lock, lockflags);
+	if (etdev->MediaState == 0) {
+		spin_lock_irqsave(&etdev->Lock, lockflags);
 
-		pAdapter->MediaState = NETIF_STATUS_MEDIA_DISCONNECT;
-		MP_CLEAR_FLAG(pAdapter, fMP_ADAPTER_LINK_DETECTION);
+		etdev->MediaState = NETIF_STATUS_MEDIA_DISCONNECT;
+		MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
 
-		spin_unlock_irqrestore(&pAdapter->Lock, lockflags);
+		spin_unlock_irqrestore(&etdev->Lock, lockflags);
 
-		netif_carrier_off(pAdapter->netdev);
+		netif_carrier_off(etdev->netdev);
 
-		pAdapter->bSetPending = false;
+		etdev->bSetPending = false;
 	}
 }
 
@@ -517,54 +517,54 @@ void et131x_link_detection_handler(unsigned long data)
  *
  * Returns 0 on success, errno on failure (as defined in errno.h)
  */
-int et131x_adapter_setup(struct et131x_adapter *pAdapter)
+int et131x_adapter_setup(struct et131x_adapter *etdev)
 {
 	int status = 0;
 
 	DBG_ENTER(et131x_dbginfo);
 
 	/* Configure the JAGCore */
-	ConfigGlobalRegs(pAdapter);
+	ConfigGlobalRegs(etdev);
 
-	ConfigMACRegs1(pAdapter);
-	ConfigMMCRegs(pAdapter);
+	ConfigMACRegs1(etdev);
+	ConfigMMCRegs(etdev);
 
-	ConfigRxMacRegs(pAdapter);
-	ConfigTxMacRegs(pAdapter);
+	ConfigRxMacRegs(etdev);
+	ConfigTxMacRegs(etdev);
 
-	ConfigRxDmaRegs(pAdapter);
-	ConfigTxDmaRegs(pAdapter);
+	ConfigRxDmaRegs(etdev);
+	ConfigTxDmaRegs(etdev);
 
-	ConfigMacStatRegs(pAdapter);
+	ConfigMacStatRegs(etdev);
 
 	/* Move the following code to Timer function?? */
-	status = et131x_xcvr_find(pAdapter);
+	status = et131x_xcvr_find(etdev);
 
 	if (status != 0)
 		DBG_WARNING(et131x_dbginfo, "Could not find the xcvr\n");
 
 	/* Prepare the TRUEPHY library. */
-	ET1310_PhyInit(pAdapter);
+	ET1310_PhyInit(etdev);
 
 	/* Reset the phy now so changes take place */
-	ET1310_PhyReset(pAdapter);
+	ET1310_PhyReset(etdev);
 
 	/* Power down PHY */
-	ET1310_PhyPowerDown(pAdapter, 1);
+	ET1310_PhyPowerDown(etdev, 1);
 
 	/*
 	 * We need to turn off 1000 base half dulplex, the mac does not
 	 * support it. For the 10/100 part, turn off all gig advertisement
 	 */
-	if (pAdapter->DeviceID != ET131X_PCI_DEVICE_ID_FAST)
-		ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_FULL);
+	if (etdev->DeviceID != ET131X_PCI_DEVICE_ID_FAST)
+		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
 	else
-		ET1310_PhyAdvertise1000BaseT(pAdapter, TRUEPHY_ADV_DUPLEX_NONE);
+		ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
 
 	/* Power up PHY */
-	ET1310_PhyPowerDown(pAdapter, 0);
+	ET1310_PhyPowerDown(etdev, 0);
 
-	et131x_setphy_normal(pAdapter);
+	et131x_setphy_normal(etdev);
 
 	DBG_LEAVE(et131x_dbginfo);
 	return status;
diff --git a/drivers/staging/et131x/et131x_isr.c b/drivers/staging/et131x/et131x_isr.c
index bbe3c1a..9f51425 100644
--- a/drivers/staging/et131x/et131x_isr.c
+++ b/drivers/staging/et131x/et131x_isr.c
@@ -211,10 +211,10 @@ out:
  */
 void et131x_isr_handler(struct work_struct *work)
 {
-	struct et131x_adapter *pAdapter =
+	struct et131x_adapter *etdev =
 		container_of(work, struct et131x_adapter, task);
-	INTERRUPT_t GlobStatus = pAdapter->Stats.InterruptStatus;
-	ADDRESS_MAP_t __iomem *iomem = pAdapter->CSRAddress;
+	INTERRUPT_t GlobStatus = etdev->Stats.InterruptStatus;
+	ADDRESS_MAP_t __iomem *iomem = etdev->CSRAddress;
 
 	/*
 	 * These first two are by far the most common.  Once handled, we clear
@@ -224,13 +224,13 @@ void et131x_isr_handler(struct work_struct *work)
 	/* Handle all the completed Transmit interrupts */
 	if (GlobStatus.bits.txdma_isr) {
 		DBG_TX(et131x_dbginfo, "TXDMA_ISR interrupt\n");
-		et131x_handle_send_interrupt(pAdapter);
+		et131x_handle_send_interrupt(etdev);
 	}
 
 	/* Handle all the completed Receives interrupts */
 	if (GlobStatus.bits.rxdma_xfr_done) {
 		DBG_RX(et131x_dbginfo, "RXDMA_XFR_DONE interrupt\n");
-		et131x_handle_recv_interrupt(pAdapter);
+		et131x_handle_recv_interrupt(etdev);
 	}
 
 	GlobStatus.value &= 0xffffffd7;
@@ -272,8 +272,8 @@ void et131x_isr_handler(struct work_struct *work)
 			/* If the user has flow control on, then we will
 			 * send a pause packet, otherwise just exit
 			 */
-			if (pAdapter->FlowControl == TxOnly ||
-			    pAdapter->FlowControl == Both) {
+			if (etdev->FlowControl == TxOnly ||
+			    etdev->FlowControl == Both) {
 				PM_CSR_t pm_csr;
 
 				/* Tell the device to send a pause packet via
@@ -330,11 +330,11 @@ void et131x_isr_handler(struct work_struct *work)
 			 */
 			/* TRAP();*/
 
-			pAdapter->TxMacTest.value =
+			etdev->TxMacTest.value =
 				readl(&iomem->txmac.tx_test.value);
 			DBG_WARNING(et131x_dbginfo,
 				    "RxDMA_ERR interrupt, error %x\n",
-				    pAdapter->TxMacTest.value);
+				    etdev->TxMacTest.value);
 		}
 
 		/* Handle the Wake on LAN Event */
@@ -370,23 +370,23 @@ void et131x_isr_handler(struct work_struct *work)
 				DBG_VERBOSE(et131x_dbginfo,
 					    "Device is in COMA mode, "
 					    "need to wake up\n");
-				DisablePhyComa(pAdapter);
+				DisablePhyComa(etdev);
 			}
 
 			/* Read the PHY ISR to clear the reason for the
 			 * interrupt.
 			 */
-			MiRead(pAdapter, (uint8_t) offsetof(MI_REGS_t, isr),
+			MiRead(etdev, (uint8_t) offsetof(MI_REGS_t, isr),
 			       &myIsr.value);
 
-			if (!pAdapter->ReplicaPhyLoopbk) {
-				MiRead(pAdapter,
+			if (!etdev->ReplicaPhyLoopbk) {
+				MiRead(etdev,
 				       (uint8_t) offsetof(MI_REGS_t, bmsr),
 				       &BmsrData.value);
 
 				BmsrInts.value =
-				    pAdapter->Bmsr.value ^ BmsrData.value;
-				pAdapter->Bmsr.value = BmsrData.value;
+				    etdev->Bmsr.value ^ BmsrData.value;
+				etdev->Bmsr.value = BmsrData.value;
 
 				DBG_VERBOSE(et131x_dbginfo,
 					    "Bmsr.value = 0x%04x,"
@@ -394,13 +394,13 @@ void et131x_isr_handler(struct work_struct *work)
 					    BmsrData.value, BmsrInts.value);
 
 				/* Do all the cable in / cable out stuff */
-				et131x_Mii_check(pAdapter, BmsrData, BmsrInts);
+				et131x_Mii_check(etdev, BmsrData, BmsrInts);
 			}
 		}
 
 		/* Let's move on to the TxMac */
 		if (GlobStatus.bits.txmac_interrupt) {
-			pAdapter->TxRing.TxMacErr.value =
+			etdev->TxRing.TxMacErr.value =
 				readl(&iomem->txmac.err.value);
 
 			/*
@@ -415,7 +415,7 @@ void et131x_isr_handler(struct work_struct *work)
 			 */
 			DBG_WARNING(et131x_dbginfo,
 				    "TXMAC interrupt, error 0x%08x\n",
-				    pAdapter->TxRing.TxMacErr.value);
+				    etdev->TxRing.TxMacErr.value);
 
 			/* If we are debugging, we want to see this error,
 			 * otherwise we just want the device to be reset and
@@ -432,7 +432,7 @@ void et131x_isr_handler(struct work_struct *work)
 			 * set the flag to cause us to reset so we can solve
 			 * this issue.
 			 */
-			/* MP_SET_FLAG( pAdapter,
+			/* MP_SET_FLAG( etdev,
 						fMP_ADAPTER_HARDWARE_ERROR); */
 
 			DBG_WARNING(et131x_dbginfo,
@@ -461,7 +461,7 @@ void et131x_isr_handler(struct work_struct *work)
 			 * counter(s).
 			 */
 			DBG_VERBOSE(et131x_dbginfo, "MAC_STAT interrupt\n");
-			HandleMacStatInterrupt(pAdapter);
+			HandleMacStatInterrupt(etdev);
 		}
 
 		/* Handle SLV Timeout Interrupt */
@@ -479,6 +479,6 @@ void et131x_isr_handler(struct work_struct *work)
 		}
 	}
 
-	if (pAdapter->PoMgmt.PowerState == NdisDeviceStateD0)
-		et131x_enable_interrupts(pAdapter);
+	if (etdev->PoMgmt.PowerState == NdisDeviceStateD0)
+		et131x_enable_interrupts(etdev);
 }
diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c
index 74a8375..77fac95 100644
--- a/drivers/staging/et131x/et131x_netdev.c
+++ b/drivers/staging/et131x/et131x_netdev.c
@@ -308,7 +308,7 @@ int et131x_close(struct net_device *netdev)
 int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
 {
 	int status = 0;
-	struct et131x_adapter *pAdapter = netdev_priv(netdev);
+	struct et131x_adapter *etdev = netdev_priv(netdev);
 	struct mii_ioctl_data *data = if_mii(reqbuf);
 
 	DBG_ENTER(et131x_dbginfo);
@@ -316,7 +316,7 @@ int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
 	switch (cmd) {
 	case SIOCGMIIPHY:
 		DBG_VERBOSE(et131x_dbginfo, "SIOCGMIIPHY\n");
-		data->phy_id = pAdapter->Stats.xcvr_addr;
+		data->phy_id = etdev->Stats.xcvr_addr;
 		break;
 
 	case SIOCGMIIREG:
@@ -324,7 +324,7 @@ int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
 		if (!capable(CAP_NET_ADMIN)) {
 			status = -EPERM;
 		} else {
-			status = MiRead(pAdapter,
+			status = MiRead(etdev,
 					data->reg_num, &data->val_out);
 		}
 		break;
@@ -334,7 +334,7 @@ int et131x_ioctl_mii(struct net_device *netdev, struct ifreq *reqbuf, int cmd)
 		if (!capable(CAP_NET_ADMIN)) {
 			status = -EPERM;
 		} else {
-			status = MiWrite(pAdapter, data->reg_num,
+			status = MiWrite(etdev, data->reg_num,
 					 data->val_in);
 		}
 		break;
@@ -608,14 +608,14 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
  */
 void et131x_tx_timeout(struct net_device *netdev)
 {
-	struct et131x_adapter *pAdapter = netdev_priv(netdev);
+	struct et131x_adapter *etdev = netdev_priv(netdev);
 	PMP_TCB pMpTcb;
 	unsigned long lockflags;
 
 	DBG_WARNING(et131x_dbginfo, "TX TIMEOUT\n");
 
 	/* Just skip this part if the adapter is doing link detection */
-	if (MP_TEST_FLAG(pAdapter, fMP_ADAPTER_LINK_DETECTION)) {
+	if (MP_TEST_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION)) {
 		DBG_ERROR(et131x_dbginfo, "Still doing link detection\n");
 		return;
 	}
@@ -623,21 +623,21 @@ void et131x_tx_timeout(struct net_device *netdev)
 	/* Any nonrecoverable hardware error?
 	 * Checks adapter->flags for any failure in phy reading
 	 */
-	if (MP_TEST_FLAG(pAdapter, fMP_ADAPTER_NON_RECOVER_ERROR)) {
+	if (MP_TEST_FLAG(etdev, fMP_ADAPTER_NON_RECOVER_ERROR)) {
 		DBG_WARNING(et131x_dbginfo, "Non recoverable error - remove\n");
 		return;
 	}
 
 	/* Hardware failure? */
-	if (MP_TEST_FLAG(pAdapter, fMP_ADAPTER_HARDWARE_ERROR)) {
+	if (MP_TEST_FLAG(etdev, fMP_ADAPTER_HARDWARE_ERROR)) {
 		DBG_WARNING(et131x_dbginfo, "hardware error - reset\n");
 		return;
 	}
 
 	/* Is send stuck? */
-	spin_lock_irqsave(&pAdapter->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
 
-	pMpTcb = pAdapter->TxRing.CurrSendHead;
+	pMpTcb = etdev->TxRing.CurrSendHead;
 
 	if (pMpTcb != NULL) {
 		pMpTcb->Count++;
@@ -645,21 +645,21 @@ void et131x_tx_timeout(struct net_device *netdev)
 		if (pMpTcb->Count > NIC_SEND_HANG_THRESHOLD) {
 #ifdef CONFIG_ET131X_DEBUG
 			TX_STATUS_BLOCK_t txDmaComplete =
-			    *(pAdapter->TxRing.pTxStatusVa);
+			    *(etdev->TxRing.pTxStatusVa);
 			PTX_DESC_ENTRY_t pDesc =
-			    pAdapter->TxRing.pTxDescRingVa +
+			    etdev->TxRing.pTxDescRingVa +
 			    pMpTcb->WrIndex.bits.val;
 #endif
 			TX_DESC_ENTRY_t StuckDescriptors[10];
 
 			if (pMpTcb->WrIndex.bits.val > 7) {
 				memcpy(StuckDescriptors,
-				       pAdapter->TxRing.pTxDescRingVa +
+				       etdev->TxRing.pTxDescRingVa +
 				       pMpTcb->WrIndex.bits.val - 6,
 				       sizeof(TX_DESC_ENTRY_t) * 10);
 			}
 
-			spin_unlock_irqrestore(&pAdapter->TCBSendQLock,
+			spin_unlock_irqrestore(&etdev->TCBSendQLock,
 					       lockflags);
 
 			DBG_WARNING(et131x_dbginfo,
@@ -677,10 +677,10 @@ void et131x_tx_timeout(struct net_device *netdev)
 				    "WbStatus 0x%08x\n", txDmaComplete.value);
 
 #ifdef CONFIG_ET131X_DEBUG
-			DumpDeviceBlock(DBG_WARNING_ON, pAdapter, 0);
-			DumpDeviceBlock(DBG_WARNING_ON, pAdapter, 1);
-			DumpDeviceBlock(DBG_WARNING_ON, pAdapter, 3);
-			DumpDeviceBlock(DBG_WARNING_ON, pAdapter, 5);
+			DumpDeviceBlock(DBG_WARNING_ON, etdev, 0);
+			DumpDeviceBlock(DBG_WARNING_ON, etdev, 1);
+			DumpDeviceBlock(DBG_WARNING_ON, etdev, 3);
+			DumpDeviceBlock(DBG_WARNING_ON, etdev, 5);
 #endif
 			et131x_close(netdev);
 			et131x_open(netdev);
@@ -689,7 +689,7 @@ void et131x_tx_timeout(struct net_device *netdev)
 		}
 	}
 
-	spin_unlock_irqrestore(&pAdapter->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
 }
 
 /**


^ permalink raw reply related

* [PATCH 02/26] et131x: spinlocks
From: Alan Cox @ 2009-08-25 14:57 UTC (permalink / raw)
  To: greg, netdev
In-Reply-To: <20090825145619.16176.68780.stgit@localhost.localdomain>

Switch to the more normal "flags" naming. Also fix up the nested use of
spin_lock_irqsave

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/et131x/et1310_phy.c     |   10 ++--
 drivers/staging/et131x/et1310_pm.c      |    6 +--
 drivers/staging/et131x/et1310_rx.c      |   28 ++++++------
 drivers/staging/et131x/et1310_tx.c      |   74 ++++++++++++++++---------------
 drivers/staging/et131x/et131x_initpci.c |    6 +--
 drivers/staging/et131x/et131x_netdev.c  |   14 +++---
 6 files changed, 69 insertions(+), 69 deletions(-)


diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
index 82fcb66..d9c7a44 100644
--- a/drivers/staging/et131x/et1310_phy.c
+++ b/drivers/staging/et131x/et1310_phy.c
@@ -484,7 +484,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
 	uint32_t uiMdiMdix;
 	uint32_t uiMasterSlave;
 	uint32_t uiPolarity;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	DBG_ENTER(et131x_dbginfo);
 
@@ -495,12 +495,12 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
 			/* Update our state variables and indicate the
 			 * connected state
 			 */
-			spin_lock_irqsave(&etdev->Lock, lockflags);
+			spin_lock_irqsave(&etdev->Lock, flags);
 
 			etdev->MediaState = NETIF_STATUS_MEDIA_CONNECT;
 			MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
 
-			spin_unlock_irqrestore(&etdev->Lock, lockflags);
+			spin_unlock_irqrestore(&etdev->Lock, flags);
 
 			/* Don't indicate state if we're in loopback mode */
 			if (etdev->RegistryPhyLoopbk == false)
@@ -533,11 +533,11 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
 			     (etdev, fMP_ADAPTER_LINK_DETECTION))
 			    || (etdev->MediaState ==
 				NETIF_STATUS_MEDIA_DISCONNECT)) {
-				spin_lock_irqsave(&etdev->Lock, lockflags);
+				spin_lock_irqsave(&etdev->Lock, flags);
 				etdev->MediaState =
 				    NETIF_STATUS_MEDIA_DISCONNECT;
 				spin_unlock_irqrestore(&etdev->Lock,
-						       lockflags);
+						       flags);
 
 				/* Only indicate state if we're in loopback
 				 * mode
diff --git a/drivers/staging/et131x/et1310_pm.c b/drivers/staging/et131x/et1310_pm.c
index 864d3ad..a507411 100644
--- a/drivers/staging/et131x/et1310_pm.c
+++ b/drivers/staging/et131x/et1310_pm.c
@@ -119,7 +119,7 @@ extern dbg_info_t *et131x_dbginfo;
  */
 void EnablePhyComa(struct et131x_adapter *etdev)
 {
-	unsigned long lockflags;
+	unsigned long flags;
 	PM_CSR_t GlobalPmCSR;
 	int32_t LoopCounter = 10;
 
@@ -134,9 +134,9 @@ void EnablePhyComa(struct et131x_adapter *etdev)
 	etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;
 
 	/* Stop sending packets. */
-	spin_lock_irqsave(&etdev->SendHWLock, lockflags);
+	spin_lock_irqsave(&etdev->SendHWLock, flags);
 	MP_SET_FLAG(etdev, fMP_ADAPTER_LOWER_POWER);
-	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags);
+	spin_unlock_irqrestore(&etdev->SendHWLock, flags);
 
 	/* Wait for outstanding Receive packets */
 	while ((MP_GET_RCV_REF(etdev) != 0) && (LoopCounter-- > 0))
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index f8cc6a6..9dc08fb 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -685,7 +685,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
 	PFBR_DESC_t pFbrEntry;
 	uint32_t iEntry;
 	RXDMA_PSR_NUM_DES_t psr_num_des;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	DBG_ENTER(et131x_dbginfo);
 
@@ -718,7 +718,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
 	writel((psr_num_des.bits.psr_ndes * LO_MARK_PERCENT_FOR_PSR) / 100,
 	       &pRxDma->psr_min_des.value);
 
-	spin_lock_irqsave(&etdev->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, flags);
 
 	/* These local variables track the PSR in the adapter structure */
 	pRxLocal->local_psr_full.bits.psr_full = 0;
@@ -801,7 +801,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
 	 */
 	writel(etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value);
 
-	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, flags);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
@@ -914,7 +914,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
 	PMP_RFD pMpRfd;
 	uint32_t nIndex;
 	uint8_t *pBufVa;
-	unsigned long lockflags;
+	unsigned long flags;
 	struct list_head *element;
 	uint8_t ringIndex;
 	uint16_t bufferIndex;
@@ -1013,7 +1013,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
 	}
 
 	/* Get and fill the RFD. */
-	spin_lock_irqsave(&etdev->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, flags);
 
 	pMpRfd = NULL;
 	element = pRxLocal->RecvList.next;
@@ -1023,14 +1023,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
 		DBG_RX(et131x_dbginfo,
 		       "NULL RFD returned from RecvList via list_entry()\n");
 		DBG_RX_LEAVE(et131x_dbginfo);
-		spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
+		spin_unlock_irqrestore(&etdev->RcvLock, flags);
 		return NULL;
 	}
 
 	list_del(&pMpRfd->list_node);
 	pRxLocal->nReadyRecv--;
 
-	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, flags);
 
 	pMpRfd->iBufferIndex = bufferIndex;
 	pMpRfd->iRingIndex = ringIndex;
@@ -1260,9 +1260,9 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
 			 * Besides, we don't really need (at this point) the
 			 * pending list anyway.
 			 */
-			/* spin_lock_irqsave( &etdev->RcvPendLock, lockflags );
+			/* spin_lock_irqsave( &etdev->RcvPendLock, flags );
 			 * list_add_tail( &pMpRfd->list_node, &etdev->RxRing.RecvPendingList );
-			 * spin_unlock_irqrestore( &etdev->RcvPendLock, lockflags );
+			 * spin_unlock_irqrestore( &etdev->RcvPendLock, flags );
 			 */
 
 			/* Update the number of outstanding Recvs */
@@ -1302,7 +1302,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
 	struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma;
 	uint16_t bi = pMpRfd->iBufferIndex;
 	uint8_t ri = pMpRfd->iRingIndex;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	DBG_RX_ENTER(et131x_dbginfo);
 
@@ -1314,7 +1314,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
 	    (ri == 0 && bi < pRxLocal->Fbr0NumEntries) ||
 #endif
 	    (ri == 1 && bi < pRxLocal->Fbr1NumEntries)) {
-		spin_lock_irqsave(&etdev->FbrLock, lockflags);
+		spin_lock_irqsave(&etdev->FbrLock, flags);
 
 		if (ri == 1) {
 			PFBR_DESC_t pNextDesc =
@@ -1362,7 +1362,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
 			       &pRxDma->fbr0_full_offset.value);
 		}
 #endif
-		spin_unlock_irqrestore(&etdev->FbrLock, lockflags);
+		spin_unlock_irqrestore(&etdev->FbrLock, flags);
 	} else {
 		DBG_ERROR(et131x_dbginfo,
 			  "NICReturnRFD illegal Buffer Index returned\n");
@@ -1371,10 +1371,10 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
 	/* The processing on this RFD is done, so put it back on the tail of
 	 * our list
 	 */
-	spin_lock_irqsave(&etdev->RcvLock, lockflags);
+	spin_lock_irqsave(&etdev->RcvLock, flags);
 	list_add_tail(&pMpRfd->list_node, &pRxLocal->RecvList);
 	pRxLocal->nReadyRecv++;
-	spin_unlock_irqrestore(&etdev->RcvLock, lockflags);
+	spin_unlock_irqrestore(&etdev->RcvLock, flags);
 
 	DBG_ASSERT(pRxLocal->nReadyRecv <= pRxLocal->NumRfd);
 	DBG_RX_LEAVE(et131x_dbginfo);
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index db0f538..a017d27 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -461,7 +461,7 @@ static int et131x_send_packet(struct sk_buff *skb,
 	int status = 0;
 	PMP_TCB pMpTcb = NULL;
 	uint16_t *pShBufVa;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	DBG_TX_ENTER(et131x_dbginfo);
 
@@ -482,12 +482,12 @@ static int et131x_send_packet(struct sk_buff *skb,
 	}
 
 	/* Get a TCB for this packet */
-	spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
 
 	pMpTcb = etdev->TxRing.TCBReadyQueueHead;
 
 	if (pMpTcb == NULL) {
-		spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
 
 		DBG_WARNING(et131x_dbginfo, "Can't obtain a TCB\n");
 		DBG_TX_LEAVE(et131x_dbginfo);
@@ -499,7 +499,7 @@ static int et131x_send_packet(struct sk_buff *skb,
 	if (etdev->TxRing.TCBReadyQueueHead == NULL)
 		etdev->TxRing.TCBReadyQueueTail = NULL;
 
-	spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
 
 	pMpTcb->PacketLength = skb->len;
 	pMpTcb->Packet = skb;
@@ -522,7 +522,7 @@ static int et131x_send_packet(struct sk_buff *skb,
 		status = nic_send_packet(etdev, pMpTcb);
 
 	if (status != 0) {
-		spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
 
 		if (etdev->TxRing.TCBReadyQueueTail) {
 			etdev->TxRing.TCBReadyQueueTail->Next = pMpTcb;
@@ -533,7 +533,7 @@ static int et131x_send_packet(struct sk_buff *skb,
 
 		etdev->TxRing.TCBReadyQueueTail = pMpTcb;
 
-		spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
 
 		DBG_TX_LEAVE(et131x_dbginfo);
 		return status;
@@ -561,7 +561,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 	struct sk_buff *pPacket = pMpTcb->Packet;
 	uint32_t FragListCount = skb_shinfo(pPacket)->nr_frags + 1;
 	struct skb_frag_struct *pFragList = &skb_shinfo(pPacket)->frags[0];
-	unsigned long lockflags1, lockflags2;
+	unsigned long flags;
 
 	DBG_TX_ENTER(et131x_dbginfo);
 
@@ -726,7 +726,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 	pMpTcb->WrIndexStart = etdev->TxRing.txDmaReadyToSend;
 	pMpTcb->PacketStaleCount = 0;
 
-	spin_lock_irqsave(&etdev->SendHWLock, lockflags1);
+	spin_lock_irqsave(&etdev->SendHWLock, flags);
 
 	iThisCopy =
 	    NUM_DESC_PER_RING_TX - etdev->TxRing.txDmaReadyToSend.bits.val;
@@ -771,7 +771,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 		pMpTcb->WrIndex.value =
 		    etdev->TxRing.txDmaReadyToSend.value - 1;
 
-	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags2);
+	spin_lock(&etdev->TCBSendQLock);
 
 	if (etdev->TxRing.CurrSendTail)
 		etdev->TxRing.CurrSendTail->Next = pMpTcb;
@@ -784,7 +784,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 
 	etdev->TxRing.nBusySend++;
 
-	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags2);
+	spin_unlock(&etdev->TCBSendQLock);
 
 	/* Write the new write pointer back to the device. */
 	writel(etdev->TxRing.txDmaReadyToSend.value,
@@ -798,7 +798,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 		       &etdev->CSRAddress->global.watchdog_timer);
 	}
 
-	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
+	spin_unlock_irqrestore(&etdev->SendHWLock, flags);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 	return 0;
@@ -829,7 +829,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 	TX_DESC_ENTRY_t *CurDescPostCopy = NULL;
 	uint32_t SlotsAvailable;
 	DMA10W_t ServiceComplete;
-	unsigned int lockflags1, lockflags2;
+	unsigned int flags;
 	struct sk_buff *pPacket = pMpTcb->Packet;
 	uint32_t FragListCount = skb_shinfo(pPacket)->nr_frags + 1;
 	struct skb_frag_struct *pFragList = &skb_shinfo(pPacket)->frags[0];
@@ -875,7 +875,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 		SegmentSize = (pPacket->len - pPacket->data_len) / 2;
 	}
 
-	spin_lock_irqsave(&etdev->SendHWLock, lockflags1);
+	spin_lock_irqsave(&etdev->SendHWLock, flags);
 
 	if (etdev->TxRing.txDmaReadyToSend.bits.serv_req_wrap ==
 	    ServiceComplete.bits.serv_cpl_wrap) {
@@ -896,7 +896,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 	if ((FragListCount + iSplitFirstElement) > SlotsAvailable) {
 		DBG_WARNING(et131x_dbginfo,
 			    "Not Enough Space in Tx Desc Ring\n");
-		spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
+		spin_unlock_irqrestore(&etdev->SendHWLock, flags);
 		return -ENOMEM;
 	}
 
@@ -1185,7 +1185,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 		       NIC_MIN_PACKET_SIZE - pMpTcb->PacketLength);
 	}
 
-	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags2);
+	spin_lock(&etdev->TCBSendQLock);
 
 	if (etdev->TxRing.CurrSendTail)
 		etdev->TxRing.CurrSendTail->Next = pMpTcb;
@@ -1198,7 +1198,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 
 	etdev->TxRing.nBusySend++;
 
-	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags2);
+	spin_unlock(&etdev->TCBSendQLock);
 
 	/* Write the new write pointer back to the device. */
 	writel(etdev->TxRing.txDmaReadyToSend.value,
@@ -1216,7 +1216,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 		       &etdev->CSRAddress->global.watchdog_timer);
 	}
 
-	spin_unlock_irqrestore(&etdev->SendHWLock, lockflags1);
+	spin_unlock_irqrestore(&etdev->SendHWLock, flags);
 
 	DBG_TX_LEAVE(et131x_dbginfo);
 	return 0;
@@ -1234,7 +1234,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
 inline void et131x_free_send_packet(struct et131x_adapter *etdev,
 							PMP_TCB pMpTcb)
 {
-	unsigned long lockflags;
+	unsigned long flags;
 	TX_DESC_ENTRY_t *desc = NULL;
 	struct net_device_stats *stats = &etdev->net_stats;
 
@@ -1311,7 +1311,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
 	memset(pMpTcb, 0, sizeof(MP_TCB));
 
 	/* Add the TCB to the Ready Q */
-	spin_lock_irqsave(&etdev->TCBReadyQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
 
 	etdev->Stats.opackets++;
 
@@ -1324,7 +1324,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
 
 	etdev->TxRing.TCBReadyQueueTail = pMpTcb;
 
-	spin_unlock_irqrestore(&etdev->TCBReadyQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
 
 	DBG_ASSERT(etdev->TxRing.nBusySend >= 0);
 }
@@ -1339,16 +1339,16 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
 {
 	PMP_TCB pMpTcb;
 	struct list_head *pEntry;
-	unsigned long lockflags;
+	unsigned long flags;
 	uint32_t FreeCounter = 0;
 
 	DBG_ENTER(et131x_dbginfo);
 
 	while (!list_empty(&etdev->TxRing.SendWaitQueue)) {
-		spin_lock_irqsave(&etdev->SendWaitLock, lockflags);
+		spin_lock_irqsave(&etdev->SendWaitLock, flags);
 
 		etdev->TxRing.nWaitSend--;
-		spin_unlock_irqrestore(&etdev->SendWaitLock, lockflags);
+		spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
 
 		pEntry = etdev->TxRing.SendWaitQueue.next;
 	}
@@ -1356,7 +1356,7 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
 	etdev->TxRing.nWaitSend = 0;
 
 	/* Any packets being sent? Check the first TCB on the send list */
-	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 	pMpTcb = etdev->TxRing.CurrSendHead;
 
@@ -1370,14 +1370,14 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
 
 		etdev->TxRing.nBusySend--;
 
-		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 
 		DBG_VERBOSE(et131x_dbginfo, "pMpTcb = 0x%p\n", pMpTcb);
 
 		FreeCounter++;
 		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
 
-		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 		pMpTcb = etdev->TxRing.CurrSendHead;
 	}
@@ -1388,7 +1388,7 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
 		BUG();
 	}
 
-	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 
 	etdev->TxRing.nBusySend = 0;
 
@@ -1429,7 +1429,7 @@ void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
  */
 static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 {
-	unsigned long lockflags;
+	unsigned long flags;
 	DMA10W_t ServiceComplete;
 	PMP_TCB pMpTcb;
 
@@ -1439,7 +1439,7 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 	/* Has the ring wrapped?  Process any descriptors that do not have
 	 * the same "wrap" indicator as the current completion indicator
 	 */
-	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 	pMpTcb = etdev->TxRing.CurrSendHead;
 	while (pMpTcb &&
@@ -1450,9 +1450,9 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 		if (pMpTcb->Next == NULL)
 			etdev->TxRing.CurrSendTail = NULL;
 
-		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
-		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 		/* Goto the next packet */
 		pMpTcb = etdev->TxRing.CurrSendHead;
@@ -1465,9 +1465,9 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 		if (pMpTcb->Next == NULL)
 			etdev->TxRing.CurrSendTail = NULL;
 
-		spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+		spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 		MP_FREE_SEND_PACKET_FUN(etdev, pMpTcb);
-		spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+		spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 		/* Goto the next packet */
 		pMpTcb = etdev->TxRing.CurrSendHead;
@@ -1477,7 +1477,7 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
 	if (etdev->TxRing.nBusySend <= (NUM_TCB / 3))
 		netif_wake_queue(etdev->netdev);
 
-	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 }
 
 /**
@@ -1489,9 +1489,9 @@ static void et131x_update_tcb_list(struct et131x_adapter *etdev)
  */
 static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
 {
-	unsigned long lockflags;
+	unsigned long flags;
 
-	spin_lock_irqsave(&etdev->SendWaitLock, lockflags);
+	spin_lock_irqsave(&etdev->SendWaitLock, flags);
 
 	while (!list_empty(&etdev->TxRing.SendWaitQueue) &&
 				MP_TCB_RESOURCES_AVAILABLE(etdev)) {
@@ -1508,5 +1508,5 @@ static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
 				etdev->TxRing.nWaitSend);
 	}
 
-	spin_unlock_irqrestore(&etdev->SendWaitLock, lockflags);
+	spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
 }
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 8455e0a..b9018e6 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -492,18 +492,18 @@ void et131x_error_timer_handler(unsigned long data)
 void et131x_link_detection_handler(unsigned long data)
 {
 	struct et131x_adapter *etdev = (struct et131x_adapter *) data;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	/* Let everyone know that we have run */
 	etdev->bLinkTimerActive = false;
 
 	if (etdev->MediaState == 0) {
-		spin_lock_irqsave(&etdev->Lock, lockflags);
+		spin_lock_irqsave(&etdev->Lock, flags);
 
 		etdev->MediaState = NETIF_STATUS_MEDIA_DISCONNECT;
 		MP_CLEAR_FLAG(etdev, fMP_ADAPTER_LINK_DETECTION);
 
-		spin_unlock_irqrestore(&etdev->Lock, lockflags);
+		spin_unlock_irqrestore(&etdev->Lock, flags);
 
 		netif_carrier_off(etdev->netdev);
 
diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c
index 77fac95..74ba177 100644
--- a/drivers/staging/et131x/et131x_netdev.c
+++ b/drivers/staging/et131x/et131x_netdev.c
@@ -467,12 +467,12 @@ void et131x_multicast(struct net_device *netdev)
 	struct et131x_adapter *adapter = netdev_priv(netdev);
 	uint32_t PacketFilter = 0;
 	uint32_t count;
-	unsigned long lockflags;
+	unsigned long flags;
 	struct dev_mc_list *mclist = netdev->mc_list;
 
 	DBG_ENTER(et131x_dbginfo);
 
-	spin_lock_irqsave(&adapter->Lock, lockflags);
+	spin_lock_irqsave(&adapter->Lock, flags);
 
 	/* Before we modify the platform-independent filter flags, store them
 	 * locally. This allows us to determine if anything's changed and if
@@ -552,7 +552,7 @@ void et131x_multicast(struct net_device *netdev)
 			    "NO UPDATE REQUIRED, FLAGS didn't change\n");
 	}
 
-	spin_unlock_irqrestore(&adapter->Lock, lockflags);
+	spin_unlock_irqrestore(&adapter->Lock, flags);
 
 	DBG_LEAVE(et131x_dbginfo);
 }
@@ -610,7 +610,7 @@ void et131x_tx_timeout(struct net_device *netdev)
 {
 	struct et131x_adapter *etdev = netdev_priv(netdev);
 	PMP_TCB pMpTcb;
-	unsigned long lockflags;
+	unsigned long flags;
 
 	DBG_WARNING(et131x_dbginfo, "TX TIMEOUT\n");
 
@@ -635,7 +635,7 @@ void et131x_tx_timeout(struct net_device *netdev)
 	}
 
 	/* Is send stuck? */
-	spin_lock_irqsave(&etdev->TCBSendQLock, lockflags);
+	spin_lock_irqsave(&etdev->TCBSendQLock, flags);
 
 	pMpTcb = etdev->TxRing.CurrSendHead;
 
@@ -660,7 +660,7 @@ void et131x_tx_timeout(struct net_device *netdev)
 			}
 
 			spin_unlock_irqrestore(&etdev->TCBSendQLock,
-					       lockflags);
+					       flags);
 
 			DBG_WARNING(et131x_dbginfo,
 				"Send stuck - reset.  pMpTcb->WrIndex %x, Flags 0x%08x\n",
@@ -689,7 +689,7 @@ void et131x_tx_timeout(struct net_device *netdev)
 		}
 	}
 
-	spin_unlock_irqrestore(&etdev->TCBSendQLock, lockflags);
+	spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
 }
 
 /**


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox