diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-05 19:11:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-05 19:11:32 -0500 |
commit | cc5724ce10c21cb44f9413266bb100ab89b18e2a (patch) | |
tree | 513882a835d54c39a4bed8bc6e405ba55da20ada | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) | |
parent | a23f4bbd8d27ac8ddc5d71ace1f91bb503f0469a (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:
Revert "tcp: Always set urgent pointer if it's beyond snd_nxt"
ipv6: Copy cork options in ip6_append_data
udp: Fix UDP short packet false positive
gianfar: Fix potential soft reset race
gianfar: Fix BD_LENGTH_MASK definition
cxgb3: Fix lro switch
iwlwifi: save PCI state before suspend, restore after resume
iwlwifi: clean key table in iwl_clear_stations_table
-rw-r--r-- | drivers/net/cxgb3/sge.c | 3 | ||||
-rw-r--r-- | drivers/net/gianfar.c | 3 | ||||
-rw-r--r-- | drivers/net/gianfar.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 12 | ||||
-rw-r--r-- | net/ipv4/udp.c | 3 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 67 |
9 files changed, 70 insertions, 27 deletions
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 379a1324db4e..d31791f60292 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -2276,8 +2276,7 @@ no_mem: | |||
2276 | } else if ((len = ntohl(r->len_cq)) != 0) { | 2276 | } else if ((len = ntohl(r->len_cq)) != 0) { |
2277 | struct sge_fl *fl; | 2277 | struct sge_fl *fl; |
2278 | 2278 | ||
2279 | if (eth) | 2279 | lro &= eth && is_eth_tcp(rss_hi); |
2280 | lro = qs->lro_enabled && is_eth_tcp(rss_hi); | ||
2281 | 2280 | ||
2282 | fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; | 2281 | fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; |
2283 | if (fl->use_pages) { | 2282 | if (fl->use_pages) { |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 3f7eab42aef1..acae2d8cd688 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -351,6 +351,9 @@ static int gfar_probe(struct of_device *ofdev, | |||
351 | /* Reset MAC layer */ | 351 | /* Reset MAC layer */ |
352 | gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET); | 352 | gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET); |
353 | 353 | ||
354 | /* We need to delay at least 3 TX clocks */ | ||
355 | udelay(2); | ||
356 | |||
354 | tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); | 357 | tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); |
355 | gfar_write(&priv->regs->maccfg1, tempval); | 358 | gfar_write(&priv->regs->maccfg1, tempval); |
356 | 359 | ||
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index b1a83344acc7..eaa86897f5c3 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -312,7 +312,7 @@ extern const char gfar_driver_version[]; | |||
312 | #define ATTRELI_EI(x) (x) | 312 | #define ATTRELI_EI(x) (x) |
313 | 313 | ||
314 | #define BD_LFLAG(flags) ((flags) << 16) | 314 | #define BD_LFLAG(flags) ((flags) << 16) |
315 | #define BD_LENGTH_MASK 0x00ff | 315 | #define BD_LENGTH_MASK 0x0000ffff |
316 | 316 | ||
317 | /* TxBD status field bits */ | 317 | /* TxBD status field bits */ |
318 | #define TXBD_READY 0x8000 | 318 | #define TXBD_READY 0x8000 |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index b35c8813bef4..c01ea48da5fe 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -4042,6 +4042,7 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4042 | priv->is_open = 1; | 4042 | priv->is_open = 1; |
4043 | } | 4043 | } |
4044 | 4044 | ||
4045 | pci_save_state(pdev); | ||
4045 | pci_set_power_state(pdev, PCI_D3hot); | 4046 | pci_set_power_state(pdev, PCI_D3hot); |
4046 | 4047 | ||
4047 | return 0; | 4048 | return 0; |
@@ -4052,6 +4053,7 @@ static int iwl_pci_resume(struct pci_dev *pdev) | |||
4052 | struct iwl_priv *priv = pci_get_drvdata(pdev); | 4053 | struct iwl_priv *priv = pci_get_drvdata(pdev); |
4053 | 4054 | ||
4054 | pci_set_power_state(pdev, PCI_D0); | 4055 | pci_set_power_state(pdev, PCI_D0); |
4056 | pci_restore_state(pdev); | ||
4055 | 4057 | ||
4056 | if (priv->is_open) | 4058 | if (priv->is_open) |
4057 | iwl_mac_start(priv->hw); | 4059 | iwl_mac_start(priv->hw); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 412f66bac1af..70a8b21ca39b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -480,6 +480,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv) | |||
480 | priv->num_stations = 0; | 480 | priv->num_stations = 0; |
481 | memset(priv->stations, 0, sizeof(priv->stations)); | 481 | memset(priv->stations, 0, sizeof(priv->stations)); |
482 | 482 | ||
483 | /* clean ucode key table bit map */ | ||
484 | priv->ucode_key_table = 0; | ||
485 | |||
483 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 486 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
484 | } | 487 | } |
485 | EXPORT_SYMBOL(iwl_clear_stations_table); | 488 | EXPORT_SYMBOL(iwl_clear_stations_table); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 95d01984c80e..5b44d322b99f 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -8143,6 +8143,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
8143 | priv->is_open = 1; | 8143 | priv->is_open = 1; |
8144 | } | 8144 | } |
8145 | 8145 | ||
8146 | pci_save_state(pdev); | ||
8146 | pci_set_power_state(pdev, PCI_D3hot); | 8147 | pci_set_power_state(pdev, PCI_D3hot); |
8147 | 8148 | ||
8148 | return 0; | 8149 | return 0; |
@@ -8153,6 +8154,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev) | |||
8153 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); | 8154 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); |
8154 | 8155 | ||
8155 | pci_set_power_state(pdev, PCI_D0); | 8156 | pci_set_power_state(pdev, PCI_D0); |
8157 | pci_restore_state(pdev); | ||
8156 | 8158 | ||
8157 | if (priv->is_open) | 8159 | if (priv->is_open) |
8158 | iwl3945_mac_start(priv->hw); | 8160 | iwl3945_mac_start(priv->hw); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 557fe16cbfb0..dda42f0bd7a3 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -663,14 +663,10 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
663 | th->urg_ptr = 0; | 663 | th->urg_ptr = 0; |
664 | 664 | ||
665 | /* The urg_mode check is necessary during a below snd_una win probe */ | 665 | /* The urg_mode check is necessary during a below snd_una win probe */ |
666 | if (unlikely(tcp_urg_mode(tp))) { | 666 | if (unlikely(tcp_urg_mode(tp) && |
667 | if (between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF)) { | 667 | between(tp->snd_up, tcb->seq + 1, tcb->seq + 0xFFFF))) { |
668 | th->urg_ptr = htons(tp->snd_up - tcb->seq); | 668 | th->urg_ptr = htons(tp->snd_up - tcb->seq); |
669 | th->urg = 1; | 669 | th->urg = 1; |
670 | } else if (after(tcb->seq + 0xFFFF, tp->snd_nxt)) { | ||
671 | th->urg_ptr = 0xFFFF; | ||
672 | th->urg = 1; | ||
673 | } | ||
674 | } | 670 | } |
675 | 671 | ||
676 | tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); | 672 | tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1ab180bad72a..cc3a0a06c004 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1231,7 +1231,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1231 | int proto) | 1231 | int proto) |
1232 | { | 1232 | { |
1233 | struct sock *sk; | 1233 | struct sock *sk; |
1234 | struct udphdr *uh = udp_hdr(skb); | 1234 | struct udphdr *uh; |
1235 | unsigned short ulen; | 1235 | unsigned short ulen; |
1236 | struct rtable *rt = (struct rtable*)skb->dst; | 1236 | struct rtable *rt = (struct rtable*)skb->dst; |
1237 | __be32 saddr = ip_hdr(skb)->saddr; | 1237 | __be32 saddr = ip_hdr(skb)->saddr; |
@@ -1244,6 +1244,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1244 | if (!pskb_may_pull(skb, sizeof(struct udphdr))) | 1244 | if (!pskb_may_pull(skb, sizeof(struct udphdr))) |
1245 | goto drop; /* No space for header. */ | 1245 | goto drop; /* No space for header. */ |
1246 | 1246 | ||
1247 | uh = udp_hdr(skb); | ||
1247 | ulen = ntohs(uh->len); | 1248 | ulen = ntohs(uh->len); |
1248 | if (ulen > skb->len) | 1249 | if (ulen > skb->len) |
1249 | goto short_packet; | 1250 | goto short_packet; |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 4b15938bef4d..9fb49c3b518a 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -1105,6 +1105,18 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1105 | return err; | 1105 | return err; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | static inline struct ipv6_opt_hdr *ip6_opt_dup(struct ipv6_opt_hdr *src, | ||
1109 | gfp_t gfp) | ||
1110 | { | ||
1111 | return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL; | ||
1112 | } | ||
1113 | |||
1114 | static inline struct ipv6_rt_hdr *ip6_rthdr_dup(struct ipv6_rt_hdr *src, | ||
1115 | gfp_t gfp) | ||
1116 | { | ||
1117 | return src ? kmemdup(src, (src->hdrlen + 1) * 8, gfp) : NULL; | ||
1118 | } | ||
1119 | |||
1108 | int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | 1120 | int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, |
1109 | int offset, int len, int odd, struct sk_buff *skb), | 1121 | int offset, int len, int odd, struct sk_buff *skb), |
1110 | void *from, int length, int transhdrlen, | 1122 | void *from, int length, int transhdrlen, |
@@ -1130,17 +1142,37 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
1130 | * setup for corking | 1142 | * setup for corking |
1131 | */ | 1143 | */ |
1132 | if (opt) { | 1144 | if (opt) { |
1133 | if (np->cork.opt == NULL) { | 1145 | if (WARN_ON(np->cork.opt)) |
1134 | np->cork.opt = kmalloc(opt->tot_len, | ||
1135 | sk->sk_allocation); | ||
1136 | if (unlikely(np->cork.opt == NULL)) | ||
1137 | return -ENOBUFS; | ||
1138 | } else if (np->cork.opt->tot_len < opt->tot_len) { | ||
1139 | printk(KERN_DEBUG "ip6_append_data: invalid option length\n"); | ||
1140 | return -EINVAL; | 1146 | return -EINVAL; |
1141 | } | 1147 | |
1142 | memcpy(np->cork.opt, opt, opt->tot_len); | 1148 | np->cork.opt = kmalloc(opt->tot_len, sk->sk_allocation); |
1143 | inet->cork.flags |= IPCORK_OPT; | 1149 | if (unlikely(np->cork.opt == NULL)) |
1150 | return -ENOBUFS; | ||
1151 | |||
1152 | np->cork.opt->tot_len = opt->tot_len; | ||
1153 | np->cork.opt->opt_flen = opt->opt_flen; | ||
1154 | np->cork.opt->opt_nflen = opt->opt_nflen; | ||
1155 | |||
1156 | np->cork.opt->dst0opt = ip6_opt_dup(opt->dst0opt, | ||
1157 | sk->sk_allocation); | ||
1158 | if (opt->dst0opt && !np->cork.opt->dst0opt) | ||
1159 | return -ENOBUFS; | ||
1160 | |||
1161 | np->cork.opt->dst1opt = ip6_opt_dup(opt->dst1opt, | ||
1162 | sk->sk_allocation); | ||
1163 | if (opt->dst1opt && !np->cork.opt->dst1opt) | ||
1164 | return -ENOBUFS; | ||
1165 | |||
1166 | np->cork.opt->hopopt = ip6_opt_dup(opt->hopopt, | ||
1167 | sk->sk_allocation); | ||
1168 | if (opt->hopopt && !np->cork.opt->hopopt) | ||
1169 | return -ENOBUFS; | ||
1170 | |||
1171 | np->cork.opt->srcrt = ip6_rthdr_dup(opt->srcrt, | ||
1172 | sk->sk_allocation); | ||
1173 | if (opt->srcrt && !np->cork.opt->srcrt) | ||
1174 | return -ENOBUFS; | ||
1175 | |||
1144 | /* need source address above miyazawa*/ | 1176 | /* need source address above miyazawa*/ |
1145 | } | 1177 | } |
1146 | dst_hold(&rt->u.dst); | 1178 | dst_hold(&rt->u.dst); |
@@ -1167,8 +1199,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
1167 | } else { | 1199 | } else { |
1168 | rt = (struct rt6_info *)inet->cork.dst; | 1200 | rt = (struct rt6_info *)inet->cork.dst; |
1169 | fl = &inet->cork.fl; | 1201 | fl = &inet->cork.fl; |
1170 | if (inet->cork.flags & IPCORK_OPT) | 1202 | opt = np->cork.opt; |
1171 | opt = np->cork.opt; | ||
1172 | transhdrlen = 0; | 1203 | transhdrlen = 0; |
1173 | exthdrlen = 0; | 1204 | exthdrlen = 0; |
1174 | mtu = inet->cork.fragsize; | 1205 | mtu = inet->cork.fragsize; |
@@ -1407,9 +1438,15 @@ error: | |||
1407 | 1438 | ||
1408 | static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np) | 1439 | static void ip6_cork_release(struct inet_sock *inet, struct ipv6_pinfo *np) |
1409 | { | 1440 | { |
1410 | inet->cork.flags &= ~IPCORK_OPT; | 1441 | if (np->cork.opt) { |
1411 | kfree(np->cork.opt); | 1442 | kfree(np->cork.opt->dst0opt); |
1412 | np->cork.opt = NULL; | 1443 | kfree(np->cork.opt->dst1opt); |
1444 | kfree(np->cork.opt->hopopt); | ||
1445 | kfree(np->cork.opt->srcrt); | ||
1446 | kfree(np->cork.opt); | ||
1447 | np->cork.opt = NULL; | ||
1448 | } | ||
1449 | |||
1413 | if (inet->cork.dst) { | 1450 | if (inet->cork.dst) { |
1414 | dst_release(inet->cork.dst); | 1451 | dst_release(inet->cork.dst); |
1415 | inet->cork.dst = NULL; | 1452 | inet->cork.dst = NULL; |