diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/8021q/vlan_dev.c | 3 | ||||
-rw-r--r-- | net/ax25/ax25_uid.c | 12 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 38 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 2 | ||||
-rw-r--r-- | net/can/af_can.c | 4 | ||||
-rw-r--r-- | net/core/dev.c | 9 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 | ||||
-rw-r--r-- | net/mac80211/Kconfig | 7 | ||||
-rw-r--r-- | net/mac80211/main.c | 2 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 38 | ||||
-rw-r--r-- | net/mac80211/rx.c | 13 | ||||
-rw-r--r-- | net/mac80211/wext.c | 43 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 10 | ||||
-rw-r--r-- | net/netfilter/nfnetlink.c | 2 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 8 | ||||
-rw-r--r-- | net/wireless/core.h | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 4 | ||||
-rw-r--r-- | net/wireless/reg.c | 5 | ||||
-rw-r--r-- | net/wireless/scan.c | 40 |
20 files changed, 181 insertions, 69 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 1b34135cf990..6b0921364014 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -668,7 +668,8 @@ static int vlan_ethtool_get_settings(struct net_device *dev, | |||
668 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); | 668 | const struct vlan_dev_info *vlan = vlan_dev_info(dev); |
669 | struct net_device *real_dev = vlan->real_dev; | 669 | struct net_device *real_dev = vlan->real_dev; |
670 | 670 | ||
671 | if (!real_dev->ethtool_ops->get_settings) | 671 | if (!real_dev->ethtool_ops || |
672 | !real_dev->ethtool_ops->get_settings) | ||
672 | return -EOPNOTSUPP; | 673 | return -EOPNOTSUPP; |
673 | 674 | ||
674 | return real_dev->ethtool_ops->get_settings(real_dev, cmd); | 675 | return real_dev->ethtool_ops->get_settings(real_dev, cmd); |
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c index 57aeba729bae..832bcf092a01 100644 --- a/net/ax25/ax25_uid.c +++ b/net/ax25/ax25_uid.c | |||
@@ -148,9 +148,13 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | |||
148 | { | 148 | { |
149 | struct ax25_uid_assoc *pt; | 149 | struct ax25_uid_assoc *pt; |
150 | struct hlist_node *node; | 150 | struct hlist_node *node; |
151 | int i = 0; | 151 | int i = 1; |
152 | 152 | ||
153 | read_lock(&ax25_uid_lock); | 153 | read_lock(&ax25_uid_lock); |
154 | |||
155 | if (*pos == 0) | ||
156 | return SEQ_START_TOKEN; | ||
157 | |||
154 | ax25_uid_for_each(pt, node, &ax25_uid_list) { | 158 | ax25_uid_for_each(pt, node, &ax25_uid_list) { |
155 | if (i == *pos) | 159 | if (i == *pos) |
156 | return pt; | 160 | return pt; |
@@ -162,8 +166,10 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) | |||
162 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 166 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
163 | { | 167 | { |
164 | ++*pos; | 168 | ++*pos; |
165 | 169 | if (v == SEQ_START_TOKEN) | |
166 | return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | 170 | return ax25_uid_list.first; |
171 | else | ||
172 | return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | ||
167 | ax25_uid_assoc, uid_node); | 173 | ax25_uid_assoc, uid_node); |
168 | } | 174 | } |
169 | 175 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 55534244c3a0..15f40ea8d544 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -866,8 +866,16 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s | |||
866 | hci_dev_lock(hdev); | 866 | hci_dev_lock(hdev); |
867 | 867 | ||
868 | conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); | 868 | conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); |
869 | if (!conn) | 869 | if (!conn) { |
870 | goto unlock; | 870 | if (ev->link_type != SCO_LINK) |
871 | goto unlock; | ||
872 | |||
873 | conn = hci_conn_hash_lookup_ba(hdev, ESCO_LINK, &ev->bdaddr); | ||
874 | if (!conn) | ||
875 | goto unlock; | ||
876 | |||
877 | conn->type = SCO_LINK; | ||
878 | } | ||
871 | 879 | ||
872 | if (!ev->status) { | 880 | if (!ev->status) { |
873 | conn->handle = __le16_to_cpu(ev->handle); | 881 | conn->handle = __le16_to_cpu(ev->handle); |
@@ -1646,20 +1654,28 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu | |||
1646 | conn->type = SCO_LINK; | 1654 | conn->type = SCO_LINK; |
1647 | } | 1655 | } |
1648 | 1656 | ||
1649 | if (conn->out && ev->status == 0x1c && conn->attempt < 2) { | 1657 | switch (ev->status) { |
1650 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | 1658 | case 0x00: |
1651 | (hdev->esco_type & EDR_ESCO_MASK); | ||
1652 | hci_setup_sync(conn, conn->link->handle); | ||
1653 | goto unlock; | ||
1654 | } | ||
1655 | |||
1656 | if (!ev->status) { | ||
1657 | conn->handle = __le16_to_cpu(ev->handle); | 1659 | conn->handle = __le16_to_cpu(ev->handle); |
1658 | conn->state = BT_CONNECTED; | 1660 | conn->state = BT_CONNECTED; |
1659 | 1661 | ||
1660 | hci_conn_add_sysfs(conn); | 1662 | hci_conn_add_sysfs(conn); |
1661 | } else | 1663 | break; |
1664 | |||
1665 | case 0x1c: /* SCO interval rejected */ | ||
1666 | case 0x1f: /* Unspecified error */ | ||
1667 | if (conn->out && conn->attempt < 2) { | ||
1668 | conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | ||
1669 | (hdev->esco_type & EDR_ESCO_MASK); | ||
1670 | hci_setup_sync(conn, conn->link->handle); | ||
1671 | goto unlock; | ||
1672 | } | ||
1673 | /* fall through */ | ||
1674 | |||
1675 | default: | ||
1662 | conn->state = BT_CLOSED; | 1676 | conn->state = BT_CLOSED; |
1677 | break; | ||
1678 | } | ||
1663 | 1679 | ||
1664 | hci_proto_connect_cfm(conn, ev->status); | 1680 | hci_proto_connect_cfm(conn, ev->status); |
1665 | if (ev->status) | 1681 | if (ev->status) |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 1d0fb0f23c63..374536e050aa 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -1194,6 +1194,8 @@ void rfcomm_dlc_accept(struct rfcomm_dlc *d) | |||
1194 | 1194 | ||
1195 | rfcomm_send_ua(d->session, d->dlci); | 1195 | rfcomm_send_ua(d->session, d->dlci); |
1196 | 1196 | ||
1197 | rfcomm_dlc_clear_timer(d); | ||
1198 | |||
1197 | rfcomm_dlc_lock(d); | 1199 | rfcomm_dlc_lock(d); |
1198 | d->state = BT_CONNECTED; | 1200 | d->state = BT_CONNECTED; |
1199 | d->state_change(d, 0); | 1201 | d->state_change(d, 0); |
diff --git a/net/can/af_can.c b/net/can/af_can.c index 547bafc79e28..10f0528c3bf5 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -674,8 +674,8 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev, | |||
674 | 674 | ||
675 | rcu_read_unlock(); | 675 | rcu_read_unlock(); |
676 | 676 | ||
677 | /* free the skbuff allocated by the netdevice driver */ | 677 | /* consume the skbuff allocated by the netdevice driver */ |
678 | kfree_skb(skb); | 678 | consume_skb(skb); |
679 | 679 | ||
680 | if (matches > 0) { | 680 | if (matches > 0) { |
681 | can_stats.matches++; | 681 | can_stats.matches++; |
diff --git a/net/core/dev.c b/net/core/dev.c index cfc614ec3719..e48c08af76ad 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1336,7 +1336,12 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
1336 | { | 1336 | { |
1337 | struct packet_type *ptype; | 1337 | struct packet_type *ptype; |
1338 | 1338 | ||
1339 | #ifdef CONFIG_NET_CLS_ACT | ||
1340 | if (!(skb->tstamp.tv64 && (G_TC_FROM(skb->tc_verd) & AT_INGRESS))) | ||
1341 | net_timestamp(skb); | ||
1342 | #else | ||
1339 | net_timestamp(skb); | 1343 | net_timestamp(skb); |
1344 | #endif | ||
1340 | 1345 | ||
1341 | rcu_read_lock(); | 1346 | rcu_read_lock(); |
1342 | list_for_each_entry_rcu(ptype, &ptype_all, list) { | 1347 | list_for_each_entry_rcu(ptype, &ptype_all, list) { |
@@ -4391,7 +4396,7 @@ int register_netdevice(struct net_device *dev) | |||
4391 | dev->iflink = -1; | 4396 | dev->iflink = -1; |
4392 | 4397 | ||
4393 | #ifdef CONFIG_COMPAT_NET_DEV_OPS | 4398 | #ifdef CONFIG_COMPAT_NET_DEV_OPS |
4394 | /* Netdevice_ops API compatiability support. | 4399 | /* Netdevice_ops API compatibility support. |
4395 | * This is temporary until all network devices are converted. | 4400 | * This is temporary until all network devices are converted. |
4396 | */ | 4401 | */ |
4397 | if (dev->netdev_ops) { | 4402 | if (dev->netdev_ops) { |
@@ -4402,7 +4407,7 @@ int register_netdevice(struct net_device *dev) | |||
4402 | dev->name, netdev_drivername(dev, drivername, 64)); | 4407 | dev->name, netdev_drivername(dev, drivername, 64)); |
4403 | 4408 | ||
4404 | /* This works only because net_device_ops and the | 4409 | /* This works only because net_device_ops and the |
4405 | compatiablity structure are the same. */ | 4410 | compatibility structure are the same. */ |
4406 | dev->netdev_ops = (void *) &(dev->init); | 4411 | dev->netdev_ops = (void *) &(dev->init); |
4407 | } | 4412 | } |
4408 | #endif | 4413 | #endif |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index fafbec8b073e..1d7f49c6f0ca 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2511,6 +2511,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2511 | struct sk_buff *p; | 2511 | struct sk_buff *p; |
2512 | struct tcphdr *th; | 2512 | struct tcphdr *th; |
2513 | struct tcphdr *th2; | 2513 | struct tcphdr *th2; |
2514 | unsigned int len; | ||
2514 | unsigned int thlen; | 2515 | unsigned int thlen; |
2515 | unsigned int flags; | 2516 | unsigned int flags; |
2516 | unsigned int mss = 1; | 2517 | unsigned int mss = 1; |
@@ -2531,6 +2532,7 @@ struct sk_buff **tcp_gro_receive(struct sk_buff **head, struct sk_buff *skb) | |||
2531 | 2532 | ||
2532 | skb_gro_pull(skb, thlen); | 2533 | skb_gro_pull(skb, thlen); |
2533 | 2534 | ||
2535 | len = skb_gro_len(skb); | ||
2534 | flags = tcp_flag_word(th); | 2536 | flags = tcp_flag_word(th); |
2535 | 2537 | ||
2536 | for (; (p = *head); head = &p->next) { | 2538 | for (; (p = *head); head = &p->next) { |
@@ -2561,7 +2563,7 @@ found: | |||
2561 | 2563 | ||
2562 | mss = skb_shinfo(p)->gso_size; | 2564 | mss = skb_shinfo(p)->gso_size; |
2563 | 2565 | ||
2564 | flush |= (skb_gro_len(skb) > mss) | !skb_gro_len(skb); | 2566 | flush |= (len > mss) | !len; |
2565 | flush |= (ntohl(th2->seq) + skb_gro_len(p)) ^ ntohl(th->seq); | 2567 | flush |= (ntohl(th2->seq) + skb_gro_len(p)) ^ ntohl(th->seq); |
2566 | 2568 | ||
2567 | if (flush || skb_gro_receive(head, skb)) { | 2569 | if (flush || skb_gro_receive(head, skb)) { |
@@ -2574,7 +2576,7 @@ found: | |||
2574 | tcp_flag_word(th2) |= flags & (TCP_FLAG_FIN | TCP_FLAG_PSH); | 2576 | tcp_flag_word(th2) |= flags & (TCP_FLAG_FIN | TCP_FLAG_PSH); |
2575 | 2577 | ||
2576 | out_check_final: | 2578 | out_check_final: |
2577 | flush = skb_gro_len(skb) < mss; | 2579 | flush = len < mss; |
2578 | flush |= flags & (TCP_FLAG_URG | TCP_FLAG_PSH | TCP_FLAG_RST | | 2580 | flush |= flags & (TCP_FLAG_URG | TCP_FLAG_PSH | TCP_FLAG_RST | |
2579 | TCP_FLAG_SYN | TCP_FLAG_FIN); | 2581 | TCP_FLAG_SYN | TCP_FLAG_FIN); |
2580 | 2582 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 53300fa2359f..59aec609cec6 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -778,7 +778,7 @@ static void tcp_adjust_pcount(struct sock *sk, struct sk_buff *skb, int decr) | |||
778 | 778 | ||
779 | if (tp->lost_skb_hint && | 779 | if (tp->lost_skb_hint && |
780 | before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(tp->lost_skb_hint)->seq) && | 780 | before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(tp->lost_skb_hint)->seq) && |
781 | (tcp_is_fack(tp) || TCP_SKB_CB(skb)->sacked)) | 781 | (tcp_is_fack(tp) || (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))) |
782 | tp->lost_cnt_hint -= decr; | 782 | tp->lost_cnt_hint -= decr; |
783 | 783 | ||
784 | tcp_verify_left_out(tp); | 784 | tcp_verify_left_out(tp); |
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index f3d9ae350fb6..ecc3faf9f11a 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
@@ -202,10 +202,3 @@ config MAC80211_DEBUG_COUNTERS | |||
202 | and show them in debugfs. | 202 | and show them in debugfs. |
203 | 203 | ||
204 | If unsure, say N. | 204 | If unsure, say N. |
205 | |||
206 | config MAC80211_VERBOSE_SPECT_MGMT_DEBUG | ||
207 | bool "Verbose Spectrum Management (IEEE 802.11h)debugging" | ||
208 | depends on MAC80211_DEBUG_MENU | ||
209 | ---help--- | ||
210 | Say Y here to print out verbose Spectrum Management (IEEE 802.11h) | ||
211 | debug messages. | ||
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index a6f1d8a869bc..fbcbed6cad01 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -258,7 +258,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed) | |||
258 | (chan->max_power - local->power_constr_level) : | 258 | (chan->max_power - local->power_constr_level) : |
259 | chan->max_power; | 259 | chan->max_power; |
260 | 260 | ||
261 | if (local->user_power_level) | 261 | if (local->user_power_level >= 0) |
262 | power = min(power, local->user_power_level); | 262 | power = min(power, local->user_power_level); |
263 | 263 | ||
264 | if (local->hw.conf.power_level != power) { | 264 | if (local->hw.conf.power_level != power) { |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 7ecda9d59d8a..132938b073dc 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -441,6 +441,9 @@ static bool ieee80211_check_tim(struct ieee802_11_elems *elems, u16 aid) | |||
441 | u8 index, indexn1, indexn2; | 441 | u8 index, indexn1, indexn2; |
442 | struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) elems->tim; | 442 | struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *) elems->tim; |
443 | 443 | ||
444 | if (unlikely(!tim || elems->tim_len < 4)) | ||
445 | return false; | ||
446 | |||
444 | aid &= 0x3fff; | 447 | aid &= 0x3fff; |
445 | index = aid / 8; | 448 | index = aid / 8; |
446 | mask = 1 << (aid & 7); | 449 | mask = 1 << (aid & 7); |
@@ -945,9 +948,13 @@ void ieee80211_beacon_loss_work(struct work_struct *work) | |||
945 | u.mgd.beacon_loss_work); | 948 | u.mgd.beacon_loss_work); |
946 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 949 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
947 | 950 | ||
948 | printk(KERN_DEBUG "%s: driver reports beacon loss from AP %pM " | 951 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
949 | "- sending probe request\n", sdata->dev->name, | 952 | if (net_ratelimit()) { |
950 | sdata->u.mgd.bssid); | 953 | printk(KERN_DEBUG "%s: driver reports beacon loss from AP %pM " |
954 | "- sending probe request\n", sdata->dev->name, | ||
955 | sdata->u.mgd.bssid); | ||
956 | } | ||
957 | #endif | ||
951 | 958 | ||
952 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; | 959 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; |
953 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, | 960 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, |
@@ -1007,9 +1014,13 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata) | |||
1007 | (local->hw.conf.flags & IEEE80211_CONF_PS)) && | 1014 | (local->hw.conf.flags & IEEE80211_CONF_PS)) && |
1008 | time_after(jiffies, | 1015 | time_after(jiffies, |
1009 | ifmgd->last_beacon + IEEE80211_MONITORING_INTERVAL)) { | 1016 | ifmgd->last_beacon + IEEE80211_MONITORING_INTERVAL)) { |
1010 | printk(KERN_DEBUG "%s: beacon loss from AP %pM " | 1017 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
1011 | "- sending probe request\n", | 1018 | if (net_ratelimit()) { |
1012 | sdata->dev->name, ifmgd->bssid); | 1019 | printk(KERN_DEBUG "%s: beacon loss from AP %pM " |
1020 | "- sending probe request\n", | ||
1021 | sdata->dev->name, ifmgd->bssid); | ||
1022 | } | ||
1023 | #endif | ||
1013 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; | 1024 | ifmgd->flags |= IEEE80211_STA_PROBEREQ_POLL; |
1014 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, | 1025 | ieee80211_send_probe_req(sdata, ifmgd->bssid, ifmgd->ssid, |
1015 | ifmgd->ssid_len, NULL, 0); | 1026 | ifmgd->ssid_len, NULL, 0); |
@@ -1355,7 +1366,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1355 | 1366 | ||
1356 | for (i = 0; i < elems.ext_supp_rates_len; i++) { | 1367 | for (i = 0; i < elems.ext_supp_rates_len; i++) { |
1357 | int rate = (elems.ext_supp_rates[i] & 0x7f) * 5; | 1368 | int rate = (elems.ext_supp_rates[i] & 0x7f) * 5; |
1358 | bool is_basic = !!(elems.supp_rates[i] & 0x80); | 1369 | bool is_basic = !!(elems.ext_supp_rates[i] & 0x80); |
1359 | 1370 | ||
1360 | if (rate > 110) | 1371 | if (rate > 110) |
1361 | have_higher_than_11mbit = true; | 1372 | have_higher_than_11mbit = true; |
@@ -1902,9 +1913,17 @@ static void ieee80211_sta_work(struct work_struct *work) | |||
1902 | 1913 | ||
1903 | static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | 1914 | static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) |
1904 | { | 1915 | { |
1905 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 1916 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
1917 | /* | ||
1918 | * Need to update last_beacon to avoid beacon loss | ||
1919 | * test to trigger. | ||
1920 | */ | ||
1921 | sdata->u.mgd.last_beacon = jiffies; | ||
1922 | |||
1923 | |||
1906 | queue_work(sdata->local->hw.workqueue, | 1924 | queue_work(sdata->local->hw.workqueue, |
1907 | &sdata->u.mgd.work); | 1925 | &sdata->u.mgd.work); |
1926 | } | ||
1908 | } | 1927 | } |
1909 | 1928 | ||
1910 | /* interface setup */ | 1929 | /* interface setup */ |
@@ -2105,12 +2124,13 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work) | |||
2105 | struct ieee80211_local *local = | 2124 | struct ieee80211_local *local = |
2106 | container_of(work, struct ieee80211_local, | 2125 | container_of(work, struct ieee80211_local, |
2107 | dynamic_ps_enable_work); | 2126 | dynamic_ps_enable_work); |
2127 | /* XXX: using scan_sdata is completely broken! */ | ||
2108 | struct ieee80211_sub_if_data *sdata = local->scan_sdata; | 2128 | struct ieee80211_sub_if_data *sdata = local->scan_sdata; |
2109 | 2129 | ||
2110 | if (local->hw.conf.flags & IEEE80211_CONF_PS) | 2130 | if (local->hw.conf.flags & IEEE80211_CONF_PS) |
2111 | return; | 2131 | return; |
2112 | 2132 | ||
2113 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) | 2133 | if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK && sdata) |
2114 | ieee80211_send_nullfunc(local, sdata, 1); | 2134 | ieee80211_send_nullfunc(local, sdata, 1); |
2115 | 2135 | ||
2116 | local->hw.conf.flags |= IEEE80211_CONF_PS; | 2136 | local->hw.conf.flags |= IEEE80211_CONF_PS; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 64ebe664effc..5fa7aedd90ed 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -29,6 +29,7 @@ | |||
29 | static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, | 29 | static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, |
30 | struct tid_ampdu_rx *tid_agg_rx, | 30 | struct tid_ampdu_rx *tid_agg_rx, |
31 | struct sk_buff *skb, | 31 | struct sk_buff *skb, |
32 | struct ieee80211_rx_status *status, | ||
32 | u16 mpdu_seq_num, | 33 | u16 mpdu_seq_num, |
33 | int bar_req); | 34 | int bar_req); |
34 | /* | 35 | /* |
@@ -1688,7 +1689,7 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx) | |||
1688 | /* manage reordering buffer according to requested */ | 1689 | /* manage reordering buffer according to requested */ |
1689 | /* sequence number */ | 1690 | /* sequence number */ |
1690 | rcu_read_lock(); | 1691 | rcu_read_lock(); |
1691 | ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL, | 1692 | ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, NULL, NULL, |
1692 | start_seq_num, 1); | 1693 | start_seq_num, 1); |
1693 | rcu_read_unlock(); | 1694 | rcu_read_unlock(); |
1694 | return RX_DROP_UNUSABLE; | 1695 | return RX_DROP_UNUSABLE; |
@@ -2293,6 +2294,7 @@ static inline u16 seq_sub(u16 sq1, u16 sq2) | |||
2293 | static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, | 2294 | static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, |
2294 | struct tid_ampdu_rx *tid_agg_rx, | 2295 | struct tid_ampdu_rx *tid_agg_rx, |
2295 | struct sk_buff *skb, | 2296 | struct sk_buff *skb, |
2297 | struct ieee80211_rx_status *rxstatus, | ||
2296 | u16 mpdu_seq_num, | 2298 | u16 mpdu_seq_num, |
2297 | int bar_req) | 2299 | int bar_req) |
2298 | { | 2300 | { |
@@ -2374,6 +2376,8 @@ static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, | |||
2374 | 2376 | ||
2375 | /* put the frame in the reordering buffer */ | 2377 | /* put the frame in the reordering buffer */ |
2376 | tid_agg_rx->reorder_buf[index] = skb; | 2378 | tid_agg_rx->reorder_buf[index] = skb; |
2379 | memcpy(tid_agg_rx->reorder_buf[index]->cb, rxstatus, | ||
2380 | sizeof(*rxstatus)); | ||
2377 | tid_agg_rx->stored_mpdu_num++; | 2381 | tid_agg_rx->stored_mpdu_num++; |
2378 | /* release the buffer until next missing frame */ | 2382 | /* release the buffer until next missing frame */ |
2379 | index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) | 2383 | index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) |
@@ -2399,7 +2403,8 @@ static u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw, | |||
2399 | } | 2403 | } |
2400 | 2404 | ||
2401 | static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local, | 2405 | static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local, |
2402 | struct sk_buff *skb) | 2406 | struct sk_buff *skb, |
2407 | struct ieee80211_rx_status *status) | ||
2403 | { | 2408 | { |
2404 | struct ieee80211_hw *hw = &local->hw; | 2409 | struct ieee80211_hw *hw = &local->hw; |
2405 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; | 2410 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; |
@@ -2448,7 +2453,7 @@ static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local, | |||
2448 | 2453 | ||
2449 | /* according to mpdu sequence number deal with reordering buffer */ | 2454 | /* according to mpdu sequence number deal with reordering buffer */ |
2450 | mpdu_seq_num = (sc & IEEE80211_SCTL_SEQ) >> 4; | 2455 | mpdu_seq_num = (sc & IEEE80211_SCTL_SEQ) >> 4; |
2451 | ret = ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, skb, | 2456 | ret = ieee80211_sta_manage_reorder_buf(hw, tid_agg_rx, skb, status, |
2452 | mpdu_seq_num, 0); | 2457 | mpdu_seq_num, 0); |
2453 | end_reorder: | 2458 | end_reorder: |
2454 | return ret; | 2459 | return ret; |
@@ -2512,7 +2517,7 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2512 | return; | 2517 | return; |
2513 | } | 2518 | } |
2514 | 2519 | ||
2515 | if (!ieee80211_rx_reorder_ampdu(local, skb)) | 2520 | if (!ieee80211_rx_reorder_ampdu(local, skb, status)) |
2516 | __ieee80211_rx_handle_packet(hw, skb, status, rate); | 2521 | __ieee80211_rx_handle_packet(hw, skb, status, rate); |
2517 | 2522 | ||
2518 | rcu_read_unlock(); | 2523 | rcu_read_unlock(); |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index deb4ecec122a..959aa8379ccf 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -417,6 +417,7 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev, | |||
417 | { | 417 | { |
418 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 418 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
419 | struct ieee80211_channel* chan = local->hw.conf.channel; | 419 | struct ieee80211_channel* chan = local->hw.conf.channel; |
420 | bool reconf = false; | ||
420 | u32 reconf_flags = 0; | 421 | u32 reconf_flags = 0; |
421 | int new_power_level; | 422 | int new_power_level; |
422 | 423 | ||
@@ -427,14 +428,38 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev, | |||
427 | if (!chan) | 428 | if (!chan) |
428 | return -EINVAL; | 429 | return -EINVAL; |
429 | 430 | ||
430 | if (data->txpower.fixed) | 431 | /* only change when not disabling */ |
431 | new_power_level = min(data->txpower.value, chan->max_power); | 432 | if (!data->txpower.disabled) { |
432 | else /* Automatic power level setting */ | 433 | if (data->txpower.fixed) { |
433 | new_power_level = chan->max_power; | 434 | if (data->txpower.value < 0) |
435 | return -EINVAL; | ||
436 | new_power_level = data->txpower.value; | ||
437 | /* | ||
438 | * Debatable, but we cannot do a fixed power | ||
439 | * level above the regulatory constraint. | ||
440 | * Use "iwconfig wlan0 txpower 15dBm" instead. | ||
441 | */ | ||
442 | if (new_power_level > chan->max_power) | ||
443 | return -EINVAL; | ||
444 | } else { | ||
445 | /* | ||
446 | * Automatic power level setting, max being the value | ||
447 | * passed in from userland. | ||
448 | */ | ||
449 | if (data->txpower.value < 0) | ||
450 | new_power_level = -1; | ||
451 | else | ||
452 | new_power_level = data->txpower.value; | ||
453 | } | ||
454 | |||
455 | reconf = true; | ||
434 | 456 | ||
435 | local->user_power_level = new_power_level; | 457 | /* |
436 | if (local->hw.conf.power_level != new_power_level) | 458 | * ieee80211_hw_config() will limit to the channel's |
437 | reconf_flags |= IEEE80211_CONF_CHANGE_POWER; | 459 | * max power and possibly power constraint from AP. |
460 | */ | ||
461 | local->user_power_level = new_power_level; | ||
462 | } | ||
438 | 463 | ||
439 | if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) { | 464 | if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) { |
440 | local->hw.conf.radio_enabled = !(data->txpower.disabled); | 465 | local->hw.conf.radio_enabled = !(data->txpower.disabled); |
@@ -442,7 +467,7 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev, | |||
442 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); | 467 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); |
443 | } | 468 | } |
444 | 469 | ||
445 | if (reconf_flags) | 470 | if (reconf || reconf_flags) |
446 | ieee80211_hw_config(local, reconf_flags); | 471 | ieee80211_hw_config(local, reconf_flags); |
447 | 472 | ||
448 | return 0; | 473 | return 0; |
@@ -530,7 +555,7 @@ static int ieee80211_ioctl_giwfrag(struct net_device *dev, | |||
530 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 555 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
531 | 556 | ||
532 | frag->value = local->fragmentation_threshold; | 557 | frag->value = local->fragmentation_threshold; |
533 | frag->disabled = (frag->value >= IEEE80211_MAX_RTS_THRESHOLD); | 558 | frag->disabled = (frag->value >= IEEE80211_MAX_FRAG_THRESHOLD); |
534 | frag->fixed = 1; | 559 | frag->fixed = 1; |
535 | 560 | ||
536 | return 0; | 561 | return 0; |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index c6439c77953c..0ea36e0c8a0e 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -512,7 +512,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, | |||
512 | 512 | ||
513 | skb = ctnetlink_alloc_skb(tuple(ct, IP_CT_DIR_ORIGINAL), GFP_ATOMIC); | 513 | skb = ctnetlink_alloc_skb(tuple(ct, IP_CT_DIR_ORIGINAL), GFP_ATOMIC); |
514 | if (!skb) | 514 | if (!skb) |
515 | return NOTIFY_DONE; | 515 | goto errout; |
516 | 516 | ||
517 | b = skb->tail; | 517 | b = skb->tail; |
518 | 518 | ||
@@ -591,8 +591,9 @@ static int ctnetlink_conntrack_event(struct notifier_block *this, | |||
591 | nla_put_failure: | 591 | nla_put_failure: |
592 | rcu_read_unlock(); | 592 | rcu_read_unlock(); |
593 | nlmsg_failure: | 593 | nlmsg_failure: |
594 | nfnetlink_set_err(0, group, -ENOBUFS); | ||
595 | kfree_skb(skb); | 594 | kfree_skb(skb); |
595 | errout: | ||
596 | nfnetlink_set_err(0, group, -ENOBUFS); | ||
596 | return NOTIFY_DONE; | 597 | return NOTIFY_DONE; |
597 | } | 598 | } |
598 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 599 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
@@ -1564,7 +1565,7 @@ static int ctnetlink_expect_event(struct notifier_block *this, | |||
1564 | 1565 | ||
1565 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); | 1566 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC); |
1566 | if (!skb) | 1567 | if (!skb) |
1567 | return NOTIFY_DONE; | 1568 | goto errout; |
1568 | 1569 | ||
1569 | b = skb->tail; | 1570 | b = skb->tail; |
1570 | 1571 | ||
@@ -1589,8 +1590,9 @@ static int ctnetlink_expect_event(struct notifier_block *this, | |||
1589 | nla_put_failure: | 1590 | nla_put_failure: |
1590 | rcu_read_unlock(); | 1591 | rcu_read_unlock(); |
1591 | nlmsg_failure: | 1592 | nlmsg_failure: |
1592 | nfnetlink_set_err(0, 0, -ENOBUFS); | ||
1593 | kfree_skb(skb); | 1593 | kfree_skb(skb); |
1594 | errout: | ||
1595 | nfnetlink_set_err(0, 0, -ENOBUFS); | ||
1594 | return NOTIFY_DONE; | 1596 | return NOTIFY_DONE; |
1595 | } | 1597 | } |
1596 | #endif | 1598 | #endif |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 2785d66a7e38..b8ab37ad7ed5 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -203,7 +203,7 @@ static int __init nfnetlink_init(void) | |||
203 | nfnetlink_rcv, NULL, THIS_MODULE); | 203 | nfnetlink_rcv, NULL, THIS_MODULE); |
204 | if (!nfnl) { | 204 | if (!nfnl) { |
205 | printk(KERN_ERR "cannot initialize nfnetlink!\n"); | 205 | printk(KERN_ERR "cannot initialize nfnetlink!\n"); |
206 | return -1; | 206 | return -ENOMEM; |
207 | } | 207 | } |
208 | 208 | ||
209 | return 0; | 209 | return 0; |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index d876b8734848..2b88295cb7b7 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -280,6 +280,14 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch) | |||
280 | if (unlikely(!skb)) | 280 | if (unlikely(!skb)) |
281 | return NULL; | 281 | return NULL; |
282 | 282 | ||
283 | #ifdef CONFIG_NET_CLS_ACT | ||
284 | /* | ||
285 | * If it's at ingress let's pretend the delay is | ||
286 | * from the network (tstamp will be updated). | ||
287 | */ | ||
288 | if (G_TC_FROM(skb->tc_verd) & AT_INGRESS) | ||
289 | skb->tstamp.tv64 = 0; | ||
290 | #endif | ||
283 | pr_debug("netem_dequeue: return skb=%p\n", skb); | 291 | pr_debug("netem_dequeue: return skb=%p\n", skb); |
284 | sch->q.qlen--; | 292 | sch->q.qlen--; |
285 | return skb; | 293 | return skb; |
diff --git a/net/wireless/core.h b/net/wireless/core.h index d43daa236ef9..0a592e4295f0 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -90,7 +90,7 @@ struct cfg80211_internal_bss { | |||
90 | struct rb_node rbn; | 90 | struct rb_node rbn; |
91 | unsigned long ts; | 91 | unsigned long ts; |
92 | struct kref ref; | 92 | struct kref ref; |
93 | bool hold; | 93 | bool hold, ies_allocated; |
94 | 94 | ||
95 | /* must be last because of priv member */ | 95 | /* must be last because of priv member */ |
96 | struct cfg80211_bss pub; | 96 | struct cfg80211_bss pub; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 353e1a4ece83..2456e4ee445e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3334,7 +3334,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, | |||
3334 | struct sk_buff *msg; | 3334 | struct sk_buff *msg; |
3335 | void *hdr; | 3335 | void *hdr; |
3336 | 3336 | ||
3337 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 3337 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); |
3338 | if (!msg) | 3338 | if (!msg) |
3339 | return; | 3339 | return; |
3340 | 3340 | ||
@@ -3353,7 +3353,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, | |||
3353 | return; | 3353 | return; |
3354 | } | 3354 | } |
3355 | 3355 | ||
3356 | genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_KERNEL); | 3356 | genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, GFP_ATOMIC); |
3357 | return; | 3357 | return; |
3358 | 3358 | ||
3359 | nla_put_failure: | 3359 | nla_put_failure: |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 6327e1617acb..6c1993d99902 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -2095,11 +2095,12 @@ int set_regdom(const struct ieee80211_regdomain *rd) | |||
2095 | /* Caller must hold cfg80211_mutex */ | 2095 | /* Caller must hold cfg80211_mutex */ |
2096 | void reg_device_remove(struct wiphy *wiphy) | 2096 | void reg_device_remove(struct wiphy *wiphy) |
2097 | { | 2097 | { |
2098 | struct wiphy *request_wiphy; | 2098 | struct wiphy *request_wiphy = NULL; |
2099 | 2099 | ||
2100 | assert_cfg80211_lock(); | 2100 | assert_cfg80211_lock(); |
2101 | 2101 | ||
2102 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | 2102 | if (last_request) |
2103 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | ||
2103 | 2104 | ||
2104 | kfree(wiphy->regd); | 2105 | kfree(wiphy->regd); |
2105 | if (!last_request || !request_wiphy) | 2106 | if (!last_request || !request_wiphy) |
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 2a00e362f5fe..2ae65b39b529 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -58,6 +58,10 @@ static void bss_release(struct kref *ref) | |||
58 | bss = container_of(ref, struct cfg80211_internal_bss, ref); | 58 | bss = container_of(ref, struct cfg80211_internal_bss, ref); |
59 | if (bss->pub.free_priv) | 59 | if (bss->pub.free_priv) |
60 | bss->pub.free_priv(&bss->pub); | 60 | bss->pub.free_priv(&bss->pub); |
61 | |||
62 | if (bss->ies_allocated) | ||
63 | kfree(bss->pub.information_elements); | ||
64 | |||
61 | kfree(bss); | 65 | kfree(bss); |
62 | } | 66 | } |
63 | 67 | ||
@@ -360,19 +364,41 @@ cfg80211_bss_update(struct cfg80211_registered_device *dev, | |||
360 | 364 | ||
361 | found = rb_find_bss(dev, res); | 365 | found = rb_find_bss(dev, res); |
362 | 366 | ||
363 | if (found && overwrite) { | 367 | if (found) { |
364 | list_replace(&found->list, &res->list); | ||
365 | rb_replace_node(&found->rbn, &res->rbn, | ||
366 | &dev->bss_tree); | ||
367 | kref_put(&found->ref, bss_release); | ||
368 | found = res; | ||
369 | } else if (found) { | ||
370 | kref_get(&found->ref); | 368 | kref_get(&found->ref); |
371 | found->pub.beacon_interval = res->pub.beacon_interval; | 369 | found->pub.beacon_interval = res->pub.beacon_interval; |
372 | found->pub.tsf = res->pub.tsf; | 370 | found->pub.tsf = res->pub.tsf; |
373 | found->pub.signal = res->pub.signal; | 371 | found->pub.signal = res->pub.signal; |
374 | found->pub.capability = res->pub.capability; | 372 | found->pub.capability = res->pub.capability; |
375 | found->ts = res->ts; | 373 | found->ts = res->ts; |
374 | |||
375 | /* overwrite IEs */ | ||
376 | if (overwrite) { | ||
377 | size_t used = dev->wiphy.bss_priv_size + sizeof(*res); | ||
378 | size_t ielen = res->pub.len_information_elements; | ||
379 | |||
380 | if (ksize(found) >= used + ielen) { | ||
381 | memcpy(found->pub.information_elements, | ||
382 | res->pub.information_elements, ielen); | ||
383 | found->pub.len_information_elements = ielen; | ||
384 | } else { | ||
385 | u8 *ies = found->pub.information_elements; | ||
386 | |||
387 | if (found->ies_allocated) { | ||
388 | if (ksize(ies) < ielen) | ||
389 | ies = krealloc(ies, ielen, | ||
390 | GFP_ATOMIC); | ||
391 | } else | ||
392 | ies = kmalloc(ielen, GFP_ATOMIC); | ||
393 | |||
394 | if (ies) { | ||
395 | memcpy(ies, res->pub.information_elements, ielen); | ||
396 | found->ies_allocated = true; | ||
397 | found->pub.information_elements = ies; | ||
398 | } | ||
399 | } | ||
400 | } | ||
401 | |||
376 | kref_put(&res->ref, bss_release); | 402 | kref_put(&res->ref, bss_release); |
377 | } else { | 403 | } else { |
378 | /* this "consumes" the reference */ | 404 | /* this "consumes" the reference */ |