]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
rocker: move rocker and rocker_port structs into header
authorJiri Pirko <jiri@mellanox.com>
Tue, 16 Feb 2016 14:14:44 +0000 (15:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Feb 2016 04:08:34 +0000 (23:08 -0500)
And take some other related thing along. They are going to be pushed
into of-dpa part anyway.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker.h
drivers/net/ethernet/rocker/rocker_main.c

index 23b5e3dfea45b70bc9ad9b2c3b4b5a007357e70b..05c1e1aa20022d9bb7438b1ff59890b48f62271b 100644 (file)
@@ -13,6 +13,8 @@
 #define _ROCKER_H
 
 #include <linux/types.h>
+#include <linux/hashtable.h>
+#include <linux/if_vlan.h>
 
 #include "rocker_hw.h"
 
@@ -24,4 +26,77 @@ struct rocker_desc_info {
        dma_addr_t mapaddr;
 };
 
+struct rocker_dma_ring_info {
+       size_t size;
+       u32 head;
+       u32 tail;
+       struct rocker_desc *desc; /* mapped */
+       dma_addr_t mapaddr;
+       struct rocker_desc_info *desc_info;
+       unsigned int type;
+};
+
+struct rocker;
+
+enum {
+       ROCKER_CTRL_LINK_LOCAL_MCAST,
+       ROCKER_CTRL_LOCAL_ARP,
+       ROCKER_CTRL_IPV4_MCAST,
+       ROCKER_CTRL_IPV6_MCAST,
+       ROCKER_CTRL_DFLT_BRIDGING,
+       ROCKER_CTRL_DFLT_OVS,
+       ROCKER_CTRL_MAX,
+};
+
+#define ROCKER_INTERNAL_VLAN_ID_BASE   0x0f00
+#define ROCKER_N_INTERNAL_VLANS                255
+#define ROCKER_VLAN_BITMAP_LEN         BITS_TO_LONGS(VLAN_N_VID)
+#define ROCKER_INTERNAL_VLAN_BITMAP_LEN        BITS_TO_LONGS(ROCKER_N_INTERNAL_VLANS)
+
+struct rocker_port {
+       struct net_device *dev;
+       struct net_device *bridge_dev;
+       struct rocker *rocker;
+       unsigned int port_number;
+       u32 pport;
+       __be16 internal_vlan_id;
+       int stp_state;
+       u32 brport_flags;
+       unsigned long ageing_time;
+       bool ctrls[ROCKER_CTRL_MAX];
+       unsigned long vlan_bitmap[ROCKER_VLAN_BITMAP_LEN];
+       struct napi_struct napi_tx;
+       struct napi_struct napi_rx;
+       struct rocker_dma_ring_info tx_ring;
+       struct rocker_dma_ring_info rx_ring;
+};
+
+struct rocker {
+       struct pci_dev *pdev;
+       u8 __iomem *hw_addr;
+       struct msix_entry *msix_entries;
+       unsigned int port_count;
+       struct rocker_port **ports;
+       struct {
+               u64 id;
+       } hw;
+       spinlock_t cmd_ring_lock;               /* for cmd ring accesses */
+       struct rocker_dma_ring_info cmd_ring;
+       struct rocker_dma_ring_info event_ring;
+       DECLARE_HASHTABLE(flow_tbl, 16);
+       spinlock_t flow_tbl_lock;               /* for flow tbl accesses */
+       u64 flow_tbl_next_cookie;
+       DECLARE_HASHTABLE(group_tbl, 16);
+       spinlock_t group_tbl_lock;              /* for group tbl accesses */
+       struct timer_list fdb_cleanup_timer;
+       DECLARE_HASHTABLE(fdb_tbl, 16);
+       spinlock_t fdb_tbl_lock;                /* for fdb tbl accesses */
+       unsigned long internal_vlan_bitmap[ROCKER_INTERNAL_VLAN_BITMAP_LEN];
+       DECLARE_HASHTABLE(internal_vlan_tbl, 8);
+       spinlock_t internal_vlan_tbl_lock;      /* for vlan tbl accesses */
+       DECLARE_HASHTABLE(neigh_tbl, 16);
+       spinlock_t neigh_tbl_lock;              /* for neigh tbl accesses */
+       u32 neigh_tbl_next_index;
+};
+
 #endif
index 1a99b358afd03d1bbc792e01c8db2ee442494d49..a67a6c7ae57f9b5e765ce609151c034c2f8e6833 100644 (file)
@@ -179,79 +179,6 @@ struct rocker_neigh_tbl_entry {
        bool ttl_check;
 };
 
-struct rocker_dma_ring_info {
-       size_t size;
-       u32 head;
-       u32 tail;
-       struct rocker_desc *desc; /* mapped */
-       dma_addr_t mapaddr;
-       struct rocker_desc_info *desc_info;
-       unsigned int type;
-};
-
-struct rocker;
-
-enum {
-       ROCKER_CTRL_LINK_LOCAL_MCAST,
-       ROCKER_CTRL_LOCAL_ARP,
-       ROCKER_CTRL_IPV4_MCAST,
-       ROCKER_CTRL_IPV6_MCAST,
-       ROCKER_CTRL_DFLT_BRIDGING,
-       ROCKER_CTRL_DFLT_OVS,
-       ROCKER_CTRL_MAX,
-};
-
-#define ROCKER_INTERNAL_VLAN_ID_BASE   0x0f00
-#define ROCKER_N_INTERNAL_VLANS                255
-#define ROCKER_VLAN_BITMAP_LEN         BITS_TO_LONGS(VLAN_N_VID)
-#define ROCKER_INTERNAL_VLAN_BITMAP_LEN        BITS_TO_LONGS(ROCKER_N_INTERNAL_VLANS)
-
-struct rocker_port {
-       struct net_device *dev;
-       struct net_device *bridge_dev;
-       struct rocker *rocker;
-       unsigned int port_number;
-       u32 pport;
-       __be16 internal_vlan_id;
-       int stp_state;
-       u32 brport_flags;
-       unsigned long ageing_time;
-       bool ctrls[ROCKER_CTRL_MAX];
-       unsigned long vlan_bitmap[ROCKER_VLAN_BITMAP_LEN];
-       struct napi_struct napi_tx;
-       struct napi_struct napi_rx;
-       struct rocker_dma_ring_info tx_ring;
-       struct rocker_dma_ring_info rx_ring;
-};
-
-struct rocker {
-       struct pci_dev *pdev;
-       u8 __iomem *hw_addr;
-       struct msix_entry *msix_entries;
-       unsigned int port_count;
-       struct rocker_port **ports;
-       struct {
-               u64 id;
-       } hw;
-       spinlock_t cmd_ring_lock;               /* for cmd ring accesses */
-       struct rocker_dma_ring_info cmd_ring;
-       struct rocker_dma_ring_info event_ring;
-       DECLARE_HASHTABLE(flow_tbl, 16);
-       spinlock_t flow_tbl_lock;               /* for flow tbl accesses */
-       u64 flow_tbl_next_cookie;
-       DECLARE_HASHTABLE(group_tbl, 16);
-       spinlock_t group_tbl_lock;              /* for group tbl accesses */
-       struct timer_list fdb_cleanup_timer;
-       DECLARE_HASHTABLE(fdb_tbl, 16);
-       spinlock_t fdb_tbl_lock;                /* for fdb tbl accesses */
-       unsigned long internal_vlan_bitmap[ROCKER_INTERNAL_VLAN_BITMAP_LEN];
-       DECLARE_HASHTABLE(internal_vlan_tbl, 8);
-       spinlock_t internal_vlan_tbl_lock;      /* for vlan tbl accesses */
-       DECLARE_HASHTABLE(neigh_tbl, 16);
-       spinlock_t neigh_tbl_lock;              /* for neigh tbl accesses */
-       u32 neigh_tbl_next_index;
-};
-
 static const u8 zero_mac[ETH_ALEN]   = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 static const u8 ff_mac[ETH_ALEN]     = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 static const u8 ll_mac[ETH_ALEN]     = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };