[PATCH v2 3/3] net/usb/r8152: adjust relative ocp function

2013-07-25 Thread Hayes Wang
- fix the conversion between cpu and __le32 - replace some pla_ocp and usb_ocp functions with generic_ocp function Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 66 + 1 file changed, 23 insertions(+), 43 deletions

[PATCH v2 2/3] net/usb/r8152: make sure the USB buffer is DMA-able

2013-07-25 Thread Hayes Wang
Allocate the required memory before calling usb_control_msg. And the additional memory copy is necessary. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 60 - 1 file changed, 35 insertions(+), 25 deletions(-) diff

[PATCH v2 1/3] net/usb/r815x: replace USB buffer from stack to DMA-able

2013-07-25 Thread Hayes Wang
Some USB buffers use stack which may not be DMA-able. Use the buffers from kmalloc to replace those one. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r815x.c | 44 +++- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git

[PATCH v3 1/3] net/usb/r815x: replace USB buffer from stack to DMA-able

2013-07-30 Thread Hayes Wang
Allocate the transfer buffer in probe(), and use the buffer for usb control transfer. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r815x.c | 117 +--- 1 file changed, 90 insertions(+), 27 deletions(-) diff --git a/drivers/net

[PATCH v3 3/3] net/usb/r8152: adjust relative ocp function

2013-07-30 Thread Hayes Wang
- fix the conversion between cpu and __le32 - replace some pla_ocp and usb_ocp functions with generic_ocp function Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 66 + 1 file changed, 23 insertions(+), 43 deletions

[PATCH v3 2/3] net/usb/r8152: replace USB buffer from stack to DMA-able

2013-07-30 Thread Hayes Wang
Allocate the required transfer buffer for usb_control_msg. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 91 +++-- 1 file changed, 66 insertions(+), 25 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH v4 3/5] net/usb/r815x: change the return value for bind functions

2013-07-31 Thread Hayes Wang
Replace 0 with the result from usbnet_cdc_bind(). Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r815x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r815x.c b/drivers/net/usb/r815x.c index 1a80e76..2df2f4f 100644 --- a/drivers/net

[PATCH v4 2/5] net/usb/r815x: avoid to call mdio functions for runtime-suspended device

2013-07-31 Thread Hayes Wang
Don't replace the usb_control_msg() with usbnet_{read,write}_cmd() which couldn't be called inside suspend/resume callback. Keep the basic functions unlimited. Instead, using usb_autopm_get_interface() and usb_autopm_put_interface() in r815x_mdio_{read,write}(). Signed-off-by: Hayes Wang hayesw

[PATCH v4 1/5] net/usb/r815x: replace USB buffer from stack to DMA-able

2013-07-31 Thread Hayes Wang
Some USB buffers use stack which may not be DMA-able. Use the buffers from kmalloc to replace those one. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r815x.c | 44 +++- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git

[PATCH net-next 2/3] net/usb/r8152: enable tx checksum

2013-08-13 Thread Hayes Wang
Enable tx checksum. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 63 + 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c6c5aa2..5d9d949 100644

[PATCH net-next 3/3] net/usb/r8152: enable interrupt transfer

2013-08-13 Thread Hayes Wang
Use the interrupt transfer to replace polling link status. Delay to update the link down status, because some of them result from the change of speed. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 134 ++-- 1 file

[PATCH net-next v2 2/3] net/usb/r8152: enable tx checksum

2013-08-14 Thread Hayes Wang
Enable tx checksum. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 64 + 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index abb0b9f..4d938a7 100644

[PATCH net-next v2 3/3] net/usb/r8152: enable interrupt transfer

2013-08-14 Thread Hayes Wang
Use the interrupt transfer to replace polling link status. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 140 ++-- 1 file changed, 113 insertions(+), 27 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net

[PATCH net-next v2 1/3] net/usb/r8152: support aggregation

2013-08-14 Thread Hayes Wang
aligned. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 647 1 file changed, 486 insertions(+), 161 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 11c51f2..abb0b9f 100644

[PATCH net-next 1/7] r8152: remove clearing the memory to zero for netdev priv

2013-08-16 Thread Hayes Wang
Remove memset(tp, 0, sizeof(*tp)); Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ef2498c..c13662b 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb

[PATCH net-next 3/7] r8152: replace lockflags with flags

2013-08-16 Thread Hayes Wang
Replace lockflags with flags. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index a18f02d

[PATCH net-next 4/7] r8152: adjust some duplicated code

2013-08-16 Thread Hayes Wang
- Use r8152_get_tx_agg for getting tx agg list - Replace submit rx with goto submit Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 55 + 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/drivers/net/usb

[PATCH net-next 2/7] r8152: replace void * with struct r8152 *

2013-08-16 Thread Hayes Wang
Change the type of contex of tx_agg and rx_agg from void * to staruc r8152 *. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c13662b

[PATCH net-next 7/7] r8152: add comments

2013-08-16 Thread Hayes Wang
Add comments. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 825edfe..f3fce41 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -790,6

[PATCH net-next 5/7] r8152: move some declearation of variables

2013-08-16 Thread Hayes Wang
Move some declearation of variables in rx_bottom(). Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 4dee76b

[PATCH 5/5] net/usb/r8152: code adjust

2013-10-28 Thread Hayes Wang
-Remove rtl8152_get_stats() -Fix the wrong name -Something else Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 46 +- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers

[PATCH 4/5] net/usb/r8152: fix incorrect type in assignment

2013-10-28 Thread Hayes Wang
Correct some declaration. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index a711025..90bc105 100644 --- a/drivers/net/usb/r8152

[PATCH 3/5] net/usb/r8152: modify the tx flow

2013-10-28 Thread Hayes Wang
Let rtl8152_start_xmit() to queue packet only, and tx_bottom() would send all of the packets. This simplify the code and make sure all the packet would be sent by the original order. Support stopping and waking tx queue. The maximum tx queue length is 60. Signed-off-by: Hayes Wang hayesw

[PATCH 2/5] net/usb/r8152: make sure the tx checksum setting is correct

2013-10-28 Thread Hayes Wang
Clear the checksum setting before checking the necessary of hardware checksum. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 5dbfe50..815d890 100644

[PATCH 1/5] net/usb/r8152: fix tx/rx memory overflow

2013-10-28 Thread Hayes Wang
The tx/rx would access the memory which is out of the desired range. Modify the method of checking the end of the memory to avoid it. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions

[PATCH 0/5] r8152 bug fixes

2013-10-28 Thread Hayes Wang
These could fix some driver issues. Hayes Wang (5): net/usb/r8152: fix tx/rx memory overflow net/usb/r8152: make sure the tx checksum setting is correct net/usb/r8152: modify the tx flow net/usb/r8152: fix incorrect type in assignment net/usb/r8152: code adjust drivers/net/usb/r8152.c

[PATCH net 1/3] r8152: fix tx/rx memory overflow

2013-10-29 Thread Hayes Wang
The tx/rx would access the memory which is out of the desired range. Modify the method of checking the end of the memory to avoid it. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions

[PATCH net 3/3] r8152: fix incorrect type in assignment

2013-10-29 Thread Hayes Wang
Correct some declaration. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 1647931..b92b7f4 100644 --- a/drivers/net/usb/r8152

[PATCH net 0/3] r8152 bug fixes

2013-10-29 Thread Hayes Wang
These could fix some driver issues. Hayes Wang (3): r8152: fix tx/rx memory overflow r8152: modify the tx flow r8152: fix incorrect type in assignment drivers/net/usb/r8152.c | 100 +--- 1 file changed, 36 insertions(+), 64 deletions

[PATCH net 2/3] r8152: modify the tx flow

2013-10-29 Thread Hayes Wang
Let rtl8152_start_xmit() to queue packet only, and tx_bottom() would send all of the packets. This simplify the code and make sure all the packet would be sent by the original order. Support stopping and waking tx queue. The maximum tx queue length is 60. Signed-off-by: Hayes Wang hayesw

[PATCH net v2 3/3] r8152: fix incorrect type in assignment

2013-10-30 Thread Hayes Wang
The data from the hardware should be little endian. Correct the declaration. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net v2 2/3] r8152: modify the tx flow

2013-10-30 Thread Hayes Wang
Remove the code for sending the packet in the rtl8152_start_xmit(). Let rtl8152_start_xmit() to queue the packet only, and schedule a tasklet to send the queued packets. This simplify the code and make sure all the packet would be sent by the original order. Signed-off-by: Hayes Wang hayesw

[PATCH net v2 1/3] r8152: fix tx/rx memory overflow

2013-10-30 Thread Hayes Wang
parts. First, check the descriptor is in the memory. The other, using the descriptor to find out the packet length and check if the packet is in the memory. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 30 +- 1 file changed, 17 insertions

[PATCH net v3 3/4] r8152: support stopping/waking tx queue

2013-11-14 Thread Hayes Wang
is filled in a available tx buffer. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 763234d..81a4171 100644 --- a/drivers/net/usb/r8152.c +++ b

[PATCH net v3 1/4] r8152: fix tx/rx memory overflow

2013-11-15 Thread Hayes Wang
to two parts. First, check the descriptor is in the memory. The other, using the descriptor to find out the packet length and check if the packet is in the memory. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 30 +- 1 file changed, 17

[PATCH net v3 4/4] r8152: fix incorrect type in assignment

2013-11-15 Thread Hayes Wang
The data from the hardware should be little endian. Correct the declaration. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net v3 2/4] r8152: modify the tx flow

2013-11-15 Thread Hayes Wang
Remove the code for sending the packet in the rtl8152_start_xmit(). Let rtl8152_start_xmit() to queue the packet only, and schedule a tasklet to send the queued packets. This simplify the code and make sure all the packet would be sent by the original order. Signed-off-by: Hayes Wang hayesw

[PATCH net-next] net/usb: new driver for RTL8152

2013-04-26 Thread Hayes Wang
Add new driver for supporting Realtek RTL8152 Based USB 2.0 Ethernet Adapters Signed-off-by: Hayes Wang hayesw...@realtek.com Cc: Realtek linux nic maintainers nic_s...@realtek.com --- drivers/net/usb/Kconfig | 11 + drivers/net/usb/Makefile|1 + drivers/net/usb/cdc_ether.c | 10

[PATCH net] r8152: fix the submission of the interrupt transfer

2014-02-05 Thread Hayes Wang
The submission of the interrupt transfer should be done after setting the bit of WORK_ENABLE, otherwise the callback function would have the opportunity to be returned directly. Clear the bit of WORK_ENABLE before killing the interrupt transfer. Signed-off-by: Hayes Wang hayesw...@realtek.com

[PATCH net-next 14/14] r8152: support get_msglevel and set_msglevel

2014-02-18 Thread Hayes Wang
Support get_msglevel and set_msglevel. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index db98842..0654bd3 100644 --- a/drivers/net/usb/r8152.c

[PATCH net-next 07/14] r8152: combine PHY reset with set_speed

2014-02-18 Thread Hayes Wang
PHY reset is necessary after some hw settings. However, it would cause the linking down, and so does the set_speed function. Combine the PHY reset with set_speed function. That could reduce the frequency of linking down and accessing the PHY register. Signed-off-by: Hayes Wang hayesw

[PATCH net-next 13/14] r8152: set disable_hub_initiated_lpm

2014-02-18 Thread Hayes Wang
Set disable_hub_initiated_lpm = 1. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ff02d5d..db98842 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb

[PATCH net-next 12/14] r8152: replace netif_rx with netif_receive_skb

2014-02-18 Thread Hayes Wang
Replace netif_rx with netif_receive_skb to avoid disabling irq frequently for increasing the efficiency. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152

[PATCH net-next 08/14] r8152: move some functions from probe to open

2014-02-18 Thread Hayes Wang
Add up method for rtl_ops and asign relative functions. Move clear_bp() and hw_phy_cfg() from init method to up method of rtl_ops. Call rtl_ops.up() for ndo_open() and rtl_ops.down for ndo_stop(). Replace allocating the memory in probe() with in ndo_open(). Signed-off-by: Hayes Wang hayesw

[PATCH net-next 03/14] r8152: replace some types from int to bool

2014-02-18 Thread Hayes Wang
Modify the following functions. - r8153_u1u2en - r8153_u2p3en - r8153_power_cut_en Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net-next 11/14] r8152: disable teredo for RTL8152

2014-02-18 Thread Hayes Wang
Disable teredo for RTL8152 by default. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index f303549..3ff11ed 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net

[PATCH net-next 10/14] r8152: support runtime suspend

2014-02-18 Thread Hayes Wang
Support runtime suspend for RTL8152 and RTL8153. Move tx_bottom() from tasklet to delayed_work. That avoids to transmit tx packets after calling autosuspend. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 181 ++-- 1

[PATCH net-next 06/14] r8152: clear BMCR_PDOWN

2014-02-18 Thread Hayes Wang
Modify the method of enabling the PHY to clear BMCR_PDOWN only. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2a778fa

[PATCH net-next 09/14] r8152: support WOL

2014-02-18 Thread Hayes Wang
Support WOL for RTL8152 and RTL8153. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 118 ++-- 1 file changed, 105 insertions(+), 13 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net-next 04/14] r8152: load the default MAC address

2014-02-18 Thread Hayes Wang
PLA_IDR for RTL_VER_01. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 4888e4f..3847c35 100644 --- a/drivers/net/usb/r8152.c

[PATCH net-next 00/14] r8152: improvement and new features

2014-02-18 Thread Hayes Wang
Change some flows or behavior to improve the efficiency or make the code readable. Besides, support WOL and runtime suspend. Hayes Wang (14): r8152: move some functions r8152: add three functions r8152: replace some types from int to bool r8152: load the default MAC address r8152

[PATCH net-next 01/14] r8152: move some functions

2014-02-18 Thread Hayes Wang
Move the following functions which is for the further coding. - rtl_clear_bp - r8153_clear_bp - r8153_teredo_off - r8152b_disable_aldps - r8152b_enable_aldps - r8152b_hw_phy_cfg Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 106

[PATCH net-next 12/12] r8152: modify the tx timeout funcfion

2014-03-04 Thread Hayes Wang
Reset and reinitialize the device when the tx timeout occurs. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 41 +++-- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net-next 10/12] r8152: reduce the numbers of the bulks

2014-03-04 Thread Hayes Wang
Reduce the numbers of tx and rx aggregation buffers. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 72cbab1..b60b3bc 100644 --- a/drivers

[PATCH net-next 11/12] r8152: add additional parameter for non x86 platform

2014-03-04 Thread Hayes Wang
Add additional parameter for non x86 platform for better throughput. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index b60b3bc..e04fcbd

[PATCH net-next 09/12] r8152: support IPv6

2014-03-04 Thread Hayes Wang
Support hw IPv6 checksum for TCP and UDP packets. Note that the hw has the limitation of the range of the transport offset. Besides, the TCP Pseudo Header of the IPv6 TSO of the hw bases on the Microsoft document which excludes the packet length. Signed-off-by: Hayes Wang hayesw...@realtek.com

[PATCH net-next 06/12] r8152: up the priority of the transmission

2014-03-04 Thread Hayes Wang
move the tx_bottom() from delayed_work to tasklet. It makes the rx and tx balanced. If the device is in runtime suspend when getting the tx packet, wakeup the device before trasmitting. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 45

[PATCH net-next 05/12] r8152: check tx agg list before spin lock

2014-03-04 Thread Hayes Wang
Check tx agg list before spin lock to avoid doing spin lock every times. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8ecb41b..00b3192 100644

[PATCH net-next 07/12] r8152: support rx checksum

2014-03-04 Thread Hayes Wang
Support hw rx checksum for TCP and UDP packets. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 53 ++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c

[PATCH net-next 08/12] r8152: support TSO

2014-03-04 Thread Hayes Wang
Support scatter gather and TSO. Adjust the tx checksum function and set the max gso size to fix the size of the tx aggregation buffer. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 133 +--- 1 file changed, 103

[PATCH net-next 02/12] r8152: replace tp-netdev with netdev

2014-03-04 Thread Hayes Wang
Replace some tp-netdev with netdev. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c8bad62..151398b 100644 --- a/drivers/net/usb/r8152

[PATCH net-next 04/12] r8152: replace spin_lock_irqsave and spin_unlock_irqrestore

2014-03-04 Thread Hayes Wang
Use spin_lock and spin_unlock in interrupt context. The ndo_start_xmit would not be called in interrupt context, so replace the relative spin_lock_irqsave and spin_unlock_irqrestore with spin_lock_bh and spin_unlock_bh. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c

[PATCH net-next 03/12] r8152: remove rtl8152_get_stats

2014-03-04 Thread Hayes Wang
The rtl8152_get_stats() returns the point address of the struct net_device_stats. This could be got from struct net_device directly. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff

[PATCH net-next 00/12] r8152: new features

2014-03-04 Thread Hayes Wang
Besides the adjustment of the code, support rx checksum, TCP large send, and IPv6. Hayes Wang (12): r8152: deal with the empty line and space r8152: replace tp-netdev with netdev r8152: remove rtl8152_get_stats r8152: replace spin_lock_irqsave and spin_unlock_irqrestore r8152: check tx

[PATCH net-next 01/12] r8152: deal with the empty line and space

2014-03-04 Thread Hayes Wang
Add or remove some empty lines. Replace the spaces with the tabs. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0654bd3..c8bad62

[PATCH net] r8152: disable the ECM mode

2014-03-04 Thread Hayes Wang
the ECM driver. Thus, disable the ECM mode driver, and let r8152 to set the configuration to vendor mode and reset the device automatically. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/Makefile| 2 +- drivers/net/usb/cdc_ether.c | 7 ++ drivers/net/usb/r8152.c

[PATCH net-next v2 01/13] r8152: deal with the empty line and space

2014-03-04 Thread Hayes Wang
Add or remove some empty lines. Replace the spaces with the tabs. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0654bd3..c8bad62

[PATCH net-next v2 13/13] r8152: modify the tx timeout funcfion

2014-03-04 Thread Hayes Wang
Reset and reinitialize the device when the tx timeout occurs. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 41 +++-- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb

[PATCH net-next v2 09/13] r8152: support TSO

2014-03-04 Thread Hayes Wang
Support scatter gather and TSO. Adjust the tx checksum function and set the max gso size to fix the size of the tx aggregation buffer. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 117 +++- 1 file changed, 87

[PATCH net-next v2 10/13] r8152: support IPv6

2014-03-04 Thread Hayes Wang
Support hw IPv6 checksum for TCP and UDP packets. Note that the hw has the limitation of the range of the transport offset. Besides, the TCP Pseudo Header of the IPv6 TSO of the hw bases on the Microsoft document which excludes the packet length. Signed-off-by: Hayes Wang hayesw...@realtek.com

[PATCH net-next v2 12/13] r8152: add additional parameter for non x86 platform

2014-03-04 Thread Hayes Wang
Add additional parameter for non x86 platform for better throughput. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index ddb5200..6c0ec37

[PATCH net-next v2 08/13] r8152: support rx checksum

2014-03-04 Thread Hayes Wang
Support hw rx checksum for TCP and UDP packets. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 41 +++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net-next v2 11/13] r8152: reduce the numbers of the bulks

2014-03-04 Thread Hayes Wang
Reduce the numbers of tx and rx aggregation buffers. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8e208f30..ddb5200 100644 --- a/drivers

[PATCH net-next v2 07/13] r8152: calculate the dropped packets for rx

2014-03-04 Thread Hayes Wang
Continue dealing with the remain rx packets, even though the allocation of the skb fail. This could calculate the correct dropped packets. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net

[PATCH net-next v2 06/13] r8152: up the priority of the transmission

2014-03-04 Thread Hayes Wang
move the tx_bottom() from delayed_work to tasklet. It makes the rx and tx balanced. If the device is in runtime suspend when getting the tx packet, wakeup the device before trasmitting. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 45

[PATCH net-next v2 02/13] r8152: replace tp-netdev with netdev

2014-03-04 Thread Hayes Wang
Replace some tp-netdev with netdev. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c8bad62..151398b 100644 --- a/drivers/net/usb/r8152

[PATCH net-next v2 03/13] r8152: remove rtl8152_get_stats

2014-03-04 Thread Hayes Wang
The rtl8152_get_stats() returns the point address of the struct net_device_stats. This could be got from struct net_device directly. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff

[PATCH net-next v2 04/13] r8152: replace spin_lock_irqsave and spin_unlock_irqrestore

2014-03-04 Thread Hayes Wang
Use spin_lock and spin_unlock in interrupt context. The ndo_start_xmit would not be called in interrupt context, so replace the relative spin_lock_irqsave and spin_unlock_irqrestore with spin_lock_bh and spin_unlock_bh. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c

[PATCH net-next v2 05/13] r8152: check tx agg list before spin lock

2014-03-04 Thread Hayes Wang
Check tx agg list before spin lock to avoid doing spin lock every times. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8ecb41b..00b3192 100644

[PATCH net-next v2 00/13] r8152: new features

2014-03-04 Thread Hayes Wang
the issue of reording the packets for support IPv6. Hayes Wang (13): r8152: deal with the empty line and space r8152: replace tp-netdev with netdev r8152: remove rtl8152_get_stats r8152: replace spin_lock_irqsave and spin_unlock_irqrestore r8152: check tx agg list before spin lock r8152

[PATCH net-next 0/3] r8152: cleanups

2014-03-05 Thread Hayes Wang
Deal with some empty lines and spaces, replace some tp-netdev with netdev, and remove the unnecessary function. Hayes Wang (3): r8152: deal with the empty line and space r8152: replace tp-netdev with netdev r8152: remove rtl8152_get_stats drivers/net/usb/r8152.c | 36

[PATCH net-next 3/3] r8152: remove rtl8152_get_stats

2014-03-05 Thread Hayes Wang
The rtl8152_get_stats() returns the point address of the struct net_device_stats. This could be got from struct net_device directly. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff

[PATCH net-next 1/3] r8152: deal with the empty line and space

2014-03-05 Thread Hayes Wang
Add or remove some empty lines. Replace the spaces with the tabs. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0654bd3..c8bad62

[PATCH net-next 2/3] r8152: replace tp-netdev with netdev

2014-03-05 Thread Hayes Wang
Replace some tp-netdev with netdev. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index c8bad62..151398b 100644 --- a/drivers/net/usb/r8152

[PATCH net-next 2/7] r8152: check tx agg list before spin lock

2014-03-06 Thread Hayes Wang
Check tx agg list before spin lock to avoid doing spin lock every times. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 8ecb41b..00b3192 100644

[PATCH net-next 7/7] r8152: support IPv6

2014-03-06 Thread Hayes Wang
Support hw IPv6 checksum for TCP and UDP packets. Note that the hw has the limitation of the range of the transport offset. Besides, the TCP Pseudo Header of the IPv6 TSO of the hw bases on the Microsoft document which excludes the packet length. Signed-off-by: Hayes Wang hayesw...@realtek.com

[PATCH net-next 6/7] r8152: support TSO

2014-03-06 Thread Hayes Wang
Support scatter gather and TSO. Adjust the tx checksum function and set the max gso size to fix the size of the tx aggregation buffer. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 117 +++- 1 file changed, 87

[PATCH net-next 5/7] r8152: support rx checksum

2014-03-06 Thread Hayes Wang
Support hw rx checksum for TCP and UDP packets. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 41 +++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net-next 4/7] r8152: calculate the dropped packets for rx

2014-03-06 Thread Hayes Wang
Continue dealing with the remain rx packets, even though the allocation of the skb fail. This could calculate the correct dropped packets. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net

[PATCH net-next 0/7] r8152: tx/rx improvement

2014-03-06 Thread Hayes Wang
- Select the suitable spin lock for each function. - Add additional check to reduce the spin lock. - Up the priority of the tx to avoid interrupted by rx. - Support rx checksum, large send, and IPv6 hw checksum. Hayes Wang (7): r8152: replace spin_lock_irqsave and spin_unlock_irqrestore

[PATCH net-next 1/7] r8152: replace spin_lock_irqsave and spin_unlock_irqrestore

2014-03-06 Thread Hayes Wang
Use spin_lock and spin_unlock in interrupt context. The ndo_start_xmit would not be called in interrupt context, so replace the relative spin_lock_irqsave and spin_unlock_irqrestore with spin_lock_bh and spin_unlock_bh. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c

[PATCH net-next 3/7] r8152: up the priority of the transmission

2014-03-06 Thread Hayes Wang
move the tx_bottom() from delayed_work to tasklet. It makes the rx and tx balanced. If the device is in runtime suspend when getting the tx packet, wakeup the device before trasmitting. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 45

[PATCH net-next] r8152: add skb_cow_head

2014-03-10 Thread Hayes Wang
Call skb_cow_head() before editing the tx packet header. The header would be reallocated if it is shared. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b

[PATCH net-next v2] r8152: add skb_cow_head

2014-03-10 Thread Hayes Wang
Call skb_cow_head() before editing the tx packet header. The header would be reallocated if it is shared. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b

[PATCH net-next] r8152: support dumping the hw counters

2014-03-11 Thread Hayes Wang
Add dumping the tally counter by ethtool. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 95 +++-- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index

[PATCH net-next 0/2] parameter modification

2014-03-12 Thread Hayes Wang
Add opportunity to change the default setting and reduce the tx/rx buffers. Hayes Wang (2): r8152: add CONFIG_RTL8152_EARLY_AGG_SUPER r8152: reduce the numbers of the bulks drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/r8152.c | 8 2 files changed, 15 insertions(+), 4

[PATCH net-next 2/2] r8152: reduce the numbers of the bulks

2014-03-12 Thread Hayes Wang
It is not necessary to have many transfer buffers. Reduce the number from 10 to 4. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/r8152.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 0c43b28

[PATCH net-next 1/2] r8152: add CONFIG_RTL8152_EARLY_AGG_SUPER

2014-03-12 Thread Hayes Wang
CONFIG_RTL8152_EARLY_AGG_SUPER to let someone could choose desired timeout value if he wants to get the best performance. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/r8152.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git

[PATCH net-next v2 0/2] parameter modification

2014-03-12 Thread Hayes Wang
Add opportunity to change the default setting and reduce the tx/rx buffers. v2: modify the patch #1 to let the value readable. Hayes Wang (2): r8152: add RTL8152_EARLY_AGG_TIMEOUT_SUPER r8152: reduce the numbers of the bulks drivers/net/usb/Kconfig | 11 +++ drivers/net/usb/r8152.c

[PATCH net-next v2 1/2] r8152: add RTL8152_EARLY_AGG_TIMEOUT_SUPER

2014-03-12 Thread Hayes Wang
RTL8152_EARLY_AGG_TIMEOUT_SUPER to let someone could choose desired timeout value if he wants to get the best performance. Signed-off-by: Hayes Wang hayesw...@realtek.com --- drivers/net/usb/Kconfig | 12 drivers/net/usb/r8152.c | 7 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git

  1   2   3   4   5   6   >