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: <CABb+yY2TJhRFEh806ODZkxUYQNik8zjR8dVK6PR1mO=bT1KeGg@mail.gmail.com>
Date:   Thu, 31 Aug 2017 12:03:06 +0530
From:   Jassi Brar <jassisinghbrar@...il.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     netdev@...r.kernel.org,
        Devicetree List <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "David S . Miller" <davem@...emloft.net>,
        Mark Rutland <mark.rutland@....com>,
        "arnd@...db.de" <arnd@...db.de>,
        "patches@...aro.org" <patches@...aro.org>,
        Jassi Brar <jaswinder.singh@...aro.org>,
        Rob Herring <robh+dt@...nel.org>, Andy Green <andy@...mcat.com>
Subject: Re: [net-next PATCHv6 2/2] net: socionext: Add NetSec driver

On Wed, Aug 30, 2017 at 10:47 PM, Andrew Lunn <andrew@...n.ch> wrote:
>> +static int netsec_mac_update_to_phy_state(struct netsec_priv *priv)
>> +{
>> +     struct phy_device *phydev = priv->ndev->phydev;
>> +     u32 value = 0;
>> +
>> +     value = phydev->duplex ? NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON :
>> +                                    NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON;
>> +
>> +     if (phydev->speed != SPEED_1000)
>> +             value |= NETSEC_MCR_PS;
>> +
>> +     if ((priv->phy_interface != PHY_INTERFACE_MODE_GMII) &&
>> +         (phydev->speed == SPEED_100))
>> +             value |= NETSEC_GMAC_MCR_REG_FES;
>> +
>> +     value |= NETSEC_GMAC_MCR_REG_CST | NETSEC_GMAC_MCR_REG_JE;
>> +
>> +     if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII)
>> +             value |= NETSEC_GMAC_MCR_REG_IBN;
>> +
>> +     if (netsec_mac_write(priv, GMAC_REG_MCR, value))
>> +             return -ETIMEDOUT;
>> +
>> +     priv->actual_link_speed = phydev->speed;
>> +     priv->actual_duplex = phydev->duplex;
>> +     netif_info(priv, drv, priv->ndev, "%s: %uMbps, duplex:%d\n",
>> +                __func__, phydev->speed, phydev->duplex);
>
> phy_print_status()
>
>> +     mac = of_get_mac_address(pdev->dev.of_node);
>> +     if (mac)
>> +             ether_addr_copy(ndev->dev_addr, mac);
>> +
>> +     if (!is_valid_ether_addr(ndev->dev_addr)) {
>> +             eth_hw_addr_random(ndev);
>> +             dev_warn(&pdev->dev, "No MAC address found, using random\n");
>> +     }
>
> So the mac address is optional, unlike what the binding document says.
>
>> +     priv->phy_np = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0);
>> +     if (!priv->phy_np) {
>> +             netif_err(priv, probe, ndev, "missing phy in DT\n");
>
> It is the phy-handle which is missing, not the phy.
>
>> +
>> +     /* MTU range */
>> +     ndev->min_mtu = ETH_MIN_MTU;
>
> No need to set this, it is the default.
>
> Otherwise, this looks good, in terms of phy and mdio.
>
Will fix these.

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ