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

21 	MLO_AN_FIXED,	/* Fixed-link mode */
22 MLO_AN_INBAND, /* In-band protocol */
77 static inline bool phylink_autoneg_inband(unsigned int mode) in phylink_autoneg_inband() argument
79 return mode == MLO_AN_INBAND; in phylink_autoneg_inband()
83 * struct phylink_link_state - link state structure
87 * @interface: link &typedef phy_interface_t mode
89 * @duplex: link duplex mode, one of DUPLEX_* constants.
93 * the medium link mode (@speed and @duplex) and the speed/duplex of the phy
94 * interface mode (@interface) are different.
118 * struct phylink_config - PHYLINK configuration structure
124 * if MAC link is at %MLO_AN_FIXED mode.
128 * if MAC link is at %MLO_AN_FIXED mode.
147 * struct phylink_mac_ops - MAC operations structure.
149 * @mac_select_pcs: Select a PCS for the interface mode.
152 * @mac_config: configure the MAC for the selected mode and state.
168 int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
170 void (*mac_config)(struct phylink_config *config, unsigned int mode,
172 int (*mac_finish)(struct phylink_config *config, unsigned int mode,
175 void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
178 struct phy_device *phy, unsigned int mode,
183 #if 0 /* For kernel-doc purposes only. */
185 * validate - Validate and update the link configuration
190 * Clear bits in the @supported and @state->advertising masks that
195 * because the MAC is unable to BaseX mode. This is more about
199 * When @config->supported_interfaces has been set, phylink will iterate
201 * MAC. The validation function must not print errors if @state->interface
204 * When @config->supported_interfaces is empty, phylink will call this
205 * function with @state->interface set to %PHY_INTERFACE_MODE_NA, and
208 * If the @state->interface mode is not supported, then the @supported
214 * mac_select_pcs: Select a PCS for the interface mode.
216 * @interface: PHY interface mode for PCS
218 * Return the &struct phylink_pcs for the specified interface mode, or
230 * mac_pcs_get_state() - Read the current inband link state from the hardware
235 * current speed in @state->speed, duplex mode in @state->duplex, pause
236 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
237 * negotiation completion state in @state->an_complete, and link up state
238 * in @state->link. If possible, @state->lp_advertising should also be
249 * mac_prepare() - prepare to change the PHY interface mode
251 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
252 * @iface: interface mode to switch to
255 * of the link, which includes changing the interface mode or at initial
256 * startup time. It may be called for the current mode. The MAC driver
261 * - mac_prepare()
262 * - mac_config()
263 * - pcs_config()
264 * - possible pcs_an_restart()
265 * - mac_finish()
270 int mac_prepare(struct phylink_config *config, unsigned int mode,
274 * mac_config() - configure the MAC for the selected mode and state
276 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
279 * Note - not all members of @state are valid. In particular,
280 * @state->lp_advertising, @state->link, @state->an_complete are never
286 * called on each link up event, and to also change the in-band advert. For
287 * non-legacy drivers, it will only be called to reconfigure the MAC for a
288 * "major" change in e.g. interface mode. It will not be called for changes
289 * in speed, duplex or pause modes or to change the in-band advertisement.
293 * (this requires a rewrite - please refer to mac_link_up() for situations
296 * In all negotiation modes, as defined by @mode, @state->pause indicates the
300 * the results of in-band negotiation/status from the MAC PCS should be used
301 * to control the MAC pause mode settings.
303 * The action performed depends on the currently selected mode:
306 * Configure for non-inband negotiation mode, where the link settings
308 * protocol from the MAC is specified by @state->interface.
310 * @state->advertising may be used, but is not required.
312 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
313 * @state->duplex and @state->pause to configure the MAC, but this is
322 * place the link in an inband negotiation mode (such as 802.3z
323 * 1000base-X or Cisco SGMII mode depending on the @state->interface
324 * mode). In both cases, link state management (whether the link
329 * Interface mode specific details are mentioned below.
331 * If in 802.3z mode, the link speed is fixed, dependent on the
332 * @state->interface. Duplex and pause modes are negotiated via
333 * the in-band configuration word. Advertised pause modes are set
334 * according to the @state->an_enabled and @state->advertising
338 * If in Cisco SGMII mode, the link speed and duplex mode are passed
339 * in the serial bitstream 16-bit configuration word, and the MAC
348 * requested settings - i.o.w., if nothing has changed between two
354 void mac_config(struct phylink_config *config, unsigned int mode,
358 * mac_finish() - finish a to change the PHY interface mode
360 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
361 * @iface: interface mode to switch to
365 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
371 int mac_finish(struct phylink_config *config, unsigned int mode,
375 * mac_an_restart() - restart 802.3z BaseX autonegotiation
385 * mac_link_down() - take the link down
387 * @mode: link autonegotiation mode
388 * @interface: link &typedef phy_interface_t mode
390 * If @mode is not an in-band negotiation mode (as defined by
395 void mac_link_down(struct phylink_config *config, unsigned int mode,
399 * mac_link_up() - allow the link to come up
402 * @mode: link autonegotiation mode
403 * @interface: link &typedef phy_interface_t mode
414 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
417 * Note that when 802.3z in-band negotiation is in use, it is possible
421 * If in-band negotiation mode is disabled, allow the link to come up. If
422 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
427 unsigned int mode, phy_interface_t interface,
434 * struct phylink_pcs - PHYLINK PCS instance
447 * struct phylink_pcs_ops - MAC PCS operations structure.
450 * @pcs_config: configure the MAC PCS for the selected mode and state.
460 int (*pcs_config)(struct phylink_pcs *pcs, unsigned int mode,
465 void (*pcs_link_up)(struct phylink_pcs *pcs, unsigned int mode,
469 #if 0 /* For kernel-doc purposes only. */
471 * pcs_validate() - validate the link configuration.
476 * Validate the interface mode, and advertising's autoneg bit, removing any
481 * Returns -EINVAL if the interface mode/autoneg mode is not supported.
482 * Returns non-zero positive if the link state can be supported.
488 * pcs_get_state() - Read the current inband link state from the hardware
493 * current speed in @state->speed, duplex mode in @state->duplex, pause
494 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
495 * negotiation completion state in @state->an_complete, and link up state
496 * in @state->link. If possible, @state->lp_advertising should also be
506 * pcs_config() - Configure the PCS mode and advertisement
508 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
509 * @interface: interface mode to be used
510 * @advertising: adertisement ethtool link mode mask
513 * Configure the PCS for the operating mode, the interface mode, and set
515 * hardware may forward the pause mode resolution to the MAC.
523 * For 1000BASE-X, the advertisement should be programmed into the PCS.
525 * For most 10GBASE-R, there is no advertisement.
527 int pcs_config(struct phylink_pcs *pcs, unsigned int mode,
532 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
541 * pcs_link_up() - program the PCS for the resolved link configuration
543 * @mode: link autonegotiation mode
544 * @interface: link &typedef phy_interface_t mode
550 * mode without in-band AN needs to be manually configured for the link
551 * and duplex setting. Otherwise, this should be a no-op.
553 void pcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
607 #define __phylink_do_bit(op, bm, mode) \ argument
608 op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)
610 #define phylink_set(bm, mode) __phylink_do_bit(__set_bit, bm, mode) argument
611 #define phylink_clear(bm, mode) __phylink_do_bit(__clear_bit, bm, mode) argument
612 #define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode) argument
622 int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,