Skip to content

Commit 171a9ba

Browse files
Matthew Wilcox (Oracle)davem330
authored andcommitted
staging/octeon: Allow test build on !MIPS
Add compile test support by moving all includes of files under asm/octeon into octeon-ethernet.h, and if we're not on MIPS, stub out all the calls into the octeon support code in octeon-stubs.h Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c51ab06 commit 171a9ba

File tree

14 files changed

+1466
-78
lines changed

14 files changed

+1466
-78
lines changed

drivers/staging/octeon/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
config OCTEON_ETHERNET
33
tristate "Cavium Networks Octeon Ethernet support"
4-
depends on CAVIUM_OCTEON_SOC && NETDEVICES
4+
depends on CAVIUM_OCTEON_SOC && NETDEVICES || COMPILE_TEST
55
select PHYLIB
66
select MDIO_OCTEON
77
help

drivers/staging/octeon/ethernet-defines.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#ifndef __ETHERNET_DEFINES_H__
2222
#define __ETHERNET_DEFINES_H__
2323

24-
#include <asm/octeon/cvmx-config.h>
25-
2624
#ifdef CONFIG_NETFILTER
2725
#define REUSE_SKBUFFS_WITHOUT_FREE 0
2826
#else

drivers/staging/octeon/ethernet-mdio.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
#include <generated/utsrelease.h>
1414
#include <net/dst.h>
1515

16-
#include <asm/octeon/octeon.h>
17-
18-
#include "ethernet-defines.h"
1916
#include "octeon-ethernet.h"
17+
#include "ethernet-defines.h"
2018
#include "ethernet-mdio.h"
2119
#include "ethernet-util.h"
2220

23-
#include <asm/octeon/cvmx-gmxx-defs.h>
24-
2521
static void cvm_oct_get_drvinfo(struct net_device *dev,
2622
struct ethtool_drvinfo *info)
2723
{

drivers/staging/octeon/ethernet-mem.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,10 @@
99
#include <linux/netdevice.h>
1010
#include <linux/slab.h>
1111

12-
#include <asm/octeon/octeon.h>
13-
12+
#include "octeon-ethernet.h"
1413
#include "ethernet-mem.h"
1514
#include "ethernet-defines.h"
1615

17-
#include <asm/octeon/cvmx-fpa.h>
18-
1916
/**
2017
* cvm_oct_fill_hw_skbuff - fill the supplied hardware pool with skbuffs
2118
* @pool: Pool to allocate an skbuff for

drivers/staging/octeon/ethernet-rgmii.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@
1212
#include <linux/ratelimit.h>
1313
#include <net/dst.h>
1414

15-
#include <asm/octeon/octeon.h>
16-
17-
#include "ethernet-defines.h"
1815
#include "octeon-ethernet.h"
16+
#include "ethernet-defines.h"
1917
#include "ethernet-util.h"
2018
#include "ethernet-mdio.h"
2119

22-
#include <asm/octeon/cvmx-helper.h>
23-
24-
#include <asm/octeon/cvmx-ipd-defs.h>
25-
#include <asm/octeon/cvmx-npi-defs.h>
26-
#include <asm/octeon/cvmx-gmxx-defs.h>
27-
2820
static DEFINE_SPINLOCK(global_register_lock);
2921

3022
static void cvm_oct_set_hw_preamble(struct octeon_ethernet *priv, bool enable)

drivers/staging/octeon/ethernet-rx.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,12 @@
2323
#include <net/xfrm.h>
2424
#endif /* CONFIG_XFRM */
2525

26-
#include <asm/octeon/octeon.h>
27-
26+
#include "octeon-ethernet.h"
2827
#include "ethernet-defines.h"
2928
#include "ethernet-mem.h"
3029
#include "ethernet-rx.h"
31-
#include "octeon-ethernet.h"
3230
#include "ethernet-util.h"
3331

34-
#include <asm/octeon/cvmx-helper.h>
35-
#include <asm/octeon/cvmx-wqe.h>
36-
#include <asm/octeon/cvmx-fau.h>
37-
#include <asm/octeon/cvmx-pow.h>
38-
#include <asm/octeon/cvmx-pip.h>
39-
#include <asm/octeon/cvmx-scratch.h>
40-
41-
#include <asm/octeon/cvmx-gmxx-defs.h>
42-
4332
static atomic_t oct_rx_ready = ATOMIC_INIT(0);
4433

4534
static struct oct_rx_group {

drivers/staging/octeon/ethernet-rx.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* Copyright (c) 2003-2007 Cavium Networks
66
*/
77

8-
#include <asm/octeon/cvmx-fau.h>
9-
108
void cvm_oct_poll_controller(struct net_device *dev);
119
void cvm_oct_rx_initialize(void);
1210
void cvm_oct_rx_shutdown(void);

drivers/staging/octeon/ethernet-sgmii.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,11 @@
1111
#include <linux/ratelimit.h>
1212
#include <net/dst.h>
1313

14-
#include <asm/octeon/octeon.h>
15-
16-
#include "ethernet-defines.h"
1714
#include "octeon-ethernet.h"
15+
#include "ethernet-defines.h"
1816
#include "ethernet-util.h"
1917
#include "ethernet-mdio.h"
2018

21-
#include <asm/octeon/cvmx-helper.h>
22-
23-
#include <asm/octeon/cvmx-gmxx-defs.h>
24-
2519
int cvm_oct_sgmii_open(struct net_device *dev)
2620
{
2721
return cvm_oct_common_open(dev, cvm_oct_link_poll);

drivers/staging/octeon/ethernet-spi.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@
1010
#include <linux/interrupt.h>
1111
#include <net/dst.h>
1212

13-
#include <asm/octeon/octeon.h>
14-
15-
#include "ethernet-defines.h"
1613
#include "octeon-ethernet.h"
14+
#include "ethernet-defines.h"
1715
#include "ethernet-util.h"
1816

19-
#include <asm/octeon/cvmx-spi.h>
20-
21-
#include <asm/octeon/cvmx-npi-defs.h>
22-
#include <asm/octeon/cvmx-spxx-defs.h>
23-
#include <asm/octeon/cvmx-stxx-defs.h>
24-
2517
static int number_spi_ports;
2618
static int need_retrain[2] = { 0, 0 };
2719

drivers/staging/octeon/ethernet-tx.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,11 @@
2222
#include <linux/atomic.h>
2323
#include <net/sch_generic.h>
2424

25-
#include <asm/octeon/octeon.h>
26-
27-
#include "ethernet-defines.h"
2825
#include "octeon-ethernet.h"
26+
#include "ethernet-defines.h"
2927
#include "ethernet-tx.h"
3028
#include "ethernet-util.h"
3129

32-
#include <asm/octeon/cvmx-wqe.h>
33-
#include <asm/octeon/cvmx-fau.h>
34-
#include <asm/octeon/cvmx-pip.h>
35-
#include <asm/octeon/cvmx-pko.h>
36-
#include <asm/octeon/cvmx-helper.h>
37-
38-
#include <asm/octeon/cvmx-gmxx-defs.h>
39-
4030
#define CVM_OCT_SKB_CB(skb) ((u64 *)((skb)->cb))
4131

4232
/*

0 commit comments

Comments
 (0)