aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-20 16:12:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-20 16:12:14 -0500
commit4dd61d92d7204788b93b064a679c9068fc5b8a5f (patch)
tree90dc522b71d06a336773f919def0fd99d59156c9 /net
parent95763dd52b4b9b3578d3428001ece1e11b016ffc (diff)
parent5ece6c2ddd6f7da9e95dc325c742c0f5afbcecbe (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: (23 commits) net: fix tiny output corruption of /proc/net/snmp6 atl2: don't request irq on resume if netif running ipv6: use seq_release_private for ip6mr.c /proc entries pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() smc911x: Fix printf format typo in smc911x driver. asix: Fix asix-based cards connecting to 10/100Mbs LAN. mv643xx_eth: fix recycle check bound mv643xx_eth: fix the order of mdiobus_{unregister, free}() calls sh: sh_eth: Update to change of mii_bus TPROXY: supply a struct flowi->flags argument in inet_sk_rebuild_header() TPROXY: fill struct flowi->flags in udp_sendmsg() net: ipg.c fix bracing on endian swapping phylib: Fix auto-negotiation restart avoidance net: jme.c rxdesc.flags is __le16, other missing endian swaps phylib: fix phy name example in documentation net: Do not fire linkwatch events until the device is registered. phonet: fix compilation with gcc-3.4 ixgbe: fix compilation with gcc-3.4 pktgen: fix multiple queue warning net: fix ip_mr_init() error path ...
Diffstat (limited to 'net')
-rw-r--r--net/core/pktgen.c9
-rw-r--r--net/ipv4/af_inet.c1
-rw-r--r--net/ipv4/ipmr.c9
-rw-r--r--net/ipv4/udp.c1
-rw-r--r--net/ipv6/ip6mr.c4
-rw-r--r--net/ipv6/proc.c6
-rw-r--r--net/mac80211/mlme.c22
-rw-r--r--net/phonet/af_phonet.c52
-rw-r--r--net/sched/sch_api.c2
-rw-r--r--net/sched/sch_generic.c7
10 files changed, 46 insertions, 67 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a47f5bad110d..8997e912aaaf 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1973,13 +1973,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
1973 1973
1974 /* make sure that we don't pick a non-existing transmit queue */ 1974 /* make sure that we don't pick a non-existing transmit queue */
1975 ntxq = pkt_dev->odev->real_num_tx_queues; 1975 ntxq = pkt_dev->odev->real_num_tx_queues;
1976 if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { 1976
1977 printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU "
1978 "disabled because CPU count (%d) exceeds number "
1979 "of tx queues (%d) on %s\n", num_online_cpus(), ntxq,
1980 pkt_dev->odev->name);
1981 pkt_dev->flags &= ~F_QUEUE_MAP_CPU;
1982 }
1983 if (ntxq <= pkt_dev->queue_map_min) { 1977 if (ntxq <= pkt_dev->queue_map_min) {
1984 printk(KERN_WARNING "pktgen: WARNING: Requested " 1978 printk(KERN_WARNING "pktgen: WARNING: Requested "
1985 "queue_map_min (zero-based) (%d) exceeds valid range " 1979 "queue_map_min (zero-based) (%d) exceeds valid range "
@@ -2202,6 +2196,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
2202 } 2196 }
2203 pkt_dev->cur_queue_map = t; 2197 pkt_dev->cur_queue_map = t;
2204 } 2198 }
2199 pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues;
2205} 2200}
2206 2201
2207/* Increment/randomize headers according to flags and current values 2202/* Increment/randomize headers according to flags and current values
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 1fbff5fa4241..1aa2dc9e380e 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1117,6 +1117,7 @@ int inet_sk_rebuild_header(struct sock *sk)
1117 }, 1117 },
1118 }, 1118 },
1119 .proto = sk->sk_protocol, 1119 .proto = sk->sk_protocol,
1120 .flags = inet_sk_flowi_flags(sk),
1120 .uli_u = { 1121 .uli_u = {
1121 .ports = { 1122 .ports = {
1122 .sport = inet->sport, 1123 .sport = inet->sport,
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index b42e082cc170..25924b1eb2ef 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1945,13 +1945,14 @@ int __init ip_mr_init(void)
1945 goto proc_cache_fail; 1945 goto proc_cache_fail;
1946#endif 1946#endif
1947 return 0; 1947 return 0;
1948reg_notif_fail:
1949 kmem_cache_destroy(mrt_cachep);
1950#ifdef CONFIG_PROC_FS 1948#ifdef CONFIG_PROC_FS
1951proc_vif_fail:
1952 unregister_netdevice_notifier(&ip_mr_notifier);
1953proc_cache_fail: 1949proc_cache_fail:
1954 proc_net_remove(&init_net, "ip_mr_vif"); 1950 proc_net_remove(&init_net, "ip_mr_vif");
1951proc_vif_fail:
1952 unregister_netdevice_notifier(&ip_mr_notifier);
1955#endif 1953#endif
1954reg_notif_fail:
1955 del_timer(&ipmr_expire_timer);
1956 kmem_cache_destroy(mrt_cachep);
1956 return err; 1957 return err;
1957} 1958}
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index cf02701ced48..98c1fd09be88 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -633,6 +633,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
633 .saddr = saddr, 633 .saddr = saddr,
634 .tos = tos } }, 634 .tos = tos } },
635 .proto = sk->sk_protocol, 635 .proto = sk->sk_protocol,
636 .flags = inet_sk_flowi_flags(sk),
636 .uli_u = { .ports = 637 .uli_u = { .ports =
637 { .sport = inet->sport, 638 { .sport = inet->sport,
638 .dport = dport } } }; 639 .dport = dport } } };
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 52a7eb0e2c2c..0524769632e7 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -224,7 +224,7 @@ static struct file_operations ip6mr_vif_fops = {
224 .open = ip6mr_vif_open, 224 .open = ip6mr_vif_open,
225 .read = seq_read, 225 .read = seq_read,
226 .llseek = seq_lseek, 226 .llseek = seq_lseek,
227 .release = seq_release, 227 .release = seq_release_private,
228}; 228};
229 229
230static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) 230static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos)
@@ -338,7 +338,7 @@ static struct file_operations ip6mr_mfc_fops = {
338 .open = ipmr_mfc_open, 338 .open = ipmr_mfc_open,
339 .read = seq_read, 339 .read = seq_read,
340 .llseek = seq_lseek, 340 .llseek = seq_lseek,
341 .release = seq_release, 341 .release = seq_release_private,
342}; 342};
343#endif 343#endif
344 344
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 07f0b76e7427..97c17fdd6f75 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -132,7 +132,7 @@ static struct snmp_mib snmp6_udplite6_list[] = {
132 132
133static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib) 133static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
134{ 134{
135 static char name[32]; 135 char name[32];
136 int i; 136 int i;
137 137
138 /* print by name -- deprecated items */ 138 /* print by name -- deprecated items */
@@ -144,7 +144,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
144 p = icmp6type2name[icmptype]; 144 p = icmp6type2name[icmptype];
145 if (!p) /* don't print un-named types here */ 145 if (!p) /* don't print un-named types here */
146 continue; 146 continue;
147 (void) snprintf(name, sizeof(name)-1, "Icmp6%s%s", 147 snprintf(name, sizeof(name), "Icmp6%s%s",
148 i & 0x100 ? "Out" : "In", p); 148 i & 0x100 ? "Out" : "In", p);
149 seq_printf(seq, "%-32s\t%lu\n", name, 149 seq_printf(seq, "%-32s\t%lu\n", name,
150 snmp_fold_field(mib, i)); 150 snmp_fold_field(mib, i));
@@ -157,7 +157,7 @@ static void snmp6_seq_show_icmpv6msg(struct seq_file *seq, void **mib)
157 val = snmp_fold_field(mib, i); 157 val = snmp_fold_field(mib, i);
158 if (!val) 158 if (!val)
159 continue; 159 continue;
160 (void) snprintf(name, sizeof(name)-1, "Icmp6%sType%u", 160 snprintf(name, sizeof(name), "Icmp6%sType%u",
161 i & 0x100 ? "Out" : "In", i & 0xff); 161 i & 0x100 ? "Out" : "In", i & 0xff);
162 seq_printf(seq, "%-32s\t%lu\n", name, val); 162 seq_printf(seq, "%-32s\t%lu\n", name, val);
163 } 163 }
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 14d165f0df75..409bb7716236 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2560,25 +2560,3 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
2560 ieee80211_restart_sta_timer(sdata); 2560 ieee80211_restart_sta_timer(sdata);
2561 rcu_read_unlock(); 2561 rcu_read_unlock();
2562} 2562}
2563
2564/* driver notification call */
2565void ieee80211_notify_mac(struct ieee80211_hw *hw,
2566 enum ieee80211_notification_types notif_type)
2567{
2568 struct ieee80211_local *local = hw_to_local(hw);
2569 struct ieee80211_sub_if_data *sdata;
2570
2571 switch (notif_type) {
2572 case IEEE80211_NOTIFY_RE_ASSOC:
2573 rtnl_lock();
2574 list_for_each_entry(sdata, &local->interfaces, list) {
2575 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2576 continue;
2577
2578 ieee80211_sta_req_auth(sdata, &sdata->u.sta);
2579 }
2580 rtnl_unlock();
2581 break;
2582 }
2583}
2584EXPORT_SYMBOL(ieee80211_notify_mac);
diff --git a/net/phonet/af_phonet.c b/net/phonet/af_phonet.c
index 7ab30f668b5a..9d211f12582b 100644
--- a/net/phonet/af_phonet.c
+++ b/net/phonet/af_phonet.c
@@ -33,9 +33,30 @@
33#include <net/phonet/phonet.h> 33#include <net/phonet/phonet.h>
34#include <net/phonet/pn_dev.h> 34#include <net/phonet/pn_dev.h>
35 35
36static struct net_proto_family phonet_proto_family; 36/* Transport protocol registration */
37static struct phonet_protocol *phonet_proto_get(int protocol); 37static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
38static inline void phonet_proto_put(struct phonet_protocol *pp); 38static DEFINE_SPINLOCK(proto_tab_lock);
39
40static struct phonet_protocol *phonet_proto_get(int protocol)
41{
42 struct phonet_protocol *pp;
43
44 if (protocol >= PHONET_NPROTO)
45 return NULL;
46
47 spin_lock(&proto_tab_lock);
48 pp = proto_tab[protocol];
49 if (pp && !try_module_get(pp->prot->owner))
50 pp = NULL;
51 spin_unlock(&proto_tab_lock);
52
53 return pp;
54}
55
56static inline void phonet_proto_put(struct phonet_protocol *pp)
57{
58 module_put(pp->prot->owner);
59}
39 60
40/* protocol family functions */ 61/* protocol family functions */
41 62
@@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = {
375 .func = phonet_rcv, 396 .func = phonet_rcv,
376}; 397};
377 398
378/* Transport protocol registration */
379static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
380static DEFINE_SPINLOCK(proto_tab_lock);
381
382int __init_or_module phonet_proto_register(int protocol, 399int __init_or_module phonet_proto_register(int protocol,
383 struct phonet_protocol *pp) 400 struct phonet_protocol *pp)
384{ 401{
@@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp)
412} 429}
413EXPORT_SYMBOL(phonet_proto_unregister); 430EXPORT_SYMBOL(phonet_proto_unregister);
414 431
415static struct phonet_protocol *phonet_proto_get(int protocol)
416{
417 struct phonet_protocol *pp;
418
419 if (protocol >= PHONET_NPROTO)
420 return NULL;
421
422 spin_lock(&proto_tab_lock);
423 pp = proto_tab[protocol];
424 if (pp && !try_module_get(pp->prot->owner))
425 pp = NULL;
426 spin_unlock(&proto_tab_lock);
427
428 return pp;
429}
430
431static inline void phonet_proto_put(struct phonet_protocol *pp)
432{
433 module_put(pp->prot->owner);
434}
435
436/* Module registration */ 432/* Module registration */
437static int __init phonet_init(void) 433static int __init phonet_init(void)
438{ 434{
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index b16ad2972c6b..6ab4a2f92ca0 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab)
417 struct nlattr *nest; 417 struct nlattr *nest;
418 418
419 nest = nla_nest_start(skb, TCA_STAB); 419 nest = nla_nest_start(skb, TCA_STAB);
420 if (nest == NULL)
421 goto nla_put_failure;
420 NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); 422 NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts);
421 nla_nest_end(skb, nest); 423 nla_nest_end(skb, nest);
422 424
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 93cd30ce6501..cdcd16fcfeda 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -270,6 +270,8 @@ static void dev_watchdog_down(struct net_device *dev)
270void netif_carrier_on(struct net_device *dev) 270void netif_carrier_on(struct net_device *dev)
271{ 271{
272 if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) { 272 if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
273 if (dev->reg_state == NETREG_UNINITIALIZED)
274 return;
273 linkwatch_fire_event(dev); 275 linkwatch_fire_event(dev);
274 if (netif_running(dev)) 276 if (netif_running(dev))
275 __netdev_watchdog_up(dev); 277 __netdev_watchdog_up(dev);
@@ -285,8 +287,11 @@ EXPORT_SYMBOL(netif_carrier_on);
285 */ 287 */
286void netif_carrier_off(struct net_device *dev) 288void netif_carrier_off(struct net_device *dev)
287{ 289{
288 if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) 290 if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
291 if (dev->reg_state == NETREG_UNINITIALIZED)
292 return;
289 linkwatch_fire_event(dev); 293 linkwatch_fire_event(dev);
294 }
290} 295}
291EXPORT_SYMBOL(netif_carrier_off); 296EXPORT_SYMBOL(netif_carrier_off);
292 297