aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@dowhile0.org>2012-01-03 20:23:18 -0500
committerDavid S. Miller <davem@davemloft.net>2012-01-03 20:23:18 -0500
commit43c6759e73907e4c8e6624f70f5c4a860518b203 (patch)
tree501232103624ab09adb94f7b7d8f3ee5e70e7a95
parent57adc1fcbae2c13104ce291b40f23e40a414fa87 (diff)
net: phy: smsc: Move SMSC PHY constants to <linux/smscphy.h>
SMSC generation 4 LAN chips integrate an IEEE 802.3 ethernet physical layer. The ethernet driver for this family of devices needs to access the SMSC PHY registers and bit-fields. So, this patch moves these constants to a place where it can be used for both the PHY and LAN drivers. Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.h4
-rw-r--r--drivers/net/phy/smsc.c21
-rw-r--r--include/linux/smscphy.h25
3 files changed, 30 insertions, 20 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.h b/drivers/net/ethernet/smsc/smsc911x.h
index 8d67aacf8867..938ecf290813 100644
--- a/drivers/net/ethernet/smsc/smsc911x.h
+++ b/drivers/net/ethernet/smsc/smsc911x.h
@@ -401,4 +401,8 @@
401#include <asm/smsc911x.h> 401#include <asm/smsc911x.h>
402#endif 402#endif
403 403
404#ifdef CONFIG_SMSC_PHY
405#include <linux/smscphy.h>
406#endif
407
404#endif /* __SMSC911X_H__ */ 408#endif /* __SMSC911X_H__ */
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index 342505c976d6..fc3e7e96c88c 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -22,26 +22,7 @@
22#include <linux/ethtool.h> 22#include <linux/ethtool.h>
23#include <linux/phy.h> 23#include <linux/phy.h>
24#include <linux/netdevice.h> 24#include <linux/netdevice.h>
25 25#include <linux/smscphy.h>
26#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
27#define MII_LAN83C185_IM 30 /* Interrupt Mask */
28#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */
29
30#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */
31#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */
32#define MII_LAN83C185_ISF_INT3 (1<<3) /* Auto-Negotiation LP Ack */
33#define MII_LAN83C185_ISF_INT4 (1<<4) /* Link Down */
34#define MII_LAN83C185_ISF_INT5 (1<<5) /* Remote Fault Detected */
35#define MII_LAN83C185_ISF_INT6 (1<<6) /* Auto-Negotiation complete */
36#define MII_LAN83C185_ISF_INT7 (1<<7) /* ENERGYON */
37
38#define MII_LAN83C185_ISF_INT_ALL (0x0e)
39
40#define MII_LAN83C185_ISF_INT_PHYLIB_EVENTS \
41 (MII_LAN83C185_ISF_INT6 | MII_LAN83C185_ISF_INT4 | \
42 MII_LAN83C185_ISF_INT7)
43
44#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */
45 26
46static int smsc_phy_config_intr(struct phy_device *phydev) 27static int smsc_phy_config_intr(struct phy_device *phydev)
47{ 28{
diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h
new file mode 100644
index 000000000000..ce718cbce435
--- /dev/null
+++ b/include/linux/smscphy.h
@@ -0,0 +1,25 @@
1#ifndef __LINUX_SMSCPHY_H__
2#define __LINUX_SMSCPHY_H__
3
4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
5#define MII_LAN83C185_IM 30 /* Interrupt Mask */
6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */
7
8#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */
9#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */
10#define MII_LAN83C185_ISF_INT3 (1<<3) /* Auto-Negotiation LP Ack */
11#define MII_LAN83C185_ISF_INT4 (1<<4) /* Link Down */
12#define MII_LAN83C185_ISF_INT5 (1<<5) /* Remote Fault Detected */
13#define MII_LAN83C185_ISF_INT6 (1<<6) /* Auto-Negotiation complete */
14#define MII_LAN83C185_ISF_INT7 (1<<7) /* ENERGYON */
15
16#define MII_LAN83C185_ISF_INT_ALL (0x0e)
17
18#define MII_LAN83C185_ISF_INT_PHYLIB_EVENTS \
19 (MII_LAN83C185_ISF_INT6 | MII_LAN83C185_ISF_INT4 | \
20 MII_LAN83C185_ISF_INT7)
21
22#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */
23#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */
24
25#endif /* __LINUX_SMSCPHY_H__ */