aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/usb/r8152.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-20r8152: modify the tx flowhayeswang1-43/+3
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-11-20r8152: fix tx/rx memory overflowhayeswang1-13/+17
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. For r8152_tx_agg_fill(), the variable remain may become negative. However, the declaration is unsigned, so the while loop wouldn't break when reaching the end of the desied memory. Although to change the declaration from unsigned to signed is enough to fix it, I also modify the checking method for safe. Replace remain = rx_buf_sz - sizeof(*tx_desc) - (u32)((void *)tx_data - agg->head); with remain = rx_buf_sz - (int)(tx_agg_align(tx_data) - agg->head); to make sure the variable remain is always positive. Then, the overflow wouldn't happen. For rx_bottom(), the rx_desc should not be used to calculate the packet length before making sure the rx_desc is in the desired range. Change the checking 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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: add commentshayeswang1-0/+5
Add comments. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: adjust tx_bottom functionhayeswang1-66/+68
Split some parts of code into another function to simplify tx_bottom(). Use while loop to replace the goto loop. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: move some declearation of variableshayeswang1-15/+14
Move some declearation of variables in rx_bottom(). Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: adjust some duplicated codehayeswang1-27/+28
- Use r8152_get_tx_agg for getting tx agg list - Replace submit rx with goto submit Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: replace lockflags with flagshayeswang1-24/+24
Replace lockflags with flags. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: replace void * with struct r8152 *hayeswang1-2/+4
Change the type of contex of tx_agg and rx_agg from void * to staruc r8152 *. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-20r8152: remove clearing the memory to zero for netdev privhayeswang1-1/+0
Remove memset(tp, 0, sizeof(*tp)); Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-15net/usb/r8152: enable interrupt transferhayeswang1-27/+113
Use the interrupt transfer to replace polling link status. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-15net/usb/r8152: enable tx checksumhayeswang1-5/+59
Enable tx checksum. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-08-15net/usb/r8152: support aggregationhayeswang1-161/+486
Enable the tx/rx aggregation which could contain one or more packets for each bulk in/out. This could reduce the loading of the host controller by sending less bulk transfer. The rx packets in the bulk in buffer should be 8-byte aligned, and the tx packets in the bulk out buffer should be 4-byte aligned. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-07-31net/usb/r8152: adjust relative ocp functionhayeswang1-43/+23
- fix the conversion between cpu and __le32 - replace some pla_ocp and usb_ocp functions with generic_ocp function Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-07-31net/usb/r8152: make sure the USB buffer is DMA-ablehayeswang1-25/+35
Allocate the required memory before calling usb_control_msg. And the additional memory copy is necessary. Signed-off-by: Hayes Wang <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-07-12usb/net/r8152: fix integer overflow in expressionhayeswang1-1/+2
config: make ARCH=avr32 allyesconfig drivers/net/usb/r8152.c: In function 'rtl8152_start_xmit': drivers/net/usb/r8152.c:956: warning: integer overflow in expression 955 memset(tx_desc, 0, sizeof(*tx_desc)); > 956 tx_desc->opts1 = cpu_to_le32((len & TX_LEN_MASK) | TX_FS | TX_LS); 957 tp->tx_skb = skb; Signed-off-by: Hayes Wang <[email protected]> Spotted-by: kbuild test robot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-05-17net/usb: r8152: Use module_usb_driver()Sachin Kamat1-12/+1
module_usb_driver() eliminates boilerplate and simplifies the code. Signed-off-by: Sachin Kamat <[email protected]> Cc: Realtek linux nic maintainers <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-05-17net/usb: r8152: Remove redundant version.h header inclusionSachin Kamat1-1/+0
version.h header inclusion is not necessary as detected by checkversion.pl. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-05-06net/usb: new driver for RTL8152hayeswang1-0/+1767
Add new driver for supporting Realtek RTL8152 Based USB 2.0 Ethernet Adapters Signed-off-by: Hayes Wang <[email protected]> Cc: Realtek linux nic maintainers <[email protected]> Signed-off-by: David S. Miller <[email protected]>