[PATCH net-next v6 6/9] net: dpaa: Convert to phylink

Sean Anderson sean.anderson at seco.com
Wed Oct 5 03:20:27 AEDT 2022



On 10/4/22 12:13 PM, Russell King (Oracle) wrote:
> On Fri, Sep 30, 2022 at 04:09:30PM -0400, Sean Anderson wrote:
>> @@ -1064,43 +1061,50 @@ static struct phylink_pcs *memac_pcs_create(struct device_node *mac_node,
>>  	return pcs;
>>  }
>>  
>> +static bool memac_supports(struct mac_device *mac_dev, phy_interface_t iface)
>> +{
>> +	/* If there's no serdes device, assume that it's been configured for
>> +	 * whatever the default interface mode is.
>> +	 */
>> +	if (!mac_dev->fman_mac->serdes)
>> +		return mac_dev->phy_if == iface;
>> +	/* Otherwise, ask the serdes */
>> +	return !phy_validate(mac_dev->fman_mac->serdes, PHY_MODE_ETHERNET,
>> +			     iface, NULL);
>> +}
>> +
>>  int memac_initialization(struct mac_device *mac_dev,
>>  			 struct device_node *mac_node,
>>  			 struct fman_mac_params *params)
>>  {
>>  	int			 err;
>> +	struct device_node      *fixed;
>>  	struct phylink_pcs	*pcs;
>> -	struct fixed_phy_status *fixed_link;
>>  	struct fman_mac		*memac;
>> +	unsigned long		 capabilities;
>> +	unsigned long		*supported;
>>  
>> +	mac_dev->phylink_ops		= &memac_mac_ops;
>>  	mac_dev->set_promisc		= memac_set_promiscuous;
>>  	mac_dev->change_addr		= memac_modify_mac_address;
>>  	mac_dev->add_hash_mac_addr	= memac_add_hash_mac_address;
>>  	mac_dev->remove_hash_mac_addr	= memac_del_hash_mac_address;
>> -	mac_dev->set_tx_pause		= memac_set_tx_pause_frames;
>> -	mac_dev->set_rx_pause		= memac_accept_rx_pause_frames;
>>  	mac_dev->set_exception		= memac_set_exception;
>>  	mac_dev->set_allmulti		= memac_set_allmulti;
>>  	mac_dev->set_tstamp		= memac_set_tstamp;
>>  	mac_dev->set_multi		= fman_set_multi;
>> -	mac_dev->adjust_link            = adjust_link_memac;
>>  	mac_dev->enable			= memac_enable;
>>  	mac_dev->disable		= memac_disable;
>>  
>> -	if (params->max_speed == SPEED_10000)
>> -		mac_dev->phy_if = PHY_INTERFACE_MODE_XGMII;
>> -
>>  	mac_dev->fman_mac = memac_config(mac_dev, params);
>> -	if (!mac_dev->fman_mac) {
>> -		err = -EINVAL;
>> -		goto _return;
>> -	}
>> +	if (!mac_dev->fman_mac)
>> +		return -EINVAL;
>>  
>>  	memac = mac_dev->fman_mac;
>>  	memac->memac_drv_param->max_frame_length = fman_get_max_frm();
>>  	memac->memac_drv_param->reset_on_init = true;
>>  
>> -	err = of_property_match_string(mac_node, "pcs-names", "xfi");
>> +	err = of_property_match_string(mac_node, "pcs-handle-names", "xfi");
> 
> While reading through the patch, I stumbled upon this - in the previous
> patch, you introduce this code with "pcs-names" and then in this patch
> you change the name of the property. I don't think this was mentioned in
> the commit message (searching it for "pcs" didn't reveal anything) so
> I'm wondering whether this name update should've been merged into the
> previous patch instead of this one?

Yes, you're right. It looks like I applied this update to the wrong
patch. Will fix for v7.

--Sean


More information about the Linuxppc-dev mailing list