Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: libwx: cleanup VF register macros

Adjust the order of VF regitser macros, make it elegant.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Link: https://patch.msgid.link/778899EE1D862EC2+20250812093725.58821-1-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jiawen Wu and committed by
Jakub Kicinski
30f7d409 a5738411

+35 -37
+35 -37
drivers/net/ethernet/wangxun/libwx/wx_vf.h
··· 4 4 #ifndef _WX_VF_H_ 5 5 #define _WX_VF_H_ 6 6 7 + /* Control registers */ 7 8 #define WX_VF_MAX_RING_NUMS 8 8 9 #define WX_VX_PF_BME 0x4B8 9 10 #define WX_VF_BME_ENABLE BIT(0) ··· 13 12 #define WX_VXCTRL_RST BIT(0) 14 13 15 14 #define WX_VXMRQC 0x78 15 + #define WX_VXMRQC_PSR_L4HDR BIT(0) 16 + #define WX_VXMRQC_PSR_L3HDR BIT(1) 17 + #define WX_VXMRQC_PSR_L2HDR BIT(2) 18 + #define WX_VXMRQC_PSR_TUNHDR BIT(3) 19 + #define WX_VXMRQC_PSR_TUNMAC BIT(4) 20 + #define WX_VXMRQC_PSR_MASK GENMASK(5, 1) 21 + #define WX_VXMRQC_PSR(f) FIELD_PREP(GENMASK(5, 1), f) 22 + #define WX_VXMRQC_RSS_HASH(f) FIELD_PREP(GENMASK(15, 13), f) 23 + #define WX_VXMRQC_RSS_MASK GENMASK(31, 16) 24 + #define WX_VXMRQC_RSS(f) FIELD_PREP(GENMASK(31, 16), f) 25 + #define WX_VXMRQC_RSS_ALG_IPV4_TCP BIT(0) 26 + #define WX_VXMRQC_RSS_ALG_IPV4 BIT(1) 27 + #define WX_VXMRQC_RSS_ALG_IPV6 BIT(4) 28 + #define WX_VXMRQC_RSS_ALG_IPV6_TCP BIT(5) 29 + #define WX_VXMRQC_RSS_EN BIT(8) 30 + 31 + #define WX_VXRSSRK(i) (0x80 + ((i) * 4)) /* i=[0,9] */ 32 + #define WX_VXRETA(i) (0xC0 + ((i) * 4)) /* i=[0,15] */ 33 + 34 + /* Interrupt registers */ 16 35 #define WX_VXICR 0x100 17 36 #define WX_VXIMS 0x108 18 37 #define WX_VXIMC 0x10C 19 38 #define WX_VF_IRQ_CLEAR_MASK 7 20 39 #define WX_VF_MAX_TX_QUEUES 4 21 40 #define WX_VF_MAX_RX_QUEUES 4 22 - #define WX_VXTXDCTL(r) (0x3010 + (0x40 * (r))) 23 - #define WX_VXRXDCTL(r) (0x1010 + (0x40 * (r))) 24 - #define WX_VXRXDCTL_ENABLE BIT(0) 25 - #define WX_VXTXDCTL_FLUSH BIT(26) 26 41 27 42 #define WX_VXITR(i) (0x200 + (4 * (i))) /* i=[0,1] */ 28 43 #define WX_VXITR_MASK GENMASK(8, 0) 29 44 #define WX_VXITR_CNT_WDIS BIT(31) 30 45 #define WX_VXIVAR_MISC 0x260 31 46 #define WX_VXIVAR(i) (0x240 + (4 * (i))) /* i=[0,3] */ 32 - 33 - #define WX_VXRXDCTL_RSCMAX(f) FIELD_PREP(GENMASK(24, 23), f) 34 - #define WX_VXRXDCTL_BUFLEN(f) FIELD_PREP(GENMASK(6, 1), f) 35 - #define WX_VXRXDCTL_BUFSZ(f) FIELD_PREP(GENMASK(11, 8), f) 36 - #define WX_VXRXDCTL_HDRSZ(f) FIELD_PREP(GENMASK(15, 12), f) 37 - 38 - #define WX_VXRXDCTL_RSCMAX_MASK GENMASK(24, 23) 39 - #define WX_VXRXDCTL_BUFLEN_MASK GENMASK(6, 1) 40 - #define WX_VXRXDCTL_BUFSZ_MASK GENMASK(11, 8) 41 - #define WX_VXRXDCTL_HDRSZ_MASK GENMASK(15, 12) 42 47 43 48 #define wx_conf_size(v, mwidth, uwidth) ({ \ 44 49 typeof(v) _v = (v); \ ··· 66 59 #define WX_VXRDBAH(r) (0x1004 + (0x40 * (r))) 67 60 #define WX_VXRDT(r) (0x1008 + (0x40 * (r))) 68 61 #define WX_VXRDH(r) (0x100C + (0x40 * (r))) 69 - 62 + #define WX_VXRXDCTL(r) (0x1010 + (0x40 * (r))) 63 + #define WX_VXRXDCTL_ENABLE BIT(0) 64 + #define WX_VXRXDCTL_BUFLEN_MASK GENMASK(6, 1) 65 + #define WX_VXRXDCTL_BUFLEN(f) FIELD_PREP(GENMASK(6, 1), f) 66 + #define WX_VXRXDCTL_BUFSZ_MASK GENMASK(11, 8) 67 + #define WX_VXRXDCTL_BUFSZ(f) FIELD_PREP(GENMASK(11, 8), f) 68 + #define WX_VXRXDCTL_HDRSZ_MASK GENMASK(15, 12) 69 + #define WX_VXRXDCTL_HDRSZ(f) FIELD_PREP(GENMASK(15, 12), f) 70 + #define WX_VXRXDCTL_RSCMAX_MASK GENMASK(24, 23) 71 + #define WX_VXRXDCTL_RSCMAX(f) FIELD_PREP(GENMASK(24, 23), f) 70 72 #define WX_VXRXDCTL_RSCEN BIT(29) 71 73 #define WX_VXRXDCTL_DROP BIT(30) 72 74 #define WX_VXRXDCTL_VLAN BIT(31) 73 75 76 + /* Transimit Path */ 74 77 #define WX_VXTDBAL(r) (0x3000 + (0x40 * (r))) 75 78 #define WX_VXTDBAH(r) (0x3004 + (0x40 * (r))) 76 79 #define WX_VXTDT(r) (0x3008 + (0x40 * (r))) 77 80 #define WX_VXTDH(r) (0x300C + (0x40 * (r))) 78 - 81 + #define WX_VXTXDCTL(r) (0x3010 + (0x40 * (r))) 79 82 #define WX_VXTXDCTL_ENABLE BIT(0) 80 83 #define WX_VXTXDCTL_BUFLEN(f) FIELD_PREP(GENMASK(6, 1), f) 81 84 #define WX_VXTXDCTL_PTHRESH(f) FIELD_PREP(GENMASK(11, 8), f) 82 85 #define WX_VXTXDCTL_WTHRESH(f) FIELD_PREP(GENMASK(22, 16), f) 83 - 84 - #define WX_VXMRQC_PSR(f) FIELD_PREP(GENMASK(5, 1), f) 85 - #define WX_VXMRQC_PSR_MASK GENMASK(5, 1) 86 - #define WX_VXMRQC_PSR_L4HDR BIT(0) 87 - #define WX_VXMRQC_PSR_L3HDR BIT(1) 88 - #define WX_VXMRQC_PSR_L2HDR BIT(2) 89 - #define WX_VXMRQC_PSR_TUNHDR BIT(3) 90 - #define WX_VXMRQC_PSR_TUNMAC BIT(4) 91 - 92 - #define WX_VXRSSRK(i) (0x80 + ((i) * 4)) /* i=[0,9] */ 93 - #define WX_VXRETA(i) (0xC0 + ((i) * 4)) /* i=[0,15] */ 94 - 95 - #define WX_VXMRQC_RSS(f) FIELD_PREP(GENMASK(31, 16), f) 96 - #define WX_VXMRQC_RSS_MASK GENMASK(31, 16) 97 - #define WX_VXMRQC_RSS_ALG_IPV4_TCP BIT(0) 98 - #define WX_VXMRQC_RSS_ALG_IPV4 BIT(1) 99 - #define WX_VXMRQC_RSS_ALG_IPV6 BIT(4) 100 - #define WX_VXMRQC_RSS_ALG_IPV6_TCP BIT(5) 101 - #define WX_VXMRQC_RSS_EN BIT(8) 102 - #define WX_VXMRQC_RSS_HASH(f) FIELD_PREP(GENMASK(15, 13), f) 86 + #define WX_VXTXDCTL_FLUSH BIT(26) 103 87 104 88 #define WX_PFLINK_STATUS(g) FIELD_GET(BIT(0), g) 105 89 #define WX_PFLINK_SPEED(g) FIELD_GET(GENMASK(31, 1), g) 106 - #define WX_VXSTATUS_SPEED(g) FIELD_GET(GENMASK(4, 1), g) 90 + #define WX_VXSTATUS_SPEED(g) FIELD_GET(GENMASK(4, 1), g) 107 91 108 92 struct wx_link_reg_fields { 109 93 u32 mac_type;