Skip to contentSkip to conversation

gianfar: Magic Packet and suspend/resume support.

PATCH In review Scott Wood 3 participants 3 messages Jun 25, 2008 – Aug 7, 2008

Subsystems (4)
lore
Share & tools
lore

Scott Wood

author
#0 lore raw

PATCH 2/3 gianfar: Magic Packet and suspend/resume support.

---
 Documentation/powerpc/booting-without-of.txt |    5 +-
 arch/powerpc/sysdev/fsl_soc.c                |    3 +
 drivers/net/gianfar.c                        |  118 +++++++++++++++++++++++++-
 drivers/net/gianfar.h                        |   12 ++-
 drivers/net/gianfar_ethtool.c                |   41 +++++++++-
 include/linux/fsl_devices.h                  |    1 +
 6 files changed, 172 insertions(+), 8 deletions(-)
Documentation/powerpc/booting-without-of.txt +3 -2
index 8aee3bd..145903a 100644
@@ -1301,14 +1301,15 @@ platforms are moved over to use the flattened-device-tree model.
       1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
       pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
 
-  Recommended properties:
+  Other properties:
 
     - phy-connection-type : a string naming the controller/PHY interface type,
       i.e., "mii" (default), "rmii", "gmii", "rgmii", "rgmii-id", "sgmii",
       "tbi", or "rtbi".  This property is only really needed if the connection
       is of type "rgmii-id", as all other connection types are detected by
       hardware.
-
+    - fsl,magic-packet : If present, indicates that the hardware supports
+      waking up via magic packet.
 
   Example:
 
arch/powerpc/sysdev/fsl_soc.c +3 -0
index ca54563..2fcd714 100644
@@ -357,6 +357,9 @@ static int __init gfar_of_init(void)
 		else
 			gfar_data.interface = PHY_INTERFACE_MODE_MII;
 
+		if (of_get_property(np, "fsl,magic-packet", NULL))
+			gfar_data.device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
+
 		ph = of_get_property(np, "phy-handle", NULL);
 		if (ph == NULL) {
 			u32 *fixed_link;
drivers/net/gianfar.c +116 -2

160 lines not on this page · raw message

drivers/net/gianfar.h +10 -2
index 27f37c8..5ee518a 100644
@@ -168,6 +168,7 @@ extern const char gfar_driver_version[];
 #define MACCFG2_GMII            0x00000200
 #define MACCFG2_HUGEFRAME	0x00000020
 #define MACCFG2_LENGTHCHECK	0x00000010
+#define MACCFG2_MPEN		0x00000008
 
 #define ECNTRL_INIT_SETTINGS	0x00001000
 #define ECNTRL_TBI_MODE         0x00000020
@@ -240,6 +241,7 @@ extern const char gfar_driver_version[];
 #define IEVENT_CRL		0x00020000
 #define IEVENT_XFUN		0x00010000
 #define IEVENT_RXB0		0x00008000
+#define IEVENT_MAG		0x00000800
 #define IEVENT_GRSC		0x00000100
 #define IEVENT_RXF0		0x00000080
 #define IEVENT_FIR		0x00000008
@@ -252,7 +254,8 @@ extern const char gfar_driver_version[];
 #define IEVENT_ERR_MASK         \
 (IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \
  IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \
- | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR)
+ | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \
+ | IEVENT_MAG)
 
 #define IMASK_INIT_CLEAR	0x00000000
 #define IMASK_BABR              0x80000000
@@ -270,6 +273,7 @@ extern const char gfar_driver_version[];
 #define IMASK_CRL		0x00020000
 #define IMASK_XFUN		0x00010000
 #define IMASK_RXB0              0x00008000
+#define IMASK_MAG		0x00000800
 #define IMASK_GTSC              0x00000100
 #define IMASK_RXFEN0		0x00000080
 #define IMASK_FIR		0x00000008
@@ -737,10 +741,14 @@ struct gfar_private {
 	unsigned int fifo_starve;
 	unsigned int fifo_starve_off;
 
+	/* Bitfield update lock */
+	spinlock_t bflock;
+
 	unsigned char vlan_enable:1,
 		rx_csum_enable:1,
 		extended_hash:1,
-		bd_stash_en:1;
+		bd_stash_en:1,
+		wol_en:1; /* Wake-on-LAN enabled */
 	unsigned short padding;
 
 	unsigned int interruptTransmit;
drivers/net/gianfar_ethtool.c +39 -2

70 lines not on this page · raw message

include/linux/fsl_devices.h +1 -0
index 0472877..4e625e0 100644
@@ -69,6 +69,7 @@ struct gianfar_mdio_data {
 #define FSL_GIANFAR_DEV_HAS_VLAN		0x00000020
 #define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH	0x00000040
 #define FSL_GIANFAR_DEV_HAS_PADDING		0x00000080
+#define FSL_GIANFAR_DEV_HAS_MAGIC_PACKET	0x00000100
 
 /* Flags in gianfar_platform_data */
 #define FSL_GIANFAR_BRD_HAS_PHY_INTR	0x00000001 /* set or use a timer */
Signature · 1 line
1.5.5.4
#1 lore raw
Quoted 9 lines · Scott Wood
---
 Documentation/powerpc/booting-without-of.txt |    5 +-
 arch/powerpc/sysdev/fsl_soc.c                |    3 +
 drivers/net/gianfar.c                        |  118 +++++++++++++++++++++++++-
 drivers/net/gianfar.h                        |   12 ++-
 drivers/net/gianfar_ethtool.c                |   41 +++++++++-
 include/linux/fsl_devices.h                  |    1 +
 6 files changed, 172 insertions(+), 8 deletions(-)

did this ever get ack'd by Kumar? I don't have a record of it.

#2 lore raw
Quoted 12 lines · Jeff Garzik
Quoted 10 lines · Scott Wood

---

Documentation/powerpc/booting-without-of.txt |    5 +-
arch/powerpc/sysdev/fsl_soc.c                |    3 +
drivers/net/gianfar.c                        |  118 ++++++++++++++++ 
+++++++++-
drivers/net/gianfar.h                        |   12 ++-
drivers/net/gianfar_ethtool.c                |   41 +++++++++-
include/linux/fsl_devices.h                  |    1 +
6 files changed, 172 insertions(+), 8 deletions(-)
Quoted 2 lines

did this ever get ack'd by Kumar? I don't have a record of it.

A version of this is already in linus's tree. I just forgot to add your Ack to it (and I apologize for that).

git commit d87eb12785c14de1586e3bad86ca2c0991300339

- k