aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-04 23:20:58 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-03-04 23:20:58 -0500
commit27d0483aa1ef66a8877d71b63bb97f46ab0246b2 (patch)
treeca84a9db8c79b789d40d2d9ae30d0349fd3562fc
parent665c1ef8369138dad7773da6407fe77ccff87deb (diff)
parentdea75bdfa57f75a7a7ec2961ec28db506c18e5db (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (22 commits) [IPCONFIG]: The kernel gets no IP from some DHCP servers b43legacy: Fix module init message rndis_wlan: fix broken data copy libertas: compare the current command with response libertas: fix sanity check on sequence number in command response p54: fix eeprom parser length sanity checks p54: fix EEPROM structure endianness ssb: Add pcibios_enable_device() return value check rc80211-pid: fix rate adjustment [ESP]: Add select on AUTHENC [TCP]: Improve ipv4 established hash function. [NETPOLL]: Revert two bogus cleanups that broke netconsole. [PPPOL2TP]: Add missing sock_put() in pppol2tp_tunnel_closeall() Subject: [PPPOL2TP] add missing sock_put() in pppol2tp_recv_dequeue() [BLUETOOTH]: l2cap info_timer delete fix in hci_conn_del [NET]: Fix race in generic address resolution. iucv: fix build error on !SMP [TCP]: Must count fack_count also when skipping [TUN]: Fix RTNL-locking in tun/tap driver [SCTP]: Use proc_create to setup de->proc_fops. ...
-rw-r--r--drivers/net/pppol2tp.c8
-rw-r--r--drivers/net/tun.c6
-rw-r--r--drivers/net/wireless/b43legacy/main.c2
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c8
-rw-r--r--drivers/net/wireless/p54common.c20
-rw-r--r--drivers/net/wireless/p54common.h8
-rw-r--r--drivers/net/wireless/rndis_wlan.c8
-rw-r--r--drivers/ssb/driver_pcicore.c5
-rw-r--r--include/linux/netpoll.h7
-rw-r--r--include/net/inet_sock.h3
-rw-r--r--net/bluetooth/l2cap.c3
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/netpoll.c12
-rw-r--r--net/ipv4/Kconfig2
-rw-r--r--net/ipv4/ipconfig.c4
-rw-r--r--net/ipv4/tcp_bic.c5
-rw-r--r--net/ipv4/tcp_input.c14
-rw-r--r--net/ipv6/Kconfig2
-rw-r--r--net/irda/ircomm/ircomm_core.c8
-rw-r--r--net/irda/irlan/irlan_common.c4
-rw-r--r--net/irda/irproc.c8
-rw-r--r--net/iucv/iucv.c2
-rw-r--r--net/mac80211/rc80211_pid_algo.c92
-rw-r--r--net/sctp/proc.c9
24 files changed, 127 insertions, 115 deletions
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index e0b072d9fdb7..86e5dba079fe 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -455,6 +455,7 @@ static void pppol2tp_recv_dequeue(struct pppol2tp_session *session)
455 skb_queue_len(&session->reorder_q)); 455 skb_queue_len(&session->reorder_q));
456 __skb_unlink(skb, &session->reorder_q); 456 __skb_unlink(skb, &session->reorder_q);
457 kfree_skb(skb); 457 kfree_skb(skb);
458 sock_put(session->sock);
458 continue; 459 continue;
459 } 460 }
460 461
@@ -1110,6 +1111,8 @@ static void pppol2tp_tunnel_closeall(struct pppol2tp_tunnel *tunnel)
1110 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) { 1111 for (hash = 0; hash < PPPOL2TP_HASH_SIZE; hash++) {
1111again: 1112again:
1112 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) { 1113 hlist_for_each_safe(walk, tmp, &tunnel->session_hlist[hash]) {
1114 struct sk_buff *skb;
1115
1113 session = hlist_entry(walk, struct pppol2tp_session, hlist); 1116 session = hlist_entry(walk, struct pppol2tp_session, hlist);
1114 1117
1115 sk = session->sock; 1118 sk = session->sock;
@@ -1138,7 +1141,10 @@ again:
1138 /* Purge any queued data */ 1141 /* Purge any queued data */
1139 skb_queue_purge(&sk->sk_receive_queue); 1142 skb_queue_purge(&sk->sk_receive_queue);
1140 skb_queue_purge(&sk->sk_write_queue); 1143 skb_queue_purge(&sk->sk_write_queue);
1141 skb_queue_purge(&session->reorder_q); 1144 while ((skb = skb_dequeue(&session->reorder_q))) {
1145 kfree_skb(skb);
1146 sock_put(sk);
1147 }
1142 1148
1143 release_sock(sk); 1149 release_sock(sk);
1144 sock_put(sk); 1150 sock_put(sk);
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 038c1ef94d2e..7b816a032957 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -663,7 +663,11 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
663 case SIOCSIFHWADDR: 663 case SIOCSIFHWADDR:
664 { 664 {
665 /* try to set the actual net device's hw address */ 665 /* try to set the actual net device's hw address */
666 int ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); 666 int ret;
667
668 rtnl_lock();
669 ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
670 rtnl_unlock();
667 671
668 if (ret == 0) { 672 if (ret == 0) {
669 /** Set the character device's hardware address. This is used when 673 /** Set the character device's hardware address. This is used when
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index c39de422e220..5f3f34e1dbfd 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3829,7 +3829,7 @@ static void b43legacy_print_driverinfo(void)
3829#ifdef CONFIG_B43LEGACY_DMA 3829#ifdef CONFIG_B43LEGACY_DMA
3830 feat_dma = "D"; 3830 feat_dma = "D";
3831#endif 3831#endif
3832 printk(KERN_INFO "Broadcom 43xx driver loaded " 3832 printk(KERN_INFO "Broadcom 43xx-legacy driver loaded "
3833 "[ Features: %s%s%s%s%s, Firmware-ID: " 3833 "[ Features: %s%s%s%s%s, Firmware-ID: "
3834 B43legacy_SUPPORTED_FIRMWARE_ID " ]\n", 3834 B43legacy_SUPPORTED_FIRMWARE_ID " ]\n",
3835 feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma); 3835 feat_pci, feat_leds, feat_rfkill, feat_pio, feat_dma);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 159216a91903..bdc6a1cc2103 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -562,9 +562,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
562 } 562 }
563 563
564 resp = (void *)priv->upld_buf; 564 resp = (void *)priv->upld_buf;
565 565 curcmd = le16_to_cpu(priv->cur_cmd->cmdbuf->command);
566 curcmd = le16_to_cpu(resp->command);
567
568 respcmd = le16_to_cpu(resp->command); 566 respcmd = le16_to_cpu(resp->command);
569 result = le16_to_cpu(resp->result); 567 result = le16_to_cpu(resp->result);
570 568
@@ -572,9 +570,9 @@ int lbs_process_rx_command(struct lbs_private *priv)
572 respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); 570 respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies);
573 lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len); 571 lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len);
574 572
575 if (resp->seqnum != resp->seqnum) { 573 if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
576 lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", 574 lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
577 le16_to_cpu(resp->seqnum), le16_to_cpu(resp->seqnum)); 575 le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
578 spin_unlock_irqrestore(&priv->driver_lock, flags); 576 spin_unlock_irqrestore(&priv->driver_lock, flags);
579 ret = -1; 577 ret = -1;
580 goto done; 578 goto done;
diff --git a/drivers/net/wireless/p54common.c b/drivers/net/wireless/p54common.c
index 5cda49aff3a8..d191e055a788 100644
--- a/drivers/net/wireless/p54common.c
+++ b/drivers/net/wireless/p54common.c
@@ -166,18 +166,23 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
166 struct p54_common *priv = dev->priv; 166 struct p54_common *priv = dev->priv;
167 struct eeprom_pda_wrap *wrap = NULL; 167 struct eeprom_pda_wrap *wrap = NULL;
168 struct pda_entry *entry; 168 struct pda_entry *entry;
169 int i = 0;
170 unsigned int data_len, entry_len; 169 unsigned int data_len, entry_len;
171 void *tmp; 170 void *tmp;
172 int err; 171 int err;
172 u8 *end = (u8 *)eeprom + len;
173 173
174 wrap = (struct eeprom_pda_wrap *) eeprom; 174 wrap = (struct eeprom_pda_wrap *) eeprom;
175 entry = (void *)wrap->data + wrap->len; 175 entry = (void *)wrap->data + le16_to_cpu(wrap->len);
176 i += 2; 176
177 i += le16_to_cpu(entry->len)*2; 177 /* verify that at least the entry length/code fits */
178 while (i < len) { 178 while ((u8 *)entry <= end - sizeof(*entry)) {
179 entry_len = le16_to_cpu(entry->len); 179 entry_len = le16_to_cpu(entry->len);
180 data_len = ((entry_len - 1) << 1); 180 data_len = ((entry_len - 1) << 1);
181
182 /* abort if entry exceeds whole structure */
183 if ((u8 *)entry + sizeof(*entry) + data_len > end)
184 break;
185
181 switch (le16_to_cpu(entry->code)) { 186 switch (le16_to_cpu(entry->code)) {
182 case PDR_MAC_ADDRESS: 187 case PDR_MAC_ADDRESS:
183 SET_IEEE80211_PERM_ADDR(dev, entry->data); 188 SET_IEEE80211_PERM_ADDR(dev, entry->data);
@@ -249,13 +254,12 @@ int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
249 priv->version = *(u8 *)(entry->data + 1); 254 priv->version = *(u8 *)(entry->data + 1);
250 break; 255 break;
251 case PDR_END: 256 case PDR_END:
252 i = len; 257 /* make it overrun */
258 entry_len = len;
253 break; 259 break;
254 } 260 }
255 261
256 entry = (void *)entry + (entry_len + 1)*2; 262 entry = (void *)entry + (entry_len + 1)*2;
257 i += 2;
258 i += entry_len*2;
259 } 263 }
260 264
261 if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { 265 if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) {
diff --git a/drivers/net/wireless/p54common.h b/drivers/net/wireless/p54common.h
index a721334e20d9..b67ff34e26fe 100644
--- a/drivers/net/wireless/p54common.h
+++ b/drivers/net/wireless/p54common.h
@@ -53,10 +53,10 @@ struct pda_entry {
53} __attribute__ ((packed)); 53} __attribute__ ((packed));
54 54
55struct eeprom_pda_wrap { 55struct eeprom_pda_wrap {
56 u32 magic; 56 __le32 magic;
57 u16 pad; 57 __le16 pad;
58 u16 len; 58 __le16 len;
59 u32 arm_opcode; 59 __le32 arm_opcode;
60 u8 data[0]; 60 u8 data[0];
61} __attribute__ ((packed)); 61} __attribute__ ((packed));
62 62
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index d9460aed1f22..10b776c1adc5 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -260,7 +260,7 @@ struct NDIS_802_11_KEY {
260 __le32 KeyLength; 260 __le32 KeyLength;
261 u8 Bssid[6]; 261 u8 Bssid[6];
262 u8 Padding[6]; 262 u8 Padding[6];
263 __le64 KeyRSC; 263 u8 KeyRSC[8];
264 u8 KeyMaterial[32]; 264 u8 KeyMaterial[32];
265} __attribute__((packed)); 265} __attribute__((packed));
266 266
@@ -1508,7 +1508,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
1508 struct usbnet *usbdev = dev->priv; 1508 struct usbnet *usbdev = dev->priv;
1509 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev); 1509 struct rndis_wext_private *priv = get_rndis_wext_priv(usbdev);
1510 struct NDIS_802_11_KEY ndis_key; 1510 struct NDIS_802_11_KEY ndis_key;
1511 int i, keyidx, ret; 1511 int keyidx, ret;
1512 u8 *addr; 1512 u8 *addr;
1513 1513
1514 keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX; 1514 keyidx = wrqu->encoding.flags & IW_ENCODE_INDEX;
@@ -1543,9 +1543,7 @@ static int rndis_iw_set_encode_ext(struct net_device *dev,
1543 ndis_key.KeyIndex = cpu_to_le32(keyidx); 1543 ndis_key.KeyIndex = cpu_to_le32(keyidx);
1544 1544
1545 if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) { 1545 if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
1546 for (i = 0; i < 6; i++) 1546 memcpy(ndis_key.KeyRSC, ext->rx_seq, 6);
1547 ndis_key.KeyRSC |=
1548 cpu_to_le64(ext->rx_seq[i] << (i * 8));
1549 ndis_key.KeyIndex |= cpu_to_le32(1 << 29); 1547 ndis_key.KeyIndex |= cpu_to_le32(1 << 29);
1550 } 1548 }
1551 1549
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c
index 07ab48d9ceab..74b9a8aea52b 100644
--- a/drivers/ssb/driver_pcicore.c
+++ b/drivers/ssb/driver_pcicore.c
@@ -111,7 +111,10 @@ static void __init ssb_fixup_pcibridge(struct pci_dev *dev)
111 111
112 /* Enable PCI bridge bus mastering and memory space */ 112 /* Enable PCI bridge bus mastering and memory space */
113 pci_set_master(dev); 113 pci_set_master(dev);
114 pcibios_enable_device(dev, ~0); 114 if (pcibios_enable_device(dev, ~0) < 0) {
115 ssb_printk(KERN_ERR "PCI: SSB bridge enable failed\n");
116 return;
117 }
115 118
116 /* Enable PCI bridge BAR1 prefetch and burst */ 119 /* Enable PCI bridge BAR1 prefetch and burst */
117 pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3); 120 pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3);
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index a0525a1f4715..e3d79593fb3a 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -25,6 +25,7 @@ struct netpoll {
25 25
26struct netpoll_info { 26struct netpoll_info {
27 atomic_t refcnt; 27 atomic_t refcnt;
28 int rx_flags;
28 spinlock_t rx_lock; 29 spinlock_t rx_lock;
29 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 30 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
30 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 31 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
@@ -50,12 +51,12 @@ static inline int netpoll_rx(struct sk_buff *skb)
50 unsigned long flags; 51 unsigned long flags;
51 int ret = 0; 52 int ret = 0;
52 53
53 if (!npinfo || !npinfo->rx_np) 54 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
54 return 0; 55 return 0;
55 56
56 spin_lock_irqsave(&npinfo->rx_lock, flags); 57 spin_lock_irqsave(&npinfo->rx_lock, flags);
57 /* check rx_np again with the lock held */ 58 /* check rx_flags again with the lock held */
58 if (npinfo->rx_np && __netpoll_rx(skb)) 59 if (npinfo->rx_flags && __netpoll_rx(skb))
59 ret = 1; 60 ret = 1;
60 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 61 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
61 62
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 70013c5f4e59..89cd011edb99 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -175,7 +175,8 @@ extern void build_ehash_secret(void);
175static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, 175static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport,
176 const __be32 faddr, const __be16 fport) 176 const __be32 faddr, const __be16 fport)
177{ 177{
178 return jhash_2words((__force __u32) laddr ^ (__force __u32) faddr, 178 return jhash_3words((__force __u32) laddr,
179 (__force __u32) faddr,
179 ((__u32) lport) << 16 | (__force __u32)fport, 180 ((__u32) lport) << 16 | (__force __u32)fport,
180 inet_ehash_secret); 181 inet_ehash_secret);
181} 182}
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 7c5459c8e8ef..34f8bf98bc05 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -417,7 +417,8 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
417 l2cap_sock_kill(sk); 417 l2cap_sock_kill(sk);
418 } 418 }
419 419
420 del_timer_sync(&conn->info_timer); 420 if (conn->info_state & L2CAP_INFO_FEAT_MASK_REQ_SENT)
421 del_timer_sync(&conn->info_timer);
421 422
422 hcon->l2cap_data = NULL; 423 hcon->l2cap_data = NULL;
423 kfree(conn); 424 kfree(conn);
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index aef01533dfb6..d9a02b2cc289 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -839,7 +839,7 @@ static void neigh_timer_handler(unsigned long arg)
839 struct sk_buff *skb = skb_peek(&neigh->arp_queue); 839 struct sk_buff *skb = skb_peek(&neigh->arp_queue);
840 /* keep skb alive even if arp_queue overflows */ 840 /* keep skb alive even if arp_queue overflows */
841 if (skb) 841 if (skb)
842 skb_get(skb); 842 skb = skb_copy(skb, GFP_ATOMIC);
843 write_unlock(&neigh->lock); 843 write_unlock(&neigh->lock);
844 neigh->ops->solicit(neigh, skb); 844 neigh->ops->solicit(neigh, skb);
845 atomic_inc(&neigh->probes); 845 atomic_inc(&neigh->probes);
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 6faa128a4c8e..4b7e756181c9 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -39,6 +39,8 @@ static struct sk_buff_head skb_pool;
39static atomic_t trapped; 39static atomic_t trapped;
40 40
41#define USEC_PER_POLL 50 41#define USEC_PER_POLL 50
42#define NETPOLL_RX_ENABLED 1
43#define NETPOLL_RX_DROP 2
42 44
43#define MAX_SKB_SIZE \ 45#define MAX_SKB_SIZE \
44 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ 46 (MAX_UDP_CHUNK + sizeof(struct udphdr) + \
@@ -126,11 +128,13 @@ static int poll_one_napi(struct netpoll_info *npinfo,
126 if (!test_bit(NAPI_STATE_SCHED, &napi->state)) 128 if (!test_bit(NAPI_STATE_SCHED, &napi->state))
127 return budget; 129 return budget;
128 130
131 npinfo->rx_flags |= NETPOLL_RX_DROP;
129 atomic_inc(&trapped); 132 atomic_inc(&trapped);
130 133
131 work = napi->poll(napi, budget); 134 work = napi->poll(napi, budget);
132 135
133 atomic_dec(&trapped); 136 atomic_dec(&trapped);
137 npinfo->rx_flags &= ~NETPOLL_RX_DROP;
134 138
135 return budget - work; 139 return budget - work;
136} 140}
@@ -472,7 +476,7 @@ int __netpoll_rx(struct sk_buff *skb)
472 if (skb->dev->type != ARPHRD_ETHER) 476 if (skb->dev->type != ARPHRD_ETHER)
473 goto out; 477 goto out;
474 478
475 /* if receive ARP during middle of NAPI poll, then queue */ 479 /* check if netpoll clients need ARP */
476 if (skb->protocol == htons(ETH_P_ARP) && 480 if (skb->protocol == htons(ETH_P_ARP) &&
477 atomic_read(&trapped)) { 481 atomic_read(&trapped)) {
478 skb_queue_tail(&npi->arp_tx, skb); 482 skb_queue_tail(&npi->arp_tx, skb);
@@ -534,9 +538,6 @@ int __netpoll_rx(struct sk_buff *skb)
534 return 1; 538 return 1;
535 539
536out: 540out:
537 /* If packet received while already in poll then just
538 * silently drop.
539 */
540 if (atomic_read(&trapped)) { 541 if (atomic_read(&trapped)) {
541 kfree_skb(skb); 542 kfree_skb(skb);
542 return 1; 543 return 1;
@@ -675,6 +676,7 @@ int netpoll_setup(struct netpoll *np)
675 goto release; 676 goto release;
676 } 677 }
677 678
679 npinfo->rx_flags = 0;
678 npinfo->rx_np = NULL; 680 npinfo->rx_np = NULL;
679 681
680 spin_lock_init(&npinfo->rx_lock); 682 spin_lock_init(&npinfo->rx_lock);
@@ -756,6 +758,7 @@ int netpoll_setup(struct netpoll *np)
756 758
757 if (np->rx_hook) { 759 if (np->rx_hook) {
758 spin_lock_irqsave(&npinfo->rx_lock, flags); 760 spin_lock_irqsave(&npinfo->rx_lock, flags);
761 npinfo->rx_flags |= NETPOLL_RX_ENABLED;
759 npinfo->rx_np = np; 762 npinfo->rx_np = np;
760 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 763 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
761 } 764 }
@@ -797,6 +800,7 @@ void netpoll_cleanup(struct netpoll *np)
797 if (npinfo->rx_np == np) { 800 if (npinfo->rx_np == np) {
798 spin_lock_irqsave(&npinfo->rx_lock, flags); 801 spin_lock_irqsave(&npinfo->rx_lock, flags);
799 npinfo->rx_np = NULL; 802 npinfo->rx_np = NULL;
803 npinfo->rx_flags &= ~NETPOLL_RX_ENABLED;
800 spin_unlock_irqrestore(&npinfo->rx_lock, flags); 804 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
801 } 805 }
802 806
diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index 19880b086e71..9c7e5ffb223d 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -343,7 +343,7 @@ config INET_ESP
343 tristate "IP: ESP transformation" 343 tristate "IP: ESP transformation"
344 select XFRM 344 select XFRM
345 select CRYPTO 345 select CRYPTO
346 select CRYPTO_AEAD 346 select CRYPTO_AUTHENC
347 select CRYPTO_HMAC 347 select CRYPTO_HMAC
348 select CRYPTO_MD5 348 select CRYPTO_MD5
349 select CRYPTO_CBC 349 select CRYPTO_CBC
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 10013ccee8dd..5dd938579eeb 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -753,9 +753,9 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name); 753 printk("Unknown ARP type 0x%04x for device %s\n", dev->type, dev->name);
754 b->htype = dev->type; /* can cause undefined behavior */ 754 b->htype = dev->type; /* can cause undefined behavior */
755 } 755 }
756
757 /* server_ip and your_ip address are both already zero per RFC2131 */
756 b->hlen = dev->addr_len; 758 b->hlen = dev->addr_len;
757 b->your_ip = NONE;
758 b->server_ip = NONE;
759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len); 759 memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
760 b->secs = htons(jiffies_diff / HZ); 760 b->secs = htons(jiffies_diff / HZ);
761 b->xid = d->xid; 761 b->xid = d->xid;
diff --git a/net/ipv4/tcp_bic.c b/net/ipv4/tcp_bic.c
index 5212ed9b0c98..7eb7636db0d0 100644
--- a/net/ipv4/tcp_bic.c
+++ b/net/ipv4/tcp_bic.c
@@ -1,12 +1,13 @@
1/* 1/*
2 * Binary Increase Congestion control for TCP 2 * Binary Increase Congestion control for TCP
3 * 3 * Home page:
4 * http://netsrv.csc.ncsu.edu/twiki/bin/view/Main/BIC
4 * This is from the implementation of BICTCP in 5 * This is from the implementation of BICTCP in
5 * Lison-Xu, Kahaled Harfoush, and Injong Rhee. 6 * Lison-Xu, Kahaled Harfoush, and Injong Rhee.
6 * "Binary Increase Congestion Control for Fast, Long Distance 7 * "Binary Increase Congestion Control for Fast, Long Distance
7 * Networks" in InfoComm 2004 8 * Networks" in InfoComm 2004
8 * Available from: 9 * Available from:
9 * http://www.csc.ncsu.edu/faculty/rhee/export/bitcp.pdf 10 * http://netsrv.csc.ncsu.edu/export/bitcp.pdf
10 * 11 *
11 * Unless BIC is enabled and congestion window is large 12 * Unless BIC is enabled and congestion window is large
12 * this behaves the same as the original Reno. 13 * this behaves the same as the original Reno.
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 19c449f62672..7facdb0f6960 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1367,7 +1367,7 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
1367 * a normal way 1367 * a normal way
1368 */ 1368 */
1369static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk, 1369static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
1370 u32 skip_to_seq) 1370 u32 skip_to_seq, int *fack_count)
1371{ 1371{
1372 tcp_for_write_queue_from(skb, sk) { 1372 tcp_for_write_queue_from(skb, sk) {
1373 if (skb == tcp_send_head(sk)) 1373 if (skb == tcp_send_head(sk))
@@ -1375,6 +1375,8 @@ static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
1375 1375
1376 if (!before(TCP_SKB_CB(skb)->end_seq, skip_to_seq)) 1376 if (!before(TCP_SKB_CB(skb)->end_seq, skip_to_seq))
1377 break; 1377 break;
1378
1379 *fack_count += tcp_skb_pcount(skb);
1378 } 1380 }
1379 return skb; 1381 return skb;
1380} 1382}
@@ -1390,7 +1392,7 @@ static struct sk_buff *tcp_maybe_skipping_dsack(struct sk_buff *skb,
1390 return skb; 1392 return skb;
1391 1393
1392 if (before(next_dup->start_seq, skip_to_seq)) { 1394 if (before(next_dup->start_seq, skip_to_seq)) {
1393 skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq); 1395 skb = tcp_sacktag_skip(skb, sk, next_dup->start_seq, fack_count);
1394 tcp_sacktag_walk(skb, sk, NULL, 1396 tcp_sacktag_walk(skb, sk, NULL,
1395 next_dup->start_seq, next_dup->end_seq, 1397 next_dup->start_seq, next_dup->end_seq,
1396 1, fack_count, reord, flag); 1398 1, fack_count, reord, flag);
@@ -1537,7 +1539,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1537 1539
1538 /* Head todo? */ 1540 /* Head todo? */
1539 if (before(start_seq, cache->start_seq)) { 1541 if (before(start_seq, cache->start_seq)) {
1540 skb = tcp_sacktag_skip(skb, sk, start_seq); 1542 skb = tcp_sacktag_skip(skb, sk, start_seq,
1543 &fack_count);
1541 skb = tcp_sacktag_walk(skb, sk, next_dup, 1544 skb = tcp_sacktag_walk(skb, sk, next_dup,
1542 start_seq, 1545 start_seq,
1543 cache->start_seq, 1546 cache->start_seq,
@@ -1565,7 +1568,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1565 goto walk; 1568 goto walk;
1566 } 1569 }
1567 1570
1568 skb = tcp_sacktag_skip(skb, sk, cache->end_seq); 1571 skb = tcp_sacktag_skip(skb, sk, cache->end_seq,
1572 &fack_count);
1569 /* Check overlap against next cached too (past this one already) */ 1573 /* Check overlap against next cached too (past this one already) */
1570 cache++; 1574 cache++;
1571 continue; 1575 continue;
@@ -1577,7 +1581,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1577 break; 1581 break;
1578 fack_count = tp->fackets_out; 1582 fack_count = tp->fackets_out;
1579 } 1583 }
1580 skb = tcp_sacktag_skip(skb, sk, start_seq); 1584 skb = tcp_sacktag_skip(skb, sk, start_seq, &fack_count);
1581 1585
1582walk: 1586walk:
1583 skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq, 1587 skb = tcp_sacktag_walk(skb, sk, next_dup, start_seq, end_seq,
diff --git a/net/ipv6/Kconfig b/net/ipv6/Kconfig
index 3ffb0323668c..58219dfffef8 100644
--- a/net/ipv6/Kconfig
+++ b/net/ipv6/Kconfig
@@ -85,7 +85,7 @@ config INET6_ESP
85 depends on IPV6 85 depends on IPV6
86 select XFRM 86 select XFRM
87 select CRYPTO 87 select CRYPTO
88 select CRYPTO_AEAD 88 select CRYPTO_AUTHENC
89 select CRYPTO_HMAC 89 select CRYPTO_HMAC
90 select CRYPTO_MD5 90 select CRYPTO_MD5
91 select CRYPTO_CBC 91 select CRYPTO_CBC
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index b825399fc160..6eef1f2a7553 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -76,9 +76,11 @@ static int __init ircomm_init(void)
76 76
77#ifdef CONFIG_PROC_FS 77#ifdef CONFIG_PROC_FS
78 { struct proc_dir_entry *ent; 78 { struct proc_dir_entry *ent;
79 ent = create_proc_entry("ircomm", 0, proc_irda); 79 ent = proc_create("ircomm", 0, proc_irda, &ircomm_proc_fops);
80 if (ent) 80 if (!ent) {
81 ent->proc_fops = &ircomm_proc_fops; 81 printk(KERN_ERR "ircomm_init: can't create /proc entry!\n");
82 return -ENODEV;
83 }
82 } 84 }
83#endif /* CONFIG_PROC_FS */ 85#endif /* CONFIG_PROC_FS */
84 86
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index a4b56e25a917..1eb4bbcb1c9e 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -128,13 +128,11 @@ static int __init irlan_init(void)
128 128
129#ifdef CONFIG_PROC_FS 129#ifdef CONFIG_PROC_FS
130 { struct proc_dir_entry *proc; 130 { struct proc_dir_entry *proc;
131 proc = create_proc_entry("irlan", 0, proc_irda); 131 proc = proc_create("irlan", 0, proc_irda, &irlan_fops);
132 if (!proc) { 132 if (!proc) {
133 printk(KERN_ERR "irlan_init: can't create /proc entry!\n"); 133 printk(KERN_ERR "irlan_init: can't create /proc entry!\n");
134 return -ENODEV; 134 return -ENODEV;
135 } 135 }
136
137 proc->proc_fops = &irlan_fops;
138 } 136 }
139#endif /* CONFIG_PROC_FS */ 137#endif /* CONFIG_PROC_FS */
140 138
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index cae24fbda966..88e80a312732 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -72,11 +72,9 @@ void __init irda_proc_register(void)
72 return; 72 return;
73 proc_irda->owner = THIS_MODULE; 73 proc_irda->owner = THIS_MODULE;
74 74
75 for (i=0; i<ARRAY_SIZE(irda_dirs); i++) { 75 for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
76 d = create_proc_entry(irda_dirs[i].name, 0, proc_irda); 76 d = proc_create(irda_dirs[i].name, 0, proc_irda,
77 if (d) 77 irda_dirs[i].fops);
78 d->proc_fops = irda_dirs[i].fops;
79 }
80} 78}
81 79
82/* 80/*
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 2753b0c448f3..d764f4c1b7e4 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -621,7 +621,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
621 return iucv_call_b2f0(IUCV_SEVER, parm); 621 return iucv_call_b2f0(IUCV_SEVER, parm);
622} 622}
623 623
624#ifdef CONFIG_SMP
625/** 624/**
626 * __iucv_cleanup_queue 625 * __iucv_cleanup_queue
627 * @dummy: unused dummy argument 626 * @dummy: unused dummy argument
@@ -632,7 +631,6 @@ static int iucv_sever_pathid(u16 pathid, u8 userdata[16])
632static void __iucv_cleanup_queue(void *dummy) 631static void __iucv_cleanup_queue(void *dummy)
633{ 632{
634} 633}
635#endif
636 634
637/** 635/**
638 * iucv_cleanup_queue 636 * iucv_cleanup_queue
diff --git a/net/mac80211/rc80211_pid_algo.c b/net/mac80211/rc80211_pid_algo.c
index c339571632b2..3b77410588e7 100644
--- a/net/mac80211/rc80211_pid_algo.c
+++ b/net/mac80211/rc80211_pid_algo.c
@@ -2,7 +2,7 @@
2 * Copyright 2002-2005, Instant802 Networks, Inc. 2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2005, Devicescape Software, Inc. 3 * Copyright 2005, Devicescape Software, Inc.
4 * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de> 4 * Copyright 2007, Mattias Nissler <mattias.nissler@gmx.de>
5 * Copyright 2007, Stefano Brivio <stefano.brivio@polimi.it> 5 * Copyright 2007-2008, Stefano Brivio <stefano.brivio@polimi.it>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -63,72 +63,66 @@
63 * RC_PID_ARITH_SHIFT. 63 * RC_PID_ARITH_SHIFT.
64 */ 64 */
65 65
66 66/* Adjust the rate while ensuring that we won't switch to a lower rate if it
67/* Shift the adjustment so that we won't switch to a lower rate if it exhibited 67 * exhibited a worse failed frames behaviour and we'll choose the highest rate
68 * a worse failed frames behaviour and we'll choose the highest rate whose 68 * whose failed frames behaviour is not worse than the one of the original rate
69 * failed frames behaviour is not worse than the one of the original rate 69 * target. While at it, check that the new rate is valid. */
70 * target. While at it, check that the adjustment is within the ranges. Then,
71 * provide the new rate index. */
72static int rate_control_pid_shift_adjust(struct rc_pid_rateinfo *r,
73 int adj, int cur, int l)
74{
75 int i, j, k, tmp;
76
77 j = r[cur].rev_index;
78 i = j + adj;
79
80 if (i < 0)
81 return r[0].index;
82 if (i >= l - 1)
83 return r[l - 1].index;
84
85 tmp = i;
86
87 if (adj < 0) {
88 for (k = j; k >= i; k--)
89 if (r[k].diff <= r[j].diff)
90 tmp = k;
91 } else {
92 for (k = i + 1; k + i < l; k++)
93 if (r[k].diff <= r[i].diff)
94 tmp = k;
95 }
96
97 return r[tmp].index;
98}
99
100static void rate_control_pid_adjust_rate(struct ieee80211_local *local, 70static void rate_control_pid_adjust_rate(struct ieee80211_local *local,
101 struct sta_info *sta, int adj, 71 struct sta_info *sta, int adj,
102 struct rc_pid_rateinfo *rinfo) 72 struct rc_pid_rateinfo *rinfo)
103{ 73{
104 struct ieee80211_sub_if_data *sdata; 74 struct ieee80211_sub_if_data *sdata;
105 struct ieee80211_hw_mode *mode; 75 struct ieee80211_hw_mode *mode;
106 int newidx; 76 int cur_sorted, new_sorted, probe, tmp, n_bitrates;
107 int maxrate; 77 int cur = sta->txrate;
108 int back = (adj > 0) ? 1 : -1;
109 78
110 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev); 79 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
111 80
112 mode = local->oper_hw_mode; 81 mode = local->oper_hw_mode;
113 maxrate = sdata->bss ? sdata->bss->max_ratectrl_rateidx : -1; 82 n_bitrates = mode->num_rates;
114 83
115 newidx = rate_control_pid_shift_adjust(rinfo, adj, sta->txrate, 84 /* Map passed arguments to sorted values. */
116 mode->num_rates); 85 cur_sorted = rinfo[cur].rev_index;
86 new_sorted = cur_sorted + adj;
117 87
118 while (newidx != sta->txrate) { 88 /* Check limits. */
119 if (rate_supported(sta, mode, newidx) && 89 if (new_sorted < 0)
120 (maxrate < 0 || newidx <= maxrate)) { 90 new_sorted = rinfo[0].rev_index;
121 sta->txrate = newidx; 91 else if (new_sorted >= n_bitrates)
122 break; 92 new_sorted = rinfo[n_bitrates - 1].rev_index;
123 }
124 93
125 newidx += back; 94 tmp = new_sorted;
95
96 if (adj < 0) {
97 /* Ensure that the rate decrease isn't disadvantageous. */
98 for (probe = cur_sorted; probe >= new_sorted; probe--)
99 if (rinfo[probe].diff <= rinfo[cur_sorted].diff &&
100 rate_supported(sta, mode, rinfo[probe].index))
101 tmp = probe;
102 } else {
103 /* Look for rate increase with zero (or below) cost. */
104 for (probe = new_sorted + 1; probe < n_bitrates; probe++)
105 if (rinfo[probe].diff <= rinfo[new_sorted].diff &&
106 rate_supported(sta, mode, rinfo[probe].index))
107 tmp = probe;
126 } 108 }
127 109
110 /* Fit the rate found to the nearest supported rate. */
111 do {
112 if (rate_supported(sta, mode, rinfo[tmp].index)) {
113 sta->txrate = rinfo[tmp].index;
114 break;
115 }
116 if (adj < 0)
117 tmp--;
118 else
119 tmp++;
120 } while (tmp < n_bitrates && tmp >= 0);
121
128#ifdef CONFIG_MAC80211_DEBUGFS 122#ifdef CONFIG_MAC80211_DEBUGFS
129 rate_control_pid_event_rate_change( 123 rate_control_pid_event_rate_change(
130 &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events, 124 &((struct rc_pid_sta_info *)sta->rate_ctrl_priv)->events,
131 newidx, mode->rates[newidx].rate); 125 cur, mode->rates[cur].rate);
132#endif 126#endif
133} 127}
134 128
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 9e214da82d9e..973f1dbc2ec3 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -256,12 +256,10 @@ int __init sctp_eps_proc_init(void)
256{ 256{
257 struct proc_dir_entry *p; 257 struct proc_dir_entry *p;
258 258
259 p = create_proc_entry("eps", S_IRUGO, proc_net_sctp); 259 p = proc_create("eps", S_IRUGO, proc_net_sctp, &sctp_eps_seq_fops);
260 if (!p) 260 if (!p)
261 return -ENOMEM; 261 return -ENOMEM;
262 262
263 p->proc_fops = &sctp_eps_seq_fops;
264
265 return 0; 263 return 0;
266} 264}
267 265
@@ -367,12 +365,11 @@ int __init sctp_assocs_proc_init(void)
367{ 365{
368 struct proc_dir_entry *p; 366 struct proc_dir_entry *p;
369 367
370 p = create_proc_entry("assocs", S_IRUGO, proc_net_sctp); 368 p = proc_create("assocs", S_IRUGO, proc_net_sctp,
369 &sctp_assocs_seq_fops);
371 if (!p) 370 if (!p)
372 return -ENOMEM; 371 return -ENOMEM;
373 372
374 p->proc_fops = &sctp_assocs_seq_fops;
375
376 return 0; 373 return 0;
377} 374}
378 375