Lines Matching +full:eee +full:- +full:pcs

8 #include <net/eee.h>
24 MLO_AN_FIXED, /* Fixed-link mode */
25 MLO_AN_INBAND, /* In-band protocol */
27 /* PCS "negotiation" mode.
28 * PHYLINK_PCS_NEG_NONE - protocol has no inband capability
29 * PHYLINK_PCS_NEG_OUTBAND - some out of band or fixed link setting
30 * PHYLINK_PCS_NEG_INBAND_DISABLED - inband mode disabled, e.g.
31 * 1000base-X with autoneg off
32 * PHYLINK_PCS_NEG_INBAND_ENABLED - inband mode enabled
34 * PHYLINK_PCS_NEG_INBAND - inband mode selected
35 * PHYLINK_PCS_NEG_ENABLED - negotiation mode enabled
104 * struct phylink_link_state - link state structure
137 * struct phylink_config - PHYLINK configuration structure
147 * MLO_AN_PHY. A fixed-link specification will override.
152 * are supported by the MAC/PCS.
157 * @lpi_timer_default: Default EEE LPI timer setting.
158 * @eee_enabled_default: If set, EEE will be enabled by phylink at creation time
181 * struct phylink_mac_ops - MAC operations structure.
183 * @mac_select_pcs: Select a PCS for the interface mode.
216 #if 0 /* For kernel-doc purposes only. */
222 * Optional method. When not provided, config->mac_capabilities will be used.
225 * driver (e.g. not supporting half-duplex in certain interface modes.)
230 * mac_select_pcs: Select a PCS for the interface mode.
232 * @interface: PHY interface mode for PCS
237 * This must not modify any state. It is used to query which PCS should
240 * set the PCS that will be used.
246 * mac_prepare() - prepare to change the PHY interface mode
258 * - mac_prepare()
259 * - mac_config()
260 * - pcs_config()
261 * - possible pcs_an_restart()
262 * - mac_finish()
271 * mac_config() - configure the MAC for the selected mode and state
276 * Note - not all members of @state are valid. In particular,
277 * @state->lp_advertising, @state->link, @state->an_complete are never
283 * or pause modes or to change the in-band advertisement.
285 * In all negotiation modes, as defined by @mode, @state->pause indicates the
289 * the results of in-band negotiation/status from the MAC PCS should be used
295 * Configure for non-inband negotiation mode, where the link settings
297 * protocol from the MAC is specified by @state->interface.
299 * @state->advertising may be used, but is not required.
301 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
302 * @state->duplex and @state->pause to configure the MAC, but this is
312 * 1000base-X or Cisco SGMII mode depending on the @state->interface
321 * @state->interface. Duplex and pause modes are negotiated via
322 * the in-band configuration word. Advertised pause modes are set
323 * according to the @state->an_enabled and @state->advertising
328 * in the serial bitstream 16-bit configuration word, and the MAC
337 * requested settings - i.o.w., if nothing has changed between two
347 * mac_finish() - finish a to change the PHY interface mode
353 * complete any necessary steps after the MAC and PCS have been configured
354 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
364 * mac_link_down() - take the link down
369 * If @mode is not an in-band negotiation mode (as defined by
378 * mac_link_up() - allow the link to come up
392 * where these settings are not automatically conveyed from the PCS block,
393 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
396 * Note that when 802.3z in-band negotiation is in use, it is possible
400 * If in-band negotiation mode is disabled, allow the link to come up. If
401 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
402 * phy_init_eee() and perform appropriate MAC configuration for EEE.
410 * mac_disable_tx_lpi() - disable LPI generation at the MAC
419 * mac_enable_tx_lpi() - configure and enable LPI generation at the MAC
440 * struct phylink_pcs - PHYLINK PCS instance
442 * are supported by this PCS.
445 * @neg_mode: provide PCS neg mode via "mode" argument
446 * @poll: poll the PCS for link changes
448 * to always be on. Standalone PCS drivers which
452 * This structure is designed to be embedded within the PCS private data,
453 * and will be passed between phylink and the PCS.
456 * the PCS driver.
468 * struct phylink_pcs_ops - MAC PCS operations structure.
471 * @pcs_enable: enable the PCS.
472 * @pcs_disable: disable the PCS.
473 * @pcs_pre_config: pre-mac_config method (for errata)
474 * @pcs_post_config: post-mac_config method (for arrata)
475 * @pcs_get_state: read the current MAC PCS link state from the hardware.
476 * @pcs_config: configure the MAC PCS for the selected mode and state.
478 * @pcs_link_up: program the PCS for the resolved link configuration
480 * @pcs_pre_init: configure PCS components necessary for MAC hardware
484 int (*pcs_validate)(struct phylink_pcs *pcs, unsigned long *supported,
486 unsigned int (*pcs_inband_caps)(struct phylink_pcs *pcs,
488 int (*pcs_enable)(struct phylink_pcs *pcs);
489 void (*pcs_disable)(struct phylink_pcs *pcs);
490 void (*pcs_pre_config)(struct phylink_pcs *pcs,
492 int (*pcs_post_config)(struct phylink_pcs *pcs,
494 void (*pcs_get_state)(struct phylink_pcs *pcs, unsigned int neg_mode,
496 int (*pcs_config)(struct phylink_pcs *pcs, unsigned int neg_mode,
500 void (*pcs_an_restart)(struct phylink_pcs *pcs);
501 void (*pcs_link_up)(struct phylink_pcs *pcs, unsigned int neg_mode,
503 int (*pcs_pre_init)(struct phylink_pcs *pcs);
506 #if 0 /* For kernel-doc purposes only. */
508 * pcs_validate() - validate the link configuration.
509 * @pcs: a pointer to a &struct phylink_pcs.
518 * Returns -EINVAL if the interface mode/autoneg mode is not supported.
519 * Returns non-zero positive if the link state can be supported.
521 int pcs_validate(struct phylink_pcs *pcs, unsigned long *supported,
525 * pcs_inband_caps - query PCS in-band capabilities for interface mode.
526 * @pcs: a pointer to a &struct phylink_pcs.
529 * Returns zero if it is unknown what in-band signalling is supported by the
535 unsigned int pcs_inband_caps(struct phylink_pcs *pcs,
539 * pcs_enable() - enable the PCS.
540 * @pcs: a pointer to a &struct phylink_pcs.
542 int pcs_enable(struct phylink_pcs *pcs);
545 * pcs_disable() - disable the PCS.
546 * @pcs: a pointer to a &struct phylink_pcs.
548 void pcs_disable(struct phylink_pcs *pcs);
551 * pcs_get_state() - Read the current inband link state from the hardware
552 * @pcs: a pointer to a &struct phylink_pcs.
556 * Read the current inband link state from the MAC PCS, reporting the
557 * current speed in @state->speed, duplex mode in @state->duplex, pause
558 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
559 * negotiation completion state in @state->an_complete, and link up state
560 * in @state->link. If possible, @state->lp_advertising should also be
566 void pcs_get_state(struct phylink_pcs *pcs, unsigned int neg_mode,
570 * pcs_config() - Configure the PCS mode and advertisement
571 * @pcs: a pointer to a &struct phylink_pcs.
577 * Configure the PCS for the operating mode, the interface mode, and set
584 * For SGMII, there is no advertisement from the MAC side, the PCS should
587 * For 1000BASE-X, the advertisement should be programmed into the PCS.
589 * For most 10GBASE-R, there is no advertisement.
592 * functions, or for PCS that set pcs->neg_mode true, should be tested
595 int pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
600 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
601 * @pcs: a pointer to a &struct phylink_pcs.
603 * When PCS ops are present, this overrides mac_an_restart() in &struct
606 void pcs_an_restart(struct phylink_pcs *pcs);
609 * pcs_link_up() - program the PCS for the resolved link configuration
610 * @pcs: a pointer to a &struct phylink_pcs.
616 * This call will be made just before mac_link_up() to inform the PCS of
617 * the resolved link parameters. For example, a PCS operating in SGMII
618 * mode without in-band AN needs to be manually configured for the link
619 * and duplex setting. Otherwise, this should be a no-op.
622 * functions, or for PCS that set pcs->neg_mode true, should be tested
625 void pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode,
629 * pcs_pre_init() - Configure PCS components necessary for MAC initialization
630 * @pcs: a pointer to a &struct phylink_pcs.
634 * should not be called after the link is brought up, as reconfiguring the PCS
638 * their associated PCS device before they can properly initialize their own
640 * which requires an active REF_CLK signal to be provided by the PHY/PCS.
642 * By calling phylink_pcs_pre_init(), MAC drivers can ensure that the PCS is
646 * model of PCS and the requirements of the MAC device attached to it. PCS
649 * driver authors should document their requirements for the PCS
650 * pre-initialization.
653 int pcs_pre_init(struct phylink_pcs *pcs);
676 int phylink_pcs_pre_init(struct phylink *pl, struct phylink_pcs *pcs);
698 int phylink_ethtool_get_eee(struct phylink *link, struct ethtool_keee *eee);
699 int phylink_ethtool_set_eee(struct phylink *link, struct ethtool_keee *eee);
716 * phylink_get_link_timer_ns - return the PCS link timer value
719 * Return the PCS link timer setting in nanoseconds for the PHY @interface
720 * mode, or -EINVAL if not appropriate.
736 return -EINVAL; in phylink_get_link_timer_ns()
742 void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs,
747 int phylink_mii_c22_pcs_config(struct mdio_device *pcs,
751 void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs);
755 void phylink_mii_c45_pcs_get_state(struct mdio_device *pcs,