diff options
Diffstat (limited to 'target/linux/realtek/files-5.10')
-rw-r--r-- | target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index 8c7813015a..1de420dea1 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -94,8 +94,6 @@ struct notify_b { static void rtl838x_create_tx_header(struct p_hdr *h, int dest_port, int prio) { - prio &= 0x7; - if (dest_port > 0) { // cpu_tag[0] is reserved on the RTL83XX SoCs h->cpu_tag[1] = 0x0401; // BIT 10: RTL8380_CPU_TAG, BIT0: L2LEARNING on @@ -103,16 +101,15 @@ static void rtl838x_create_tx_header(struct p_hdr *h, int dest_port, int prio) h->cpu_tag[3] = 0x0000; h->cpu_tag[4] = BIT(dest_port) >> 16; h->cpu_tag[5] = BIT(dest_port) & 0xffff; - // Set internal priority and AS_PRIO + + /* Set internal priority (PRI) and enable (AS_PRI) */ if (prio >= 0) - h->cpu_tag[2] |= (prio | 0x8) << 12; + h->cpu_tag[2] |= ((prio & 0x7) | BIT(3)) << 12; } } static void rtl839x_create_tx_header(struct p_hdr *h, int dest_port, int prio) { - prio &= 0x7; - if (dest_port > 0) { // cpu_tag[0] is reserved on the RTL83XX SoCs h->cpu_tag[1] = 0x0100; // RTL8390_CPU_TAG marker @@ -128,9 +125,10 @@ static void rtl839x_create_tx_header(struct p_hdr *h, int dest_port, int prio) } h->cpu_tag[2] |= BIT(4); // Enable destination port mask use h->cpu_tag[2] |= BIT(7); // Enable L2 Learning - // Set internal priority and AS_PRIO + + /* Set internal priority (PRI) and enable (AS_PRI) */ if (prio >= 0) - h->cpu_tag[1] |= prio | BIT(3); + h->cpu_tag[2] |= ((prio & 0x7) | BIT(3)) << 8; } } @@ -138,21 +136,21 @@ static void rtl930x_create_tx_header(struct p_hdr *h, int dest_port, int prio) { h->cpu_tag[0] = 0x8000; // CPU tag marker h->cpu_tag[1] = h->cpu_tag[2] = 0; - if (prio >= 0) - h->cpu_tag[2] = BIT(13) | prio << 8; // Enable and set Priority Queue h->cpu_tag[3] = 0; h->cpu_tag[4] = 0; h->cpu_tag[5] = 0; h->cpu_tag[6] = BIT(dest_port) >> 16; h->cpu_tag[7] = BIT(dest_port) & 0xffff; + + /* Enable (AS_QID) and set priority queue (QID) */ + if (prio >= 0) + h->cpu_tag[2] = (BIT(5) | (prio & 0x1f)) << 8; } static void rtl931x_create_tx_header(struct p_hdr *h, int dest_port, int prio) { h->cpu_tag[0] = 0x8000; // CPU tag marker h->cpu_tag[1] = h->cpu_tag[2] = 0; - if (prio >= 0) - h->cpu_tag[2] = BIT(13) | prio << 8; // Enable and set Priority Queue h->cpu_tag[3] = 0; h->cpu_tag[4] = h->cpu_tag[5] = h->cpu_tag[6] = h->cpu_tag[7] = 0; if (dest_port >= 32) { @@ -163,6 +161,10 @@ static void rtl931x_create_tx_header(struct p_hdr *h, int dest_port, int prio) h->cpu_tag[6] = BIT(dest_port) >> 16; h->cpu_tag[7] = BIT(dest_port) & 0xffff; } + + /* Enable (AS_QID) and set priority queue (QID) */ + if (prio >= 0) + h->cpu_tag[2] = (BIT(5) | (prio & 0x1f)) << 8; } static void rtl93xx_header_vlan_set(struct p_hdr *h, int vlan) |