diff options
author | Steven Walter <stevenrwalter@gmail.com> | 2010-05-31 08:34:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-01 03:15:51 -0400 |
commit | db6f30078dcb0117336f20275e4828c86132e46e (patch) | |
tree | 2fb0213d26c06ceb98b0b8b4ad47afde8ef9a71e /drivers/net/tulip/tulip.h | |
parent | 7a1d7f01b5e90f85d0b4ec4bfd5a5da769d2bb1d (diff) |
tulip: implement wake-on-lan support
Based on a patch from http://simon.baatz.info/wol-support-for-an983b/
Tested to resume from suspend by magic packet.
Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip/tulip.h')
-rw-r--r-- | drivers/net/tulip/tulip.h | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h index 0afa2d4f9472..e525875ed67d 100644 --- a/drivers/net/tulip/tulip.h +++ b/drivers/net/tulip/tulip.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/netdevice.h> | 22 | #include <linux/netdevice.h> |
23 | #include <linux/ethtool.h> | ||
23 | #include <linux/timer.h> | 24 | #include <linux/timer.h> |
24 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
25 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
@@ -51,22 +52,23 @@ struct tulip_chip_table { | |||
51 | 52 | ||
52 | 53 | ||
53 | enum tbl_flag { | 54 | enum tbl_flag { |
54 | HAS_MII = 0x0001, | 55 | HAS_MII = 0x00001, |
55 | HAS_MEDIA_TABLE = 0x0002, | 56 | HAS_MEDIA_TABLE = 0x00002, |
56 | CSR12_IN_SROM = 0x0004, | 57 | CSR12_IN_SROM = 0x00004, |
57 | ALWAYS_CHECK_MII = 0x0008, | 58 | ALWAYS_CHECK_MII = 0x00008, |
58 | HAS_ACPI = 0x0010, | 59 | HAS_ACPI = 0x00010, |
59 | MC_HASH_ONLY = 0x0020, /* Hash-only multicast filter. */ | 60 | MC_HASH_ONLY = 0x00020, /* Hash-only multicast filter. */ |
60 | HAS_PNICNWAY = 0x0080, | 61 | HAS_PNICNWAY = 0x00080, |
61 | HAS_NWAY = 0x0040, /* Uses internal NWay xcvr. */ | 62 | HAS_NWAY = 0x00040, /* Uses internal NWay xcvr. */ |
62 | HAS_INTR_MITIGATION = 0x0100, | 63 | HAS_INTR_MITIGATION = 0x00100, |
63 | IS_ASIX = 0x0200, | 64 | IS_ASIX = 0x00200, |
64 | HAS_8023X = 0x0400, | 65 | HAS_8023X = 0x00400, |
65 | COMET_MAC_ADDR = 0x0800, | 66 | COMET_MAC_ADDR = 0x00800, |
66 | HAS_PCI_MWI = 0x1000, | 67 | HAS_PCI_MWI = 0x01000, |
67 | HAS_PHY_IRQ = 0x2000, | 68 | HAS_PHY_IRQ = 0x02000, |
68 | HAS_SWAPPED_SEEPROM = 0x4000, | 69 | HAS_SWAPPED_SEEPROM = 0x04000, |
69 | NEEDS_FAKE_MEDIA_TABLE = 0x8000, | 70 | NEEDS_FAKE_MEDIA_TABLE = 0x08000, |
71 | COMET_PM = 0x10000, | ||
70 | }; | 72 | }; |
71 | 73 | ||
72 | 74 | ||
@@ -120,6 +122,11 @@ enum tulip_offsets { | |||
120 | CSR13 = 0x68, | 122 | CSR13 = 0x68, |
121 | CSR14 = 0x70, | 123 | CSR14 = 0x70, |
122 | CSR15 = 0x78, | 124 | CSR15 = 0x78, |
125 | CSR18 = 0x88, | ||
126 | CSR19 = 0x8c, | ||
127 | CSR20 = 0x90, | ||
128 | CSR27 = 0xAC, | ||
129 | CSR28 = 0xB0, | ||
123 | }; | 130 | }; |
124 | 131 | ||
125 | /* register offset and bits for CFDD PCI config reg */ | 132 | /* register offset and bits for CFDD PCI config reg */ |
@@ -289,6 +296,30 @@ enum t21143_csr6_bits { | |||
289 | csr6_mask_100bt = (csr6_scr | csr6_pcs | csr6_hbd), | 296 | csr6_mask_100bt = (csr6_scr | csr6_pcs | csr6_hbd), |
290 | }; | 297 | }; |
291 | 298 | ||
299 | enum tulip_comet_csr13_bits { | ||
300 | /* The LINKOFFE and LINKONE work in conjunction with LSCE, i.e. they | ||
301 | * determine which link status transition wakes up if LSCE is | ||
302 | * enabled */ | ||
303 | comet_csr13_linkoffe = (1 << 17), | ||
304 | comet_csr13_linkone = (1 << 16), | ||
305 | comet_csr13_wfre = (1 << 10), | ||
306 | comet_csr13_mpre = (1 << 9), | ||
307 | comet_csr13_lsce = (1 << 8), | ||
308 | comet_csr13_wfr = (1 << 2), | ||
309 | comet_csr13_mpr = (1 << 1), | ||
310 | comet_csr13_lsc = (1 << 0), | ||
311 | }; | ||
312 | |||
313 | enum tulip_comet_csr18_bits { | ||
314 | comet_csr18_pmes_sticky = (1 << 24), | ||
315 | comet_csr18_pm_mode = (1 << 19), | ||
316 | comet_csr18_apm_mode = (1 << 18), | ||
317 | comet_csr18_d3a = (1 << 7) | ||
318 | }; | ||
319 | |||
320 | enum tulip_comet_csr20_bits { | ||
321 | comet_csr20_pmes = (1 << 15), | ||
322 | }; | ||
292 | 323 | ||
293 | /* Keep the ring sizes a power of two for efficiency. | 324 | /* Keep the ring sizes a power of two for efficiency. |
294 | Making the Tx ring too large decreases the effectiveness of channel | 325 | Making the Tx ring too large decreases the effectiveness of channel |
@@ -411,6 +442,7 @@ struct tulip_private { | |||
411 | unsigned int csr6; /* Current CSR6 control settings. */ | 442 | unsigned int csr6; /* Current CSR6 control settings. */ |
412 | unsigned char eeprom[EEPROM_SIZE]; /* Serial EEPROM contents. */ | 443 | unsigned char eeprom[EEPROM_SIZE]; /* Serial EEPROM contents. */ |
413 | void (*link_change) (struct net_device * dev, int csr5); | 444 | void (*link_change) (struct net_device * dev, int csr5); |
445 | struct ethtool_wolinfo wolinfo; /* WOL settings */ | ||
414 | u16 sym_advertise, mii_advertise; /* NWay capabilities advertised. */ | 446 | u16 sym_advertise, mii_advertise; /* NWay capabilities advertised. */ |
415 | u16 lpar; /* 21143 Link partner ability. */ | 447 | u16 lpar; /* 21143 Link partner ability. */ |
416 | u16 advertising[4]; | 448 | u16 advertising[4]; |