Skip to contentSkip to conversation

RTL8153-BD is used in Dell DA300 type-C dongle. It should be added to the whitelist of devices to activate MAC address pass through.

PATCH In review David Chen 3 participants 4 messages Feb 18, 2019

Subsystems (4)
lore
Share & tools
lore

David Chen

author
#0 lore raw

PATCH 2/2 RTL8153-BD is used in Dell DA300 type-C dongle. It should be added to the whitelist of devices to activate MAC address pass through.

From: David Chen <[email protected]>

Per confirming with Realtek all devices containing RTL8153-BD should activate MAC pass through and there won't use pass through bit on efuse like in RTL8153-AD.

---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/r8152.c +1 -1
index ada6baf8847a..86c8c64fbb0f 100644
@@ -1179,7 +1179,7 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
 	} else {
 		/* test for RTL8153-BND and RTL8153-BD */
 		ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
-		if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) {
+		if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) {
 			netif_dbg(tp, probe, tp->netdev,
 				  "Invalid variant for MAC pass through\n");
 			return -ENODEV;
#1 lore raw
Quoted 16 lines · David Chen

From: David Chen <[email protected]>

Per confirming with Realtek all devices containing RTL8153-BD should activate MAC pass through and there won't use pass through bit on efuse like in RTL8153-AD.

---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/r8152.c +0 -0
index ada6baf8847a..86c8c64fbb0f 100644

drivers/net/usb/r8152.c static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa) · line 1182

Quoted 5 lines
drivers/net/usb/r8152.c +1 -1
@@ -1179,7 +1179,7 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
 	} else {
 		/* test for RTL8153-BND and RTL8153-BD */
 		ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
-		if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) {
+		if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) {

You are inverting the second half of the test. How can this possibly be right? Had you dropped it, I would understand. But this? Are you sure?

Regards
Oliver

author
#2 lore raw

Hi Oliver,

Thanks for reviewing. I have made some mistake, will correct it and resend.

Thanks and Regards,
-David

Quoted 31 lines

Oliver Neukum <[email protected]> 於 2019年2月18日 下午4:04 寫道:

Quoted 17 lines · David Chen

From: David Chen <[email protected]>

Per confirming with Realtek all devices containing RTL8153-BD should activate MAC pass through and there won't use pass through bit on efuse like in RTL8153-AD.

---
drivers/net/usb/r8152.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/r8152.c +0 -0
index ada6baf8847a..86c8c64fbb0f 100644

drivers/net/usb/r8152.c static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa) · line 1182

Quoted 5 lines
drivers/net/usb/r8152.c +1 -1
@@ -1179,7 +1179,7 @@ static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa)
   } else {
       /* test for RTL8153-BND and RTL8153-BD */
       ocp_data = ocp_read_byte(tp, MCU_TYPE_USB, USB_MISC_1);
-        if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK)) {
+        if ((ocp_data & BND_MASK) == 0 && (ocp_data & BD_MASK) == 0) {

You are inverting the second half of the test. How can this possibly be right? Had you dropped it, I would understand. But this? Are you sure?

Regards
Oliver