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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHPKR9KmDSgC9EstJLfhqY9SB462OSJhQCEPS7Ka=VvnqbH6iQ@mail.gmail.com>
Date:	Fri, 30 May 2014 18:35:43 +0530
From:	Balakumaran Kannan <kumaran.4353@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	Steve Glendinning <steve.glendinning@...well.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/1] driver: net: smsc911x: set NOCARRIER flag in driver initialization

Hi David,

On Fri, May 30, 2014 at 3:58 AM, David Miller <davem@...emloft.net> wrote:
> From: Balakumaran Kannan <kumaran.4353@...il.com>
> Date: Sun, 25 May 2014 00:24:46 +0530
>
>> @@ -2525,6 +2525,8 @@ static int smsc911x_drv_probe(struct platform_device *pdev)
>>
>>       netdev_info(dev, "MAC Address: %pM\n", dev->dev_addr);
>>
>> +     netif_carrier_off(dev);
>> +
>>       return 0;
>>
>
> You should do this before the network device is registered.
IMHO calling netif_carrier_off after registering device will not
affect functionality. Because,

    * Device starts carrier detection once driver's open function
calls phy_start.
    * Kernel starts network layer initialization only after __dev_open
function sets IFF_UP bit of dev->flags.
    And __dev_open sets this bit only after driver's open function returns.
    * So we could place netif_carrier_off call anywhere before
phy_start in driver's open function gets called.

Also I have referred some other drivers.

    * Intel i40e driver calls netif_carrier_off at the beginning of
driver's open (i40e_open) function.
    * e1000 driver places netif_carrier_off at the end of driver probe
(e1000_probe) function.
    * realtek r8169 driver calls netif_carrier_off at the end of
driver init (rtl_init_one) function.

All these drivers call netif_carrier_off function after registering
the network device using register_netdev.

This explanation is based on my understanding. Please explain to me if
I'm wrong or I miss something. In such case I'll modify the patch
accordingly.

Thank you.

Regards,
K.Balakumaran
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ