linux/drivers/net/e1000e
Bruce Allan 2b6b168d52 e1000e: access multiple PHY registers on same page at the same time
Doing a PHY page select can take a long time, relatively speaking. This
can cause a significant delay when updating a number of PHY registers on
the same page by unnecessarily setting the page for each PHY access. For
example when going to Sx, all the PHY wakeup registers (WUC, RAR[], MTA[],
SHRAR[], IP4AT[], IP6AT[], etc.) on 82577/8/9 need to be updated which
takes a long time which can cause issues when suspending.

This patch introduces new PHY ops function pointers to allow callers to
set the page directly and do any number of PHY accesses on that page.
This feature is currently only implemented for 82577, 82578 and 82579
PHYs for both the normally addressed registers as well as the special-
case addressing of the PHY wakeup registers on page 800. For the latter
registers, the existing function for accessing the wakeup registers has
been divided up into three- 1) enable access to the wakeup register page,
2) perform the register access and 3) disable access to the wakeup register
page. The two functions that enable/disable access to the wakeup register
page are necessarily available to the caller so that the caller can restore
the value of the Port Control (a.k.a. Wakeup Enable) register after the
wakeup register accesses are done.

All instances of writing to multiple PHY registers on the same page are
updated to use this new method and to acquire any PHY locking mechanism
before setting the page and performing the register accesses, and release
the locking mechanism afterward.

Some affiliated magic number cleanup is done as well.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2011-06-09 20:33:36 -07:00
..
82571.c e1000e: implement ethtool set_phys_id 2011-04-27 02:05:53 -07:00
defines.h e1000e: disable jumbo frames on 82579 when MACsec enabled in EEPROM 2011-03-11 02:23:21 -08:00
e1000.h e1000e: access multiple PHY registers on same page at the same time 2011-06-09 20:33:36 -07:00
es2lan.c e1000e: disable far-end loopback mode on ESB2 2011-06-09 20:31:24 -07:00
ethtool.c net: remove interrupt.h inclusion from netdevice.h 2011-06-06 22:55:11 -07:00
hw.h e1000e: access multiple PHY registers on same page at the same time 2011-06-09 20:33:36 -07:00
ich8lan.c e1000e: access multiple PHY registers on same page at the same time 2011-06-09 20:33:36 -07:00
lib.c e1000e: minor comment cleanups 2011-05-14 17:50:01 -07:00
Makefile e1000e: update Copyright for 2011 2011-01-14 02:04:01 -08:00
netdev.c e1000e: access multiple PHY registers on same page at the same time 2011-06-09 20:33:36 -07:00
param.c e1000e: consistent use of Rx/Tx vs. RX/TX/rx/tx in comments/logs 2011-01-14 02:06:23 -08:00
phy.c e1000e: access multiple PHY registers on same page at the same time 2011-06-09 20:33:36 -07:00