diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-10-05 06:59:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-07 04:10:44 -0400 |
commit | d73d3a8cb4723e161589864741d8528d70b350eb (patch) | |
tree | eece04666dfccff368e7d6fc6665bd328987fd46 /include/linux/ethtool.h | |
parent | d250a5f90e53f5e150618186230795352d154c88 (diff) |
ethtool: Add reset operation
After updating firmware stored in flash, users may wish to reset the
relevant hardware and start the new firmware immediately. This should
not be completely automatic as it may be disruptive.
A selective reset may also be useful for debugging or diagnostics.
This adds a separate reset operation which takes flags indicating the
components to be reset. Drivers are allowed to reset only a subset of
those requested, and must indicate the actual subset. This allows the
use of generic component masks and some future expansion.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index aa0dcb3833d1..eb1a48da2d43 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -498,6 +498,7 @@ struct ethtool_ops { | |||
498 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 498 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); |
499 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 499 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
500 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 500 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
501 | int (*reset)(struct net_device *, u32 *); | ||
501 | }; | 502 | }; |
502 | #endif /* __KERNEL__ */ | 503 | #endif /* __KERNEL__ */ |
503 | 504 | ||
@@ -555,6 +556,7 @@ struct ethtool_ops { | |||
555 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 556 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
556 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 557 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
557 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 558 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
559 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | ||
558 | 560 | ||
559 | /* compatibility with older code */ | 561 | /* compatibility with older code */ |
560 | #define SPARC_ETH_GSET ETHTOOL_GSET | 562 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -685,4 +687,34 @@ struct ethtool_ops { | |||
685 | 687 | ||
686 | #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL | 688 | #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL |
687 | 689 | ||
690 | /* Reset flags */ | ||
691 | /* The reset() operation must clear the flags for the components which | ||
692 | * were actually reset. On successful return, the flags indicate the | ||
693 | * components which were not reset, either because they do not exist | ||
694 | * in the hardware or because they cannot be reset independently. The | ||
695 | * driver must never reset any components that were not requested. | ||
696 | */ | ||
697 | enum ethtool_reset_flags { | ||
698 | /* These flags represent components dedicated to the interface | ||
699 | * the command is addressed to. Shift any flag left by | ||
700 | * ETH_RESET_SHARED_SHIFT to reset a shared component of the | ||
701 | * same type. | ||
702 | */ | ||
703 | ETH_RESET_MGMT = 1 << 0, /* Management processor */ | ||
704 | ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */ | ||
705 | ETH_RESET_DMA = 1 << 2, /* DMA engine */ | ||
706 | ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */ | ||
707 | ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */ | ||
708 | ETH_RESET_MAC = 1 << 5, /* Media access controller */ | ||
709 | ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */ | ||
710 | ETH_RESET_RAM = 1 << 7, /* RAM shared between | ||
711 | * multiple components */ | ||
712 | |||
713 | ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to | ||
714 | * this interface */ | ||
715 | ETH_RESET_ALL = 0xffffffff, /* All components used by this | ||
716 | * interface, even if shared */ | ||
717 | }; | ||
718 | #define ETH_RESET_SHARED_SHIFT 16 | ||
719 | |||
688 | #endif /* _LINUX_ETHTOOL_H */ | 720 | #endif /* _LINUX_ETHTOOL_H */ |