Skip to contentSkip to conversation

r8152: split the source code

PATCH New Hayes Wang 3 participants 20 messages May 22, 2020 – Jul 26, 2021

Subsystems (3)
lore
Share & tools
lore

Hayes Wang

author
#0 lore raw

cover r8152: split the source code

The r8152.c is too large to find out the desired part, so I speparate it into r8152_main.c and r8152_fw.c.

Hayes Wang (2):
r8152: group the usb ethernet of realtek
r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

 MAINTAINERS                                   |   10 +-
 drivers/net/usb/Kconfig                       |   30 +-
 drivers/net/usb/Makefile                      |    4 +-
 drivers/net/usb/realtek/Kconfig               |   33 +
 drivers/net/usb/realtek/Makefile              |    9 +
 drivers/net/usb/realtek/r8152_basic.h         |  860 ++++++
 drivers/net/usb/realtek/r8152_fw.c            | 1557 ++++++++++
 .../net/usb/{r8152.c => realtek/r8152_main.c} | 2585 +----------------
 drivers/net/usb/{ => realtek}/r8153_ecm.c     |    0
 drivers/net/usb/{ => realtek}/rtl8150.c       |    0
 10 files changed, 2576 insertions(+), 2512 deletions(-)
 create mode 100644 drivers/net/usb/realtek/Kconfig
 create mode 100644 drivers/net/usb/realtek/Makefile
 create mode 100644 drivers/net/usb/realtek/r8152_basic.h
 create mode 100644 drivers/net/usb/realtek/r8152_fw.c
 rename drivers/net/usb/{r8152.c => realtek/r8152_main.c} (75%)
 rename drivers/net/usb/{ => realtek}/r8153_ecm.c (100%)
 rename drivers/net/usb/{ => realtek}/rtl8150.c (100%)
Signature · 1 line
2.26.3
author
#1 lore raw

PATCH 1/2 r8152: group the usb ethernet of realtek

These are minor corrections for r8152 driver.

Hayes Wang (2):
eth/r8152: fix assigning the wrong endpoint
eth/r8152: fix typo in register name

 drivers/usb/eth/r8152.c | 22 ++++++++++++----------
 drivers/usb/eth/r8152.h |  4 ++--
 2 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
2.21.1
author
#2 lore raw

PATCH 2/2 r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

In reply to Hayes Wang

Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out.

---
 drivers/usb/eth/r8152.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/usb/eth/r8152.c +8 -6
index 61b8683230..7c48663370 100644
@@ -1354,9 +1354,8 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 	struct usb_interface *iface;
 	struct usb_interface_descriptor *iface_desc;
 	int ep_in_found = 0, ep_out_found = 0;
-	int i;
-
 	struct r8152 *tp;
+	int i;
 
 	/* let's examine the device now */
 	iface = &dev->config.if_desc[ifnum];
@@ -1399,10 +1398,13 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 		if ((iface->ep_desc[i].bmAttributes &
 		     USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
 			u8 ep_addr = iface->ep_desc[i].bEndpointAddress;
-			if ((ep_addr & USB_DIR_IN) && !ep_in_found) {
-				ss->ep_in = ep_addr &
-					USB_ENDPOINT_NUMBER_MASK;
-				ep_in_found = 1;
+
+			if (ep_addr & USB_DIR_IN) {
+				if (!ep_in_found) {
+					ss->ep_in = ep_addr &
+						USB_ENDPOINT_NUMBER_MASK;
+					ep_in_found = 1;
+				}
 			} else {
 				if (!ep_out_found) {
 					ss->ep_out = ep_addr &
Signature · 1 line
2.21.1
#3 lore raw

PATCH 1/2 eth/r8152: fix assigning the wrong endpoint

Quoted 28 lines · Hayes Wang

Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out.

---
 drivers/usb/eth/r8152.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/usb/eth/r8152.c +1 -3
index 61b8683230..7c48663370 100644
@@ -1354,9 +1354,8 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 	struct usb_interface *iface;
 	struct usb_interface_descriptor *iface_desc;
 	int ep_in_found = 0, ep_out_found = 0;
-	int i;
-
 	struct r8152 *tp;
+	int i;
 
 	/* let's examine the device now */
 	iface = &dev->config.if_desc[ifnum];
@@ -1399,10 +1398,13 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 		if ((iface->ep_desc[i].bmAttributes &
 		     USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
 			u8 ep_addr = iface->ep_desc[i].bEndpointAddress;
-			if ((ep_addr & USB_DIR_IN) && !ep_in_found) {

drivers/usb/eth/r8152.c int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum, · line 1407

Quoted 10 lines
drivers/usb/eth/r8152.c +7 -3
-				ss->ep_in = ep_addr &
-					USB_ENDPOINT_NUMBER_MASK;
-				ep_in_found = 1;
+
+			if (ep_addr & USB_DIR_IN) {
+				if (!ep_in_found) {
+					ss->ep_in = ep_addr &
+						USB_ENDPOINT_NUMBER_MASK;
+					ep_in_found = 1;
+				}

So why don't you rework the code this way instead, to make it easier to understand:

if ((ep_addr & USB_DIR_IN) && !ep_in_found) {
... do in stuff ...
}

if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {
... do out stuff ...
}

Would that work ?

author
#4 lore raw

PATCH 1/2 eth/r8152: fix assigning the wrong endpoint

Marek Vasut [mailto:marex at denx.de]

Quoted 1 line

Sent: Friday, May 22, 2020 9:22 PM

[...]

Quoted 6 lines
Quoted 6 lines
drivers/usb/eth/r8152.c +2 -4
-			if ((ep_addr & USB_DIR_IN) && !ep_in_found) {
-				ss->ep_in = ep_addr &
-					USB_ENDPOINT_NUMBER_MASK;
-				ep_in_found = 1;
+
+			if (ep_addr & USB_DIR_IN) {
Quoted 8 lines

drivers/usb/eth/r8152.c int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum, · line 1407

Quoted 5 lines
drivers/usb/eth/r8152.c +5 -0
+				if (!ep_in_found) {
+					ss->ep_in = ep_addr &
+						USB_ENDPOINT_NUMBER_MASK;
+					ep_in_found = 1;
+				}

So why don't you rework the code this way instead, to make it easier to understand:

Ok, I'll do it and resend this patch. Thanks.

Quoted 9 lines

if ((ep_addr & USB_DIR_IN) && !ep_in_found) {
... do in stuff ...
}

if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {
... do out stuff ...
}

Would that work ?

Yes.

Best Regards,
Hayes

author
#5 lore raw

cover r8152: split the source code

In reply to Hayes Wang

The PAL_BDC_CR should be PLA_BDC_CR.

---
 drivers/usb/eth/r8152.c | 8 ++++----
 drivers/usb/eth/r8152.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/usb/eth/r8152.c +4 -4
index 7c48663370..f201a1789b 100644
@@ -711,9 +711,9 @@ static void r8152b_enter_oob(struct r8152 *tp)
 
 	rtl_rx_vlan_en(tp, false);
 
-	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
+	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
 	ocp_data |= ALDPS_PROXY_MODE;
-	ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
+	ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
 
 	ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 	ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
@@ -844,9 +844,9 @@ static void r8153_enter_oob(struct r8152 *tp)
 
 	rtl_rx_vlan_en(tp, false);
 
-	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
+	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
 	ocp_data |= ALDPS_PROXY_MODE;
-	ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
+	ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
 
 	ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 	ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
drivers/usb/eth/r8152.h +2 -2
index 09f1c6178b..c7f62b8b3e 100644
@@ -22,7 +22,7 @@
 #define PLA_TEREDO_CFG		0xc0bc
 #define PLA_MAR			0xcd00
 #define PLA_BACKUP		0xd000
-#define PAL_BDC_CR		0xd1a0
+#define PLA_BDC_CR		0xd1a0
 #define PLA_TEREDO_TIMER	0xd2cc
 #define PLA_REALWOW_TIMER	0xd2e8
 #define PLA_LEDSEL		0xdd90
@@ -225,7 +225,7 @@
 #define TEREDO_RS_EVENT_MASK	0x00fe
 #define OOB_TEREDO_EN		0x0001
 
-/* PAL_BDC_CR */
+/* PLA_BDC_CR */
 #define ALDPS_PROXY_MODE	0x0001
 
 /* PLA_CONFIG34 */
Signature · 1 line
2.21.1
Applied
#6 lore raw

PATCH 2/2 eth/r8152: fix typo in register name

Quoted 7 lines · Hayes Wang

The PAL_BDC_CR should be PLA_BDC_CR.

---
 drivers/usb/eth/r8152.c | 8 ++++----
 drivers/usb/eth/r8152.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

Applied, thanks. Take a look at 1/2 and resend it if applicable.

author
#7 lore raw

PATCH RESEND 1/2 r8152: group the usb ethernet of realtek

In reply to Hayes Wang

v2:
Reword the patch #1 to make it easier to understand.

v1:
These are minor corrections for r8152 driver.

Hayes Wang (2):
eth/r8152: fix assigning the wrong endpoint
eth/r8152: fix typo in register name

 drivers/usb/eth/r8152.c | 22 ++++++++++++----------
 drivers/usb/eth/r8152.h |  4 ++--
 2 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
2.21.1
author
#8 lore raw

PATCH v2 2/2 eth/r8152: fix typo in register name

The PAL_BDC_CR should be PLA_BDC_CR.

---
 drivers/usb/eth/r8152.c | 8 ++++----
 drivers/usb/eth/r8152.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/usb/eth/r8152.c +4 -4
index 9f7bc7986d..cef79cab49 100644
@@ -711,9 +711,9 @@ static void r8152b_enter_oob(struct r8152 *tp)
 
 	rtl_rx_vlan_en(tp, false);
 
-	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
+	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
 	ocp_data |= ALDPS_PROXY_MODE;
-	ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
+	ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
 
 	ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 	ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
@@ -844,9 +844,9 @@ static void r8153_enter_oob(struct r8152 *tp)
 
 	rtl_rx_vlan_en(tp, false);
 
-	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PAL_BDC_CR);
+	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_BDC_CR);
 	ocp_data |= ALDPS_PROXY_MODE;
-	ocp_write_word(tp, MCU_TYPE_PLA, PAL_BDC_CR, ocp_data);
+	ocp_write_word(tp, MCU_TYPE_PLA, PLA_BDC_CR, ocp_data);
 
 	ocp_data = ocp_read_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL);
 	ocp_data |= NOW_IS_OOB | DIS_MCU_CLROOB;
drivers/usb/eth/r8152.h +2 -2
index 09f1c6178b..c7f62b8b3e 100644
@@ -22,7 +22,7 @@
 #define PLA_TEREDO_CFG		0xc0bc
 #define PLA_MAR			0xcd00
 #define PLA_BACKUP		0xd000
-#define PAL_BDC_CR		0xd1a0
+#define PLA_BDC_CR		0xd1a0
 #define PLA_TEREDO_TIMER	0xd2cc
 #define PLA_REALWOW_TIMER	0xd2e8
 #define PLA_LEDSEL		0xdd90
@@ -225,7 +225,7 @@
 #define TEREDO_RS_EVENT_MASK	0x00fe
 #define OOB_TEREDO_EN		0x0001
 
-/* PAL_BDC_CR */
+/* PLA_BDC_CR */
 #define ALDPS_PROXY_MODE	0x0001
 
 /* PLA_CONFIG34 */
Signature · 1 line
2.21.1
author
#9 lore raw

PATCH RESEND 2/2 r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

In reply to Hayes Wang

Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out.

---
 drivers/usb/eth/r8152.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/usb/eth/r8152.c +6 -8
index 61b8683230..9f7bc7986d 100644
@@ -1354,9 +1354,8 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 	struct usb_interface *iface;
 	struct usb_interface_descriptor *iface_desc;
 	int ep_in_found = 0, ep_out_found = 0;
-	int i;
-
 	struct r8152 *tp;
+	int i;
 
 	/* let's examine the device now */
 	iface = &dev->config.if_desc[ifnum];
@@ -1399,16 +1398,15 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 		if ((iface->ep_desc[i].bmAttributes &
 		     USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
 			u8 ep_addr = iface->ep_desc[i].bEndpointAddress;
+
 			if ((ep_addr & USB_DIR_IN) && !ep_in_found) {
 				ss->ep_in = ep_addr &
 					USB_ENDPOINT_NUMBER_MASK;
 				ep_in_found = 1;
-			} else {
-				if (!ep_out_found) {
-					ss->ep_out = ep_addr &
-						USB_ENDPOINT_NUMBER_MASK;
-					ep_out_found = 1;
-				}
+			} else if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {
+				ss->ep_out = ep_addr &
+					USB_ENDPOINT_NUMBER_MASK;
+				ep_out_found = 1;
 			}
 		}
 
Signature · 1 line
2.21.1
#10 lore raw

PATCH v2 1/2 eth/r8152: fix assigning the wrong endpoint

Quoted 29 lines · Hayes Wang

Although I think it never occurs, the code doesn't make sense, because it may allow to assign an IN endpoint to ss->ep_out.

---
 drivers/usb/eth/r8152.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/usb/eth/r8152.c +2 -2
index 61b8683230..9f7bc7986d 100644
@@ -1354,9 +1354,8 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 	struct usb_interface *iface;
 	struct usb_interface_descriptor *iface_desc;
 	int ep_in_found = 0, ep_out_found = 0;
-	int i;
-
 	struct r8152 *tp;
+	int i;
 
 	/* let's examine the device now */
 	iface = &dev->config.if_desc[ifnum];
@@ -1399,16 +1398,15 @@ int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum,
 		if ((iface->ep_desc[i].bmAttributes &
 		     USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
 			u8 ep_addr = iface->ep_desc[i].bEndpointAddress;
+
 			if ((ep_addr & USB_DIR_IN) && !ep_in_found) {

drivers/usb/eth/r8152.c int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum, · line 1406

Quoted 10 lines
drivers/usb/eth/r8152.c +1 -6
 				ss->ep_in = ep_addr &
 					USB_ENDPOINT_NUMBER_MASK;
 				ep_in_found = 1;
-			} else {
-				if (!ep_out_found) {
-					ss->ep_out = ep_addr &
-						USB_ENDPOINT_NUMBER_MASK;
-					ep_out_found = 1;
-				}
+			} else if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {

Sorry, I was wrong in my previous suggestion, the USB_DIR_OUT macro is expanded to 0, so this patch cannot work. 2/2 is already upstream. Do you have a chance to test these patches before sending them ?

author
#11 lore raw

PATCH v2 1/2 eth/r8152: fix assigning the wrong endpoint

Marek Vasut [mailto:marex at denx.de]

Quoted 1 line

Sent: Monday, May 25, 2020 8:03 PM

[...]

				ep_out_found = 1;
Quoted 7 lines

drivers/usb/eth/r8152.c int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum, · line 1406

Quoted 2 lines
drivers/usb/eth/r8152.c +1 -1
-				}
+			} else if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {

Sorry, I was wrong in my previous suggestion, the USB_DIR_OUT macro is expanded to 0, so this patch cannot work. 2/2 is already upstream. Do you have a chance to test these patches before sending them ?

Excuse me. I test v1 only.
Do I have to resend v1 for patch #1?

Best Regards,
Hayes

#12 lore raw

PATCH v2 1/2 eth/r8152: fix assigning the wrong endpoint

Quoted 12 lines · Hayes Wang

Marek Vasut [mailto:marex at denx.de]

Quoted 1 line

Sent: Monday, May 25, 2020 8:03 PM

[...]

				ep_out_found = 1;
Quoted 7 lines

drivers/usb/eth/r8152.c int r8152_eth_probe(struct usb_device *dev, unsigned int ifnum, · line 1406

Quoted 2 lines
drivers/usb/eth/r8152.c +1 -1
-				}
+			} else if ((ep_addr & USB_DIR_OUT) && !ep_out_found) {

Sorry, I was wrong in my previous suggestion, the USB_DIR_OUT macro is expanded to 0, so this patch cannot work. 2/2 is already upstream. Do you have a chance to test these patches before sending them ?

Quoted 2 lines

Excuse me. I test v1 only.
Do I have to resend v1 for patch #1?

I'll pick V1, no worries.

author
#13 lore raw

PATCH v2 1/2 eth/r8152: fix assigning the wrong endpoint

Marek Vasut [mailto:marex at denx.de]

Quoted 1 line

Sent: Monday, May 25, 2020 9:01 PM

[...]

Quoted 4 lines
Quoted 2 lines

Excuse me. I test v1 only.
Do I have to resend v1 for patch #1?

I'll pick V1, no worries.

Thanks.

Best Regards,
Hayes

maintainer
#14 lore raw

Re: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

In reply to Hayes Wang
Quoted 4 lines · Hayes Wang

Rename r8152.c with r8152_main.c. Move some basic definitions from r8152_main.c to r8152_basic.h. Move the relative code of firmware from r8152_main.c to r8152_fw.c. Rename the definition of "EFUSE" with "USB_EFUSE".

That is a lot of different things all happening in one commit, why?

Please break this up into "one patch per change" and submit it that way.

But the real question is why break this file up in the first place? What is wrong with the way it is today? What future changes require this file to be in smaller pieces? If none, why make this? If there are future changes, then please submit this change when you submit those, as that would show a real need.

thanks,

greg k-h

author
#15 lore raw

RE: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

Greg KH <[email protected]>

Quoted 1 line

Sent: Monday, July 26, 2021 3:37 PM

[...]

Quoted 1 line

That is a lot of different things all happening in one commit, why?

I plan to separate the file into two files. And I find I need an additional header file for it, so The patch includes adding that header file.

Quoted 7 lines

Please break this up into "one patch per change" and submit it that way.

But the real question is why break this file up in the first place? What is wrong with the way it is today? What future changes require this file to be in smaller pieces? If none, why make this? If there are future changes, then please submit this change when you submit those, as that would show a real need.

The purpose is let me easy to maintain the driver. The code is larger and larger. And I find that the r8169.c has been separated into three files. Therefore, I think maybe I could split the driver into small parts like r8169. Then, the code wouldn't be complex.

Should I abandon these patches?

Best Regards,
Hayes

maintainer
#16 lore raw

Re: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

Quoted 8 lines · Hayes Wang

Greg KH <[email protected]>

Quoted 1 line

Sent: Monday, July 26, 2021 3:37 PM

[...]

Quoted 1 line

That is a lot of different things all happening in one commit, why?

I plan to separate the file into two files. And I find I need an additional header file for it, so The patch includes adding that header file.

You also do other things, like renaming defines, which is not just moving code around, right?

Quoted 8 lines
Quoted 7 lines

Please break this up into "one patch per change" and submit it that way.

But the real question is why break this file up in the first place? What is wrong with the way it is today? What future changes require this file to be in smaller pieces? If none, why make this? If there are future changes, then please submit this change when you submit those, as that would show a real need.

Quoted 6 lines

The purpose is let me easy to maintain the driver. The code is larger and larger. And I find that the r8169.c has been separated into three files. Therefore, I think maybe I could split the driver into small parts like r8169. Then, the code wouldn't be complex.

I do not know, is it really easier to find things in 3 different files instead of one? That's up to you, but you did not say why this change is needed.

thanks,

greg k-h

author
#17 lore raw

RE: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

Greg KH <[email protected]>

Quoted 1 line

Sent: Monday, July 26, 2021 4:37 PM

[...]

Quoted 2 lines

You also do other things, like renaming defines, which is not just moving code around, right?

Yes. You are right.

[...]

Quoted 3 lines

I do not know, is it really easier to find things in 3 different files instead of one? That's up to you, but you did not say why this change is needed.

We support a new chip or feature with a test driver. The test driver is similar with the upstream driver, except the method of the firmware. After we confirm that the test driver work fine, we compare the differences with the upstream driver and submit patches. And the code about firmware takes us more time to find out the differences. Therefore, I wish to move the part of the firmware out.

I don't sure if it is acceptable for such patches. If it is unacceptable, I would abandon these patches.

Best Regards,
Hayes

maintainer
#18 lore raw

Re: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

Quoted 7 lines · Hayes Wang

Greg KH <[email protected]>

Quoted 1 line

Sent: Monday, July 26, 2021 4:37 PM

[...]

Quoted 2 lines

You also do other things, like renaming defines, which is not just moving code around, right?

Yes. You are right.

So resend the series and only do "one thing per patch" please.

Quoted 5 lines

[...]

Quoted 3 lines

I do not know, is it really easier to find things in 3 different files instead of one? That's up to you, but you did not say why this change is needed.

Quoted 8 lines

We support a new chip or feature with a test driver. The test driver is similar with the upstream driver, except the method of the firmware. After we confirm that the test driver work fine, we compare the differences with the upstream driver and submit patches. And the code about firmware takes us more time to find out the differences. Therefore, I wish to move the part of the firmware out.

Great, then submit the broken up driver as part of a patchset that adds new device support, as that makes more sense when that happens, right?

thanks,

greg k-h

author
#19 lore raw

RE: [PATCH net-next RESEND 2/2] r8152: separate the r8152.c into r8152_main.c and r8152_fw.c

Greg KH <[email protected]>

Quoted 1 line

Sent: Monday, July 26, 2021 7:14 PM

[...]

Quoted 11 lines
Quoted 8 lines

We support a new chip or feature with a test driver. The test driver is similar with the upstream driver, except the method of the firmware. After we confirm that the test driver work fine, we compare the differences with the upstream driver and submit patches. And the code about firmware takes us more time to find out the differences. Therefore, I wish to move the part of the firmware out.

Great, then submit the broken up driver as part of a patchset that adds new device support, as that makes more sense when that happens, right?

I got it. I will submit them with the support of new device in the future.

Best Regards,
Hayes