Re: [PATCH net-next 2/3] net: phy: mscc: split the driver into separate files

From: Antoine Tenart
Date: Tue Mar 10 2020 - 10:39:51 EST


Hello Andrew,

Quoting Andrew Lunn (2020-03-10 14:24:02)
> On Tue, Mar 10, 2020 at 10:07:19AM +0100, Antoine Tenart wrote:
> > +++ b/drivers/net/phy/mscc/mscc.h
> > @@ -0,0 +1,451 @@
> > +/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
> > +/*
> > + * Driver for Microsemi VSC85xx PHYs
> > + *
> > + * Copyright (c) 2016 Microsemi Corporation
> > + */
> > +
> > +#ifndef _MSCC_PHY_H_
> > +#define _MSCC_PHY_H_
> > +
> > +#if IS_ENABLED(CONFIG_MACSEC)
> > +#include <net/macsec.h>
> > +#include "mscc_macsec.h"
> > +#endif
>
> > +#if IS_ENABLED(CONFIG_MACSEC)
> > +struct macsec_flow {
> > + struct list_head list;
> > + enum mscc_macsec_destination_ports port;
> > + enum macsec_bank bank;
> > + u32 index;
> > + int assoc_num;
> > + bool has_transformation;
> > +
> > + /* Highest takes precedence [0..15] */
> > + u8 priority;
> > +
> > + u8 key[MACSEC_KEYID_LEN];
> > +
> > + union {
> > + struct macsec_rx_sa *rx_sa;
> > + struct macsec_tx_sa *tx_sa;
> > + };
> > +
> > + /* Matching */
> > + struct {
> > + u8 sci:1;
> > + u8 tagged:1;
> > + u8 untagged:1;
> > + u8 etype:1;
> > + } match;
> > +
> > + u16 etype;
> > +
> > + /* Action */
> > + struct {
> > + u8 bypass:1;
> > + u8 drop:1;
> > + } action;
> > +
> > +};
> > +#endif
>
> Could some of this be moved into mscc_macsec.h? It would reduce the
> number of #ifdefs.

You're right, will do in v2.

Do you also want the '#if IS_ENABLED(MACSEC)' to be in the mscc_macsec.h
file, for the whole file, or do I keep its inclusion conditional here?

Thanks!
Antoine

--
Antoine TÃnart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com