OSDN Git Service

net: phy: realtek: add utility functions to read/write page addresses
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 2 Dec 2017 21:51:28 +0000 (22:51 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 3 Dec 2017 14:38:17 +0000 (09:38 -0500)
commit136819a6e8df374e6b9b424586ff11c9e241a1cb
tree9edc421b1423cbbc7a210d238b52e1aee168b8bc
parentf609ab0ed8e7bef2cd61d230bf9e83e1ec5b9ddb
net: phy: realtek: add utility functions to read/write page addresses

Realtek PHYs implement the concept of so-called "extension pages". The
reason for this is probably because these PHYs expose more registers
than available in the standard address range.
After all read/write operations on such a page are done the driver
should switch back to page 0 where the standard MII registers (such as
MII_BMCR) are available.

When referring to such a register the datasheets of RTL8211E and
RTL8211F always specify:
- the page / "ext. page" which has to be written to RTL821x_PAGE_SELECT
- an address (sometimes also called reg)

These new utility functions make the existing code easier to read since
it removes some duplication (switching back to page 0 is done within the
new helpers for example).

No functional changes are intended.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/realtek.c