Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327799
b: refs/heads/master
c: 1e9f020
h: refs/heads/master
i:
  327797: 7fc332e
  327795: 0e71ae1
  327791: c52d34b
v: v3
  • Loading branch information
David S. Miller committed Sep 4, 2012
1 parent fc6414b commit a1f0c8a
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 148 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ace1fe1231bdfffd60b5e703aa5b7283fbf98dbd
refs/heads/master: 1e9f0207d3e63fab7a0f8a0e532bdc73ea850baf
11 changes: 1 addition & 10 deletions trunk/drivers/net/usb/cx82310_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,9 @@ static const struct driver_info cx82310_info = {
.tx_fixup = cx82310_tx_fixup,
};

#define USB_DEVICE_CLASS(vend, prod, cl, sc, pr) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_DEV_INFO, \
.idVendor = (vend), \
.idProduct = (prod), \
.bDeviceClass = (cl), \
.bDeviceSubClass = (sc), \
.bDeviceProtocol = (pr)

static const struct usb_device_id products[] = {
{
USB_DEVICE_CLASS(0x0572, 0xcb01, 0xff, 0, 0),
USB_DEVICE_AND_INTERFACE_INFO(0x0572, 0xcb01, 0xff, 0, 0),
.driver_info = (unsigned long) &cx82310_info
},
{ },
Expand Down
23 changes: 7 additions & 16 deletions trunk/drivers/net/usb/sierra_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ static atomic_t iface_counter = ATOMIC_INIT(0);
*/
#define SIERRA_NET_USBCTL_BUF_LEN 1024

struct sierra_net_info_data {
u16 rx_urb_size;
};
/* Overriding the default usbnet rx_urb_size */
#define SIERRA_NET_RX_URB_SIZE (8 * 1024)

/* Private data structure */
struct sierra_net_data {
Expand Down Expand Up @@ -560,7 +559,7 @@ static void sierra_net_defer_kevent(struct usbnet *dev, int work)
/*
* Sync Retransmit Timer Handler. On expiry, kick the work queue
*/
void sierra_sync_timer(unsigned long syncdata)
static void sierra_sync_timer(unsigned long syncdata)
{
struct usbnet *dev = (struct usbnet *)syncdata;

Expand Down Expand Up @@ -678,9 +677,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = {
0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00};

struct sierra_net_info_data *data =
(struct sierra_net_info_data *)dev->driver_info->data;

dev_dbg(&dev->udev->dev, "%s", __func__);

ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
Expand Down Expand Up @@ -725,9 +721,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
sierra_net_set_ctx_index(priv, 0);

/* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
dev->rx_urb_size = data->rx_urb_size;
dev->rx_urb_size = SIERRA_NET_RX_URB_SIZE;
if (dev->udev->speed != USB_SPEED_HIGH)
dev->rx_urb_size = min_t(size_t, 4096, data->rx_urb_size);
dev->rx_urb_size = min_t(size_t, 4096, SIERRA_NET_RX_URB_SIZE);

dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
Expand Down Expand Up @@ -866,8 +862,8 @@ static int sierra_net_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
}

/* ---------------------------- Transmit data path ----------------------*/
struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
gfp_t flags)
static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev,
struct sk_buff *skb, gfp_t flags)
{
struct sierra_net_data *priv = sierra_net_get_private(dev);
u16 len;
Expand Down Expand Up @@ -918,10 +914,6 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
return NULL;
}

static const struct sierra_net_info_data sierra_net_info_data_direct_ip = {
.rx_urb_size = 8 * 1024,
};

static const struct driver_info sierra_net_info_direct_ip = {
.description = "Sierra Wireless USB-to-WWAN Modem",
.flags = FLAG_WWAN | FLAG_SEND_ZLP,
Expand All @@ -930,7 +922,6 @@ static const struct driver_info sierra_net_info_direct_ip = {
.status = sierra_net_status,
.rx_fixup = sierra_net_rx_fixup,
.tx_fixup = sierra_net_tx_fixup,
.data = (unsigned long)&sierra_net_info_data_direct_ip,
};

#define DIRECT_IP_DEVICE(vend, prod) \
Expand Down
10 changes: 8 additions & 2 deletions trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -913,15 +913,21 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
return tp->snd_ssthresh >= TCP_INFINITE_SSTHRESH;
}

static inline bool tcp_in_cwnd_reduction(const struct sock *sk)
{
return (TCPF_CA_CWR | TCPF_CA_Recovery) &
(1 << inet_csk(sk)->icsk_ca_state);
}

/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
* The exception is rate halving phase, when cwnd is decreasing towards
* The exception is cwnd reduction phase, when cwnd is decreasing towards
* ssthresh.
*/
static inline __u32 tcp_current_ssthresh(const struct sock *sk)
{
const struct tcp_sock *tp = tcp_sk(sk);

if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery))
if (tcp_in_cwnd_reduction(sk))
return tp->snd_ssthresh;
else
return max(tp->snd_ssthresh,
Expand Down
Loading

0 comments on commit a1f0c8a

Please sign in to comment.