Lines Matching +full:mode +full:-

21 	MLO_AN_FIXED,	/* Fixed-link mode */
22 MLO_AN_INBAND, /* In-band protocol */
25 static inline bool phylink_autoneg_inband(unsigned int mode) in phylink_autoneg_inband() argument
27 return mode == MLO_AN_INBAND; in phylink_autoneg_inband()
31 * struct phylink_link_state - link state structure
35 * @interface: link &typedef phy_interface_t mode
37 * @duplex: link duplex mode, one of DUPLEX_* constants.
61 * struct phylink_config - PHYLINK configuration structure
66 * if MAC link is at %MLO_AN_FIXED mode.
69 * if MAC link is at %MLO_AN_FIXED mode.
82 * struct phylink_mac_ops - MAC operations structure.
86 * @mac_config: configure the MAC for the selected mode and state.
100 int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
102 void (*mac_config)(struct phylink_config *config, unsigned int mode,
104 int (*mac_finish)(struct phylink_config *config, unsigned int mode,
107 void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
110 struct phy_device *phy, unsigned int mode,
115 #if 0 /* For kernel-doc purposes only. */
117 * validate - Validate and update the link configuration
122 * Clear bits in the @supported and @state->advertising masks that
127 * because the MAC is unable to BaseX mode. This is more about
131 * If the @state->interface mode is %PHY_INTERFACE_MODE_1000BASEX
132 * or %PHY_INTERFACE_MODE_2500BASEX, select the appropriate mode
133 * based on @state->advertising and/or @state->speed and update
134 * @state->interface accordingly. See phylink_helper_basex_speed().
136 * When @state->interface is %PHY_INTERFACE_MODE_NA, phylink expects the
139 * If the @state->interface mode is not supported, then the @supported
146 * mac_pcs_get_state() - Read the current inband link state from the hardware
151 * current speed in @state->speed, duplex mode in @state->duplex, pause
152 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
153 * negotiation completion state in @state->an_complete, and link up state
154 * in @state->link. If possible, @state->lp_advertising should also be
161 * mac_prepare() - prepare to change the PHY interface mode
163 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
164 * @iface: interface mode to switch to
167 * of the link, which includes changing the interface mode or at initial
168 * startup time. It may be called for the current mode. The MAC driver
173 * - mac_prepare()
174 * - mac_config()
175 * - pcs_config()
176 * - possible pcs_an_restart()
177 * - mac_finish()
182 int mac_prepare(struct phylink_config *config, unsigned int mode,
186 * mac_config() - configure the MAC for the selected mode and state
188 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
191 * Note - not all members of @state are valid. In particular,
192 * @state->lp_advertising, @state->link, @state->an_complete are never
196 * (this requires a rewrite - please refer to mac_link_up() for situations
199 * In all negotiation modes, as defined by @mode, @state->pause indicates the
203 * the results of in-band negotiation/status from the MAC PCS should be used
204 * to control the MAC pause mode settings.
206 * The action performed depends on the currently selected mode:
209 * Configure for non-inband negotiation mode, where the link settings
211 * protocol from the MAC is specified by @state->interface.
213 * @state->advertising may be used, but is not required.
215 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
216 * @state->duplex and @state->pause to configure the MAC, but this is
225 * place the link in an inband negotiation mode (such as 802.3z
226 * 1000base-X or Cisco SGMII mode depending on the @state->interface
227 * mode). In both cases, link state management (whether the link
232 * Interface mode specific details are mentioned below.
234 * If in 802.3z mode, the link speed is fixed, dependent on the
235 * @state->interface. Duplex and pause modes are negotiated via
236 * the in-band configuration word. Advertised pause modes are set
237 * according to the @state->an_enabled and @state->advertising
241 * If in Cisco SGMII mode, the link speed and duplex mode are passed
242 * in the serial bitstream 16-bit configuration word, and the MAC
251 * requested settings - i.o.w., if nothing has changed between two
257 void mac_config(struct phylink_config *config, unsigned int mode,
261 * mac_finish() - finish a to change the PHY interface mode
263 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
264 * @iface: interface mode to switch to
268 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
274 int mac_finish(struct phylink_config *config, unsigned int mode,
278 * mac_an_restart() - restart 802.3z BaseX autonegotiation
284 * mac_link_down() - take the link down
286 * @mode: link autonegotiation mode
287 * @interface: link &typedef phy_interface_t mode
289 * If @mode is not an in-band negotiation mode (as defined by
294 void mac_link_down(struct phylink_config *config, unsigned int mode,
298 * mac_link_up() - allow the link to come up
301 * @mode: link autonegotiation mode
302 * @interface: link &typedef phy_interface_t mode
313 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
316 * Note that when 802.3z in-band negotiation is in use, it is possible
320 * If in-band negotiation mode is disabled, allow the link to come up. If
321 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
326 unsigned int mode, phy_interface_t interface,
333 * struct phylink_pcs - PHYLINK PCS instance
346 * struct phylink_pcs_ops - MAC PCS operations structure.
348 * @pcs_config: configure the MAC PCS for the selected mode and state.
356 int (*pcs_config)(struct phylink_pcs *pcs, unsigned int mode,
361 void (*pcs_link_up)(struct phylink_pcs *pcs, unsigned int mode,
365 #if 0 /* For kernel-doc purposes only. */
367 * pcs_get_state() - Read the current inband link state from the hardware
372 * current speed in @state->speed, duplex mode in @state->duplex, pause
373 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
374 * negotiation completion state in @state->an_complete, and link up state
375 * in @state->link. If possible, @state->lp_advertising should also be
385 * pcs_config() - Configure the PCS mode and advertisement
387 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
388 * @interface: interface mode to be used
389 * @advertising: adertisement ethtool link mode mask
392 * Configure the PCS for the operating mode, the interface mode, and set
394 * hardware may forward the pause mode resolution to the MAC.
402 * For 1000BASE-X, the advertisement should be programmed into the PCS.
404 * For most 10GBASE-R, there is no advertisement.
406 int pcs_config(struct phylink_pcs *pcs, unsigned int mode,
411 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
420 * pcs_link_up() - program the PCS for the resolved link configuration
422 * @mode: link autonegotiation mode
423 * @interface: link &typedef phy_interface_t mode
429 * mode without in-band AN needs to be manually configured for the link
430 * and duplex setting. Otherwise, this should be a no-op.
432 void pcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
479 #define __phylink_do_bit(op, bm, mode) \ argument
480 op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)
482 #define phylink_set(bm, mode) __phylink_do_bit(__set_bit, bm, mode) argument
483 #define phylink_clear(bm, mode) __phylink_do_bit(__clear_bit, bm, mode) argument
484 #define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode) argument
494 int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,