Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Javier Martinez Canillas and committed by
David S. Miller
43c6759e 57adc1fc

+30 -20
+4
drivers/net/ethernet/smsc/smsc911x.h
··· 401 401 #include <asm/smsc911x.h> 402 402 #endif 403 403 404 + #ifdef CONFIG_SMSC_PHY 405 + #include <linux/smscphy.h> 406 + #endif 407 + 404 408 #endif /* __SMSC911X_H__ */
+1 -20
drivers/net/phy/smsc.c
··· 22 22 #include <linux/ethtool.h> 23 23 #include <linux/phy.h> 24 24 #include <linux/netdevice.h> 25 - 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 */ 25 + #include <linux/smscphy.h> 45 26 46 27 static int smsc_phy_config_intr(struct phy_device *phydev) 47 28 {
+25
include/linux/smscphy.h
··· 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__ */