Lines Matching +full:mode +full:-
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
139 * if MAC link is at %MLO_AN_FIXED mode.
143 * if MAC link is at %MLO_AN_FIXED mode.
163 * struct phylink_mac_ops - MAC operations structure.
164 * @mac_get_caps: Get MAC capabilities for interface mode.
165 * @mac_select_pcs: Select a PCS for the interface mode.
167 * @mac_config: configure the MAC for the selected mode and state.
179 int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
181 void (*mac_config)(struct phylink_config *config, unsigned int mode,
183 int (*mac_finish)(struct phylink_config *config, unsigned int mode,
185 void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
188 struct phy_device *phy, unsigned int mode,
193 #if 0 /* For kernel-doc purposes only. */
195 * mac_get_caps: Get MAC capabilities for interface mode.
197 * @interface: PHY interface mode.
199 * Optional method. When not provided, config->mac_capabilities will be used.
201 * interface mode where there is some special handling required by the MAC
202 * driver (e.g. not supporting half-duplex in certain interface modes.)
207 * mac_select_pcs: Select a PCS for the interface mode.
209 * @interface: PHY interface mode for PCS
211 * Return the &struct phylink_pcs for the specified interface mode, or
223 * mac_prepare() - prepare to change the PHY interface mode
225 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
226 * @iface: interface mode to switch to
229 * of the link, which includes changing the interface mode or at initial
230 * startup time. It may be called for the current mode. The MAC driver
235 * - mac_prepare()
236 * - mac_config()
237 * - pcs_config()
238 * - possible pcs_an_restart()
239 * - mac_finish()
244 int mac_prepare(struct phylink_config *config, unsigned int mode,
248 * mac_config() - configure the MAC for the selected mode and state
250 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
253 * Note - not all members of @state are valid. In particular,
254 * @state->lp_advertising, @state->link, @state->an_complete are never
259 * e.g. interface mode. It will not be called for changes in speed, duplex
260 * or pause modes or to change the in-band advertisement.
262 * In all negotiation modes, as defined by @mode, @state->pause indicates the
266 * the results of in-band negotiation/status from the MAC PCS should be used
267 * to control the MAC pause mode settings.
269 * The action performed depends on the currently selected mode:
272 * Configure for non-inband negotiation mode, where the link settings
274 * protocol from the MAC is specified by @state->interface.
276 * @state->advertising may be used, but is not required.
278 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
279 * @state->duplex and @state->pause to configure the MAC, but this is
288 * place the link in an inband negotiation mode (such as 802.3z
289 * 1000base-X or Cisco SGMII mode depending on the @state->interface
290 * mode). In both cases, link state management (whether the link
295 * Interface mode specific details are mentioned below.
297 * If in 802.3z mode, the link speed is fixed, dependent on the
298 * @state->interface. Duplex and pause modes are negotiated via
299 * the in-band configuration word. Advertised pause modes are set
300 * according to the @state->an_enabled and @state->advertising
304 * If in Cisco SGMII mode, the link speed and duplex mode are passed
305 * in the serial bitstream 16-bit configuration word, and the MAC
314 * requested settings - i.o.w., if nothing has changed between two
320 void mac_config(struct phylink_config *config, unsigned int mode,
324 * mac_finish() - finish a to change the PHY interface mode
326 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
327 * @iface: interface mode to switch to
331 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
337 int mac_finish(struct phylink_config *config, unsigned int mode,
341 * mac_link_down() - take the link down
343 * @mode: link autonegotiation mode
344 * @interface: link &typedef phy_interface_t mode
346 * If @mode is not an in-band negotiation mode (as defined by
351 void mac_link_down(struct phylink_config *config, unsigned int mode,
355 * mac_link_up() - allow the link to come up
358 * @mode: link autonegotiation mode
359 * @interface: link &typedef phy_interface_t mode
370 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
373 * Note that when 802.3z in-band negotiation is in use, it is possible
377 * If in-band negotiation mode is disabled, allow the link to come up. If
378 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
383 unsigned int mode, phy_interface_t interface,
390 * struct phylink_pcs - PHYLINK PCS instance
393 * @neg_mode: provide PCS neg mode via "mode" argument
410 * struct phylink_pcs_ops - MAC PCS operations structure.
414 * @pcs_pre_config: pre-mac_config method (for errata)
415 * @pcs_post_config: post-mac_config method (for arrata)
417 * @pcs_config: configure the MAC PCS for the selected mode and state.
442 #if 0 /* For kernel-doc purposes only. */
444 * pcs_validate() - validate the link configuration.
449 * Validate the interface mode, and advertising's autoneg bit, removing any
454 * Returns -EINVAL if the interface mode/autoneg mode is not supported.
455 * Returns non-zero positive if the link state can be supported.
461 * pcs_enable() - enable the PCS.
467 * pcs_disable() - disable the PCS.
473 * pcs_get_state() - Read the current inband link state from the hardware
478 * current speed in @state->speed, duplex mode in @state->duplex, pause
479 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
480 * negotiation completion state in @state->an_complete, and link up state
481 * in @state->link. If possible, @state->lp_advertising should also be
491 * pcs_config() - Configure the PCS mode and advertisement
493 * @neg_mode: link negotiation mode (see below)
494 * @interface: interface mode to be used
495 * @advertising: adertisement ethtool link mode mask
498 * Configure the PCS for the operating mode, the interface mode, and set
500 * hardware may forward the pause mode resolution to the MAC.
508 * For 1000BASE-X, the advertisement should be programmed into the PCS.
510 * For most 10GBASE-R, there is no advertisement.
513 * functions, or for PCS that set pcs->neg_mode true, should be tested
521 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
530 * pcs_link_up() - program the PCS for the resolved link configuration
532 * @neg_mode: link negotiation mode (see below)
533 * @interface: link &typedef phy_interface_t mode
539 * mode without in-band AN needs to be manually configured for the link
540 * and duplex setting. Otherwise, this should be a no-op.
542 * The %mode argument should be tested via the phylink_mode_*() family of
543 * functions, or for PCS that set pcs->neg_mode true, should be tested
595 #define __phylink_do_bit(op, bm, mode) \ argument
596 op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)
598 #define phylink_set(bm, mode) __phylink_do_bit(__set_bit, bm, mode) argument
599 #define phylink_clear(bm, mode) __phylink_do_bit(__clear_bit, bm, mode) argument
600 #define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode) argument
605 * phylink_get_link_timer_ns - return the PCS link timer value
606 * @interface: link &typedef phy_interface_t mode
609 * mode, or -EINVAL if not appropriate.
624 return -EINVAL; in phylink_get_link_timer_ns()