[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <X/4M3CJ4xU381ozH@lunn.ch>
Date: Tue, 12 Jan 2021 21:55:56 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Marek BehĂșn <kabel@...nel.org>
Cc: netdev@...r.kernel.org, Russell King <rmk+kernel@...linux.org.uk>,
Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net,
pali@...nel.org
Subject: Re: [PATCH net-next v4 1/4] net: phy: mdio-i2c: support I2C MDIO
protocol for RollBall SFP modules
> > > +static int i2c_mii_read_rollball(struct mii_bus *bus, int phy_id, int reg)
> > > +{
> > > + u8 buf[4], res[6];
> > > + int bus_addr, ret;
> > > + u16 val;
> > > +
> > > + if (!(reg & MII_ADDR_C45))
> > > + return -EOPNOTSUPP;
> > > +
> > > + bus_addr = i2c_mii_phy_addr(phy_id);
> > > + if (bus_addr != ROLLBALL_PHY_I2C_ADDR)
> > > + return 0xffff;
> > > +
> > > + buf[0] = ROLLBALL_DATA_ADDR;
> > > + buf[1] = (reg >> 16) & 0x1f;
> > > + buf[2] = (reg >> 8) & 0xff;
> > > + buf[3] = reg & 0xff;
> >
> > This looks odd. There are only 32 registers for C22 transactions, so
> > it fits in one byte. You can set buf[1] and buf[2] to zero.
>
> C22 is not supported by this protocol.
Duh!
Sorry for the noise.
Andrew
Powered by blists - more mailing lists