[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR0402MB28002EE1DB0B3FB39B907052E0EE0@VI1PR0402MB2800.eurprd04.prod.outlook.com>
Date: Fri, 14 Jun 2019 14:06:05 +0000
From: Ioana Ciornei <ioana.ciornei@....com>
To: Andrew Lunn <andrew@...n.ch>
CC: "linux@...linux.org.uk" <linux@...linux.org.uk>,
"hkallweit1@...il.com" <hkallweit1@...il.com>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Alexandru Marginean <alexandru.marginean@....com>,
Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>
Subject: RE: [PATCH RFC 3/6] dpaa2-mac: add MC API for the DPMAC object
> Subject: Re: [PATCH RFC 3/6] dpaa2-mac: add MC API for the DPMAC object
>
> > +/**
> > + * dpmac_set_link_state() - Set the Ethernet link status
> > + * @mc_io: Pointer to opaque I/O object
> > + * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
> > + * @token: Token of DPMAC object
> > + * @link_state: Link state configuration
> > + *
> > + * Return: '0' on Success; Error code otherwise.
> > + */
> > +int dpmac_set_link_state(struct fsl_mc_io *mc_io,
> > + u32 cmd_flags,
> > + u16 token,
> > + struct dpmac_link_state *link_state) {
> > + struct dpmac_cmd_set_link_state *cmd_params;
> > + struct fsl_mc_command cmd = { 0 };
> > +
> > + /* prepare command */
> > + cmd.header =
> mc_encode_cmd_header(DPMAC_CMDID_SET_LINK_STATE,
> > + cmd_flags,
> > + token);
> > + cmd_params = (struct dpmac_cmd_set_link_state *)cmd.params;
> > + cmd_params->options = cpu_to_le64(link_state->options);
> > + cmd_params->rate = cpu_to_le32(link_state->rate);
> > + dpmac_set_field(cmd_params->state, STATE, link_state->up);
> > + dpmac_set_field(cmd_params->state, STATE_VALID,
> > + link_state->state_valid);
> > + cmd_params->supported = cpu_to_le64(link_state->supported);
> > + cmd_params->advertising = cpu_to_le64(link_state->advertising);
>
> I don't understand what supported and advertising mean in the context of a
> MAC. PHY yes, but MAC?
It's still in the context of the PHY. I see that the choice of function name is not great but this is done
only to convey what the supported and the advertising modes are to the Ethernet driver.
>
> > + * DPMAC link configuration/state options */
> > +
> > +/**
> > + * Enable auto-negotiation
> > + */
> > +#define DPMAC_LINK_OPT_AUTONEG BIT_ULL(0)
> > +/**
> > + * Enable half-duplex mode
> > + */
> > +#define DPMAC_LINK_OPT_HALF_DUPLEX BIT_ULL(1)
> > +/**
> > + * Enable pause frames
> > + */
> > +#define DPMAC_LINK_OPT_PAUSE BIT_ULL(2)
> > +/**
> > + * Enable a-symmetric pause frames
> > + */
> > +#define DPMAC_LINK_OPT_ASYM_PAUSE BIT_ULL(3)
>
> So is this to configure the MAC? The MAC can do half duplex, pause, asym
> pause?
>
> But from the previous patch, the PHY cannot do half duplex?
>
> Andrew
As stated in the previous reply, the MAC can do pause, asym pause but not half duplex or EEE.
The DPMAC_LINK_OPT_HALF_DUPLEX bit is just a leftover and can be removed.
--
Ioana
Powered by blists - more mailing lists