nfp: allow converting representor's netdev into nfp_port
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 27 Jun 2017 07:50:23 +0000 (00:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jun 2017 19:48:48 +0000 (15:48 -0400)
commit39ae7eb69db3a3daa3aa2f6c66e37dba1975ef00
treeaa3e13945b9ca10db383d33b8942a647058160e1
parent5d7c64a70fa15aef903469b05ca664f7cd17d769
nfp: allow converting representor's netdev into nfp_port

Based on struct net_device_ops figure out if netdev is a nfp_repr.
Use this knowledge to convert netdev directly to nfp_port.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
drivers/net/ethernet/netronome/nfp/nfp_net_repr.h
drivers/net/ethernet/netronome/nfp/nfp_port.c