Skip to content

Commit

Permalink
octeon: Add Cavium Octeon driver support
Browse files Browse the repository at this point in the history
  • Loading branch information
carlgsmith committed Oct 5, 2020
1 parent dc57832 commit 0075fac
Show file tree
Hide file tree
Showing 4 changed files with 535 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LINUX/configure
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ subsys enable ptnetmap

# available drivers
driver_avail="r8169.c virtio_net.c forcedeth.c veth.c \
e1000 e1000e igb ixgbe ixgbevf i40e vmxnet3 mlx5"
e1000 e1000e igb ixgbe ixgbevf i40e vmxnet3 mlx5 octeon"
# enabled drivers (bitfield)
driver=
drv()
Expand Down
3 changes: 3 additions & 0 deletions LINUX/default-config.mak.in_
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,6 @@ virtio_net.c@force := 1
endef

$(foreach d,$(filter virtio_net.c,$(E_DRIVERS)),$(eval $(call virtio_net)))

octeon@src := cp -Rp @KSRC@/source/drivers/staging/octeon octeon
octeon@conf := CONFIG_OCTEON_ETHERNET
37 changes: 37 additions & 0 deletions LINUX/final-patches/vanilla--octeon--40406--99999
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index c6344edfa6f4..006fbbd4e7aa 100644
--- a/octeon/ethernet.c
+++ b/octeon/ethernet.c
@@ -128,6 +128,10 @@ static DECLARE_DELAYED_WORK(cvm_oct_rx_refill_work, cvm_oct_rx_refill_worker);
extern int __cvmx_helper_set_phy_mode(int interface, int index);
#endif

+#if defined(CONFIG_NETMAP) || defined(CONFIG_NETMAP_MODULE)
+#include <octeon_netmap.h>
+#endif
+
static void cvm_oct_rx_refill_worker(struct work_struct *work)
{
/
@@ -1100,6 +1104,10 @@ static int cvm_oct_probe(struct platform_device *pdev)
queue_delayed_work(cvm_oct_poll_queue,
&priv->port_periodic_work, HZ);
}
+
+#ifdef CONFIG_NETMAP
+ octeon_netmap_attach(priv);
+#endif /* DEV_NETMAP */
}
}

@@ -1145,6 +1153,10 @@ static int cvm_oct_remove(struct platform_device *pdev)
struct net_device *dev = cvm_oct_device[port];
struct octeon_ethernet *priv = netdev_priv(dev);

+#ifdef CONFIG_NETMAP
+ octeon_netmap_detach(priv);
+#endif /* DEV_NETMAP */
+
cancel_delayed_work_sync(&priv->port_periodic_work);

cvm_oct_tx_shutdown_dev(dev);
Loading

0 comments on commit 0075fac

Please sign in to comment.