Skip to content

Commit f8ad1f3

Browse files
Vadim Lomovtsevdavem330
authored andcommitted
net: thunderx: move filter register related macro into proper place
The ThunderX NIC has set of registers which allows to configure filter policy for ingress packets. There are three possible regimes of filtering multicasts, broadcasts and unicasts: accept all, reject all and accept filter allowed only. Current implementation has enum with all of them and two generic macro for enabling filtering et all (CAM_ACCEPT) and enabling/disabling broadcast packets, which also should be corrected in order to represent register bits properly. All these values are private for driver and there is no need to ‘publish’ them via header file. This commit is to move filtering register manipulation values from header file into source with explicit assignment of exact register values to them to be used while register configuring. Signed-off-by: Vadim Lomovtsev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5e8b270 commit f8ad1f3

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

drivers/net/ethernet/cavium/thunder/thunder_bgx.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@
2424
#define DRV_NAME "thunder_bgx"
2525
#define DRV_VERSION "1.0"
2626

27+
/* RX_DMAC_CTL configuration */
28+
enum MCAST_MODE {
29+
MCAST_MODE_REJECT = 0x0,
30+
MCAST_MODE_ACCEPT = 0x1,
31+
MCAST_MODE_CAM_FILTER = 0x2,
32+
RSVD = 0x3
33+
};
34+
35+
#define BCAST_ACCEPT BIT(0)
36+
#define CAM_ACCEPT BIT(3)
37+
#define MCAST_MODE_MASK 0x3
38+
#define BGX_MCAST_MODE(x) (x << 1)
39+
2740
struct lmac {
2841
struct bgx *bgx;
2942
int dmac;

drivers/net/ethernet/cavium/thunder/thunder_bgx.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,6 @@
205205
#define LMAC_INTR_LINK_UP BIT(0)
206206
#define LMAC_INTR_LINK_DOWN BIT(1)
207207

208-
/* RX_DMAC_CTL configuration*/
209-
enum MCAST_MODE {
210-
MCAST_MODE_REJECT,
211-
MCAST_MODE_ACCEPT,
212-
MCAST_MODE_CAM_FILTER,
213-
RSVD
214-
};
215-
216-
#define BCAST_ACCEPT 1
217-
#define CAM_ACCEPT 1
218-
219208
void octeon_mdiobus_force_mod_depencency(void);
220209
void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable);
221210
void bgx_add_dmac_addr(u64 dmac, int node, int bgx_idx, int lmac);

0 commit comments

Comments
 (0)