Lines Matching +full:- +full:- +full:mode +full:- +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.
68 * if MAC link is at %MLO_AN_FIXED mode.
80 * struct phylink_mac_ops - MAC operations structure.
84 * @mac_config: configure the MAC for the selected mode and state.
98 int (*mac_prepare)(struct phylink_config *config, unsigned int mode,
100 void (*mac_config)(struct phylink_config *config, unsigned int mode,
102 int (*mac_finish)(struct phylink_config *config, unsigned int mode,
105 void (*mac_link_down)(struct phylink_config *config, unsigned int mode,
108 struct phy_device *phy, unsigned int mode,
113 #if 0 /* For kernel-doc purposes only. */
115 * validate - Validate and update the link configuration
120 * Clear bits in the @supported and @state->advertising masks that
125 * because the MAC is unable to BaseX mode. This is more about
129 * If the @state->interface mode is %PHY_INTERFACE_MODE_1000BASEX
130 * or %PHY_INTERFACE_MODE_2500BASEX, select the appropriate mode
131 * based on @state->advertising and/or @state->speed and update
132 * @state->interface accordingly. See phylink_helper_basex_speed().
134 * When @state->interface is %PHY_INTERFACE_MODE_NA, phylink expects the
137 * If the @state->interface mode is not supported, then the @supported
144 * mac_pcs_get_state() - Read the current inband link state from the hardware
149 * current speed in @state->speed, duplex mode in @state->duplex, pause
150 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
151 * negotiation completion state in @state->an_complete, and link up state
152 * in @state->link. If possible, @state->lp_advertising should also be
159 * mac_prepare() - prepare to change the PHY interface mode
161 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
162 * @iface: interface mode to switch to
165 * of the link, which includes changing the interface mode or at initial
166 * startup time. It may be called for the current mode. The MAC driver
171 * - mac_prepare()
172 * - mac_config()
173 * - pcs_config()
174 * - possible pcs_an_restart()
175 * - mac_finish()
180 int mac_prepare(struct phylink_config *config, unsigned int mode,
184 * mac_config() - configure the MAC for the selected mode and state
186 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
189 * Note - not all members of @state are valid. In particular,
190 * @state->lp_advertising, @state->link, @state->an_complete are never
194 * (this requires a rewrite - please refer to mac_link_up() for situations
197 * In all negotiation modes, as defined by @mode, @state->pause indicates the
201 * the results of in-band negotiation/status from the MAC PCS should be used
202 * to control the MAC pause mode settings.
204 * The action performed depends on the currently selected mode:
207 * Configure for non-inband negotiation mode, where the link settings
209 * protocol from the MAC is specified by @state->interface.
211 * @state->advertising may be used, but is not required.
213 * Older drivers (prior to the mac_link_up() change) may use @state->speed,
214 * @state->duplex and @state->pause to configure the MAC, but this is
223 * place the link in an inband negotiation mode (such as 802.3z
224 * 1000base-X or Cisco SGMII mode depending on the @state->interface
225 * mode). In both cases, link state management (whether the link
230 * Interface mode specific details are mentioned below.
232 * If in 802.3z mode, the link speed is fixed, dependent on the
233 * @state->interface. Duplex and pause modes are negotiated via
234 * the in-band configuration word. Advertised pause modes are set
235 * according to the @state->an_enabled and @state->advertising
239 * If in Cisco SGMII mode, the link speed and duplex mode are passed
240 * in the serial bitstream 16-bit configuration word, and the MAC
249 * requested settings - i.o.w., if nothing has changed between two
255 void mac_config(struct phylink_config *config, unsigned int mode,
259 * mac_finish() - finish a to change the PHY interface mode
261 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
262 * @iface: interface mode to switch to
266 * for the @mode and @iface. E.g. a MAC driver may wish to re-enable the
272 int mac_finish(struct phylink_config *config, unsigned int mode,
276 * mac_an_restart() - restart 802.3z BaseX autonegotiation
282 * mac_link_down() - take the link down
284 * @mode: link autonegotiation mode
285 * @interface: link &typedef phy_interface_t mode
287 * If @mode is not an in-band negotiation mode (as defined by
292 void mac_link_down(struct phylink_config *config, unsigned int mode,
296 * mac_link_up() - allow the link to come up
299 * @mode: link autonegotiation mode
300 * @interface: link &typedef phy_interface_t mode
311 * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
314 * Note that when 802.3z in-band negotiation is in use, it is possible
318 * If in-band negotiation mode is disabled, allow the link to come up. If
319 * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
324 unsigned int mode, phy_interface_t interface,
331 * struct phylink_pcs - PHYLINK PCS instance
344 * struct phylink_pcs_ops - MAC PCS operations structure.
346 * @pcs_config: configure the MAC PCS for the selected mode and state.
354 int (*pcs_config)(struct phylink_pcs *pcs, unsigned int mode,
359 void (*pcs_link_up)(struct phylink_pcs *pcs, unsigned int mode,
363 #if 0 /* For kernel-doc purposes only. */
365 * pcs_get_state() - Read the current inband link state from the hardware
370 * current speed in @state->speed, duplex mode in @state->duplex, pause
371 * mode in @state->pause using the %MLO_PAUSE_RX and %MLO_PAUSE_TX bits,
372 * negotiation completion state in @state->an_complete, and link up state
373 * in @state->link. If possible, @state->lp_advertising should also be
383 * pcs_config() - Configure the PCS mode and advertisement
385 * @mode: one of %MLO_AN_FIXED, %MLO_AN_PHY, %MLO_AN_INBAND.
386 * @interface: interface mode to be used
387 * @advertising: adertisement ethtool link mode mask
390 * Configure the PCS for the operating mode, the interface mode, and set
392 * hardware may forward the pause mode resolution to the MAC.
400 * For 1000BASE-X, the advertisement should be programmed into the PCS.
402 * For most 10GBASE-R, there is no advertisement.
404 int pcs_config(struct phylink_pcs *pcs, unsigned int mode,
409 * pcs_an_restart() - restart 802.3z BaseX autonegotiation
418 * pcs_link_up() - program the PCS for the resolved link configuration
420 * @mode: link autonegotiation mode
421 * @interface: link &typedef phy_interface_t mode
427 * mode without in-band AN needs to be manually configured for the link
428 * and duplex setting. Otherwise, this should be a no-op.
430 void pcs_link_up(struct phylink_pcs *pcs, unsigned int mode,
471 #define __phylink_do_bit(op, bm, mode) \ argument
472 op(ETHTOOL_LINK_MODE_ ## mode ## _BIT, bm)
474 #define phylink_set(bm, mode) __phylink_do_bit(__set_bit, bm, mode) argument
475 #define phylink_clear(bm, mode) __phylink_do_bit(__clear_bit, bm, mode) argument
476 #define phylink_test(bm, mode) __phylink_do_bit(test_bit, bm, mode) argument
486 int phylink_mii_c22_pcs_config(struct mdio_device *pcs, unsigned int mode,