Re: [PATCHv4] net: dsa: add SMSC/Microchip LAN9303 three port ethernet switch driver

From: David Miller
Date: Wed Apr 12 2017 - 13:15:27 EST


From: David Miller <davem@xxxxxxxxxxxxx>
Date: Wed, 12 Apr 2017 12:04:46 -0400 (EDT)

> From: Juergen Borleis <jbe@xxxxxxxxxxxxxx>
> Date: Wed, 12 Apr 2017 16:02:14 +0200
>
>> The LAN9303 is a three port 10/100 ethernet switch with integrated phys
>> for the two external ethernet ports. The third port is an RMII/MII
>> interface to a host master network interface (e.g. fixed link).
>>
>> While the LAN9303 device itself supports offload packet processing, this
>> driver does not make use of it yet. This driver just configures the device
>> to provide two separate network interfaces (which is the default state of
>> a DSA device).
>>
>> Please note: the "MDIO managed mode" driver part isn't tested yet. I have
>> used and tested the "I2C managed mode" only.
>
> Series applied, thank you.

Actually, this doesn't even build. Please fix this and resubmit.

Thank you.

In file included from net/dsa/tag_lan9303.c:17:0:
net/dsa/dsa_priv.h:52:16: warning: ʽstruct dsa_switchʼ declared inside parameter list
struct dsa_port *dport, int port);
^
net/dsa/dsa_priv.h:52:16: warning: its scope is only this definition or declaration, which is probably not what you want
net/dsa/dsa_priv.h:55:39: warning: ʽstruct dsa_switchʼ declared inside parameter list
int dsa_cpu_port_ethtool_setup(struct dsa_switch *ds);
^
net/dsa/dsa_priv.h:56:42: warning: ʽstruct dsa_switchʼ declared inside parameter list
void dsa_cpu_port_ethtool_restore(struct dsa_switch *ds);
^
net/dsa/dsa_priv.h:60:36: warning: ʽstruct dsa_switchʼ declared inside parameter list
void dsa_slave_mii_bus_init(struct dsa_switch *ds);
^
net/dsa/dsa_priv.h:63:8: warning: ʽstruct dsa_switchʼ declared inside parameter list
int port, const char *name);
^
net/dsa/dsa_priv.h:71:41: warning: ʽstruct dsa_switchʼ declared inside parameter list
int dsa_switch_register_notifier(struct dsa_switch *ds);
^
net/dsa/dsa_priv.h:72:44: warning: ʽstruct dsa_switchʼ declared inside parameter list
void dsa_switch_unregister_notifier(struct dsa_switch *ds);
^
In file included from ./include/linux/swab.h:4:0,
from ./include/uapi/linux/byteorder/little_endian.h:12,
from ./include/linux/byteorder/little_endian.h:4,
from ./arch/x86/include/uapi/asm/byteorder.h:4,
from ./include/asm-generic/bitops/le.h:5,
from ./arch/x86/include/asm/bitops.h:517,
from ./include/linux/bitops.h:36,
from ./include/linux/kernel.h:10,
from ./include/linux/skbuff.h:17,
from ./include/linux/if_ether.h:23,
from ./include/linux/etherdevice.h:25,
from net/dsa/tag_lan9303.c:14:
net/dsa/tag_lan9303.c: In function ʽlan9303_xmitʼ:
net/dsa/tag_lan9303.c:65:30: error: dereferencing pointer to incomplete type ʽstruct dsa_portʼ
lan9303_tag[1] = htons(p->dp->index | BIT(4));
^
./include/uapi/linux/swab.h:100:54: note: in definition of macro ʽ__swab16ʼ
#define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
^
./include/linux/byteorder/generic.h:134:21: note: in expansion of macro ʽ__cpu_to_be16ʼ
#define ___htons(x) __cpu_to_be16(x)
^
./include/linux/byteorder/generic.h:140:18: note: in expansion of macro ʽ___htonsʼ
#define htons(x) ___htons(x)
^
net/dsa/tag_lan9303.c:65:19: note: in expansion of macro ʽhtonsʼ
lan9303_tag[1] = htons(p->dp->index | BIT(4));
^
net/dsa/tag_lan9303.c: In function ʽlan9303_rcvʼ:
net/dsa/tag_lan9303.c:86:10: error: dereferencing pointer to incomplete type ʽstruct dsa_switch_treeʼ
ds = dst->ds[0];
^
net/dsa/tag_lan9303.c:119:9: error: dereferencing pointer to incomplete type ʽstruct dsa_switchʼ
if (!ds->ports[source_port].netdev) {
^
scripts/Makefile.build:294: recipe for target 'net/dsa/tag_lan9303.o' failed