Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: rpjday@crashcourse.ca
Cc: netdev@vger.kernel.org
Subject: Re: should __LINK_STATE_* enums really be restricted to generic queueing layer?
Date: Fri, 24 Aug 2018 15:49:17 +0200	[thread overview]
Message-ID: <20180824134917.GB1999@lunn.ch> (raw)
In-Reply-To: <20180824071738.Horde.kWZLgt1409E2fICBH1FiM5U@crashcourse.ca>

On Fri, Aug 24, 2018 at 07:17:38AM -0400, rpjday@crashcourse.ca wrote:
>   more curious pedantry ... in netdevice.h, one reads:
> 
>   /* These flag bits are private to the generic network queueing
>    * layer; they may not be explicitly referenced by any other
>    * code.
>    */
> 
>   enum netdev_state_t {
>         __LINK_STATE_START,
>         __LINK_STATE_PRESENT,
>         __LINK_STATE_NOCARRIER,
>         __LINK_STATE_LINKWATCH_PENDING,
>         __LINK_STATE_DORMANT,
>   };
> 
> ok, but there are definitely a few examples of what look like
> non-generic network queueing code referencing those enums.
> 
>   one example, drivers/net/ethernet/amd/sun3lance.c, which openly
> (and amusingly) admits that it shouldn't be doing this:
> 
>         dev->netdev_ops = &lance_netdev_ops;
>   //      KLUDGE -- REMOVE ME
>         set_bit(__LINK_STATE_PRESENT, &dev->state);
>         return 1;
>   }
> 
> there are a few more places (admittedly, not many) -- is this
> acceptable behaviour?

Not in a new driver.

The sun3lance is a very old driver. I have misty memories of a Sun
3/60. There is nothing in this code about a driving a PHY. Maybe using
netif_carrier_on() would work, but without having access to the
hardware to test, i would just leave it alone.

       Andrew

      reply	other threads:[~2018-08-24 17:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 11:17 should __LINK_STATE_* enums really be restricted to generic queueing layer? rpjday
2018-08-24 13:49 ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180824134917.GB1999@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=netdev@vger.kernel.org \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox