[1/2] net: phy: Add BaseT1 auto-negotiation constants

Message ID 20231218221814.69304-1-dima.fedrau@gmail.com
State New
Headers
Series [1/2] net: phy: Add BaseT1 auto-negotiation constants |

Commit Message

Dimitri Fedrau Dec. 18, 2023, 10:18 p.m. UTC
  Added constants for advertising 100BT1 and 1000BT1 in register BASE-T1
auto-negotiation advertisement register [31:16] (Register 7.515)

Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
---
 include/uapi/linux/mdio.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Andrew Lunn Dec. 18, 2023, 11:45 p.m. UTC | #1
On Mon, Dec 18, 2023 at 11:18:13PM +0100, Dimitri Fedrau wrote:
> Added constants for advertising 100BT1 and 1000BT1 in register BASE-T1
> auto-negotiation advertisement register [31:16] (Register 7.515)

Hi Dimitri

These two patches look good, but...

Please take a read of:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq

Also, its normal to include a user for new APIs. Do you have a driver
which will make use of this to advertisement modes?

Thanks
	Andrew
  
Dimitri Fedrau Dec. 19, 2023, 9:28 a.m. UTC | #2
Am Tue, Dec 19, 2023 at 12:45:01AM +0100 schrieb Andrew Lunn:
> On Mon, Dec 18, 2023 at 11:18:13PM +0100, Dimitri Fedrau wrote:
> > Added constants for advertising 100BT1 and 1000BT1 in register BASE-T1
> > auto-negotiation advertisement register [31:16] (Register 7.515)
> 
> Hi Dimitri
> 
> These two patches look good, but...
> 
> Please take a read of:
> 
> https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq
> 
I probably should have sent them with subject-prefix "PATCH net-next" !?

> Also, its normal to include a user for new APIs. Do you have a driver
> which will make use of this to advertisement modes?
> 
Yes, I'm currently trying to push a driver for the Marvell88Q2220
100BASE-T1/1000BASE-T1 PHY. It supports autonegotiation and with an
additional patch to function genphy_c45_baset1_an_config_aneg which is
not part of the series it is possible to set the advertised speed.
I probably should send all patches as a series including the driver ?

> Thanks
> 	Andrew

Best regards,
Dimitri
  
Andrew Lunn Dec. 19, 2023, 4:01 p.m. UTC | #3
> Yes, I'm currently trying to push a driver for the Marvell88Q2220
> 100BASE-T1/1000BASE-T1 PHY. It supports autonegotiation and with an
> additional patch to function genphy_c45_baset1_an_config_aneg which is
> not part of the series it is possible to set the advertised speed.
> I probably should send all patches as a series including the driver ?

Yes, please do send it all together as one patchset.

	Andrew
  

Patch

diff --git a/include/uapi/linux/mdio.h b/include/uapi/linux/mdio.h
index d03863da180e..020ccc810d23 100644
--- a/include/uapi/linux/mdio.h
+++ b/include/uapi/linux/mdio.h
@@ -348,6 +348,8 @@ 
 
 /* BASE-T1 auto-negotiation advertisement register [31:16] */
 #define MDIO_AN_T1_ADV_M_B10L		0x4000	/* device is compatible with 10BASE-T1L */
+#define MDIO_AN_T1_ADV_M_1000BT1	0x0080	/* advertise 1000BASE-T1 */
+#define MDIO_AN_T1_ADV_M_100BT1		0x0020	/* advertise 100BASE-T1 */
 #define MDIO_AN_T1_ADV_M_MST		0x0010	/* advertise master preference */
 
 /* BASE-T1 auto-negotiation advertisement register [47:32] */