Lines Matching +full:mac +full:- +full:phy
4 #include <linux/phy.h>
23 MLO_AN_PHY = 0, /* Conventional PHY */
24 MLO_AN_FIXED, /* Fixed-link mode */
25 MLO_AN_INBAND, /* In-band protocol */
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
114 * the medium link mode (@speed and @duplex) and the speed/duplex of the phy
137 * struct phylink_config - PHYLINK configuration structure
138 * @dev: a pointer to a struct device associated with the MAC
141 * if MAC link is at %MLO_AN_FIXED mode.
142 * @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM.
143 * @mac_requires_rxc: if true, the MAC always requires a receive clock from PHY.
144 * The PHY driver should start the clock signal as soon as
147 * MLO_AN_PHY. A fixed-link specification will override.
148 * @eee_rx_clk_stop_enable: if true, PHY can stop the receive clock during LPI
150 * if MAC link is at %MLO_AN_FIXED mode.
152 * are supported by the MAC/PCS.
153 * @lpi_interfaces: bitmap describing which PHY interface modes can support
155 * @mac_capabilities: MAC pause/speed/duplex capabilities.
156 * @lpi_capabilities: MAC speeds which can support LPI signalling
181 * struct phylink_mac_ops - MAC operations structure.
182 * @mac_get_caps: Get MAC capabilities for interface mode.
185 * @mac_config: configure the MAC for the selected mode and state.
208 struct phy_device *phy, unsigned int mode,
216 #if 0 /* For kernel-doc purposes only. */
218 * mac_get_caps: Get MAC capabilities for interface mode.
220 * @interface: PHY interface mode.
222 * Optional method. When not provided, config->mac_capabilities will be used.
223 * When implemented, this returns the MAC capabilities for the specified
224 * interface mode where there is some special handling required by the MAC
225 * driver (e.g. not supporting half-duplex in certain interface modes.)
232 * @interface: PHY interface mode for PCS
246 * mac_prepare() - prepare to change the PHY interface mode
253 * startup time. It may be called for the current mode. The MAC driver
255 * Serdes PHY.
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
281 * This will only be called to reconfigure the MAC for a "major" change in
283 * or pause modes or to change the in-band advertisement.
285 * In all negotiation modes, as defined by @mode, @state->pause indicates the
287 * set, %MLO_PAUSE_TX and %MLO_PAUSE_RX indicate whether the MAC should send
289 * the results of in-band negotiation/status from the MAC PCS should be used
290 * to control the MAC pause mode settings.
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
314 * is up or not) is performed by the MAC, and reported via the
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
330 * configuration word. Nothing is advertised by the MAC. The MAC is
336 * Implementations are expected to update the MAC to reflect the
337 * requested settings - i.o.w., if nothing has changed between two
347 * mac_finish() - finish a to change the PHY interface mode
352 * phylink will call this if it called mac_prepare() to allow the MAC to
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
355 * Serdes PHY here if it was previously disabled by mac_prepare().
364 * mac_link_down() - take the link down
369 * If @mode is not an in-band negotiation mode (as defined by
371 * Energy Efficient Ethernet MAC configuration. Interface type
378 * mac_link_up() - allow the link to come up
380 * @phy: any attached phy
388 * Configure the MAC for an established link.
391 * settings, and should be used to configure the MAC block appropriately
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.
405 void mac_link_up(struct phylink_config *config, struct phy_device *phy,
410 * mac_disable_tx_lpi() - disable LPI generation at the MAC
413 * Disable generation of LPI at the MAC, effectively preventing the MAC
419 * mac_enable_tx_lpi() - configure and enable LPI generation at the MAC
428 * Enable LPI generation at the MAC, and configure whether the xMII transmit
440 * struct phylink_pcs - PHYLINK PCS instance
447 * @rxc_always_on: The MAC driver requires the reference clock
449 * do not have access to a PHY device can check
468 * struct phylink_pcs_ops - MAC PCS operations structure.
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.
480 * @pcs_pre_init: configure PCS components necessary for MAC hardware
506 #if 0 /* For kernel-doc purposes only. */
508 * pcs_validate() - validate the link configuration.
518 * Returns -EINVAL if the interface mode/autoneg mode is not supported.
519 * Returns non-zero positive if the link state can be supported.
525 * pcs_inband_caps - query PCS in-band capabilities for interface mode.
529 * Returns zero if it is unknown what in-band signalling is supported by the
530 * PHY (e.g. because the PHY driver doesn't implement the method.) Otherwise,
539 * pcs_enable() - enable the PCS.
545 * pcs_disable() - disable the PCS.
551 * pcs_get_state() - Read the current inband link state from the hardware
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
570 * pcs_config() - Configure the PCS mode and advertisement
575 * @permit_pause_to_mac: permit forwarding pause resolution to MAC
579 * hardware may forward the pause mode resolution to the MAC.
584 * For SGMII, there is no advertisement from the MAC side, the PCS should
585 * be programmed to acknowledge the inband word from the PHY.
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
600 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
609 * pcs_link_up() - program the PCS for the resolved link configuration
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
629 * pcs_pre_init() - Configure PCS components necessary for MAC initialization
632 * This function can be called by MAC drivers through the
637 * Some MAC devices require specific hardware initialization to be performed by
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
648 * conjunction with a MAC device whose driver calls phylink_pcs_pre_init(). MAC
650 * pre-initialization.
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()