Commit 7b667cd3 authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.davemloft.net:/disk1/BK/net-2.6

into kernel.bkbits.net:/home/davem/net-2.6
parents 92c06c66 ee127b1d
......@@ -230,7 +230,7 @@ static int suni_start(struct atm_dev *dev)
unsigned long flags;
int first;
if (!(dev->dev_data = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
if (!(dev->phy_data = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
return -ENOMEM;
PRIV(dev)->dev = dev;
......
......@@ -296,14 +296,15 @@ static int __init bcm203x_init(void)
return err;
}
static void __exit bcm203x_cleanup(void)
static void __exit bcm203x_exit(void)
{
usb_deregister(&bcm203x_driver);
}
module_init(bcm203x_init);
module_exit(bcm203x_cleanup);
module_exit(bcm203x_exit);
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
......@@ -779,14 +779,15 @@ static int __init bfusb_init(void)
return err;
}
static void __exit bfusb_cleanup(void)
static void __exit bfusb_exit(void)
{
usb_deregister(&bfusb_driver);
}
module_init(bfusb_init);
module_exit(bfusb_cleanup);
module_exit(bfusb_exit);
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
......@@ -512,7 +512,7 @@ static int bcsp_recv(struct hci_uart *hu, void *data, int count)
struct bcsp_struct *bcsp = hu->priv;
register unsigned char *ptr;
BT_DBG("hu %p count %d rx_state %ld rx_count %ld",
BT_DBG("hu %p count %d rx_state %d rx_count %ld",
hu, count, bcsp->rx_state, bcsp->rx_count);
ptr = data;
......
......@@ -521,7 +521,7 @@ int bcsp_init(void);
int bcsp_deinit(void);
#endif
int __init hci_uart_init(void)
static int __init hci_uart_init(void)
{
static struct tty_ldisc hci_uart_ldisc;
int err;
......@@ -559,7 +559,7 @@ int __init hci_uart_init(void)
return 0;
}
void hci_uart_cleanup(void)
static void __exit hci_uart_exit(void)
{
int err;
......@@ -576,9 +576,10 @@ void hci_uart_cleanup(void)
}
module_init(hci_uart_init);
module_exit(hci_uart_cleanup);
module_exit(hci_uart_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS_LDISC(N_HCI);
......@@ -55,7 +55,7 @@
#include "hci_usb.h"
#ifndef HCI_USB_DEBUG
#ifndef CONFIG_BT_HCIUSB_DEBUG
#undef BT_DBG
#define BT_DBG( A... )
#undef BT_DMP
......@@ -795,7 +795,7 @@ int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
struct hci_dev *hdev;
int i, a, e, size, ifn, isoc_ifnum, isoc_alts;
BT_DBG("udev %p ifnum %d", udev, ifnum);
BT_DBG("udev %p intf %p", udev, intf);
if (!id->driver_info) {
const struct usb_device_id *match;
......@@ -991,7 +991,7 @@ static struct usb_driver hci_usb_driver = {
.id_table = bluetooth_ids,
};
int hci_usb_init(void)
static int __init hci_usb_init(void)
{
int err;
......@@ -1003,14 +1003,15 @@ int hci_usb_init(void)
return err;
}
void hci_usb_cleanup(void)
static void __exit hci_usb_exit(void)
{
usb_deregister(&hci_usb_driver);
}
module_init(hci_usb_init);
module_exit(hci_usb_cleanup);
module_exit(hci_usb_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth HCI USB driver ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
......@@ -169,7 +169,7 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait)
return mask;
}
/* Get packet from user space buffer(already verified) */
/* Get packet from user space buffer */
static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, size_t count)
{
struct tun_pi pi = { 0, __constant_htons(ETH_P_IP) };
......@@ -180,7 +180,8 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
if ((len -= sizeof(pi)) > len)
return -EINVAL;
memcpy_fromiovec((void *)&pi, iv, sizeof(pi));
if(memcpy_fromiovec((void *)&pi, iv, sizeof(pi)))
return -EFAULT;
}
if (!(skb = alloc_skb(len + 2, GFP_KERNEL))) {
......@@ -189,7 +190,8 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
}
skb_reserve(skb, 2);
memcpy_fromiovec(skb_put(skb, len), iv, len);
if (memcpy_fromiovec(skb_put(skb, len), iv, len))
return -EFAULT;
skb->dev = tun->dev;
switch (tun->flags & TUN_TYPE_MASK) {
......@@ -213,26 +215,29 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
return count;
}
static inline size_t iov_total(const struct iovec *iv, unsigned long count)
{
unsigned long i;
size_t len;
for (i = 0, len = 0; i < count; i++)
len += iv[i].iov_len;
return len;
}
/* Writev */
static ssize_t tun_chr_writev(struct file * file, const struct iovec *iv,
unsigned long count, loff_t *pos)
{
struct tun_struct *tun = file->private_data;
unsigned long i;
size_t len;
if (!tun)
return -EBADFD;
DBG(KERN_INFO "%s: tun_chr_write %ld\n", tun->dev->name, count);
for (i = 0, len = 0; i < count; i++) {
if (verify_area(VERIFY_READ, iv[i].iov_base, iv[i].iov_len))
return -EFAULT;
len += iv[i].iov_len;
}
return tun_get_user(tun, (struct iovec *) iv, len);
return tun_get_user(tun, (struct iovec *) iv, iov_total(iv, count));
}
/* Write */
......@@ -243,7 +248,7 @@ static ssize_t tun_chr_write(struct file * file, const char * buf,
return tun_chr_writev(file, &iv, 1, pos);
}
/* Put packet to the user space buffer (already verified) */
/* Put packet to the user space buffer */
static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
struct sk_buff *skb,
struct iovec *iv, int len)
......@@ -260,7 +265,8 @@ static __inline__ ssize_t tun_put_user(struct tun_struct *tun,
pi.flags |= TUN_PKT_STRIP;
}
memcpy_toiovec(iv, (void *) &pi, sizeof(pi));
if (memcpy_toiovec(iv, (void *) &pi, sizeof(pi)))
return -EFAULT;
total += sizeof(pi);
}
......@@ -283,18 +289,13 @@ static ssize_t tun_chr_readv(struct file *file, const struct iovec *iv,
DECLARE_WAITQUEUE(wait, current);
struct sk_buff *skb;
ssize_t len, ret = 0;
unsigned long i;
if (!tun)
return -EBADFD;
DBG(KERN_INFO "%s: tun_chr_read\n", tun->dev->name);
for (i = 0, len = 0; i < count; i++) {
if (verify_area(VERIFY_WRITE, iv[i].iov_base, iv[i].iov_len))
return -EFAULT;
len += iv[i].iov_len;
}
len = iov_total(iv, count);
if (len < 0)
return -EINVAL;
......@@ -602,21 +603,22 @@ static struct file_operations tun_fops = {
static struct miscdevice tun_miscdev = {
.minor = TUN_MINOR,
.name = "net/tun",
.fops = &tun_fops
.name = "tun",
.fops = &tun_fops,
.devfs_name = "net/tun",
};
int __init tun_init(void)
{
int ret = 0;
printk(KERN_INFO "Universal TUN/TAP device driver %s "
"(C)1999-2002 Maxim Krasnyansky\n", TUN_VER);
if (misc_register(&tun_miscdev)) {
ret = misc_register(&tun_miscdev);
if (ret)
printk(KERN_ERR "tun: Can't register misc device %d\n", TUN_MINOR);
return -EIO;
}
return 0;
return ret;
}
void tun_cleanup(void)
......
......@@ -29,11 +29,11 @@
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#ifdef __KERNEL__
#include <asm/atomic.h>
#include <asm/cache.h>
#include <asm/byteorder.h>
#ifdef __KERNEL__
#include <linux/config.h>
#include <linux/device.h>
#include <linux/percpu.h>
......
......@@ -377,7 +377,6 @@ struct tcp_opt {
/* TCP Westwood structure */
struct {
__u32 bw_sample; /* bandwidth sample */
__u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */
__u32 bw_est; /* bandwidth estimate */
__u32 rtt_win_sx; /* here starts a new evaluation... */
......
......@@ -305,7 +305,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
struct net_device *vlandev = (struct net_device *) seq->private;
const struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
struct net_device_stats *stats;
static const char *fmt = "%30s %12lu\n";
static const char fmt[] = "%30s %12lu\n";
int i;
if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
......
......@@ -323,7 +323,7 @@ int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo)
return err;
}
struct net_proto_family bt_sock_family_ops = {
static struct net_proto_family bt_sock_family_ops = {
.owner = THIS_MODULE,
.family = PF_BLUETOOTH,
.create = bt_sock_create,
......@@ -364,7 +364,7 @@ static int __init bt_init(void)
return 0;
}
static void __exit bt_cleanup(void)
static void __exit bt_exit(void)
{
hci_sock_cleanup();
......@@ -377,9 +377,10 @@ static void __exit bt_cleanup(void)
}
subsys_initcall(bt_init);
module_exit(bt_cleanup);
module_exit(bt_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth Core ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS_NETPROTO(PF_BLUETOOTH);
......@@ -5,7 +5,7 @@
Clment Moreau <clement.moreau@inventel.fr>
David Libault <david.libault@inventel.fr>
Copyright (C) 2002 Maxim Krasnyanskiy <maxk@qualcomm.com>
Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
......@@ -672,7 +672,7 @@ int bnep_get_conninfo(struct bnep_conninfo *ci)
return err;
}
static int __init bnep_init_module(void)
static int __init bnep_init(void)
{
char flt[50] = "";
......@@ -694,15 +694,16 @@ static int __init bnep_init_module(void)
return 0;
}
static void __exit bnep_cleanup_module(void)
static void __exit bnep_exit(void)
{
bnep_sock_cleanup();
}
module_init(bnep_init_module);
module_exit(bnep_cleanup_module);
module_init(bnep_init);
module_exit(bnep_exit);
MODULE_AUTHOR("David Libault <david.libault@inventel.fr>, Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("Bluetooth BNEP ver " VERSION);
MODULE_AUTHOR("David Libault <david.libault@inventel.fr>, Maxim Krasnyanskiy <maxk@qualcomm.com>");
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS("bt-proto-4");
......@@ -5,7 +5,7 @@
Clment Moreau <clement.moreau@inventel.fr>
David Libault <david.libault@inventel.fr>
Copyright (C) 2002 Maxim Krasnyanskiy <maxk@qualcomm.com>
Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
......
......@@ -4,7 +4,7 @@
Written 2001-2002 by
David Libault <david.libault@inventel.fr>
Copyright (C) 2002 Maxim Krasnyanskiy <maxk@qualcomm.com>
Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
......
......@@ -482,7 +482,7 @@ int cmtp_get_conninfo(struct cmtp_conninfo *ci)
}
int __init init_cmtp(void)
static int __init cmtp_init(void)
{
l2cap_load();
......@@ -493,15 +493,16 @@ int __init init_cmtp(void)
return 0;
}
void __exit exit_cmtp(void)
static void __exit cmtp_exit(void)
{
cmtp_cleanup_sockets();
}
module_init(init_cmtp);
module_exit(exit_cmtp);
module_init(cmtp_init);
module_exit(cmtp_exit);
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth CMTP ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS("bt-proto-5");
......@@ -222,7 +222,7 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
vs = (struct hci_rp_read_voice_setting *) skb->data;
if (vs->status) {
BT_DBG("%s READ_VOICE_SETTING failed %d", hdev->name, vc->status);
BT_DBG("%s READ_VOICE_SETTING failed %d", hdev->name, vs->status);
break;
}
......@@ -359,7 +359,7 @@ static inline void hci_cs_create_conn(struct hci_dev *hdev, __u8 status)
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
BT_DBG("%s status 0x%x bdaddr %s conn %p", hdev->name,
status, batostr(&cc->bdaddr), conn);
status, batostr(&cp->bdaddr), conn);
if (status) {
if (conn) {
......
......@@ -535,7 +535,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
return err;
}
int l2cap_sock_listen(struct socket *sock, int backlog)
static int l2cap_sock_listen(struct socket *sock, int backlog)
{
struct sock *sk = sock->sk;
int err = 0;
......@@ -563,7 +563,7 @@ int l2cap_sock_listen(struct socket *sock, int backlog)
return err;
}
int l2cap_sock_accept(struct socket *sock, struct socket *newsock, int flags)
static int l2cap_sock_accept(struct socket *sock, struct socket *newsock, int flags)
{
DECLARE_WAITQUEUE(wait, current);
struct sock *sk = sock->sk, *nsk;
......@@ -1051,7 +1051,7 @@ static void l2cap_chan_ready(struct sock *sk)
}
/* Copy frame to all raw sockets on that connection */
void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb)
static void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb)
{
struct l2cap_chan_list *l = &conn->chan_list;
struct sk_buff *nskb;
......@@ -2153,7 +2153,7 @@ static struct hci_proto l2cap_hci_proto = {
.recv_acldata = l2cap_recv_acldata
};
int __init l2cap_init(void)
static int __init l2cap_init(void)
{
int err;
......@@ -2175,7 +2175,7 @@ int __init l2cap_init(void)
return 0;
}
void __exit l2cap_cleanup(void)
static void __exit l2cap_exit(void)
{
l2cap_proc_cleanup();
......@@ -2197,9 +2197,10 @@ void l2cap_load(void)
EXPORT_SYMBOL(l2cap_load);
module_init(l2cap_init);
module_exit(l2cap_cleanup);
module_exit(l2cap_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS("bt-proto-0");
......@@ -1948,7 +1948,7 @@ static void __exit rfcomm_proc_cleanup(void)
#endif /* CONFIG_PROC_FS */
/* ---- Initialization ---- */
int __init rfcomm_init(void)
static int __init rfcomm_init(void)
{
l2cap_load();
......@@ -1967,7 +1967,7 @@ int __init rfcomm_init(void)
return 0;
}
void __exit rfcomm_cleanup(void)
static void __exit rfcomm_exit(void)
{
/* Terminate working thread.
* ie. Set terminate flag and wake it up */
......@@ -1988,9 +1988,10 @@ void __exit rfcomm_cleanup(void)
}
module_init(rfcomm_init);
module_exit(rfcomm_cleanup);
module_exit(rfcomm_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS("bt-proto-3");
......@@ -194,7 +194,7 @@ static inline int sco_chan_add(struct sco_conn *conn, struct sock *sk, struct so
return err;
}
int sco_connect(struct sock *sk)
static int sco_connect(struct sock *sk)
{
bdaddr_t *src = &bt_sk(sk)->src;
bdaddr_t *dst = &bt_sk(sk)->dst;
......@@ -533,7 +533,7 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen
return err;
}
int sco_sock_listen(struct socket *sock, int backlog)
static int sco_sock_listen(struct socket *sock, int backlog)
{
struct sock *sk = sock->sk;
int err = 0;
......@@ -556,7 +556,7 @@ int sco_sock_listen(struct socket *sock, int backlog)
return err;
}
int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags)
static int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags)
{
DECLARE_WAITQUEUE(wait, current);
struct sock *sk = sock->sk, *ch;
......@@ -655,7 +655,7 @@ static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
return err;
}
int sco_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
static int sco_sock_setsockopt(struct socket *sock, int level, int optname, char *optval, int optlen)
{
struct sock *sk = sock->sk;
int err = 0;
......@@ -674,7 +674,7 @@ int sco_sock_setsockopt(struct socket *sock, int level, int optname, char *optva
return err;
}
int sco_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
static int sco_sock_getsockopt(struct socket *sock, int level, int optname, char *optval, int *optlen)
{
struct sock *sk = sock->sk;
struct sco_options opts;
......@@ -835,7 +835,7 @@ static void sco_conn_ready(struct sco_conn *conn)
}
/* ----- SCO interface with lower layer (HCI) ----- */
int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
{
BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr));
......@@ -843,7 +843,7 @@ int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
return HCI_LM_ACCEPT;
}
int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
static int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
{
BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status);
......@@ -862,7 +862,7 @@ int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
return 0;
}
int sco_disconn_ind(struct hci_conn *hcon, __u8 reason)
static int sco_disconn_ind(struct hci_conn *hcon, __u8 reason)
{
BT_DBG("hcon %p reason %d", hcon, reason);
......@@ -873,7 +873,7 @@ int sco_disconn_ind(struct hci_conn *hcon, __u8 reason)
return 0;
}
int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
static int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
{
struct sco_conn *conn = hcon->sco_data;
......@@ -1013,7 +1013,7 @@ static struct hci_proto sco_hci_proto = {
.recv_scodata = sco_recv_scodata
};
int __init sco_init(void)
static int __init sco_init(void)
{
int err;
......@@ -1035,7 +1035,7 @@ int __init sco_init(void)
return 0;
}
void __exit sco_cleanup(void)
static void __exit sco_exit(void)
{
int err;
......@@ -1050,9 +1050,10 @@ void __exit sco_cleanup(void)
}
module_init(sco_init);
module_exit(sco_cleanup);
module_exit(sco_exit);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("Bluetooth SCO ver " VERSION);
MODULE_VERSION(VERSION);
MODULE_LICENSE("GPL");
MODULE_ALIAS("bt-proto-2");
......@@ -2051,21 +2051,25 @@ static void tcp_process_frto(struct sock *sk, u32 prior_snd_una)
*/
tp->frto_counter = (tp->frto_counter + 1) % 3;
}
/*
* TCP Westwood
* Functions needed for estimating bandwidth.
* TCP Westwood+
*/
/*
* This function initializes fields used in TCP Westwood.
* We can't get no information about RTT at this time so
* we are forced to set it to 0.
* @init_westwood
* This function initializes fields used in TCP Westwood+. We can't
* get no information about RTTmin at this time so we simply set it to
* TCP_WESTWOOD_INIT_RTT. This value was chosen to be too conservative
* since in this way we're sure it will be updated in a consistent
* way as soon as possible. It will reasonably happen within the first
* RTT period of the connection lifetime.
*/
static void init_westwood(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
tp->westwood.bw_sample = 0;
tp->westwood.bw_ns_est = 0;
tp->westwood.bw_est = 0;
tp->westwood.accounted = 0;
......@@ -2080,6 +2084,7 @@ static void init_westwood(struct sock *sk)
* @westwood_do_filter
* Low-pass filter. Implemented using constant coeffients.
*/
static inline __u32 westwood_do_filter(__u32 a, __u32 b)
{
return (((7 * a) + b) >> 3);
......@@ -2088,20 +2093,21 @@ static inline __u32 westwood_do_filter(__u32 a, __u32 b)
static void westwood_filter(struct sock *sk, __u32 delta)
{
struct tcp_opt *tp = tcp_sk(sk);
__u32 sample = tp->westwood.bk / delta;
tp->westwood.bw_ns_est =
westwood_do_filter(tp->westwood.bw_ns_est, sample);
westwood_do_filter(tp->westwood.bw_ns_est,
tp->westwood.bk / delta);
tp->westwood.bw_est =
westwood_do_filter(tp->westwood.bw_est,
tp->westwood.bw_ns_est);
tp->westwood.bw_sample = sample;
}
/* @westwood_update_rttmin
/*
* @westwood_update_rttmin
* It is used to update RTTmin. In this case we MUST NOT use
* WESTWOOD_RTT_MIN minimum bound since we could be on a LAN!
*/
static inline __u32 westwood_update_rttmin(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2118,9 +2124,9 @@ static inline __u32 westwood_update_rttmin(struct sock *sk)
/*
* @westwood_acked
* Evaluate increases for dk. It requires no lock since when it is
* called lock should already be held. Be careful about it!
* Evaluate increases for dk.
*/
static inline __u32 westwood_acked(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2136,6 +2142,7 @@ static inline __u32 westwood_acked(struct sock *sk)
* It returns 0 if we are still evaluating samples in the same RTT
* window, 1 if the sample has to be considered in the next window.
*/
static int westwood_new_window(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2164,11 +2171,9 @@ static int westwood_new_window(struct sock *sk)
/*
* @westwood_update_window
* It updates RTT evaluation window if it is the right moment to do
* it. If so it calls filter for evaluating bandwidth. Be careful
* about __westwood_update_window() since it is called without
* any form of lock. It should be used only for internal purposes.
* Call westwood_update_window() instead.
* it. If so it calls filter for evaluating bandwidth.
*/
static void __westwood_update_window(struct sock *sk, __u32 now)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2192,11 +2197,12 @@ static void westwood_update_window(struct sock *sk, __u32 now)
}
/*
* @__westwood_fast_bw
* @__tcp_westwood_fast_bw
* It is called when we are in fast path. In particular it is called when
* header prediction is successfull. In such case infact update is
* straight forward and doesn't need any particular care.
*/
void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2210,7 +2216,7 @@ void __tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb)
/*
* @tcp_westwood_dupack_update
* @westwood_dupack_update
* It updates accounted and cumul_ack when receiving a dupack.
*/
......@@ -2244,6 +2250,7 @@ static inline void westwood_complete_update(struct tcp_opt *tp)
* This function evaluates cumul_ack for evaluating dk in case of
* delayed or partial acks.
*/
static __u32 westwood_acked_count(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
......@@ -2271,11 +2278,12 @@ static __u32 westwood_acked_count(struct sock *sk)
/*
* @__westwood_slow_bw
* @__tcp_westwood_slow_bw
* It is called when something is going wrong..even if there could
* be no problems! Infact a simple delayed packet may trigger a
* dupack. But we need to be careful in such case.
*/
void __tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb)
{
struct tcp_opt *tp = tcp_sk(sk);
......
......@@ -437,13 +437,13 @@ static void htb_add_to_wait_tree (struct htb_sched *q,
cl->pq_key++;
/* update the nearest event cache */
if (q->near_ev_cache[cl->level] - cl->pq_key < 0x80000000)
if (time_after(q->near_ev_cache[cl->level], cl->pq_key))
q->near_ev_cache[cl->level] = cl->pq_key;
while (*p) {
struct htb_class *c; parent = *p;
c = rb_entry(parent, struct htb_class, pq_node);
if (cl->pq_key - c->pq_key < 0x80000000)
if (time_after_eq(cl->pq_key, c->pq_key))
p = &parent->rb_right;
else
p = &parent->rb_left;
......@@ -869,7 +869,7 @@ static long htb_do_events(struct htb_sched *q,int level)
while (p->rb_left) p = p->rb_left;
cl = rb_entry(p, struct htb_class, pq_node);
if (cl->pq_key - (q->jiffies+1) < 0x80000000) {
if (time_after(cl->pq_key, q->jiffies)) {
HTB_DBG(8,3,"htb_do_ev_ret delay=%ld\n",cl->pq_key - q->jiffies);
return cl->pq_key - q->jiffies;
}
......@@ -1048,7 +1048,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
/* common case optimization - skip event handler quickly */
int m;
long delay;
if (q->jiffies - q->near_ev_cache[level] < 0x80000000 || 0) {
if (time_after_eq(q->jiffies, q->near_ev_cache[level])) {
delay = htb_do_events(q,level);
q->near_ev_cache[level] = q->jiffies + (delay ? delay : HZ);
#ifdef HTB_DEBUG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment