@@ -91,9 +91,10 @@ struct phylink_mac_ops {
9191 void (* mac_an_restart )(struct phylink_config * config );
9292 void (* mac_link_down )(struct phylink_config * config , unsigned int mode ,
9393 phy_interface_t interface );
94- void (* mac_link_up )(struct phylink_config * config , unsigned int mode ,
95- phy_interface_t interface ,
96- struct phy_device * phy );
94+ void (* mac_link_up )(struct phylink_config * config ,
95+ struct phy_device * phy , unsigned int mode ,
96+ phy_interface_t interface , int speed , int duplex ,
97+ bool tx_pause , bool rx_pause );
9798};
9899
99100#if 0 /* For kernel-doc purposes only. */
@@ -152,6 +153,9 @@ void mac_pcs_get_state(struct phylink_config *config,
152153 * guaranteed to be correct, and so any mac_config() implementation must
153154 * never reference these fields.
154155 *
156+ * (this requires a rewrite - please refer to mac_link_up() for situations
157+ * where the PCS and MAC are not tightly integrated.)
158+ *
155159 * In all negotiation modes, as defined by @mode, @state->pause indicates the
156160 * pause settings which should be applied as follows. If %MLO_PAUSE_AN is not
157161 * set, %MLO_PAUSE_TX and %MLO_PAUSE_RX indicate whether the MAC should send
@@ -162,12 +166,20 @@ void mac_pcs_get_state(struct phylink_config *config,
162166 * The action performed depends on the currently selected mode:
163167 *
164168 * %MLO_AN_FIXED, %MLO_AN_PHY:
165- * Configure the specified @state->speed and @state->duplex over a link
166- * specified by @state->interface. @state->advertising may be used, but
167- * is not required. Pause modes as above. Other members of @state must
168- * be ignored.
169+ * Configure for non-inband negotiation mode, where the link settings
170+ * are completely communicated via mac_link_up(). The physical link
171+ * protocol from the MAC is specified by @state->interface.
172+ *
173+ * @state->advertising may be used, but is not required.
174+ *
175+ * Older drivers (prior to the mac_link_up() change) may use @state->speed,
176+ * @state->duplex and @state->pause to configure the MAC, but this is
177+ * deprecated; such drivers should be converted to use mac_link_up().
169178 *
170- * Valid state members: interface, speed, duplex, pause, advertising.
179+ * Other members of @state must be ignored.
180+ *
181+ * Valid state members: interface, advertising.
182+ * Deprecated state members: speed, duplex, pause.
171183 *
172184 * %MLO_AN_INBAND:
173185 * place the link in an inband negotiation mode (such as 802.3z
@@ -228,19 +240,34 @@ void mac_link_down(struct phylink_config *config, unsigned int mode,
228240/**
229241 * mac_link_up() - allow the link to come up
230242 * @config: a pointer to a &struct phylink_config.
243+ * @phy: any attached phy
231244 * @mode: link autonegotiation mode
232245 * @interface: link &typedef phy_interface_t mode
233- * @phy: any attached phy
246+ * @speed: link speed
247+ * @duplex: link duplex
248+ * @tx_pause: link transmit pause enablement status
249+ * @rx_pause: link receive pause enablement status
234250 *
235- * If @mode is not an in-band negotiation mode (as defined by
236- * phylink_autoneg_inband()), allow the link to come up. If @phy
237- * is non-%NULL, configure Energy Efficient Ethernet by calling
251+ * Configure the MAC for an established link.
252+ *
253+ * @speed, @duplex, @tx_pause and @rx_pause indicate the finalised link
254+ * settings, and should be used to configure the MAC block appropriately
255+ * where these settings are not automatically conveyed from the PCS block,
256+ * or if in-band negotiation (as defined by phylink_autoneg_inband(@mode))
257+ * is disabled.
258+ *
259+ * Note that when 802.3z in-band negotiation is in use, it is possible
260+ * that the user wishes to override the pause settings, and this should
261+ * be allowed when considering the implementation of this method.
262+ *
263+ * If in-band negotiation mode is disabled, allow the link to come up. If
264+ * @phy is non-%NULL, configure Energy Efficient Ethernet by calling
238265 * phy_init_eee() and perform appropriate MAC configuration for EEE.
239266 * Interface type selection must be done in mac_config().
240267 */
241- void mac_link_up (struct phylink_config * config , unsigned int mode ,
242- phy_interface_t interface ,
243- struct phy_device * phy );
268+ void mac_link_up (struct phylink_config * config , struct phy_device * phy ,
269+ unsigned int mode , phy_interface_t interface ,
270+ int speed , int duplex , bool tx_pause , bool rx_pause );
244271#endif
245272
246273struct phylink * phylink_create (struct phylink_config * , struct fwnode_handle * ,
0 commit comments