lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1546859136.3037.23.camel@suse.com>
Date:   Mon, 07 Jan 2019 12:05:36 +0100
From:   Oliver Neukum <oneukum@...e.com>
To:     Marek Vasut <marex@...x.de>, netdev@...r.kernel.org
Cc:     "David S . Miller" <davem@...emloft.net>,
        Florian Fainelli <f.fainelli@...il.com>,
        Andrew Lunn <andrew@...n.ch>,
        Nisar Sayed <Nisar.Sayed@...rochip.com>,
        Woojung Huh <Woojung.Huh@...rochip.com>,
        linux-usb@...r.kernel.org
Subject: Re: [PATCH 07/19] usbnet: smsc95xx: Split the reset function

On Do, 2019-01-03 at 02:10 +0100, Marek Vasut wrote:
> The smsc95xx_reset() is called either during bind or later during
> the driver operation. However, the MII structure can be populated
> only once, when the smsc95xx_reset() is called from the drivers
> bind function.
> 
> Split the reset function to allow filling the MII structure only
> once. This is done in preparation of phydev conversion, where the
> code will connect to PHY between those two halves of the reset
> function.
> 
> Signed-off-by: Marek Vasut <marex@...x.de>
> Cc: David S. Miller <davem@...emloft.net>
> Cc: Nisar Sayed <Nisar.Sayed@...rochip.com>
> Cc: Woojung Huh <Woojung.Huh@...rochip.com>
> Cc: Andrew Lunn <andrew@...n.ch>
> Cc: Florian Fainelli <f.fainelli@...il.com>
> Cc: linux-usb@...r.kernel.org
> To: netdev@...r.kernel.org
> ---
>  drivers/net/usb/smsc95xx.c | 36 +++++++++++++++++++++++++++---------
>  1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
> index 551d05eb258e..e40cde490a42 100644
> --- a/drivers/net/usb/smsc95xx.c
> +++ b/drivers/net/usb/smsc95xx.c
> @@ -944,14 +944,6 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
>  {
>  	int bmcr, ret, timeout = 0;
>  
> -	/* Initialize MII structure */
> -	dev->mii.dev = dev->net;
> -	dev->mii.mdio_read = smsc95xx_mdio_read;
> -	dev->mii.mdio_write = smsc95xx_mdio_write;
> -	dev->mii.phy_id_mask = 0x1f;
> -	dev->mii.reg_num_mask = 0x1f;
> -	dev->mii.phy_id = SMSC95XX_INTERNAL_PHY_ID;
> -
>  	/* reset phy and wait for reset to complete */
>  	smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
>  
> @@ -985,7 +977,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
>  	return 0;
>  }
>  
> -static int smsc95xx_reset(struct usbnet *dev)
> +static int smsc95xx_reset_pre(struct usbnet *dev)

Hi,

may I request that you choose different names? These names suggest a
connection with the pre_reset() and post_reset() methods of a USB
driver.

	Regards
		Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ