aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorhayeswang <hayeswang@realtek.com>2014-09-01 22:27:52 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-01 23:41:45 -0400
commit52aec126c42819899793b9ffbd3f2e25705ba096 (patch)
tree1ad94bc41f3d191d847c9a5844c9fbb97affd510 /drivers/net/usb
parent4559154a58fdb18939dda8f1691a2aecf9154166 (diff)
r8152: rename rx_buf_sz
The variable "rx_buf_sz" is used by both tx and rx buffers. Replace it with "agg_buf_sz". Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/r8152.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index cc64dc0ba6fc..80b0179bff1f 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -607,9 +607,9 @@ enum tx_csum_stat {
607 * The RTL chips use a 64 element hash table based on the Ethernet CRC. 607 * The RTL chips use a 64 element hash table based on the Ethernet CRC.
608 */ 608 */
609static const int multicast_filter_limit = 32; 609static const int multicast_filter_limit = 32;
610static unsigned int rx_buf_sz = 16384; 610static unsigned int agg_buf_sz = 16384;
611 611
612#define RTL_LIMITED_TSO_SIZE (rx_buf_sz - sizeof(struct tx_desc) - \ 612#define RTL_LIMITED_TSO_SIZE (agg_buf_sz - sizeof(struct tx_desc) - \
613 VLAN_ETH_HLEN - VLAN_HLEN) 613 VLAN_ETH_HLEN - VLAN_HLEN)
614 614
615static 615static
@@ -1248,13 +1248,13 @@ static int alloc_all_mem(struct r8152 *tp)
1248 skb_queue_head_init(&tp->tx_queue); 1248 skb_queue_head_init(&tp->tx_queue);
1249 1249
1250 for (i = 0; i < RTL8152_MAX_RX; i++) { 1250 for (i = 0; i < RTL8152_MAX_RX; i++) {
1251 buf = kmalloc_node(rx_buf_sz, GFP_KERNEL, node); 1251 buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
1252 if (!buf) 1252 if (!buf)
1253 goto err1; 1253 goto err1;
1254 1254
1255 if (buf != rx_agg_align(buf)) { 1255 if (buf != rx_agg_align(buf)) {
1256 kfree(buf); 1256 kfree(buf);
1257 buf = kmalloc_node(rx_buf_sz + RX_ALIGN, GFP_KERNEL, 1257 buf = kmalloc_node(agg_buf_sz + RX_ALIGN, GFP_KERNEL,
1258 node); 1258 node);
1259 if (!buf) 1259 if (!buf)
1260 goto err1; 1260 goto err1;
@@ -1274,13 +1274,13 @@ static int alloc_all_mem(struct r8152 *tp)
1274 } 1274 }
1275 1275
1276 for (i = 0; i < RTL8152_MAX_TX; i++) { 1276 for (i = 0; i < RTL8152_MAX_TX; i++) {
1277 buf = kmalloc_node(rx_buf_sz, GFP_KERNEL, node); 1277 buf = kmalloc_node(agg_buf_sz, GFP_KERNEL, node);
1278 if (!buf) 1278 if (!buf)
1279 goto err1; 1279 goto err1;
1280 1280
1281 if (buf != tx_agg_align(buf)) { 1281 if (buf != tx_agg_align(buf)) {
1282 kfree(buf); 1282 kfree(buf);
1283 buf = kmalloc_node(rx_buf_sz + TX_ALIGN, GFP_KERNEL, 1283 buf = kmalloc_node(agg_buf_sz + TX_ALIGN, GFP_KERNEL,
1284 node); 1284 node);
1285 if (!buf) 1285 if (!buf)
1286 goto err1; 1286 goto err1;
@@ -1518,7 +1518,7 @@ static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
1518 tx_data = agg->head; 1518 tx_data = agg->head;
1519 agg->skb_num = 0; 1519 agg->skb_num = 0;
1520 agg->skb_len = 0; 1520 agg->skb_len = 0;
1521 remain = rx_buf_sz; 1521 remain = agg_buf_sz;
1522 1522
1523 while (remain >= ETH_ZLEN + sizeof(struct tx_desc)) { 1523 while (remain >= ETH_ZLEN + sizeof(struct tx_desc)) {
1524 struct tx_desc *tx_desc; 1524 struct tx_desc *tx_desc;
@@ -1565,7 +1565,7 @@ static int r8152_tx_agg_fill(struct r8152 *tp, struct tx_agg *agg)
1565 1565
1566 dev_kfree_skb_any(skb); 1566 dev_kfree_skb_any(skb);
1567 1567
1568 remain = rx_buf_sz - (int)(tx_agg_align(tx_data) - agg->head); 1568 remain = agg_buf_sz - (int)(tx_agg_align(tx_data) - agg->head);
1569 } 1569 }
1570 1570
1571 if (!skb_queue_empty(&skb_head)) { 1571 if (!skb_queue_empty(&skb_head)) {
@@ -1771,7 +1771,7 @@ static
1771int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags) 1771int r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags)
1772{ 1772{
1773 usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1), 1773 usb_fill_bulk_urb(agg->urb, tp->udev, usb_rcvbulkpipe(tp->udev, 1),
1774 agg->head, rx_buf_sz, 1774 agg->head, agg_buf_sz,
1775 (usb_complete_t)read_bulk_callback, agg); 1775 (usb_complete_t)read_bulk_callback, agg);
1776 1776
1777 return usb_submit_urb(agg->urb, mem_flags); 1777 return usb_submit_urb(agg->urb, mem_flags);
@@ -1915,8 +1915,8 @@ static void set_tx_qlen(struct r8152 *tp)
1915{ 1915{
1916 struct net_device *netdev = tp->netdev; 1916 struct net_device *netdev = tp->netdev;
1917 1917
1918 tp->tx_qlen = rx_buf_sz / (netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN + 1918 tp->tx_qlen = agg_buf_sz / (netdev->mtu + VLAN_ETH_HLEN + VLAN_HLEN +
1919 sizeof(struct tx_desc)); 1919 sizeof(struct tx_desc));
1920} 1920}
1921 1921
1922static inline u8 rtl8152_get_speed(struct r8152 *tp) 1922static inline u8 rtl8152_get_speed(struct r8152 *tp)