octeontx2-pf: Add support for unicast MAC address filtering
[linux-2.6-microblaze.git] / drivers / net / ethernet / marvell / octeontx2 / nic / otx2_common.h
index 2387c40..f959688 100644 (file)
@@ -229,12 +229,21 @@ struct otx2_ptp {
 
 #define OTX2_HW_TIMESTAMP_LEN  8
 
+struct otx2_mac_table {
+       u8 addr[ETH_ALEN];
+       u16 mcam_entry;
+       bool inuse;
+};
+
 struct otx2_flow_config {
        u16                     entry[NPC_MAX_NONCONTIG_ENTRIES];
        u32                     nr_flows;
 #define OTX2_MAX_NTUPLE_FLOWS  32
-#define OTX2_MCAM_COUNT                OTX2_MAX_NTUPLE_FLOWS
+#define OTX2_MAX_UNICAST_FLOWS 8
+#define OTX2_MCAM_COUNT                (OTX2_MAX_NTUPLE_FLOWS + \
+                                OTX2_MAX_UNICAST_FLOWS)
        u32                     ntuple_offset;
+       u32                     unicast_offset;
        u32                     ntuple_max_flows;
        struct list_head        flow_list;
 };
@@ -251,6 +260,7 @@ struct otx2_nic {
 #define OTX2_FLAG_INTF_DOWN                    BIT_ULL(2)
 #define OTX2_FLAG_MCAM_ENTRIES_ALLOC           BIT_ULL(3)
 #define OTX2_FLAG_NTUPLE_SUPPORT               BIT_ULL(4)
+#define OTX2_FLAG_UCAST_FLTR_SUPPORT           BIT_ULL(5)
 #define OTX2_FLAG_RX_PAUSE_ENABLED             BIT_ULL(9)
 #define OTX2_FLAG_TX_PAUSE_ENABLED             BIT_ULL(10)
        u64                     flags;
@@ -279,6 +289,7 @@ struct otx2_nic {
        struct refill_work      *refill_wrk;
        struct workqueue_struct *otx2_wq;
        struct work_struct      rx_mode_work;
+       struct otx2_mac_table   *mac_table;
 
        /* Ethtool stuff */
        u32                     msg_enable;
@@ -674,5 +685,7 @@ int otx2_add_flow(struct otx2_nic *pfvf,
 int otx2_remove_flow(struct otx2_nic *pfvf, u32 location);
 int otx2_prepare_flow_request(struct ethtool_rx_flow_spec *fsp,
                              struct npc_install_flow_req *req);
+int otx2_del_macfilter(struct net_device *netdev, const u8 *mac);
+int otx2_add_macfilter(struct net_device *netdev, const u8 *mac);
 
 #endif /* OTX2_COMMON_H */