Lines Matching +full:mac +full:- +full:mode

22 	MLO_AN_FIXED,	/* Fixed-link mode */
23 MLO_AN_INBAND, /* In-band protocol */
25 /* PCS "negotiation" mode.
26 * PHYLINK_PCS_NEG_NONE - protocol has no inband capability
27 * PHYLINK_PCS_NEG_OUTBAND - some out of band or fixed link setting
28 * PHYLINK_PCS_NEG_INBAND_DISABLED - inband mode disabled, e.g.
29 * 1000base-X with autoneg off
30 * PHYLINK_PCS_NEG_INBAND_ENABLED - inband mode enabled
32 * PHYLINK_PCS_NEG_INBAND - inband mode selected
33 * PHYLINK_PCS_NEG_ENABLED - negotiation mode enabled
96 static inline bool phylink_autoneg_inband(unsigned int mode) in phylink_autoneg_inband() argument
98 return mode == MLO_AN_INBAND; in phylink_autoneg_inband()
102 * struct phylink_link_state - link state structure
106 * @interface: link &typedef phy_interface_t mode
108 * @duplex: link duplex mode, one of DUPLEX_* constants.
112 * the medium link mode (@speed and @duplex) and the speed/duplex of the phy
113 * interface mode (@interface) are different.
135 * struct phylink_config - PHYLINK configuration structure
136 * @dev: a pointer to a struct device associated with the MAC
139 * if MAC link is at %MLO_AN_FIXED mode.
140 * @mac_managed_pm: if true, indicate the MAC driver is responsible for PHY PM.
141 * @mac_requires_rxc: if true, the MAC always requires a receive clock from PHY.
145 * MLO_AN_PHY. A fixed-link specification will override.
147 * if MAC link is at %MLO_AN_FIXED mode.
149 * are supported by the MAC/PCS.
150 * @mac_capabilities: MAC pause/speed/duplex capabilities.
168 * struct phylink_mac_ops - MAC operations structure.
169 * @mac_get_caps: Get MAC capabilities for interface mode.
170 * @mac_select_pcs: Select a PCS for the interface mode.
172 * @mac_config: configure the MAC for the selected mode and state.
184 int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
186 void (*mac_config)(struct phylink_config *config, unsigned int mode,
188 int (*mac_finish)(struct phylink_config *config, unsigned int mode,
190 void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
193 struct phy_device *phy, unsigned int mode,
198 #if 0 /* For kernel-doc purposes only. */
200 * mac_get_caps: Get MAC capabilities for interface mode.
202 * @interface: PHY interface mode.
204 * Optional method. When not provided, config->mac_capabilities will be used.
205 * When implemented, this returns the MAC capabilities for the specified
206 * interface mode where there is some special handling required by the MAC
207 * driver (e.g. not supporting half-duplex in certain interface modes.)
212 * mac_select_pcs: Select a PCS for the interface mode.
214 * @interface: PHY interface mode for PCS
216 * Return the &struct phylink_pcs for the specified interface mode, or
228 * mac_prepare() - prepare to change the PHY interface mode
230 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
231 * @iface: interface mode to switch to
234 * of the link, which includes changing the interface mode or at initial
235 * startup time. It may be called for the current mode. The MAC driver
240 * - mac_prepare()
241 * - mac_config()
242 * - pcs_config()
243 * - possible pcs_an_restart()
244 * - mac_finish()
249 int mac_prepare(struct phylink_config *config, unsigned int mode,
253 * mac_config() - configure the MAC for the selected mode and state
255 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
258 * Note - not all members of @state are valid. In particular,
259 * @state->lp_advertising, @state->link, @state->an_complete are never
263 * This will only be called to reconfigure the MAC for a "major" change in
264 * e.g. interface mode. It will not be called for changes in speed, duplex
265 * or pause modes or to change the in-band advertisement.
267 * In all negotiation modes, as defined by @mode, @state->pause indicates the
269 * set, %MLO_PAUSE_TX and %MLO_PAUSE_RX indicate whether the MAC should send
271 * the results of in-band negotiation/status from the MAC PCS should be used
272 * to control the MAC pause mode settings.
274 * The action performed depends on the currently selected mode:
277 * Configure for non-inband negotiation mode, where the link settings
279 * protocol from the MAC is specified by @state->interface.
281 * @state->advertising may be used, but is not required.
283 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
284 * @state->duplex and @state->pause to configure the MAC, but this is
293 * place the link in an inband negotiation mode (such as 802.3z
294 * 1000base-X or Cisco SGMII mode depending on the @state->interface
295 * mode). In both cases, link state management (whether the link
296 * is up or not) is performed by the MAC, and reported via the
300 * Interface mode specific details are mentioned below.
302 * If in 802.3z mode, the link speed is fixed, dependent on the
303 * @state->interface. Duplex and pause modes are negotiated via
304 * the in-band configuration word. Advertised pause modes are set
305 * according to the @state->an_enabled and @state->advertising
309 * If in Cisco SGMII mode, the link speed and duplex mode are passed
310 * in the serial bitstream 16-bit configuration word, and the MAC
312 * configuration word. Nothing is advertised by the MAC. The MAC is
318 * Implementations are expected to update the MAC to reflect the
319 * requested settings - i.o.w., if nothing has changed between two
325 void mac_config(struct phylink_config *config, unsigned int mode,
329 * mac_finish() - finish a to change the PHY interface mode
331 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
332 * @iface: interface mode to switch to
334 * phylink will call this if it called mac_prepare() to allow the MAC to
335 * complete any necessary steps after the MAC and PCS have been configured
336 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
342 int mac_finish(struct phylink_config *config, unsigned int mode,
346 * mac_link_down() - take the link down
348 * @mode: link autonegotiation mode
349 * @interface: link &typedef phy_interface_t mode
351 * If @mode is not an in-band negotiation mode (as defined by
353 * Energy Efficient Ethernet MAC configuration. Interface type
356 void mac_link_down(struct phylink_config *config, unsigned int mode,
360 * mac_link_up() - allow the link to come up
363 * @mode: link autonegotiation mode
364 * @interface: link &typedef phy_interface_t mode
370 * Configure the MAC for an established link.
373 * settings, and should be used to configure the MAC block appropriately
375 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
378 * Note that when 802.3z in-band negotiation is in use, it is possible
382 * If in-band negotiation mode is disabled, allow the link to come up. If
383 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
384 * phy_init_eee() and perform appropriate MAC configuration for EEE.
388 unsigned int mode, phy_interface_t interface,
395 * struct phylink_pcs - PHYLINK PCS instance
398 * @neg_mode: provide PCS neg mode via "mode" argument
400 * @rxc_always_on: The MAC driver requires the reference clock
420 * struct phylink_pcs_ops - MAC PCS operations structure.
424 * @pcs_pre_config: pre-mac_config method (for errata)
425 * @pcs_post_config: post-mac_config method (for arrata)
426 * @pcs_get_state: read the current MAC PCS link state from the hardware.
427 * @pcs_config: configure the MAC PCS for the selected mode and state.
431 * @pcs_pre_init: configure PCS components necessary for MAC hardware
455 #if 0 /* For kernel-doc purposes only. */
457 * pcs_validate() - validate the link configuration.
462 * Validate the interface mode, and advertising's autoneg bit, removing any
467 * Returns -EINVAL if the interface mode/autoneg mode is not supported.
468 * Returns non-zero positive if the link state can be supported.
474 * pcs_enable() - enable the PCS.
480 * pcs_disable() - disable the PCS.
486 * pcs_get_state() - Read the current inband link state from the hardware
490 * Read the current inband link state from the MAC PCS, reporting the
491 * current speed in @state->speed, duplex mode in @state->duplex, pause
492 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
493 * negotiation completion state in @state->an_complete, and link up state
494 * in @state->link. If possible, @state->lp_advertising should also be
501 * pcs_config() - Configure the PCS mode and advertisement
503 * @neg_mode: link negotiation mode (see below)
504 * @interface: interface mode to be used
505 * @advertising: adertisement ethtool link mode mask
506 * @permit_pause_to_mac: permit forwarding pause resolution to MAC
508 * Configure the PCS for the operating mode, the interface mode, and set
510 * hardware may forward the pause mode resolution to the MAC.
515 * For SGMII, there is no advertisement from the MAC side, the PCS should
518 * For 1000BASE-X, the advertisement should be programmed into the PCS.
520 * For most 10GBASE-R, there is no advertisement.
523 * functions, or for PCS that set pcs->neg_mode true, should be tested
531 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
540 * pcs_link_up() - program the PCS for the resolved link configuration
542 * @neg_mode: link negotiation mode (see below)
543 * @interface: link &typedef phy_interface_t mode
549 * mode without in-band AN needs to be manually configured for the link
550 * and duplex setting. Otherwise, this should be a no-op.
552 * The %mode argument should be tested via the phylink_mode_*() family of
553 * functions, or for PCS that set pcs->neg_mode true, should be tested
560 * pcs_pre_init() - Configure PCS components necessary for MAC initialization
563 * This function can be called by MAC drivers through the
568 * Some MAC devices require specific hardware initialization to be performed by
573 * By calling phylink_pcs_pre_init(), MAC drivers can ensure that the PCS is
577 * model of PCS and the requirements of the MAC device attached to it. PCS
579 * conjunction with a MAC device whose driver calls phylink_pcs_pre_init(). MAC
581 * pre-initialization.
637 #define __phylink_do_bit(op, bm, mode) \ argument
638 op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)
640 #define phylink_set(bm, mode) __phylink_do_bit(__set_bit, bm, mode) argument
641 #define phylink_clear(bm, mode) __phylink_do_bit(__clear_bit, bm, mode) argument
642 #define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode) argument
647 * phylink_get_link_timer_ns - return the PCS link timer value
648 * @interface: link &typedef phy_interface_t mode
651 * mode, or -EINVAL if not appropriate.
667 return -EINVAL; in phylink_get_link_timer_ns()