aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/9p/client.c155
-rw-r--r--net/9p/mod.c4
-rw-r--r--net/9p/protocol.c44
-rw-r--r--net/9p/trans_virtio.c4
-rw-r--r--net/atm/atm_misc.c2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/atm/common.c2
-rw-r--r--net/atm/lec.c2
-rw-r--r--net/atm/proc.c2
-rw-r--r--net/bridge/br_fdb.c2
-rw-r--r--net/bridge/br_if.c2
-rw-r--r--net/bridge/br_netlink.c2
-rw-r--r--net/bridge/br_private.h1
-rw-r--r--net/bridge/br_private_stp.h3
-rw-r--r--net/bridge/br_stp.c31
-rw-r--r--net/bridge/br_stp_bpdu.c15
-rw-r--r--net/bridge/br_stp_if.c3
-rw-r--r--net/bridge/br_stp_timer.c1
-rw-r--r--net/bridge/netfilter/ebt_ulog.c1
-rw-r--r--net/ceph/messenger.c12
-rw-r--r--net/ceph/osd_client.c6
-rw-r--r--net/core/flow.c2
-rw-r--r--net/core/link_watch.c2
-rw-r--r--net/decnet/dn_fib.c2
-rw-r--r--net/decnet/dn_neigh.c2
-rw-r--r--net/decnet/dn_table.c2
-rw-r--r--net/decnet/dn_timer.c2
-rw-r--r--net/ipv4/cipso_ipv4.c2
-rw-r--r--net/ipv4/gre.c21
-rw-r--r--net/ipv4/ipmr.c2
-rw-r--r--net/ipv4/raw.c2
-rw-r--r--net/ipv4/route.c2
-rw-r--r--net/ipv6/ip6_tunnel.c2
-rw-r--r--net/iucv/iucv.c9
-rw-r--r--net/l2tp/l2tp_core.c2
-rw-r--r--net/l2tp/l2tp_ppp.c2
-rw-r--r--net/mac80211/agg-rx.c10
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/driver-ops.h31
-rw-r--r--net/mac80211/driver-trace.h43
-rw-r--r--net/mac80211/ieee80211_i.h7
-rw-r--r--net/mac80211/key.c2
-rw-r--r--net/mac80211/mesh_hwmp.c20
-rw-r--r--net/mac80211/mlme.c30
-rw-r--r--net/mac80211/pm.c3
-rw-r--r--net/mac80211/scan.c6
-rw-r--r--net/mac80211/sta_info.c4
-rw-r--r--net/mac80211/tkip.c11
-rw-r--r--net/mac80211/util.c71
-rw-r--r--net/mac80211/work.c28
-rw-r--r--net/netfilter/nfnetlink_log.c2
-rw-r--r--net/netfilter/nfnetlink_queue.c2
-rw-r--r--net/netlabel/netlabel_cipso_v4.c2
-rw-r--r--net/netlabel/netlabel_domainhash.c3
-rw-r--r--net/netlabel/netlabel_kapi.c2
-rw-r--r--net/netlabel/netlabel_mgmt.c2
-rw-r--r--net/netlabel/netlabel_mgmt.h2
-rw-r--r--net/netlabel/netlabel_unlabeled.c5
-rw-r--r--net/rds/page.c1
-rw-r--r--net/socket.c2
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c7
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c32
-rw-r--r--net/sunrpc/svc_xprt.c11
-rw-r--r--net/sunrpc/svcauth_unix.c79
-rw-r--r--net/sunrpc/svcsock.c2
-rw-r--r--net/sunrpc/xprtrdma/xprt_rdma.h2
-rw-r--r--net/tipc/core.h2
-rw-r--r--net/wireless/core.c7
-rw-r--r--net/wireless/core.h4
-rw-r--r--net/wireless/nl80211.c109
-rw-r--r--net/wireless/scan.c4
-rw-r--r--net/wireless/util.c38
72 files changed, 624 insertions, 318 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index 9e3b0e640da1..0505a03c374c 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -72,23 +72,22 @@ inline int p9_is_proto_dotu(struct p9_client *clnt)
72EXPORT_SYMBOL(p9_is_proto_dotu); 72EXPORT_SYMBOL(p9_is_proto_dotu);
73 73
74/* Interpret mount option for protocol version */ 74/* Interpret mount option for protocol version */
75static int get_protocol_version(const substring_t *name) 75static int get_protocol_version(char *s)
76{ 76{
77 int version = -EINVAL; 77 int version = -EINVAL;
78 78
79 if (!strncmp("9p2000", name->from, name->to-name->from)) { 79 if (!strcmp(s, "9p2000")) {
80 version = p9_proto_legacy; 80 version = p9_proto_legacy;
81 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n"); 81 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: Legacy\n");
82 } else if (!strncmp("9p2000.u", name->from, name->to-name->from)) { 82 } else if (!strcmp(s, "9p2000.u")) {
83 version = p9_proto_2000u; 83 version = p9_proto_2000u;
84 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n"); 84 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.u\n");
85 } else if (!strncmp("9p2000.L", name->from, name->to-name->from)) { 85 } else if (!strcmp(s, "9p2000.L")) {
86 version = p9_proto_2000L; 86 version = p9_proto_2000L;
87 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.L\n"); 87 P9_DPRINTK(P9_DEBUG_9P, "Protocol version: 9P2000.L\n");
88 } else { 88 } else
89 P9_DPRINTK(P9_DEBUG_ERROR, "Unknown protocol version %s. ", 89 printk(KERN_INFO "9p: Unknown protocol version %s.\n", s);
90 name->from); 90
91 }
92 return version; 91 return version;
93} 92}
94 93
@@ -106,6 +105,7 @@ static int parse_opts(char *opts, struct p9_client *clnt)
106 char *p; 105 char *p;
107 substring_t args[MAX_OPT_ARGS]; 106 substring_t args[MAX_OPT_ARGS];
108 int option; 107 int option;
108 char *s;
109 int ret = 0; 109 int ret = 0;
110 110
111 clnt->proto_version = p9_proto_2000u; 111 clnt->proto_version = p9_proto_2000u;
@@ -141,22 +141,41 @@ static int parse_opts(char *opts, struct p9_client *clnt)
141 clnt->msize = option; 141 clnt->msize = option;
142 break; 142 break;
143 case Opt_trans: 143 case Opt_trans:
144 clnt->trans_mod = v9fs_get_trans_by_name(&args[0]); 144 s = match_strdup(&args[0]);
145 if(clnt->trans_mod == NULL) { 145 if (!s) {
146 ret = -ENOMEM;
146 P9_DPRINTK(P9_DEBUG_ERROR, 147 P9_DPRINTK(P9_DEBUG_ERROR,
147 "Could not find request transport: %s\n", 148 "problem allocating copy of trans arg\n");
148 (char *) &args[0]); 149 goto free_and_return;
150 }
151 clnt->trans_mod = v9fs_get_trans_by_name(s);
152 if (clnt->trans_mod == NULL) {
153 printk(KERN_INFO
154 "9p: Could not find "
155 "request transport: %s\n", s);
149 ret = -EINVAL; 156 ret = -EINVAL;
157 kfree(s);
150 goto free_and_return; 158 goto free_and_return;
151 } 159 }
160 kfree(s);
152 break; 161 break;
153 case Opt_legacy: 162 case Opt_legacy:
154 clnt->proto_version = p9_proto_legacy; 163 clnt->proto_version = p9_proto_legacy;
155 break; 164 break;
156 case Opt_version: 165 case Opt_version:
157 ret = get_protocol_version(&args[0]); 166 s = match_strdup(&args[0]);
158 if (ret == -EINVAL) 167 if (!s) {
168 ret = -ENOMEM;
169 P9_DPRINTK(P9_DEBUG_ERROR,
170 "problem allocating copy of version arg\n");
159 goto free_and_return; 171 goto free_and_return;
172 }
173 ret = get_protocol_version(s);
174 if (ret == -EINVAL) {
175 kfree(s);
176 goto free_and_return;
177 }
178 kfree(s);
160 clnt->proto_version = ret; 179 clnt->proto_version = ret;
161 break; 180 break;
162 default: 181 default:
@@ -280,7 +299,8 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag)
280 * buffer to read the data into */ 299 * buffer to read the data into */
281 tag++; 300 tag++;
282 301
283 BUG_ON(tag >= c->max_tag); 302 if(tag >= c->max_tag)
303 return NULL;
284 304
285 row = tag / P9_ROW_MAXTAG; 305 row = tag / P9_ROW_MAXTAG;
286 col = tag % P9_ROW_MAXTAG; 306 col = tag % P9_ROW_MAXTAG;
@@ -749,7 +769,7 @@ static int p9_client_version(struct p9_client *c)
749 err = p9pdu_readf(req->rc, c->proto_version, "ds", &msize, &version); 769 err = p9pdu_readf(req->rc, c->proto_version, "ds", &msize, &version);
750 if (err) { 770 if (err) {
751 P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err); 771 P9_DPRINTK(P9_DEBUG_9P, "version error %d\n", err);
752 p9pdu_dump(1, req->rc); 772 P9_DUMP_PKT(1, req->rc);
753 goto error; 773 goto error;
754 } 774 }
755 775
@@ -821,8 +841,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
821 if (err) 841 if (err)
822 goto destroy_fidpool; 842 goto destroy_fidpool;
823 843
824 if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize) 844 if (clnt->msize > clnt->trans_mod->maxsize)
825 clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ; 845 clnt->msize = clnt->trans_mod->maxsize;
826 846
827 err = p9_client_version(clnt); 847 err = p9_client_version(clnt);
828 if (err) 848 if (err)
@@ -911,7 +931,7 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
911 931
912 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", &qid); 932 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", &qid);
913 if (err) { 933 if (err) {
914 p9pdu_dump(1, req->rc); 934 P9_DUMP_PKT(1, req->rc);
915 p9_free_req(clnt, req); 935 p9_free_req(clnt, req);
916 goto error; 936 goto error;
917 } 937 }
@@ -971,7 +991,7 @@ struct p9_fid *p9_client_walk(struct p9_fid *oldfid, uint16_t nwname,
971 991
972 err = p9pdu_readf(req->rc, clnt->proto_version, "R", &nwqids, &wqids); 992 err = p9pdu_readf(req->rc, clnt->proto_version, "R", &nwqids, &wqids);
973 if (err) { 993 if (err) {
974 p9pdu_dump(1, req->rc); 994 P9_DUMP_PKT(1, req->rc);
975 p9_free_req(clnt, req); 995 p9_free_req(clnt, req);
976 goto clunk_fid; 996 goto clunk_fid;
977 } 997 }
@@ -1038,7 +1058,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
1038 1058
1039 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", &qid, &iounit); 1059 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1040 if (err) { 1060 if (err) {
1041 p9pdu_dump(1, req->rc); 1061 P9_DUMP_PKT(1, req->rc);
1042 goto free_and_error; 1062 goto free_and_error;
1043 } 1063 }
1044 1064
@@ -1081,7 +1101,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
1081 1101
1082 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", qid, &iounit); 1102 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", qid, &iounit);
1083 if (err) { 1103 if (err) {
1084 p9pdu_dump(1, req->rc); 1104 P9_DUMP_PKT(1, req->rc);
1085 goto free_and_error; 1105 goto free_and_error;
1086 } 1106 }
1087 1107
@@ -1126,7 +1146,7 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
1126 1146
1127 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", &qid, &iounit); 1147 err = p9pdu_readf(req->rc, clnt->proto_version, "Qd", &qid, &iounit);
1128 if (err) { 1148 if (err) {
1129 p9pdu_dump(1, req->rc); 1149 P9_DUMP_PKT(1, req->rc);
1130 goto free_and_error; 1150 goto free_and_error;
1131 } 1151 }
1132 1152
@@ -1165,7 +1185,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid,
1165 1185
1166 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid); 1186 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid);
1167 if (err) { 1187 if (err) {
1168 p9pdu_dump(1, req->rc); 1188 P9_DUMP_PKT(1, req->rc);
1169 goto free_and_error; 1189 goto free_and_error;
1170 } 1190 }
1171 1191
@@ -1249,9 +1269,11 @@ int p9_client_clunk(struct p9_fid *fid)
1249 P9_DPRINTK(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid); 1269 P9_DPRINTK(P9_DEBUG_9P, "<<< RCLUNK fid %d\n", fid->fid);
1250 1270
1251 p9_free_req(clnt, req); 1271 p9_free_req(clnt, req);
1252 p9_fid_destroy(fid);
1253
1254error: 1272error:
1273 /*
1274 * Fid is not valid even after a failed clunk
1275 */
1276 p9_fid_destroy(fid);
1255 return err; 1277 return err;
1256} 1278}
1257EXPORT_SYMBOL(p9_client_clunk); 1279EXPORT_SYMBOL(p9_client_clunk);
@@ -1281,6 +1303,29 @@ error:
1281} 1303}
1282EXPORT_SYMBOL(p9_client_remove); 1304EXPORT_SYMBOL(p9_client_remove);
1283 1305
1306int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags)
1307{
1308 int err = 0;
1309 struct p9_req_t *req;
1310 struct p9_client *clnt;
1311
1312 P9_DPRINTK(P9_DEBUG_9P, ">>> TUNLINKAT fid %d %s %d\n",
1313 dfid->fid, name, flags);
1314
1315 clnt = dfid->clnt;
1316 req = p9_client_rpc(clnt, P9_TUNLINKAT, "dsd", dfid->fid, name, flags);
1317 if (IS_ERR(req)) {
1318 err = PTR_ERR(req);
1319 goto error;
1320 }
1321 P9_DPRINTK(P9_DEBUG_9P, "<<< RUNLINKAT fid %d %s\n", dfid->fid, name);
1322
1323 p9_free_req(clnt, req);
1324error:
1325 return err;
1326}
1327EXPORT_SYMBOL(p9_client_unlinkat);
1328
1284int 1329int
1285p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset, 1330p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1286 u32 count) 1331 u32 count)
@@ -1318,11 +1363,12 @@ p9_client_read(struct p9_fid *fid, char *data, char __user *udata, u64 offset,
1318 1363
1319 err = p9pdu_readf(req->rc, clnt->proto_version, "D", &count, &dataptr); 1364 err = p9pdu_readf(req->rc, clnt->proto_version, "D", &count, &dataptr);
1320 if (err) { 1365 if (err) {
1321 p9pdu_dump(1, req->rc); 1366 P9_DUMP_PKT(1, req->rc);
1322 goto free_and_error; 1367 goto free_and_error;
1323 } 1368 }
1324 1369
1325 P9_DPRINTK(P9_DEBUG_9P, "<<< RREAD count %d\n", count); 1370 P9_DPRINTK(P9_DEBUG_9P, "<<< RREAD count %d\n", count);
1371 P9_DUMP_PKT(1, req->rc);
1326 1372
1327 if (!req->tc->pbuf_size) { 1373 if (!req->tc->pbuf_size) {
1328 if (data) { 1374 if (data) {
@@ -1386,7 +1432,7 @@ p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
1386 1432
1387 err = p9pdu_readf(req->rc, clnt->proto_version, "d", &count); 1433 err = p9pdu_readf(req->rc, clnt->proto_version, "d", &count);
1388 if (err) { 1434 if (err) {
1389 p9pdu_dump(1, req->rc); 1435 P9_DUMP_PKT(1, req->rc);
1390 goto free_and_error; 1436 goto free_and_error;
1391 } 1437 }
1392 1438
@@ -1426,7 +1472,7 @@ struct p9_wstat *p9_client_stat(struct p9_fid *fid)
1426 1472
1427 err = p9pdu_readf(req->rc, clnt->proto_version, "wS", &ignored, ret); 1473 err = p9pdu_readf(req->rc, clnt->proto_version, "wS", &ignored, ret);
1428 if (err) { 1474 if (err) {
1429 p9pdu_dump(1, req->rc); 1475 P9_DUMP_PKT(1, req->rc);
1430 p9_free_req(clnt, req); 1476 p9_free_req(clnt, req);
1431 goto error; 1477 goto error;
1432 } 1478 }
@@ -1477,7 +1523,7 @@ struct p9_stat_dotl *p9_client_getattr_dotl(struct p9_fid *fid,
1477 1523
1478 err = p9pdu_readf(req->rc, clnt->proto_version, "A", ret); 1524 err = p9pdu_readf(req->rc, clnt->proto_version, "A", ret);
1479 if (err) { 1525 if (err) {
1480 p9pdu_dump(1, req->rc); 1526 P9_DUMP_PKT(1, req->rc);
1481 p9_free_req(clnt, req); 1527 p9_free_req(clnt, req);
1482 goto error; 1528 goto error;
1483 } 1529 }
@@ -1625,7 +1671,7 @@ int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb)
1625 &sb->bsize, &sb->blocks, &sb->bfree, &sb->bavail, 1671 &sb->bsize, &sb->blocks, &sb->bfree, &sb->bavail,
1626 &sb->files, &sb->ffree, &sb->fsid, &sb->namelen); 1672 &sb->files, &sb->ffree, &sb->fsid, &sb->namelen);
1627 if (err) { 1673 if (err) {
1628 p9pdu_dump(1, req->rc); 1674 P9_DUMP_PKT(1, req->rc);
1629 p9_free_req(clnt, req); 1675 p9_free_req(clnt, req);
1630 goto error; 1676 goto error;
1631 } 1677 }
@@ -1643,7 +1689,8 @@ error:
1643} 1689}
1644EXPORT_SYMBOL(p9_client_statfs); 1690EXPORT_SYMBOL(p9_client_statfs);
1645 1691
1646int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name) 1692int p9_client_rename(struct p9_fid *fid,
1693 struct p9_fid *newdirfid, const char *name)
1647{ 1694{
1648 int err; 1695 int err;
1649 struct p9_req_t *req; 1696 struct p9_req_t *req;
@@ -1670,6 +1717,36 @@ error:
1670} 1717}
1671EXPORT_SYMBOL(p9_client_rename); 1718EXPORT_SYMBOL(p9_client_rename);
1672 1719
1720int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
1721 struct p9_fid *newdirfid, const char *new_name)
1722{
1723 int err;
1724 struct p9_req_t *req;
1725 struct p9_client *clnt;
1726
1727 err = 0;
1728 clnt = olddirfid->clnt;
1729
1730 P9_DPRINTK(P9_DEBUG_9P, ">>> TRENAMEAT olddirfid %d old name %s"
1731 " newdirfid %d new name %s\n", olddirfid->fid, old_name,
1732 newdirfid->fid, new_name);
1733
1734 req = p9_client_rpc(clnt, P9_TRENAMEAT, "dsds", olddirfid->fid,
1735 old_name, newdirfid->fid, new_name);
1736 if (IS_ERR(req)) {
1737 err = PTR_ERR(req);
1738 goto error;
1739 }
1740
1741 P9_DPRINTK(P9_DEBUG_9P, "<<< RRENAMEAT newdirfid %d new name %s\n",
1742 newdirfid->fid, new_name);
1743
1744 p9_free_req(clnt, req);
1745error:
1746 return err;
1747}
1748EXPORT_SYMBOL(p9_client_renameat);
1749
1673/* 1750/*
1674 * An xattrwalk without @attr_name gives the fid for the lisxattr namespace 1751 * An xattrwalk without @attr_name gives the fid for the lisxattr namespace
1675 */ 1752 */
@@ -1701,7 +1778,7 @@ struct p9_fid *p9_client_xattrwalk(struct p9_fid *file_fid,
1701 } 1778 }
1702 err = p9pdu_readf(req->rc, clnt->proto_version, "q", attr_size); 1779 err = p9pdu_readf(req->rc, clnt->proto_version, "q", attr_size);
1703 if (err) { 1780 if (err) {
1704 p9pdu_dump(1, req->rc); 1781 P9_DUMP_PKT(1, req->rc);
1705 p9_free_req(clnt, req); 1782 p9_free_req(clnt, req);
1706 goto clunk_fid; 1783 goto clunk_fid;
1707 } 1784 }
@@ -1780,7 +1857,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
1780 1857
1781 err = p9pdu_readf(req->rc, clnt->proto_version, "D", &count, &dataptr); 1858 err = p9pdu_readf(req->rc, clnt->proto_version, "D", &count, &dataptr);
1782 if (err) { 1859 if (err) {
1783 p9pdu_dump(1, req->rc); 1860 P9_DUMP_PKT(1, req->rc);
1784 goto free_and_error; 1861 goto free_and_error;
1785 } 1862 }
1786 1863
@@ -1817,7 +1894,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
1817 1894
1818 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid); 1895 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid);
1819 if (err) { 1896 if (err) {
1820 p9pdu_dump(1, req->rc); 1897 P9_DUMP_PKT(1, req->rc);
1821 goto error; 1898 goto error;
1822 } 1899 }
1823 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type, 1900 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKNOD qid %x.%llx.%x\n", qid->type,
@@ -1848,7 +1925,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode,
1848 1925
1849 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid); 1926 err = p9pdu_readf(req->rc, clnt->proto_version, "Q", qid);
1850 if (err) { 1927 if (err) {
1851 p9pdu_dump(1, req->rc); 1928 P9_DUMP_PKT(1, req->rc);
1852 goto error; 1929 goto error;
1853 } 1930 }
1854 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type, 1931 P9_DPRINTK(P9_DEBUG_9P, "<<< RMKDIR qid %x.%llx.%x\n", qid->type,
@@ -1883,7 +1960,7 @@ int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status)
1883 1960
1884 err = p9pdu_readf(req->rc, clnt->proto_version, "b", status); 1961 err = p9pdu_readf(req->rc, clnt->proto_version, "b", status);
1885 if (err) { 1962 if (err) {
1886 p9pdu_dump(1, req->rc); 1963 P9_DUMP_PKT(1, req->rc);
1887 goto error; 1964 goto error;
1888 } 1965 }
1889 P9_DPRINTK(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status); 1966 P9_DPRINTK(P9_DEBUG_9P, "<<< RLOCK status %i\n", *status);
@@ -1916,7 +1993,7 @@ int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *glock)
1916 &glock->start, &glock->length, &glock->proc_id, 1993 &glock->start, &glock->length, &glock->proc_id,
1917 &glock->client_id); 1994 &glock->client_id);
1918 if (err) { 1995 if (err) {
1919 p9pdu_dump(1, req->rc); 1996 P9_DUMP_PKT(1, req->rc);
1920 goto error; 1997 goto error;
1921 } 1998 }
1922 P9_DPRINTK(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld " 1999 P9_DPRINTK(P9_DEBUG_9P, "<<< RGETLOCK type %i start %lld length %lld "
@@ -1944,7 +2021,7 @@ int p9_client_readlink(struct p9_fid *fid, char **target)
1944 2021
1945 err = p9pdu_readf(req->rc, clnt->proto_version, "s", target); 2022 err = p9pdu_readf(req->rc, clnt->proto_version, "s", target);
1946 if (err) { 2023 if (err) {
1947 p9pdu_dump(1, req->rc); 2024 P9_DUMP_PKT(1, req->rc);
1948 goto error; 2025 goto error;
1949 } 2026 }
1950 P9_DPRINTK(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target); 2027 P9_DPRINTK(P9_DEBUG_9P, "<<< RREADLINK target %s\n", *target);
diff --git a/net/9p/mod.c b/net/9p/mod.c
index 72c398275051..2664d1292291 100644
--- a/net/9p/mod.c
+++ b/net/9p/mod.c
@@ -80,14 +80,14 @@ EXPORT_SYMBOL(v9fs_unregister_trans);
80 * @name: string identifying transport 80 * @name: string identifying transport
81 * 81 *
82 */ 82 */
83struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name) 83struct p9_trans_module *v9fs_get_trans_by_name(char *s)
84{ 84{
85 struct p9_trans_module *t, *found = NULL; 85 struct p9_trans_module *t, *found = NULL;
86 86
87 spin_lock(&v9fs_trans_lock); 87 spin_lock(&v9fs_trans_lock);
88 88
89 list_for_each_entry(t, &v9fs_trans_list, list) 89 list_for_each_entry(t, &v9fs_trans_list, list)
90 if (strncmp(t->name, name->from, name->to-name->from) == 0 && 90 if (strcmp(t->name, s) == 0 &&
91 try_module_get(t->owner)) { 91 try_module_get(t->owner)) {
92 found = t; 92 found = t;
93 break; 93 break;
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index a873277cb996..df58375ea6b3 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -44,30 +44,24 @@ p9pdu_writef(struct p9_fcall *pdu, int proto_version, const char *fmt, ...);
44void 44void
45p9pdu_dump(int way, struct p9_fcall *pdu) 45p9pdu_dump(int way, struct p9_fcall *pdu)
46{ 46{
47 int i, n; 47 int len = pdu->size;
48 u8 *data = pdu->sdata; 48
49 int datalen = pdu->size; 49 if ((p9_debug_level & P9_DEBUG_VPKT) != P9_DEBUG_VPKT) {
50 char buf[255]; 50 if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT) {
51 int buflen = 255; 51 if (len > 32)
52 52 len = 32;
53 i = n = 0; 53 } else {
54 if (datalen > (buflen-16)) 54 /* shouldn't happen */
55 datalen = buflen-16; 55 return;
56 while (i < datalen) { 56 }
57 n += scnprintf(buf + n, buflen - n, "%02x ", data[i]);
58 if (i%4 == 3)
59 n += scnprintf(buf + n, buflen - n, " ");
60 if (i%32 == 31)
61 n += scnprintf(buf + n, buflen - n, "\n");
62
63 i++;
64 } 57 }
65 n += scnprintf(buf + n, buflen - n, "\n");
66 58
67 if (way) 59 if (way)
68 P9_DPRINTK(P9_DEBUG_PKT, "[[[(%d) %s\n", datalen, buf); 60 print_hex_dump_bytes("[9P] ", DUMP_PREFIX_OFFSET, pdu->sdata,
61 len);
69 else 62 else
70 P9_DPRINTK(P9_DEBUG_PKT, "]]](%d) %s\n", datalen, buf); 63 print_hex_dump_bytes("]9P[ ", DUMP_PREFIX_OFFSET, pdu->sdata,
64 len);
71} 65}
72#else 66#else
73void 67void
@@ -610,7 +604,7 @@ int p9stat_read(char *buf, int len, struct p9_wstat *st, int proto_version)
610 ret = p9pdu_readf(&fake_pdu, proto_version, "S", st); 604 ret = p9pdu_readf(&fake_pdu, proto_version, "S", st);
611 if (ret) { 605 if (ret) {
612 P9_DPRINTK(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret); 606 P9_DPRINTK(P9_DEBUG_9P, "<<< p9stat_read failed: %d\n", ret);
613 p9pdu_dump(1, &fake_pdu); 607 P9_DUMP_PKT(0, &fake_pdu);
614 } 608 }
615 609
616 return ret; 610 return ret;
@@ -632,11 +626,7 @@ int p9pdu_finalize(struct p9_fcall *pdu)
632 err = p9pdu_writef(pdu, 0, "d", size); 626 err = p9pdu_writef(pdu, 0, "d", size);
633 pdu->size = size; 627 pdu->size = size;
634 628
635#ifdef CONFIG_NET_9P_DEBUG 629 P9_DUMP_PKT(0, pdu);
636 if ((p9_debug_level & P9_DEBUG_PKT) == P9_DEBUG_PKT)
637 p9pdu_dump(0, pdu);
638#endif
639
640 P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size, 630 P9_DPRINTK(P9_DEBUG_9P, ">>> size=%d type: %d tag: %d\n", pdu->size,
641 pdu->id, pdu->tag); 631 pdu->id, pdu->tag);
642 632
@@ -669,7 +659,7 @@ int p9dirent_read(char *buf, int len, struct p9_dirent *dirent,
669 &dirent->d_off, &dirent->d_type, &nameptr); 659 &dirent->d_off, &dirent->d_type, &nameptr);
670 if (ret) { 660 if (ret) {
671 P9_DPRINTK(P9_DEBUG_9P, "<<< p9dirent_read failed: %d\n", ret); 661 P9_DPRINTK(P9_DEBUG_9P, "<<< p9dirent_read failed: %d\n", ret);
672 p9pdu_dump(1, &fake_pdu); 662 P9_DUMP_PKT(1, &fake_pdu);
673 goto out; 663 goto out;
674 } 664 }
675 665
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 244e70742183..175b5135bdcf 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -367,7 +367,7 @@ req_retry_pinned:
367 in += inp; 367 in += inp;
368 } else { 368 } else {
369 in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, 369 in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,
370 client->msize); 370 req->rc->capacity);
371 } 371 }
372 372
373 err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc); 373 err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);
@@ -592,7 +592,7 @@ static struct p9_trans_module p9_virtio_trans = {
592 .close = p9_virtio_close, 592 .close = p9_virtio_close,
593 .request = p9_virtio_request, 593 .request = p9_virtio_request,
594 .cancel = p9_virtio_cancel, 594 .cancel = p9_virtio_cancel,
595 .maxsize = PAGE_SIZE*16, 595 .maxsize = PAGE_SIZE*VIRTQUEUE_NUM,
596 .pref = P9_TRANS_PREF_PAYLOAD_SEP, 596 .pref = P9_TRANS_PREF_PAYLOAD_SEP,
597 .def = 0, 597 .def = 0,
598 .owner = THIS_MODULE, 598 .owner = THIS_MODULE,
diff --git a/net/atm/atm_misc.c b/net/atm/atm_misc.c
index fc63526d8695..f41f02656ff4 100644
--- a/net/atm/atm_misc.c
+++ b/net/atm/atm_misc.c
@@ -9,7 +9,7 @@
9#include <linux/sonet.h> 9#include <linux/sonet.h>
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13 13
14int atm_charge(struct atm_vcc *vcc, int truesize) 14int atm_charge(struct atm_vcc *vcc, int truesize)
15{ 15{
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 4bc8c67ecb14..852394072fa1 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -37,7 +37,7 @@
37#include <linux/uaccess.h> 37#include <linux/uaccess.h>
38#include <asm/byteorder.h> /* for htons etc. */ 38#include <asm/byteorder.h> /* for htons etc. */
39#include <asm/system.h> /* save/restore_flags */ 39#include <asm/system.h> /* save/restore_flags */
40#include <asm/atomic.h> 40#include <linux/atomic.h>
41 41
42#include "common.h" 42#include "common.h"
43#include "resources.h" 43#include "resources.h"
diff --git a/net/atm/common.c b/net/atm/common.c
index 22b963d06a10..14ff9fe39989 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -23,7 +23,7 @@
23#include <linux/uaccess.h> 23#include <linux/uaccess.h>
24#include <linux/poll.h> 24#include <linux/poll.h>
25 25
26#include <asm/atomic.h> 26#include <linux/atomic.h>
27 27
28#include "resources.h" /* atm_find_dev */ 28#include "resources.h" /* atm_find_dev */
29#include "common.h" /* prototypes */ 29#include "common.h" /* prototypes */
diff --git a/net/atm/lec.c b/net/atm/lec.c
index ba48daa68c1f..215c9fad7cdf 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1335,7 +1335,7 @@ static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr,
1335#include <linux/types.h> 1335#include <linux/types.h>
1336#include <linux/timer.h> 1336#include <linux/timer.h>
1337#include <linux/param.h> 1337#include <linux/param.h>
1338#include <asm/atomic.h> 1338#include <linux/atomic.h>
1339#include <linux/inetdevice.h> 1339#include <linux/inetdevice.h>
1340#include <net/route.h> 1340#include <net/route.h>
1341 1341
diff --git a/net/atm/proc.c b/net/atm/proc.c
index be3afdefec58..0d020de8d233 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -27,7 +27,7 @@
27#include <net/atmclip.h> 27#include <net/atmclip.h>
28#include <linux/uaccess.h> 28#include <linux/uaccess.h>
29#include <linux/param.h> /* for HZ */ 29#include <linux/param.h> /* for HZ */
30#include <asm/atomic.h> 30#include <linux/atomic.h>
31#include "resources.h" 31#include "resources.h"
32#include "common.h" /* atm_proc_init prototype */ 32#include "common.h" /* atm_proc_init prototype */
33#include "signaling.h" /* to get sigd - ugly too */ 33#include "signaling.h" /* to get sigd - ugly too */
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index e0dfbc151dd7..68def3b7fb49 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -21,7 +21,7 @@
21#include <linux/jhash.h> 21#include <linux/jhash.h>
22#include <linux/random.h> 22#include <linux/random.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <asm/atomic.h> 24#include <linux/atomic.h>
25#include <asm/unaligned.h> 25#include <asm/unaligned.h>
26#include "br_private.h" 26#include "br_private.h"
27 27
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 1bacca4cb676..3176e2e13d9b 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -388,7 +388,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
388 br_ifinfo_notify(RTM_NEWLINK, p); 388 br_ifinfo_notify(RTM_NEWLINK, p);
389 389
390 if (changed_addr) 390 if (changed_addr)
391 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); 391 call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev);
392 392
393 dev_set_mtu(br->dev, br_min_mtu(br)); 393 dev_set_mtu(br->dev, br_min_mtu(br));
394 394
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 6814083a92f4..5b1ed1ba9aa7 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -188,6 +188,8 @@ static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
188 188
189 p->state = new_state; 189 p->state = new_state;
190 br_log_state(p); 190 br_log_state(p);
191 br_ifinfo_notify(RTM_NEWLINK, p);
192
191 return 0; 193 return 0;
192} 194}
193 195
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 54578f274d85..78cc364997d9 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -124,6 +124,7 @@ struct net_bridge_port
124 bridge_id designated_bridge; 124 bridge_id designated_bridge;
125 u32 path_cost; 125 u32 path_cost;
126 u32 designated_cost; 126 u32 designated_cost;
127 unsigned long designated_age;
127 128
128 struct timer_list forward_delay_timer; 129 struct timer_list forward_delay_timer;
129 struct timer_list hold_timer; 130 struct timer_list hold_timer;
diff --git a/net/bridge/br_private_stp.h b/net/bridge/br_private_stp.h
index 642ef47a867e..05ed9bc7e426 100644
--- a/net/bridge/br_private_stp.h
+++ b/net/bridge/br_private_stp.h
@@ -56,7 +56,8 @@ extern void br_become_root_bridge(struct net_bridge *br);
56extern void br_config_bpdu_generation(struct net_bridge *); 56extern void br_config_bpdu_generation(struct net_bridge *);
57extern void br_configuration_update(struct net_bridge *); 57extern void br_configuration_update(struct net_bridge *);
58extern void br_port_state_selection(struct net_bridge *); 58extern void br_port_state_selection(struct net_bridge *);
59extern void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu); 59extern void br_received_config_bpdu(struct net_bridge_port *p,
60 const struct br_config_bpdu *bpdu);
60extern void br_received_tcn_bpdu(struct net_bridge_port *p); 61extern void br_received_tcn_bpdu(struct net_bridge_port *p);
61extern void br_transmit_config(struct net_bridge_port *p); 62extern void br_transmit_config(struct net_bridge_port *p);
62extern void br_transmit_tcn(struct net_bridge *br); 63extern void br_transmit_tcn(struct net_bridge *br);
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c
index bb4383e84de9..ad0a3f7cf6cc 100644
--- a/net/bridge/br_stp.c
+++ b/net/bridge/br_stp.c
@@ -109,7 +109,6 @@ static void br_root_selection(struct net_bridge *br)
109 list_for_each_entry(p, &br->port_list, list) { 109 list_for_each_entry(p, &br->port_list, list) {
110 if (br_should_become_root_port(p, root_port)) 110 if (br_should_become_root_port(p, root_port))
111 root_port = p->port_no; 111 root_port = p->port_no;
112
113 } 112 }
114 113
115 br->root_port = root_port; 114 br->root_port = root_port;
@@ -145,7 +144,6 @@ void br_transmit_config(struct net_bridge_port *p)
145 struct br_config_bpdu bpdu; 144 struct br_config_bpdu bpdu;
146 struct net_bridge *br; 145 struct net_bridge *br;
147 146
148
149 if (timer_pending(&p->hold_timer)) { 147 if (timer_pending(&p->hold_timer)) {
150 p->config_pending = 1; 148 p->config_pending = 1;
151 return; 149 return;
@@ -164,8 +162,7 @@ void br_transmit_config(struct net_bridge_port *p)
164 else { 162 else {
165 struct net_bridge_port *root 163 struct net_bridge_port *root
166 = br_get_port(br, br->root_port); 164 = br_get_port(br, br->root_port);
167 bpdu.message_age = br->max_age 165 bpdu.message_age = (jiffies - root->designated_age)
168 - (root->message_age_timer.expires - jiffies)
169 + MESSAGE_AGE_INCR; 166 + MESSAGE_AGE_INCR;
170 } 167 }
171 bpdu.max_age = br->max_age; 168 bpdu.max_age = br->max_age;
@@ -182,20 +179,21 @@ void br_transmit_config(struct net_bridge_port *p)
182} 179}
183 180
184/* called under bridge lock */ 181/* called under bridge lock */
185static inline void br_record_config_information(struct net_bridge_port *p, 182static void br_record_config_information(struct net_bridge_port *p,
186 const struct br_config_bpdu *bpdu) 183 const struct br_config_bpdu *bpdu)
187{ 184{
188 p->designated_root = bpdu->root; 185 p->designated_root = bpdu->root;
189 p->designated_cost = bpdu->root_path_cost; 186 p->designated_cost = bpdu->root_path_cost;
190 p->designated_bridge = bpdu->bridge_id; 187 p->designated_bridge = bpdu->bridge_id;
191 p->designated_port = bpdu->port_id; 188 p->designated_port = bpdu->port_id;
189 p->designated_age = jiffies + bpdu->message_age;
192 190
193 mod_timer(&p->message_age_timer, jiffies 191 mod_timer(&p->message_age_timer, jiffies
194 + (p->br->max_age - bpdu->message_age)); 192 + (p->br->max_age - bpdu->message_age));
195} 193}
196 194
197/* called under bridge lock */ 195/* called under bridge lock */
198static inline void br_record_config_timeout_values(struct net_bridge *br, 196static void br_record_config_timeout_values(struct net_bridge *br,
199 const struct br_config_bpdu *bpdu) 197 const struct br_config_bpdu *bpdu)
200{ 198{
201 br->max_age = bpdu->max_age; 199 br->max_age = bpdu->max_age;
@@ -254,7 +252,8 @@ static void br_designated_port_selection(struct net_bridge *br)
254} 252}
255 253
256/* called under bridge lock */ 254/* called under bridge lock */
257static int br_supersedes_port_info(struct net_bridge_port *p, struct br_config_bpdu *bpdu) 255static int br_supersedes_port_info(const struct net_bridge_port *p,
256 const struct br_config_bpdu *bpdu)
258{ 257{
259 int t; 258 int t;
260 259
@@ -285,7 +284,7 @@ static int br_supersedes_port_info(struct net_bridge_port *p, struct br_config_b
285} 284}
286 285
287/* called under bridge lock */ 286/* called under bridge lock */
288static inline void br_topology_change_acknowledged(struct net_bridge *br) 287static void br_topology_change_acknowledged(struct net_bridge *br)
289{ 288{
290 br->topology_change_detected = 0; 289 br->topology_change_detected = 0;
291 del_timer(&br->tcn_timer); 290 del_timer(&br->tcn_timer);
@@ -327,7 +326,7 @@ void br_config_bpdu_generation(struct net_bridge *br)
327} 326}
328 327
329/* called under bridge lock */ 328/* called under bridge lock */
330static inline void br_reply(struct net_bridge_port *p) 329static void br_reply(struct net_bridge_port *p)
331{ 330{
332 br_transmit_config(p); 331 br_transmit_config(p);
333} 332}
@@ -363,6 +362,8 @@ static void br_make_blocking(struct net_bridge_port *p)
363 362
364 p->state = BR_STATE_BLOCKING; 363 p->state = BR_STATE_BLOCKING;
365 br_log_state(p); 364 br_log_state(p);
365 br_ifinfo_notify(RTM_NEWLINK, p);
366
366 del_timer(&p->forward_delay_timer); 367 del_timer(&p->forward_delay_timer);
367 } 368 }
368} 369}
@@ -379,15 +380,14 @@ static void br_make_forwarding(struct net_bridge_port *p)
379 p->state = BR_STATE_FORWARDING; 380 p->state = BR_STATE_FORWARDING;
380 br_topology_change_detection(br); 381 br_topology_change_detection(br);
381 del_timer(&p->forward_delay_timer); 382 del_timer(&p->forward_delay_timer);
382 } 383 } else if (br->stp_enabled == BR_KERNEL_STP)
383 else if (br->stp_enabled == BR_KERNEL_STP)
384 p->state = BR_STATE_LISTENING; 384 p->state = BR_STATE_LISTENING;
385 else 385 else
386 p->state = BR_STATE_LEARNING; 386 p->state = BR_STATE_LEARNING;
387 387
388 br_multicast_enable_port(p); 388 br_multicast_enable_port(p);
389
390 br_log_state(p); 389 br_log_state(p);
390 br_ifinfo_notify(RTM_NEWLINK, p);
391 391
392 if (br->forward_delay != 0) 392 if (br->forward_delay != 0)
393 mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay); 393 mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay);
@@ -431,14 +431,15 @@ void br_port_state_selection(struct net_bridge *br)
431} 431}
432 432
433/* called under bridge lock */ 433/* called under bridge lock */
434static inline void br_topology_change_acknowledge(struct net_bridge_port *p) 434static void br_topology_change_acknowledge(struct net_bridge_port *p)
435{ 435{
436 p->topology_change_ack = 1; 436 p->topology_change_ack = 1;
437 br_transmit_config(p); 437 br_transmit_config(p);
438} 438}
439 439
440/* called under bridge lock */ 440/* called under bridge lock */
441void br_received_config_bpdu(struct net_bridge_port *p, struct br_config_bpdu *bpdu) 441void br_received_config_bpdu(struct net_bridge_port *p,
442 const struct br_config_bpdu *bpdu)
442{ 443{
443 struct net_bridge *br; 444 struct net_bridge *br;
444 int was_root; 445 int was_root;
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 289646ec9b7b..e16aade51ae0 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -210,10 +210,19 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,
210 bpdu.hello_time = br_get_ticks(buf+28); 210 bpdu.hello_time = br_get_ticks(buf+28);
211 bpdu.forward_delay = br_get_ticks(buf+30); 211 bpdu.forward_delay = br_get_ticks(buf+30);
212 212
213 br_received_config_bpdu(p, &bpdu); 213 if (bpdu.message_age > bpdu.max_age) {
214 } 214 if (net_ratelimit())
215 br_notice(p->br,
216 "port %u config from %pM"
217 " (message_age %ul > max_age %ul)\n",
218 p->port_no,
219 eth_hdr(skb)->h_source,
220 bpdu.message_age, bpdu.max_age);
221 goto out;
222 }
215 223
216 else if (buf[0] == BPDU_TYPE_TCN) { 224 br_received_config_bpdu(p, &bpdu);
225 } else if (buf[0] == BPDU_TYPE_TCN) {
217 br_received_tcn_bpdu(p); 226 br_received_tcn_bpdu(p);
218 } 227 }
219 out: 228 out:
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 6f615b8192f4..10eda3cd1d71 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -88,6 +88,7 @@ void br_stp_enable_port(struct net_bridge_port *p)
88 br_init_port(p); 88 br_init_port(p);
89 br_port_state_selection(p->br); 89 br_port_state_selection(p->br);
90 br_log_state(p); 90 br_log_state(p);
91 br_ifinfo_notify(RTM_NEWLINK, p);
91} 92}
92 93
93/* called under bridge lock */ 94/* called under bridge lock */
@@ -104,6 +105,8 @@ void br_stp_disable_port(struct net_bridge_port *p)
104 p->topology_change_ack = 0; 105 p->topology_change_ack = 0;
105 p->config_pending = 0; 106 p->config_pending = 0;
106 107
108 br_ifinfo_notify(RTM_NEWLINK, p);
109
107 del_timer(&p->message_age_timer); 110 del_timer(&p->message_age_timer);
108 del_timer(&p->forward_delay_timer); 111 del_timer(&p->forward_delay_timer);
109 del_timer(&p->hold_timer); 112 del_timer(&p->hold_timer);
diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c
index 3e965140051e..58de2a0f9975 100644
--- a/net/bridge/br_stp_timer.c
+++ b/net/bridge/br_stp_timer.c
@@ -97,6 +97,7 @@ static void br_forward_delay_timer_expired(unsigned long arg)
97 netif_carrier_on(br->dev); 97 netif_carrier_on(br->dev);
98 } 98 }
99 br_log_state(p); 99 br_log_state(p);
100 br_ifinfo_notify(RTM_NEWLINK, p);
100 spin_unlock(&br->lock); 101 spin_unlock(&br->lock);
101} 102}
102 103
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c
index 26377e96fa1c..bf2a333ca7c7 100644
--- a/net/bridge/netfilter/ebt_ulog.c
+++ b/net/bridge/netfilter/ebt_ulog.c
@@ -216,7 +216,6 @@ unlock:
216nlmsg_failure: 216nlmsg_failure:
217 pr_debug("error during NLMSG_PUT. This should " 217 pr_debug("error during NLMSG_PUT. This should "
218 "not happen, please report to author.\n"); 218 "not happen, please report to author.\n");
219 goto unlock;
220alloc_failure: 219alloc_failure:
221 goto unlock; 220 goto unlock;
222} 221}
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 78b55f49de7c..c340e2e0765b 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -486,13 +486,10 @@ static void prepare_write_message(struct ceph_connection *con)
486 m = list_first_entry(&con->out_queue, 486 m = list_first_entry(&con->out_queue,
487 struct ceph_msg, list_head); 487 struct ceph_msg, list_head);
488 con->out_msg = m; 488 con->out_msg = m;
489 if (test_bit(LOSSYTX, &con->state)) { 489
490 list_del_init(&m->list_head); 490 /* put message on sent list */
491 } else { 491 ceph_msg_get(m);
492 /* put message on sent list */ 492 list_move_tail(&m->list_head, &con->out_sent);
493 ceph_msg_get(m);
494 list_move_tail(&m->list_head, &con->out_sent);
495 }
496 493
497 /* 494 /*
498 * only assign outgoing seq # if we haven't sent this message 495 * only assign outgoing seq # if we haven't sent this message
@@ -1399,6 +1396,7 @@ static void process_ack(struct ceph_connection *con)
1399 break; 1396 break;
1400 dout("got ack for seq %llu type %d at %p\n", seq, 1397 dout("got ack for seq %llu type %d at %p\n", seq,
1401 le16_to_cpu(m->hdr.type), m); 1398 le16_to_cpu(m->hdr.type), m);
1399 m->ack_stamp = jiffies;
1402 ceph_msg_remove(m); 1400 ceph_msg_remove(m);
1403 } 1401 }
1404 prepare_read_tag(con); 1402 prepare_read_tag(con);
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 7330c2757c0c..ce310eee708d 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1085,9 +1085,15 @@ static void handle_timeout(struct work_struct *work)
1085 req = list_entry(osdc->req_lru.next, struct ceph_osd_request, 1085 req = list_entry(osdc->req_lru.next, struct ceph_osd_request,
1086 r_req_lru_item); 1086 r_req_lru_item);
1087 1087
1088 /* hasn't been long enough since we sent it? */
1088 if (time_before(jiffies, req->r_stamp + timeout)) 1089 if (time_before(jiffies, req->r_stamp + timeout))
1089 break; 1090 break;
1090 1091
1092 /* hasn't been long enough since it was acked? */
1093 if (req->r_request->ack_stamp == 0 ||
1094 time_before(jiffies, req->r_request->ack_stamp + timeout))
1095 break;
1096
1091 BUG_ON(req == last_req && req->r_stamp == last_stamp); 1097 BUG_ON(req == last_req && req->r_stamp == last_stamp);
1092 last_req = req; 1098 last_req = req;
1093 last_stamp = req->r_stamp; 1099 last_stamp = req->r_stamp;
diff --git a/net/core/flow.c b/net/core/flow.c
index 990703b8863b..bf32c33cad3b 100644
--- a/net/core/flow.c
+++ b/net/core/flow.c
@@ -22,7 +22,7 @@
22#include <linux/cpumask.h> 22#include <linux/cpumask.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <net/flow.h> 24#include <net/flow.h>
25#include <asm/atomic.h> 25#include <linux/atomic.h>
26#include <linux/security.h> 26#include <linux/security.h>
27 27
28struct flow_cache_entry { 28struct flow_cache_entry {
diff --git a/net/core/link_watch.c b/net/core/link_watch.c
index a7b342131869..357bd4ee4baa 100644
--- a/net/core/link_watch.c
+++ b/net/core/link_watch.c
@@ -126,7 +126,7 @@ static void linkwatch_schedule_work(int urgent)
126 return; 126 return;
127 127
128 /* It's already running which is good enough. */ 128 /* It's already running which is good enough. */
129 if (!cancel_delayed_work(&linkwatch_work)) 129 if (!__cancel_delayed_work(&linkwatch_work))
130 return; 130 return;
131 131
132 /* Otherwise we reschedule it again for immediate execution. */ 132 /* Otherwise we reschedule it again for immediate execution. */
diff --git a/net/decnet/dn_fib.c b/net/decnet/dn_fib.c
index 2bd8e53d7774..9e885f180b60 100644
--- a/net/decnet/dn_fib.c
+++ b/net/decnet/dn_fib.c
@@ -30,7 +30,7 @@
30#include <linux/netdevice.h> 30#include <linux/netdevice.h>
31#include <linux/timer.h> 31#include <linux/timer.h>
32#include <linux/spinlock.h> 32#include <linux/spinlock.h>
33#include <asm/atomic.h> 33#include <linux/atomic.h>
34#include <asm/uaccess.h> 34#include <asm/uaccess.h>
35#include <net/neighbour.h> 35#include <net/neighbour.h>
36#include <net/dst.h> 36#include <net/dst.h>
diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
index 0dc3fe61085b..7f0eb087dc11 100644
--- a/net/decnet/dn_neigh.c
+++ b/net/decnet/dn_neigh.c
@@ -38,7 +38,7 @@
38#include <linux/seq_file.h> 38#include <linux/seq_file.h>
39#include <linux/rcupdate.h> 39#include <linux/rcupdate.h>
40#include <linux/jhash.h> 40#include <linux/jhash.h>
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42#include <net/net_namespace.h> 42#include <net/net_namespace.h>
43#include <net/neighbour.h> 43#include <net/neighbour.h>
44#include <net/dst.h> 44#include <net/dst.h>
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c
index cd0354e9bdb3..a9a62f225a6b 100644
--- a/net/decnet/dn_table.c
+++ b/net/decnet/dn_table.c
@@ -25,7 +25,7 @@
25#include <linux/netdevice.h> 25#include <linux/netdevice.h>
26#include <linux/timer.h> 26#include <linux/timer.h>
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <asm/atomic.h> 28#include <linux/atomic.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <linux/route.h> /* RTF_xxx */ 30#include <linux/route.h> /* RTF_xxx */
31#include <net/neighbour.h> 31#include <net/neighbour.h>
diff --git a/net/decnet/dn_timer.c b/net/decnet/dn_timer.c
index 09825711d58a..67f691bd4acf 100644
--- a/net/decnet/dn_timer.c
+++ b/net/decnet/dn_timer.c
@@ -22,7 +22,7 @@
22#include <linux/timer.h> 22#include <linux/timer.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <net/sock.h> 24#include <net/sock.h>
25#include <asm/atomic.h> 25#include <linux/atomic.h>
26#include <net/flow.h> 26#include <net/flow.h>
27#include <net/dn.h> 27#include <net/dn.h>
28 28
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 2b3c23c287cd..2c2a98e402e7 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -50,7 +50,7 @@
50#include <net/tcp.h> 50#include <net/tcp.h>
51#include <net/netlabel.h> 51#include <net/netlabel.h>
52#include <net/cipso_ipv4.h> 52#include <net/cipso_ipv4.h>
53#include <asm/atomic.h> 53#include <linux/atomic.h>
54#include <asm/bug.h> 54#include <asm/bug.h>
55#include <asm/unaligned.h> 55#include <asm/unaligned.h>
56 56
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c
index 9dbe10875fbd..dbfc21de3479 100644
--- a/net/ipv4/gre.c
+++ b/net/ipv4/gre.c
@@ -15,6 +15,7 @@
15#include <linux/kmod.h> 15#include <linux/kmod.h>
16#include <linux/skbuff.h> 16#include <linux/skbuff.h>
17#include <linux/in.h> 17#include <linux/in.h>
18#include <linux/ip.h>
18#include <linux/netdevice.h> 19#include <linux/netdevice.h>
19#include <linux/spinlock.h> 20#include <linux/spinlock.h>
20#include <net/protocol.h> 21#include <net/protocol.h>
@@ -96,27 +97,17 @@ drop:
96static void gre_err(struct sk_buff *skb, u32 info) 97static void gre_err(struct sk_buff *skb, u32 info)
97{ 98{
98 const struct gre_protocol *proto; 99 const struct gre_protocol *proto;
99 u8 ver; 100 const struct iphdr *iph = (const struct iphdr *)skb->data;
100 101 u8 ver = skb->data[(iph->ihl<<2) + 1]&0x7f;
101 if (!pskb_may_pull(skb, 12))
102 goto drop;
103 102
104 ver = skb->data[1]&0x7f;
105 if (ver >= GREPROTO_MAX) 103 if (ver >= GREPROTO_MAX)
106 goto drop; 104 return;
107 105
108 rcu_read_lock(); 106 rcu_read_lock();
109 proto = rcu_dereference(gre_proto[ver]); 107 proto = rcu_dereference(gre_proto[ver]);
110 if (!proto || !proto->err_handler) 108 if (proto && proto->err_handler)
111 goto drop_unlock; 109 proto->err_handler(skb, info);
112 proto->err_handler(skb, info);
113 rcu_read_unlock();
114 return;
115
116drop_unlock:
117 rcu_read_unlock(); 110 rcu_read_unlock();
118drop:
119 kfree_skb(skb);
120} 111}
121 112
122static const struct net_protocol net_gre_protocol = { 113static const struct net_protocol net_gre_protocol = {
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index aae2bd8cd924..58e879157976 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1796,7 +1796,7 @@ static struct mr_table *ipmr_rt_fib_lookup(struct net *net, struct sk_buff *skb)
1796 struct flowi4 fl4 = { 1796 struct flowi4 fl4 = {
1797 .daddr = iph->daddr, 1797 .daddr = iph->daddr,
1798 .saddr = iph->saddr, 1798 .saddr = iph->saddr,
1799 .flowi4_tos = iph->tos, 1799 .flowi4_tos = RT_TOS(iph->tos),
1800 .flowi4_oif = rt->rt_oif, 1800 .flowi4_oif = rt->rt_oif,
1801 .flowi4_iif = rt->rt_iif, 1801 .flowi4_iif = rt->rt_iif,
1802 .flowi4_mark = rt->rt_mark, 1802 .flowi4_mark = rt->rt_mark,
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 08526786dc39..1457acb39cec 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -38,7 +38,7 @@
38 */ 38 */
39 39
40#include <linux/types.h> 40#include <linux/types.h>
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42#include <asm/byteorder.h> 42#include <asm/byteorder.h>
43#include <asm/current.h> 43#include <asm/current.h>
44#include <asm/uaccess.h> 44#include <asm/uaccess.h>
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 33137307d52a..1730689f560e 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1740,7 +1740,7 @@ void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt)
1740 memset(&fl4, 0, sizeof(fl4)); 1740 memset(&fl4, 0, sizeof(fl4));
1741 fl4.daddr = iph->daddr; 1741 fl4.daddr = iph->daddr;
1742 fl4.saddr = iph->saddr; 1742 fl4.saddr = iph->saddr;
1743 fl4.flowi4_tos = iph->tos; 1743 fl4.flowi4_tos = RT_TOS(iph->tos);
1744 fl4.flowi4_oif = rt->dst.dev->ifindex; 1744 fl4.flowi4_oif = rt->dst.dev->ifindex;
1745 fl4.flowi4_iif = skb->dev->ifindex; 1745 fl4.flowi4_iif = skb->dev->ifindex;
1746 fl4.flowi4_mark = skb->mark; 1746 fl4.flowi4_mark = skb->mark;
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 36c2842a86b2..0bc98886c383 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -40,7 +40,7 @@
40#include <linux/slab.h> 40#include <linux/slab.h>
41 41
42#include <asm/uaccess.h> 42#include <asm/uaccess.h>
43#include <asm/atomic.h> 43#include <linux/atomic.h>
44 44
45#include <net/icmp.h> 45#include <net/icmp.h>
46#include <net/ip.h> 46#include <net/ip.h>
diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index 7f9124914b13..075a3808aa40 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -51,7 +51,7 @@
51#include <linux/cpu.h> 51#include <linux/cpu.h>
52#include <linux/reboot.h> 52#include <linux/reboot.h>
53#include <net/iucv/iucv.h> 53#include <net/iucv/iucv.h>
54#include <asm/atomic.h> 54#include <linux/atomic.h>
55#include <asm/ebcdic.h> 55#include <asm/ebcdic.h>
56#include <asm/io.h> 56#include <asm/io.h>
57#include <asm/irq.h> 57#include <asm/irq.h>
@@ -1988,12 +1988,13 @@ static int __init iucv_init(void)
1988 rc = -EPROTONOSUPPORT; 1988 rc = -EPROTONOSUPPORT;
1989 goto out; 1989 goto out;
1990 } 1990 }
1991 ctl_set_bit(0, 1);
1991 rc = iucv_query_maxconn(); 1992 rc = iucv_query_maxconn();
1992 if (rc) 1993 if (rc)
1993 goto out; 1994 goto out_ctl;
1994 rc = register_external_interrupt(0x4000, iucv_external_interrupt); 1995 rc = register_external_interrupt(0x4000, iucv_external_interrupt);
1995 if (rc) 1996 if (rc)
1996 goto out; 1997 goto out_ctl;
1997 iucv_root = root_device_register("iucv"); 1998 iucv_root = root_device_register("iucv");
1998 if (IS_ERR(iucv_root)) { 1999 if (IS_ERR(iucv_root)) {
1999 rc = PTR_ERR(iucv_root); 2000 rc = PTR_ERR(iucv_root);
@@ -2055,6 +2056,8 @@ out_free:
2055 root_device_unregister(iucv_root); 2056 root_device_unregister(iucv_root);
2056out_int: 2057out_int:
2057 unregister_external_interrupt(0x4000, iucv_external_interrupt); 2058 unregister_external_interrupt(0x4000, iucv_external_interrupt);
2059out_ctl:
2060 ctl_clear_bit(0, 1);
2058out: 2061out:
2059 return rc; 2062 return rc;
2060} 2063}
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index ed8a2335442f..ad4ac2601a56 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -55,7 +55,7 @@
55#include <net/protocol.h> 55#include <net/protocol.h>
56 56
57#include <asm/byteorder.h> 57#include <asm/byteorder.h>
58#include <asm/atomic.h> 58#include <linux/atomic.h>
59 59
60#include "l2tp_core.h" 60#include "l2tp_core.h"
61 61
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 39a21d0c61c4..f42cd0915966 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -97,7 +97,7 @@
97#include <net/xfrm.h> 97#include <net/xfrm.h>
98 98
99#include <asm/byteorder.h> 99#include <asm/byteorder.h>
100#include <asm/atomic.h> 100#include <linux/atomic.h>
101 101
102#include "l2tp_core.h" 102#include "l2tp_core.h"
103 103
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index ebadb9ac9a7e..fd1aaf2a4a6c 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -104,14 +104,22 @@ void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
104 const u8 *addr) 104 const u8 *addr)
105{ 105{
106 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); 106 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
107 struct sta_info *sta = sta_info_get(sdata, addr); 107 struct sta_info *sta;
108 int i; 108 int i;
109 109
110 rcu_read_lock();
111 sta = sta_info_get(sdata, addr);
112 if (!sta) {
113 rcu_read_unlock();
114 return;
115 }
116
110 for (i = 0; i < STA_TID_NUM; i++) 117 for (i = 0; i < STA_TID_NUM; i++)
111 if (ba_rx_bitmap & BIT(i)) 118 if (ba_rx_bitmap & BIT(i))
112 set_bit(i, sta->ampdu_mlme.tid_rx_stop_requested); 119 set_bit(i, sta->ampdu_mlme.tid_rx_stop_requested);
113 120
114 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work); 121 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work);
122 rcu_read_unlock();
115} 123}
116EXPORT_SYMBOL(ieee80211_stop_rx_ba_session); 124EXPORT_SYMBOL(ieee80211_stop_rx_ba_session);
117 125
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index bfc36e904764..3d1b091d9b2e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1255,6 +1255,10 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1255 */ 1255 */
1256 p.uapsd = false; 1256 p.uapsd = false;
1257 1257
1258 if (params->queue >= local->hw.queues)
1259 return -EINVAL;
1260
1261 local->tx_conf[params->queue] = p;
1258 if (drv_conf_tx(local, params->queue, &p)) { 1262 if (drv_conf_tx(local, params->queue, &p)) {
1259 wiphy_debug(local->hw.wiphy, 1263 wiphy_debug(local->hw.wiphy,
1260 "failed to set TX queue parameters for queue %d\n", 1264 "failed to set TX queue parameters for queue %d\n",
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index b2d6bba44054..1425380983f7 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -130,6 +130,37 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local,
130 trace_drv_return_void(local); 130 trace_drv_return_void(local);
131} 131}
132 132
133static inline int drv_tx_sync(struct ieee80211_local *local,
134 struct ieee80211_sub_if_data *sdata,
135 const u8 *bssid,
136 enum ieee80211_tx_sync_type type)
137{
138 int ret = 0;
139
140 might_sleep();
141
142 trace_drv_tx_sync(local, sdata, bssid, type);
143 if (local->ops->tx_sync)
144 ret = local->ops->tx_sync(&local->hw, &sdata->vif,
145 bssid, type);
146 trace_drv_return_int(local, ret);
147 return ret;
148}
149
150static inline void drv_finish_tx_sync(struct ieee80211_local *local,
151 struct ieee80211_sub_if_data *sdata,
152 const u8 *bssid,
153 enum ieee80211_tx_sync_type type)
154{
155 might_sleep();
156
157 trace_drv_finish_tx_sync(local, sdata, bssid, type);
158 if (local->ops->finish_tx_sync)
159 local->ops->finish_tx_sync(&local->hw, &sdata->vif,
160 bssid, type);
161 trace_drv_return_void(local);
162}
163
133static inline u64 drv_prepare_multicast(struct ieee80211_local *local, 164static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
134 struct netdev_hw_addr_list *mc_list) 165 struct netdev_hw_addr_list *mc_list)
135{ 166{
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 4470f6e8b845..f47b00dc7afd 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -319,6 +319,49 @@ TRACE_EVENT(drv_bss_info_changed,
319 ) 319 )
320); 320);
321 321
322DECLARE_EVENT_CLASS(tx_sync_evt,
323 TP_PROTO(struct ieee80211_local *local,
324 struct ieee80211_sub_if_data *sdata,
325 const u8 *bssid,
326 enum ieee80211_tx_sync_type type),
327 TP_ARGS(local, sdata, bssid, type),
328
329 TP_STRUCT__entry(
330 LOCAL_ENTRY
331 VIF_ENTRY
332 __array(char, bssid, ETH_ALEN)
333 __field(u32, sync_type)
334 ),
335
336 TP_fast_assign(
337 LOCAL_ASSIGN;
338 VIF_ASSIGN;
339 memcpy(__entry->bssid, bssid, ETH_ALEN);
340 __entry->sync_type = type;
341 ),
342
343 TP_printk(
344 LOCAL_PR_FMT VIF_PR_FMT " bssid:%pM type:%d",
345 LOCAL_PR_ARG, VIF_PR_ARG, __entry->bssid, __entry->sync_type
346 )
347);
348
349DEFINE_EVENT(tx_sync_evt, drv_tx_sync,
350 TP_PROTO(struct ieee80211_local *local,
351 struct ieee80211_sub_if_data *sdata,
352 const u8 *bssid,
353 enum ieee80211_tx_sync_type type),
354 TP_ARGS(local, sdata, bssid, type)
355);
356
357DEFINE_EVENT(tx_sync_evt, drv_finish_tx_sync,
358 TP_PROTO(struct ieee80211_local *local,
359 struct ieee80211_sub_if_data *sdata,
360 const u8 *bssid,
361 enum ieee80211_tx_sync_type type),
362 TP_ARGS(local, sdata, bssid, type)
363);
364
322TRACE_EVENT(drv_prepare_multicast, 365TRACE_EVENT(drv_prepare_multicast,
323 TP_PROTO(struct ieee80211_local *local, int mc_count), 366 TP_PROTO(struct ieee80211_local *local, int mc_count),
324 367
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index dda0d1ab34f3..400c09bea639 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -323,6 +323,7 @@ struct ieee80211_work {
323 u8 key[WLAN_KEY_LEN_WEP104]; 323 u8 key[WLAN_KEY_LEN_WEP104];
324 u8 key_len, key_idx; 324 u8 key_len, key_idx;
325 bool privacy; 325 bool privacy;
326 bool synced;
326 } probe_auth; 327 } probe_auth;
327 struct { 328 struct {
328 struct cfg80211_bss *bss; 329 struct cfg80211_bss *bss;
@@ -336,6 +337,7 @@ struct ieee80211_work {
336 u8 ssid_len; 337 u8 ssid_len;
337 u8 supp_rates_len; 338 u8 supp_rates_len;
338 bool wmm_used, use_11n, uapsd_used; 339 bool wmm_used, use_11n, uapsd_used;
340 bool synced;
339 } assoc; 341 } assoc;
340 struct { 342 struct {
341 u32 duration; 343 u32 duration;
@@ -746,6 +748,7 @@ struct ieee80211_local {
746 struct workqueue_struct *workqueue; 748 struct workqueue_struct *workqueue;
747 749
748 unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; 750 unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
751 struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
749 /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ 752 /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
750 spinlock_t queue_stop_reason_lock; 753 spinlock_t queue_stop_reason_lock;
751 754
@@ -1376,14 +1379,14 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1376 enum ieee80211_band band, u32 rate_mask, 1379 enum ieee80211_band band, u32 rate_mask,
1377 u8 channel); 1380 u8 channel);
1378struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1381struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1379 u8 *dst, 1382 u8 *dst, u32 ratemask,
1380 const u8 *ssid, size_t ssid_len, 1383 const u8 *ssid, size_t ssid_len,
1381 const u8 *ie, size_t ie_len, 1384 const u8 *ie, size_t ie_len,
1382 bool directed); 1385 bool directed);
1383void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1386void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1384 const u8 *ssid, size_t ssid_len, 1387 const u8 *ssid, size_t ssid_len,
1385 const u8 *ie, size_t ie_len, 1388 const u8 *ie, size_t ie_len,
1386 bool directed); 1389 u32 ratemask, bool directed);
1387 1390
1388void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, 1391void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1389 const size_t supp_rates_len, 1392 const size_t supp_rates_len,
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 739bee13e813..5150c6d11b57 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -278,7 +278,7 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
278 bool defunikey, defmultikey, defmgmtkey; 278 bool defunikey, defmultikey, defmgmtkey;
279 279
280 if (new) 280 if (new)
281 list_add(&new->list, &sdata->key_list); 281 list_add_tail(&new->list, &sdata->key_list);
282 282
283 if (sta && pairwise) { 283 if (sta && pairwise) {
284 rcu_assign_pointer(sta->ptk, new); 284 rcu_assign_pointer(sta->ptk, new);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 2b18053070c1..3460108810d5 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -57,29 +57,29 @@ static inline u32 u16_field_get(u8 *preq_elem, int offset, bool ae)
57#define PREQ_IE_TTL(x) (*(x + 2)) 57#define PREQ_IE_TTL(x) (*(x + 2))
58#define PREQ_IE_PREQ_ID(x) u32_field_get(x, 3, 0) 58#define PREQ_IE_PREQ_ID(x) u32_field_get(x, 3, 0)
59#define PREQ_IE_ORIG_ADDR(x) (x + 7) 59#define PREQ_IE_ORIG_ADDR(x) (x + 7)
60#define PREQ_IE_ORIG_SN(x) u32_field_get(x, 13, 0); 60#define PREQ_IE_ORIG_SN(x) u32_field_get(x, 13, 0)
61#define PREQ_IE_LIFETIME(x) u32_field_get(x, 17, AE_F_SET(x)); 61#define PREQ_IE_LIFETIME(x) u32_field_get(x, 17, AE_F_SET(x))
62#define PREQ_IE_METRIC(x) u32_field_get(x, 21, AE_F_SET(x)); 62#define PREQ_IE_METRIC(x) u32_field_get(x, 21, AE_F_SET(x))
63#define PREQ_IE_TARGET_F(x) (*(AE_F_SET(x) ? x + 32 : x + 26)) 63#define PREQ_IE_TARGET_F(x) (*(AE_F_SET(x) ? x + 32 : x + 26))
64#define PREQ_IE_TARGET_ADDR(x) (AE_F_SET(x) ? x + 33 : x + 27) 64#define PREQ_IE_TARGET_ADDR(x) (AE_F_SET(x) ? x + 33 : x + 27)
65#define PREQ_IE_TARGET_SN(x) u32_field_get(x, 33, AE_F_SET(x)); 65#define PREQ_IE_TARGET_SN(x) u32_field_get(x, 33, AE_F_SET(x))
66 66
67 67
68#define PREP_IE_FLAGS(x) PREQ_IE_FLAGS(x) 68#define PREP_IE_FLAGS(x) PREQ_IE_FLAGS(x)
69#define PREP_IE_HOPCOUNT(x) PREQ_IE_HOPCOUNT(x) 69#define PREP_IE_HOPCOUNT(x) PREQ_IE_HOPCOUNT(x)
70#define PREP_IE_TTL(x) PREQ_IE_TTL(x) 70#define PREP_IE_TTL(x) PREQ_IE_TTL(x)
71#define PREP_IE_ORIG_ADDR(x) (x + 3) 71#define PREP_IE_ORIG_ADDR(x) (x + 3)
72#define PREP_IE_ORIG_SN(x) u32_field_get(x, 9, 0); 72#define PREP_IE_ORIG_SN(x) u32_field_get(x, 9, 0)
73#define PREP_IE_LIFETIME(x) u32_field_get(x, 13, AE_F_SET(x)); 73#define PREP_IE_LIFETIME(x) u32_field_get(x, 13, AE_F_SET(x))
74#define PREP_IE_METRIC(x) u32_field_get(x, 17, AE_F_SET(x)); 74#define PREP_IE_METRIC(x) u32_field_get(x, 17, AE_F_SET(x))
75#define PREP_IE_TARGET_ADDR(x) (AE_F_SET(x) ? x + 27 : x + 21) 75#define PREP_IE_TARGET_ADDR(x) (AE_F_SET(x) ? x + 27 : x + 21)
76#define PREP_IE_TARGET_SN(x) u32_field_get(x, 27, AE_F_SET(x)); 76#define PREP_IE_TARGET_SN(x) u32_field_get(x, 27, AE_F_SET(x))
77 77
78#define PERR_IE_TTL(x) (*(x)) 78#define PERR_IE_TTL(x) (*(x))
79#define PERR_IE_TARGET_FLAGS(x) (*(x + 2)) 79#define PERR_IE_TARGET_FLAGS(x) (*(x + 2))
80#define PERR_IE_TARGET_ADDR(x) (x + 3) 80#define PERR_IE_TARGET_ADDR(x) (x + 3)
81#define PERR_IE_TARGET_SN(x) u32_field_get(x, 9, 0); 81#define PERR_IE_TARGET_SN(x) u32_field_get(x, 9, 0)
82#define PERR_IE_TARGET_RCODE(x) u16_field_get(x, 13, 0); 82#define PERR_IE_TARGET_RCODE(x) u16_field_get(x, 13, 0)
83 83
84#define MSEC_TO_TU(x) (x*1000/1024) 84#define MSEC_TO_TU(x) (x*1000/1024)
85#define SN_GT(x, y) ((long) (y) - (long) (x) < 0) 85#define SN_GT(x, y) ((long) (y) - (long) (x) < 0)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c99237cd4b98..d6470c7fd6ce 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -917,6 +917,7 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
917 params.aifs, params.cw_min, params.cw_max, 917 params.aifs, params.cw_min, params.cw_max,
918 params.txop, params.uapsd); 918 params.txop, params.uapsd);
919#endif 919#endif
920 local->tx_conf[queue] = params;
920 if (drv_conf_tx(local, queue, &params)) 921 if (drv_conf_tx(local, queue, &params))
921 wiphy_debug(local->hw.wiphy, 922 wiphy_debug(local->hw.wiphy,
922 "failed to set TX queue parameters for queue %d\n", 923 "failed to set TX queue parameters for queue %d\n",
@@ -1219,7 +1220,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata)
1219 } else { 1220 } else {
1220 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1221 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1221 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0, 1222 ieee80211_send_probe_req(sdata, dst, ssid + 2, ssid[1], NULL, 0,
1222 true); 1223 (u32) -1, true);
1223 } 1224 }
1224 1225
1225 ifmgd->probe_send_count++; 1226 ifmgd->probe_send_count++;
@@ -1304,7 +1305,8 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw,
1304 1305
1305 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID); 1306 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
1306 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid, 1307 skb = ieee80211_build_probe_req(sdata, ifmgd->associated->bssid,
1307 ssid + 2, ssid[1], NULL, 0, true); 1308 (u32) -1, ssid + 2, ssid[1],
1309 NULL, 0, true);
1308 1310
1309 return skb; 1311 return skb;
1310} 1312}
@@ -2333,14 +2335,16 @@ static enum work_done_result
2333ieee80211_probe_auth_done(struct ieee80211_work *wk, 2335ieee80211_probe_auth_done(struct ieee80211_work *wk,
2334 struct sk_buff *skb) 2336 struct sk_buff *skb)
2335{ 2337{
2338 struct ieee80211_local *local = wk->sdata->local;
2339
2336 if (!skb) { 2340 if (!skb) {
2337 cfg80211_send_auth_timeout(wk->sdata->dev, wk->filter_ta); 2341 cfg80211_send_auth_timeout(wk->sdata->dev, wk->filter_ta);
2338 return WORK_DONE_DESTROY; 2342 goto destroy;
2339 } 2343 }
2340 2344
2341 if (wk->type == IEEE80211_WORK_AUTH) { 2345 if (wk->type == IEEE80211_WORK_AUTH) {
2342 cfg80211_send_rx_auth(wk->sdata->dev, skb->data, skb->len); 2346 cfg80211_send_rx_auth(wk->sdata->dev, skb->data, skb->len);
2343 return WORK_DONE_DESTROY; 2347 goto destroy;
2344 } 2348 }
2345 2349
2346 mutex_lock(&wk->sdata->u.mgd.mtx); 2350 mutex_lock(&wk->sdata->u.mgd.mtx);
@@ -2350,6 +2354,12 @@ ieee80211_probe_auth_done(struct ieee80211_work *wk,
2350 wk->type = IEEE80211_WORK_AUTH; 2354 wk->type = IEEE80211_WORK_AUTH;
2351 wk->probe_auth.tries = 0; 2355 wk->probe_auth.tries = 0;
2352 return WORK_DONE_REQUEUE; 2356 return WORK_DONE_REQUEUE;
2357 destroy:
2358 if (wk->probe_auth.synced)
2359 drv_finish_tx_sync(local, wk->sdata, wk->filter_ta,
2360 IEEE80211_TX_SYNC_AUTH);
2361
2362 return WORK_DONE_DESTROY;
2353} 2363}
2354 2364
2355int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, 2365int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
@@ -2422,6 +2432,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
2422static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk, 2432static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk,
2423 struct sk_buff *skb) 2433 struct sk_buff *skb)
2424{ 2434{
2435 struct ieee80211_local *local = wk->sdata->local;
2425 struct ieee80211_mgmt *mgmt; 2436 struct ieee80211_mgmt *mgmt;
2426 struct ieee80211_rx_status *rx_status; 2437 struct ieee80211_rx_status *rx_status;
2427 struct ieee802_11_elems elems; 2438 struct ieee802_11_elems elems;
@@ -2429,7 +2440,7 @@ static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk,
2429 2440
2430 if (!skb) { 2441 if (!skb) {
2431 cfg80211_send_assoc_timeout(wk->sdata->dev, wk->filter_ta); 2442 cfg80211_send_assoc_timeout(wk->sdata->dev, wk->filter_ta);
2432 return WORK_DONE_DESTROY; 2443 goto destroy;
2433 } 2444 }
2434 2445
2435 if (wk->type == IEEE80211_WORK_ASSOC_BEACON_WAIT) { 2446 if (wk->type == IEEE80211_WORK_ASSOC_BEACON_WAIT) {
@@ -2449,6 +2460,10 @@ static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk,
2449 status = le16_to_cpu(mgmt->u.assoc_resp.status_code); 2460 status = le16_to_cpu(mgmt->u.assoc_resp.status_code);
2450 2461
2451 if (status == WLAN_STATUS_SUCCESS) { 2462 if (status == WLAN_STATUS_SUCCESS) {
2463 if (wk->assoc.synced)
2464 drv_finish_tx_sync(local, wk->sdata, wk->filter_ta,
2465 IEEE80211_TX_SYNC_ASSOC);
2466
2452 mutex_lock(&wk->sdata->u.mgd.mtx); 2467 mutex_lock(&wk->sdata->u.mgd.mtx);
2453 if (!ieee80211_assoc_success(wk, mgmt, skb->len)) { 2468 if (!ieee80211_assoc_success(wk, mgmt, skb->len)) {
2454 mutex_unlock(&wk->sdata->u.mgd.mtx); 2469 mutex_unlock(&wk->sdata->u.mgd.mtx);
@@ -2462,6 +2477,11 @@ static enum work_done_result ieee80211_assoc_done(struct ieee80211_work *wk,
2462 } 2477 }
2463 2478
2464 cfg80211_send_rx_assoc(wk->sdata->dev, skb->data, skb->len); 2479 cfg80211_send_rx_assoc(wk->sdata->dev, skb->data, skb->len);
2480 destroy:
2481 if (wk->assoc.synced)
2482 drv_finish_tx_sync(local, wk->sdata, wk->filter_ta,
2483 IEEE80211_TX_SYNC_ASSOC);
2484
2465 return WORK_DONE_DESTROY; 2485 return WORK_DONE_DESTROY;
2466} 2486}
2467 2487
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index f87e993e713b..6326d3439861 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -34,6 +34,9 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
34 struct ieee80211_sub_if_data *sdata; 34 struct ieee80211_sub_if_data *sdata;
35 struct sta_info *sta; 35 struct sta_info *sta;
36 36
37 if (!local->open_count)
38 goto suspend;
39
37 ieee80211_scan_cancel(local); 40 ieee80211_scan_cancel(local);
38 41
39 if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) { 42 if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 08a45ac3d6f8..6f09eca01112 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -228,7 +228,6 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
228static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) 228static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
229{ 229{
230 struct cfg80211_scan_request *req = local->scan_req; 230 struct cfg80211_scan_request *req = local->scan_req;
231 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
232 enum ieee80211_band band; 231 enum ieee80211_band band;
233 int i, ielen, n_chans; 232 int i, ielen, n_chans;
234 233
@@ -253,7 +252,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
253 252
254 ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie, 253 ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie,
255 req->ie, req->ie_len, band, 254 req->ie, req->ie_len, band,
256 sdata->rc_rateidx_mask[band], 0); 255 req->rates[band], 0);
257 local->hw_scan_req->ie_len = ielen; 256 local->hw_scan_req->ie_len = ielen;
258 257
259 return true; 258 return true;
@@ -653,6 +652,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
653{ 652{
654 int i; 653 int i;
655 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 654 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
655 enum ieee80211_band band = local->hw.conf.channel->band;
656 656
657 for (i = 0; i < local->scan_req->n_ssids; i++) 657 for (i = 0; i < local->scan_req->n_ssids; i++)
658 ieee80211_send_probe_req( 658 ieee80211_send_probe_req(
@@ -660,7 +660,7 @@ static void ieee80211_scan_state_send_probe(struct ieee80211_local *local,
660 local->scan_req->ssids[i].ssid, 660 local->scan_req->ssids[i].ssid,
661 local->scan_req->ssids[i].ssid_len, 661 local->scan_req->ssids[i].ssid_len,
662 local->scan_req->ie, local->scan_req->ie_len, 662 local->scan_req->ie, local->scan_req->ie_len,
663 false); 663 local->scan_req->rates[band], false);
664 664
665 /* 665 /*
666 * After sending probe requests, wait for probe responses 666 * After sending probe requests, wait for probe responses
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index b83870bf60fa..3db78b696c5c 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -97,7 +97,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
97 struct sta_info *sta; 97 struct sta_info *sta;
98 98
99 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], 99 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)],
100 rcu_read_lock_held() ||
101 lockdep_is_held(&local->sta_lock) || 100 lockdep_is_held(&local->sta_lock) ||
102 lockdep_is_held(&local->sta_mtx)); 101 lockdep_is_held(&local->sta_mtx));
103 while (sta) { 102 while (sta) {
@@ -105,7 +104,6 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata,
105 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) 104 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
106 break; 105 break;
107 sta = rcu_dereference_check(sta->hnext, 106 sta = rcu_dereference_check(sta->hnext,
108 rcu_read_lock_held() ||
109 lockdep_is_held(&local->sta_lock) || 107 lockdep_is_held(&local->sta_lock) ||
110 lockdep_is_held(&local->sta_mtx)); 108 lockdep_is_held(&local->sta_mtx));
111 } 109 }
@@ -123,7 +121,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
123 struct sta_info *sta; 121 struct sta_info *sta;
124 122
125 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)], 123 sta = rcu_dereference_check(local->sta_hash[STA_HASH(addr)],
126 rcu_read_lock_held() ||
127 lockdep_is_held(&local->sta_lock) || 124 lockdep_is_held(&local->sta_lock) ||
128 lockdep_is_held(&local->sta_mtx)); 125 lockdep_is_held(&local->sta_mtx));
129 while (sta) { 126 while (sta) {
@@ -132,7 +129,6 @@ struct sta_info *sta_info_get_bss(struct ieee80211_sub_if_data *sdata,
132 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0) 129 memcmp(sta->sta.addr, addr, ETH_ALEN) == 0)
133 break; 130 break;
134 sta = rcu_dereference_check(sta->hnext, 131 sta = rcu_dereference_check(sta->hnext,
135 rcu_read_lock_held() ||
136 lockdep_is_held(&local->sta_lock) || 132 lockdep_is_held(&local->sta_lock) ||
137 lockdep_is_held(&local->sta_mtx)); 133 lockdep_is_held(&local->sta_mtx));
138 } 134 }
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index cc79e697cdb2..f49d00a4c7fd 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -185,6 +185,17 @@ void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
185} 185}
186EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv); 186EXPORT_SYMBOL(ieee80211_get_tkip_p1k_iv);
187 187
188void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
189 const u8 *ta, u32 iv32, u16 *p1k)
190{
191 const u8 *tk = &keyconf->key[NL80211_TKIP_DATA_OFFSET_ENCR_KEY];
192 struct tkip_ctx ctx;
193
194 tkip_mixing_phase1(tk, &ctx, ta, iv32);
195 memcpy(p1k, ctx.p1k, sizeof(ctx.p1k));
196}
197EXPORT_SYMBOL(ieee80211_get_tkip_rx_p1k);
198
188void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, 199void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
189 struct sk_buff *skb, u8 *p2k) 200 struct sk_buff *skb, u8 *p2k)
190{ 201{
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 5bfb80cba634..ddeb1b998383 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -799,6 +799,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
799 799
800 qparam.uapsd = false; 800 qparam.uapsd = false;
801 801
802 local->tx_conf[queue] = qparam;
802 drv_conf_tx(local, queue, &qparam); 803 drv_conf_tx(local, queue, &qparam);
803 } 804 }
804 805
@@ -1016,7 +1017,7 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
1016} 1017}
1017 1018
1018struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata, 1019struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1019 u8 *dst, 1020 u8 *dst, u32 ratemask,
1020 const u8 *ssid, size_t ssid_len, 1021 const u8 *ssid, size_t ssid_len,
1021 const u8 *ie, size_t ie_len, 1022 const u8 *ie, size_t ie_len,
1022 bool directed) 1023 bool directed)
@@ -1049,9 +1050,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1049 1050
1050 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, 1051 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len,
1051 local->hw.conf.channel->band, 1052 local->hw.conf.channel->band,
1052 sdata->rc_rateidx_mask 1053 ratemask, chan);
1053 [local->hw.conf.channel->band],
1054 chan);
1055 1054
1056 skb = ieee80211_probereq_get(&local->hw, &sdata->vif, 1055 skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1057 ssid, ssid_len, 1056 ssid, ssid_len,
@@ -1072,12 +1071,12 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1072void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1071void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1073 const u8 *ssid, size_t ssid_len, 1072 const u8 *ssid, size_t ssid_len,
1074 const u8 *ie, size_t ie_len, 1073 const u8 *ie, size_t ie_len,
1075 bool directed) 1074 u32 ratemask, bool directed)
1076{ 1075{
1077 struct sk_buff *skb; 1076 struct sk_buff *skb;
1078 1077
1079 skb = ieee80211_build_probe_req(sdata, dst, ssid, ssid_len, ie, ie_len, 1078 skb = ieee80211_build_probe_req(sdata, dst, ratemask, ssid, ssid_len,
1080 directed); 1079 ie, ie_len, directed);
1081 if (skb) 1080 if (skb)
1082 ieee80211_tx_skb(sdata, skb); 1081 ieee80211_tx_skb(sdata, skb);
1083} 1082}
@@ -1134,7 +1133,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1134 struct ieee80211_hw *hw = &local->hw; 1133 struct ieee80211_hw *hw = &local->hw;
1135 struct ieee80211_sub_if_data *sdata; 1134 struct ieee80211_sub_if_data *sdata;
1136 struct sta_info *sta; 1135 struct sta_info *sta;
1137 int res; 1136 int res, i;
1138 1137
1139#ifdef CONFIG_PM 1138#ifdef CONFIG_PM
1140 if (local->suspended) 1139 if (local->suspended)
@@ -1157,27 +1156,37 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1157 } 1156 }
1158#endif 1157#endif
1159 1158
1160 /* restart hardware */ 1159 /* setup fragmentation threshold */
1161 if (local->open_count) { 1160 drv_set_frag_threshold(local, hw->wiphy->frag_threshold);
1162 /* 1161
1163 * Upon resume hardware can sometimes be goofy due to 1162 /* setup RTS threshold */
1164 * various platform / driver / bus issues, so restarting 1163 drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
1165 * the device may at times not work immediately. Propagate 1164
1166 * the error. 1165 /* reset coverage class */
1167 */ 1166 drv_set_coverage_class(local, hw->wiphy->coverage_class);
1168 res = drv_start(local); 1167
1169 if (res) { 1168 /* everything else happens only if HW was up & running */
1170 WARN(local->suspended, "Hardware became unavailable " 1169 if (!local->open_count)
1171 "upon resume. This could be a software issue " 1170 goto wake_up;
1172 "prior to suspend or a hardware issue.\n");
1173 return res;
1174 }
1175 1171
1176 ieee80211_led_radio(local, true); 1172 /*
1177 ieee80211_mod_tpt_led_trig(local, 1173 * Upon resume hardware can sometimes be goofy due to
1178 IEEE80211_TPT_LEDTRIG_FL_RADIO, 0); 1174 * various platform / driver / bus issues, so restarting
1175 * the device may at times not work immediately. Propagate
1176 * the error.
1177 */
1178 res = drv_start(local);
1179 if (res) {
1180 WARN(local->suspended, "Hardware became unavailable "
1181 "upon resume. This could be a software issue "
1182 "prior to suspend or a hardware issue.\n");
1183 return res;
1179 } 1184 }
1180 1185
1186 ieee80211_led_radio(local, true);
1187 ieee80211_mod_tpt_led_trig(local,
1188 IEEE80211_TPT_LEDTRIG_FL_RADIO, 0);
1189
1181 /* add interfaces */ 1190 /* add interfaces */
1182 list_for_each_entry(sdata, &local->interfaces, list) { 1191 list_for_each_entry(sdata, &local->interfaces, list) {
1183 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && 1192 if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN &&
@@ -1201,11 +1210,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1201 } 1210 }
1202 mutex_unlock(&local->sta_mtx); 1211 mutex_unlock(&local->sta_mtx);
1203 1212
1204 /* setup fragmentation threshold */ 1213 /* reconfigure tx conf */
1205 drv_set_frag_threshold(local, hw->wiphy->frag_threshold); 1214 for (i = 0; i < hw->queues; i++)
1206 1215 drv_conf_tx(local, i, &local->tx_conf[i]);
1207 /* setup RTS threshold */
1208 drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
1209 1216
1210 /* reconfigure hardware */ 1217 /* reconfigure hardware */
1211 ieee80211_hw_config(local, ~0); 1218 ieee80211_hw_config(local, ~0);
@@ -1287,9 +1294,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1287 if (ieee80211_sdata_running(sdata)) 1294 if (ieee80211_sdata_running(sdata))
1288 ieee80211_enable_keys(sdata); 1295 ieee80211_enable_keys(sdata);
1289 1296
1290#ifdef CONFIG_PM
1291 wake_up: 1297 wake_up:
1292#endif
1293 ieee80211_wake_queues_by_reason(hw, 1298 ieee80211_wake_queues_by_reason(hw,
1294 IEEE80211_QUEUE_STOP_REASON_SUSPEND); 1299 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
1295 1300
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index edf8583280c9..380b9a7462b6 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -25,6 +25,7 @@
25 25
26#include "ieee80211_i.h" 26#include "ieee80211_i.h"
27#include "rate.h" 27#include "rate.h"
28#include "driver-ops.h"
28 29
29#define IEEE80211_AUTH_TIMEOUT (HZ / 5) 30#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
30#define IEEE80211_AUTH_MAX_TRIES 3 31#define IEEE80211_AUTH_MAX_TRIES 3
@@ -427,6 +428,14 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
427 struct ieee80211_sub_if_data *sdata = wk->sdata; 428 struct ieee80211_sub_if_data *sdata = wk->sdata;
428 struct ieee80211_local *local = sdata->local; 429 struct ieee80211_local *local = sdata->local;
429 430
431 if (!wk->probe_auth.synced) {
432 int ret = drv_tx_sync(local, sdata, wk->filter_ta,
433 IEEE80211_TX_SYNC_AUTH);
434 if (ret)
435 return WORK_ACT_TIMEOUT;
436 }
437 wk->probe_auth.synced = true;
438
430 wk->probe_auth.tries++; 439 wk->probe_auth.tries++;
431 if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) { 440 if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) {
432 printk(KERN_DEBUG "%s: direct probe to %pM timed out\n", 441 printk(KERN_DEBUG "%s: direct probe to %pM timed out\n",
@@ -450,7 +459,8 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
450 * will not answer to direct packet in unassociated state. 459 * will not answer to direct packet in unassociated state.
451 */ 460 */
452 ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid, 461 ieee80211_send_probe_req(sdata, NULL, wk->probe_auth.ssid,
453 wk->probe_auth.ssid_len, NULL, 0, true); 462 wk->probe_auth.ssid_len, NULL, 0,
463 (u32) -1, true);
454 464
455 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 465 wk->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
456 run_again(local, wk->timeout); 466 run_again(local, wk->timeout);
@@ -465,6 +475,14 @@ ieee80211_authenticate(struct ieee80211_work *wk)
465 struct ieee80211_sub_if_data *sdata = wk->sdata; 475 struct ieee80211_sub_if_data *sdata = wk->sdata;
466 struct ieee80211_local *local = sdata->local; 476 struct ieee80211_local *local = sdata->local;
467 477
478 if (!wk->probe_auth.synced) {
479 int ret = drv_tx_sync(local, sdata, wk->filter_ta,
480 IEEE80211_TX_SYNC_AUTH);
481 if (ret)
482 return WORK_ACT_TIMEOUT;
483 }
484 wk->probe_auth.synced = true;
485
468 wk->probe_auth.tries++; 486 wk->probe_auth.tries++;
469 if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) { 487 if (wk->probe_auth.tries > IEEE80211_AUTH_MAX_TRIES) {
470 printk(KERN_DEBUG "%s: authentication with %pM" 488 printk(KERN_DEBUG "%s: authentication with %pM"
@@ -498,6 +516,14 @@ ieee80211_associate(struct ieee80211_work *wk)
498 struct ieee80211_sub_if_data *sdata = wk->sdata; 516 struct ieee80211_sub_if_data *sdata = wk->sdata;
499 struct ieee80211_local *local = sdata->local; 517 struct ieee80211_local *local = sdata->local;
500 518
519 if (!wk->assoc.synced) {
520 int ret = drv_tx_sync(local, sdata, wk->filter_ta,
521 IEEE80211_TX_SYNC_ASSOC);
522 if (ret)
523 return WORK_ACT_TIMEOUT;
524 }
525 wk->assoc.synced = true;
526
501 wk->assoc.tries++; 527 wk->assoc.tries++;
502 if (wk->assoc.tries > IEEE80211_ASSOC_MAX_TRIES) { 528 if (wk->assoc.tries > IEEE80211_ASSOC_MAX_TRIES) {
503 printk(KERN_DEBUG "%s: association with %pM" 529 printk(KERN_DEBUG "%s: association with %pM"
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 2e7ccbb43ddb..2d8158acf6fa 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -33,7 +33,7 @@
33#include <net/netfilter/nf_log.h> 33#include <net/netfilter/nf_log.h>
34#include <net/netfilter/nfnetlink_log.h> 34#include <net/netfilter/nfnetlink_log.h>
35 35
36#include <asm/atomic.h> 36#include <linux/atomic.h>
37 37
38#ifdef CONFIG_BRIDGE_NETFILTER 38#ifdef CONFIG_BRIDGE_NETFILTER
39#include "../bridge/br_private.h" 39#include "../bridge/br_private.h"
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index 49132bddd73e..00bd475eab4b 100644
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -31,7 +31,7 @@
31#include <net/sock.h> 31#include <net/sock.h>
32#include <net/netfilter/nf_queue.h> 32#include <net/netfilter/nf_queue.h>
33 33
34#include <asm/atomic.h> 34#include <linux/atomic.h>
35 35
36#ifdef CONFIG_BRIDGE_NETFILTER 36#ifdef CONFIG_BRIDGE_NETFILTER
37#include "../bridge/br_private.h" 37#include "../bridge/br_private.h"
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c
index bae5756b1626..dd53a36d89af 100644
--- a/net/netlabel/netlabel_cipso_v4.c
+++ b/net/netlabel/netlabel_cipso_v4.c
@@ -39,7 +39,7 @@
39#include <net/genetlink.h> 39#include <net/genetlink.h>
40#include <net/netlabel.h> 40#include <net/netlabel.h>
41#include <net/cipso_ipv4.h> 41#include <net/cipso_ipv4.h>
42#include <asm/atomic.h> 42#include <linux/atomic.h>
43 43
44#include "netlabel_user.h" 44#include "netlabel_user.h"
45#include "netlabel_cipso_v4.h" 45#include "netlabel_cipso_v4.h"
diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
index de0d8e4cbfb6..2aa975e5452d 100644
--- a/net/netlabel/netlabel_domainhash.c
+++ b/net/netlabel/netlabel_domainhash.c
@@ -55,8 +55,7 @@ struct netlbl_domhsh_tbl {
55 * should be okay */ 55 * should be okay */
56static DEFINE_SPINLOCK(netlbl_domhsh_lock); 56static DEFINE_SPINLOCK(netlbl_domhsh_lock);
57#define netlbl_domhsh_rcu_deref(p) \ 57#define netlbl_domhsh_rcu_deref(p) \
58 rcu_dereference_check(p, rcu_read_lock_held() || \ 58 rcu_dereference_check(p, lockdep_is_held(&netlbl_domhsh_lock))
59 lockdep_is_held(&netlbl_domhsh_lock))
60static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL; 59static struct netlbl_domhsh_tbl *netlbl_domhsh = NULL;
61static struct netlbl_dom_map *netlbl_domhsh_def = NULL; 60static struct netlbl_dom_map *netlbl_domhsh_def = NULL;
62 61
diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c
index 1b83e0009d8d..b528dd928d3c 100644
--- a/net/netlabel/netlabel_kapi.c
+++ b/net/netlabel/netlabel_kapi.c
@@ -39,7 +39,7 @@
39#include <net/netlabel.h> 39#include <net/netlabel.h>
40#include <net/cipso_ipv4.h> 40#include <net/cipso_ipv4.h>
41#include <asm/bug.h> 41#include <asm/bug.h>
42#include <asm/atomic.h> 42#include <linux/atomic.h>
43 43
44#include "netlabel_domainhash.h" 44#include "netlabel_domainhash.h"
45#include "netlabel_unlabeled.h" 45#include "netlabel_unlabeled.h"
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index 4f251b19fbcc..dff8a0809245 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -42,7 +42,7 @@
42#include <net/ipv6.h> 42#include <net/ipv6.h>
43#include <net/netlabel.h> 43#include <net/netlabel.h>
44#include <net/cipso_ipv4.h> 44#include <net/cipso_ipv4.h>
45#include <asm/atomic.h> 45#include <linux/atomic.h>
46 46
47#include "netlabel_domainhash.h" 47#include "netlabel_domainhash.h"
48#include "netlabel_user.h" 48#include "netlabel_user.h"
diff --git a/net/netlabel/netlabel_mgmt.h b/net/netlabel/netlabel_mgmt.h
index 0a25838bcf45..8db37f4c10f7 100644
--- a/net/netlabel/netlabel_mgmt.h
+++ b/net/netlabel/netlabel_mgmt.h
@@ -32,7 +32,7 @@
32#define _NETLABEL_MGMT_H 32#define _NETLABEL_MGMT_H
33 33
34#include <net/netlabel.h> 34#include <net/netlabel.h>
35#include <asm/atomic.h> 35#include <linux/atomic.h>
36 36
37/* 37/*
38 * The following NetLabel payloads are supported by the management interface. 38 * The following NetLabel payloads are supported by the management interface.
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index 8efd061a0ae9..f1ecf848e3ac 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -52,7 +52,7 @@
52#include <net/net_namespace.h> 52#include <net/net_namespace.h>
53#include <net/netlabel.h> 53#include <net/netlabel.h>
54#include <asm/bug.h> 54#include <asm/bug.h>
55#include <asm/atomic.h> 55#include <linux/atomic.h>
56 56
57#include "netlabel_user.h" 57#include "netlabel_user.h"
58#include "netlabel_addrlist.h" 58#include "netlabel_addrlist.h"
@@ -116,8 +116,7 @@ struct netlbl_unlhsh_walk_arg {
116 * hash table should be okay */ 116 * hash table should be okay */
117static DEFINE_SPINLOCK(netlbl_unlhsh_lock); 117static DEFINE_SPINLOCK(netlbl_unlhsh_lock);
118#define netlbl_unlhsh_rcu_deref(p) \ 118#define netlbl_unlhsh_rcu_deref(p) \
119 rcu_dereference_check(p, rcu_read_lock_held() || \ 119 rcu_dereference_check(p, lockdep_is_held(&netlbl_unlhsh_lock))
120 lockdep_is_held(&netlbl_unlhsh_lock))
121static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL; 120static struct netlbl_unlhsh_tbl *netlbl_unlhsh = NULL;
122static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL; 121static struct netlbl_unlhsh_iface *netlbl_unlhsh_def = NULL;
123 122
diff --git a/net/rds/page.c b/net/rds/page.c
index d8acdebe3c7c..b82d63e77b03 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -32,6 +32,7 @@
32 */ 32 */
33#include <linux/highmem.h> 33#include <linux/highmem.h>
34#include <linux/gfp.h> 34#include <linux/gfp.h>
35#include <linux/cpu.h>
35 36
36#include "rds.h" 37#include "rds.h"
37 38
diff --git a/net/socket.c b/net/socket.c
index 02dc82db3d23..26ed35c7751e 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -467,7 +467,7 @@ static struct socket *sock_alloc(void)
467 struct inode *inode; 467 struct inode *inode;
468 struct socket *sock; 468 struct socket *sock;
469 469
470 inode = new_inode(sock_mnt->mnt_sb); 470 inode = new_inode_pseudo(sock_mnt->mnt_sb);
471 if (!inode) 471 if (!inode)
472 return NULL; 472 return NULL;
473 473
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index c3b75333b821..8c67890de427 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -744,6 +744,13 @@ static struct pf_desc gss_kerberos_pfs[] = {
744 }, 744 },
745}; 745};
746 746
747MODULE_ALIAS("rpc-auth-gss-krb5");
748MODULE_ALIAS("rpc-auth-gss-krb5i");
749MODULE_ALIAS("rpc-auth-gss-krb5p");
750MODULE_ALIAS("rpc-auth-gss-390003");
751MODULE_ALIAS("rpc-auth-gss-390004");
752MODULE_ALIAS("rpc-auth-gss-390005");
753
747static struct gss_api_mech gss_kerberos_mech = { 754static struct gss_api_mech gss_kerberos_mech = {
748 .gm_name = "krb5", 755 .gm_name = "krb5",
749 .gm_owner = THIS_MODULE, 756 .gm_owner = THIS_MODULE,
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index e3c36a274412..ca8cad8251c7 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -141,7 +141,7 @@ gss_mech_get(struct gss_api_mech *gm)
141EXPORT_SYMBOL_GPL(gss_mech_get); 141EXPORT_SYMBOL_GPL(gss_mech_get);
142 142
143struct gss_api_mech * 143struct gss_api_mech *
144gss_mech_get_by_name(const char *name) 144_gss_mech_get_by_name(const char *name)
145{ 145{
146 struct gss_api_mech *pos, *gm = NULL; 146 struct gss_api_mech *pos, *gm = NULL;
147 147
@@ -158,6 +158,17 @@ gss_mech_get_by_name(const char *name)
158 158
159} 159}
160 160
161struct gss_api_mech * gss_mech_get_by_name(const char *name)
162{
163 struct gss_api_mech *gm = NULL;
164
165 gm = _gss_mech_get_by_name(name);
166 if (!gm) {
167 request_module("rpc-auth-gss-%s", name);
168 gm = _gss_mech_get_by_name(name);
169 }
170 return gm;
171}
161EXPORT_SYMBOL_GPL(gss_mech_get_by_name); 172EXPORT_SYMBOL_GPL(gss_mech_get_by_name);
162 173
163struct gss_api_mech * 174struct gss_api_mech *
@@ -194,10 +205,9 @@ mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
194 return 0; 205 return 0;
195} 206}
196 207
197struct gss_api_mech * 208struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
198gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
199{ 209{
200 struct gss_api_mech *pos, *gm = NULL; 210 struct gss_api_mech *gm = NULL, *pos;
201 211
202 spin_lock(&registered_mechs_lock); 212 spin_lock(&registered_mechs_lock);
203 list_for_each_entry(pos, &registered_mechs, gm_list) { 213 list_for_each_entry(pos, &registered_mechs, gm_list) {
@@ -213,6 +223,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
213 return gm; 223 return gm;
214} 224}
215 225
226struct gss_api_mech *
227gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
228{
229 struct gss_api_mech *gm;
230
231 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
232
233 if (!gm) {
234 request_module("rpc-auth-gss-%u", pseudoflavor);
235 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
236 }
237 return gm;
238}
239
216EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor); 240EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor);
217 241
218int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) 242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index ab86b7927f84..bd31208bbb61 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -902,12 +902,13 @@ void svc_delete_xprt(struct svc_xprt *xprt)
902 if (!test_and_set_bit(XPT_DETACHED, &xprt->xpt_flags)) 902 if (!test_and_set_bit(XPT_DETACHED, &xprt->xpt_flags))
903 list_del_init(&xprt->xpt_list); 903 list_del_init(&xprt->xpt_list);
904 /* 904 /*
905 * We used to delete the transport from whichever list 905 * The only time we're called while xpt_ready is still on a list
906 * it's sk_xprt.xpt_ready node was on, but we don't actually 906 * is while the list itself is about to be destroyed (in
907 * need to. This is because the only time we're called 907 * svc_destroy). BUT svc_xprt_enqueue could still be attempting
908 * while still attached to a queue, the queue itself 908 * to add new entries to the sp_sockets list, so we can't leave
909 * is about to be destroyed (in svc_destroy). 909 * a freed xprt on it.
910 */ 910 */
911 list_del_init(&xprt->xpt_ready);
911 if (test_bit(XPT_TEMP, &xprt->xpt_flags)) 912 if (test_bit(XPT_TEMP, &xprt->xpt_flags))
912 serv->sv_tmpcnt--; 913 serv->sv_tmpcnt--;
913 spin_unlock_bh(&serv->sv_lock); 914 spin_unlock_bh(&serv->sv_lock);
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index c8e10216c113..ce136323da8b 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -30,12 +30,10 @@
30 30
31struct unix_domain { 31struct unix_domain {
32 struct auth_domain h; 32 struct auth_domain h;
33#ifdef CONFIG_NFSD_DEPRECATED
34 int addr_changes;
35#endif /* CONFIG_NFSD_DEPRECATED */
36 /* other stuff later */ 33 /* other stuff later */
37}; 34};
38 35
36extern struct auth_ops svcauth_null;
39extern struct auth_ops svcauth_unix; 37extern struct auth_ops svcauth_unix;
40 38
41static void svcauth_unix_domain_release(struct auth_domain *dom) 39static void svcauth_unix_domain_release(struct auth_domain *dom)
@@ -74,9 +72,6 @@ struct auth_domain *unix_domain_find(char *name)
74 return NULL; 72 return NULL;
75 } 73 }
76 new->h.flavour = &svcauth_unix; 74 new->h.flavour = &svcauth_unix;
77#ifdef CONFIG_NFSD_DEPRECATED
78 new->addr_changes = 0;
79#endif /* CONFIG_NFSD_DEPRECATED */
80 rv = auth_domain_lookup(name, &new->h); 75 rv = auth_domain_lookup(name, &new->h);
81 } 76 }
82} 77}
@@ -95,9 +90,6 @@ struct ip_map {
95 char m_class[8]; /* e.g. "nfsd" */ 90 char m_class[8]; /* e.g. "nfsd" */
96 struct in6_addr m_addr; 91 struct in6_addr m_addr;
97 struct unix_domain *m_client; 92 struct unix_domain *m_client;
98#ifdef CONFIG_NFSD_DEPRECATED
99 int m_add_change;
100#endif /* CONFIG_NFSD_DEPRECATED */
101}; 93};
102 94
103static void ip_map_put(struct kref *kref) 95static void ip_map_put(struct kref *kref)
@@ -151,9 +143,6 @@ static void update(struct cache_head *cnew, struct cache_head *citem)
151 143
152 kref_get(&item->m_client->h.ref); 144 kref_get(&item->m_client->h.ref);
153 new->m_client = item->m_client; 145 new->m_client = item->m_client;
154#ifdef CONFIG_NFSD_DEPRECATED
155 new->m_add_change = item->m_add_change;
156#endif /* CONFIG_NFSD_DEPRECATED */
157} 146}
158static struct cache_head *ip_map_alloc(void) 147static struct cache_head *ip_map_alloc(void)
159{ 148{
@@ -338,16 +327,6 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
338 ip.h.flags = 0; 327 ip.h.flags = 0;
339 if (!udom) 328 if (!udom)
340 set_bit(CACHE_NEGATIVE, &ip.h.flags); 329 set_bit(CACHE_NEGATIVE, &ip.h.flags);
341#ifdef CONFIG_NFSD_DEPRECATED
342 else {
343 ip.m_add_change = udom->addr_changes;
344 /* if this is from the legacy set_client system call,
345 * we need m_add_change to be one higher
346 */
347 if (expiry == NEVER)
348 ip.m_add_change++;
349 }
350#endif /* CONFIG_NFSD_DEPRECATED */
351 ip.h.expiry_time = expiry; 330 ip.h.expiry_time = expiry;
352 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, 331 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h,
353 hash_str(ipm->m_class, IP_HASHBITS) ^ 332 hash_str(ipm->m_class, IP_HASHBITS) ^
@@ -367,62 +346,6 @@ static inline int ip_map_update(struct net *net, struct ip_map *ipm,
367 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry); 346 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry);
368} 347}
369 348
370#ifdef CONFIG_NFSD_DEPRECATED
371int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom)
372{
373 struct unix_domain *udom;
374 struct ip_map *ipmp;
375
376 if (dom->flavour != &svcauth_unix)
377 return -EINVAL;
378 udom = container_of(dom, struct unix_domain, h);
379 ipmp = ip_map_lookup(net, "nfsd", addr);
380
381 if (ipmp)
382 return ip_map_update(net, ipmp, udom, NEVER);
383 else
384 return -ENOMEM;
385}
386EXPORT_SYMBOL_GPL(auth_unix_add_addr);
387
388int auth_unix_forget_old(struct auth_domain *dom)
389{
390 struct unix_domain *udom;
391
392 if (dom->flavour != &svcauth_unix)
393 return -EINVAL;
394 udom = container_of(dom, struct unix_domain, h);
395 udom->addr_changes++;
396 return 0;
397}
398EXPORT_SYMBOL_GPL(auth_unix_forget_old);
399
400struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr)
401{
402 struct ip_map *ipm;
403 struct auth_domain *rv;
404 struct sunrpc_net *sn;
405
406 sn = net_generic(net, sunrpc_net_id);
407 ipm = ip_map_lookup(net, "nfsd", addr);
408
409 if (!ipm)
410 return NULL;
411 if (cache_check(sn->ip_map_cache, &ipm->h, NULL))
412 return NULL;
413
414 if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
415 sunrpc_invalidate(&ipm->h, sn->ip_map_cache);
416 rv = NULL;
417 } else {
418 rv = &ipm->m_client->h;
419 kref_get(&rv->ref);
420 }
421 cache_put(&ipm->h, sn->ip_map_cache);
422 return rv;
423}
424EXPORT_SYMBOL_GPL(auth_unix_lookup);
425#endif /* CONFIG_NFSD_DEPRECATED */
426 349
427void svcauth_unix_purge(void) 350void svcauth_unix_purge(void)
428{ 351{
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index af04f779ce9f..f2cb5b881dea 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -51,6 +51,8 @@
51#include <linux/sunrpc/stats.h> 51#include <linux/sunrpc/stats.h>
52#include <linux/sunrpc/xprt.h> 52#include <linux/sunrpc/xprt.h>
53 53
54#include "sunrpc.h"
55
54#define RPCDBG_FACILITY RPCDBG_SVCXPRT 56#define RPCDBG_FACILITY RPCDBG_SVCXPRT
55 57
56 58
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
index cae761a8536c..ddf05288d9f1 100644
--- a/net/sunrpc/xprtrdma/xprt_rdma.h
+++ b/net/sunrpc/xprtrdma/xprt_rdma.h
@@ -42,7 +42,7 @@
42 42
43#include <linux/wait.h> /* wait_queue_head_t, etc */ 43#include <linux/wait.h> /* wait_queue_head_t, etc */
44#include <linux/spinlock.h> /* spinlock_t, etc */ 44#include <linux/spinlock.h> /* spinlock_t, etc */
45#include <asm/atomic.h> /* atomic_t, etc */ 45#include <linux/atomic.h> /* atomic_t, etc */
46 46
47#include <rdma/rdma_cm.h> /* RDMA connection api */ 47#include <rdma/rdma_cm.h> /* RDMA connection api */
48#include <rdma/ib_verbs.h> /* RDMA verbs api */ 48#include <rdma/ib_verbs.h> /* RDMA verbs api */
diff --git a/net/tipc/core.h b/net/tipc/core.h
index d234a98a460a..2761af36d141 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -47,7 +47,7 @@
47#include <linux/string.h> 47#include <linux/string.h>
48#include <asm/uaccess.h> 48#include <asm/uaccess.h>
49#include <linux/interrupt.h> 49#include <linux/interrupt.h>
50#include <asm/atomic.h> 50#include <linux/atomic.h>
51#include <asm/hardirq.h> 51#include <asm/hardirq.h>
52#include <linux/netdevice.h> 52#include <linux/netdevice.h>
53#include <linux/in.h> 53#include <linux/in.h>
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 880dbe2e6f94..645437cfc464 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -488,6 +488,10 @@ int wiphy_register(struct wiphy *wiphy)
488 int i; 488 int i;
489 u16 ifmodes = wiphy->interface_modes; 489 u16 ifmodes = wiphy->interface_modes;
490 490
491 if (WARN_ON((wiphy->wowlan.flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE) &&
492 !(wiphy->wowlan.flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)))
493 return -EINVAL;
494
491 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses)) 495 if (WARN_ON(wiphy->addresses && !wiphy->n_addresses))
492 return -EINVAL; 496 return -EINVAL;
493 497
@@ -918,7 +922,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
918 * Configure power management to the driver here so that its 922 * Configure power management to the driver here so that its
919 * correctly set also after interface type changes etc. 923 * correctly set also after interface type changes etc.
920 */ 924 */
921 if (wdev->iftype == NL80211_IFTYPE_STATION && 925 if ((wdev->iftype == NL80211_IFTYPE_STATION ||
926 wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) &&
922 rdev->ops->set_power_mgmt) 927 rdev->ops->set_power_mgmt)
923 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev, 928 if (rdev->ops->set_power_mgmt(wdev->wiphy, dev,
924 wdev->ps, 929 wdev->ps,
diff --git a/net/wireless/core.h b/net/wireless/core.h
index a570ff9214ec..8672e028022f 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -447,6 +447,10 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
447 447
448u16 cfg80211_calculate_bitrate(struct rate_info *rate); 448u16 cfg80211_calculate_bitrate(struct rate_info *rate);
449 449
450int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
451 const u8 *rates, unsigned int n_rates,
452 u32 *mask);
453
450int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev, 454int cfg80211_validate_beacon_int(struct cfg80211_registered_device *rdev,
451 u32 beacon_int); 455 u32 beacon_int);
452 456
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 6a82c898f831..28d2aa109bee 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -177,6 +177,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
177 [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 }, 177 [NL80211_ATTR_STA_PLINK_STATE] = { .type = NLA_U8 },
178 [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 }, 178 [NL80211_ATTR_SCHED_SCAN_INTERVAL] = { .type = NLA_U32 },
179 [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED }, 179 [NL80211_ATTR_REKEY_DATA] = { .type = NLA_NESTED },
180 [NL80211_ATTR_SCAN_SUPP_RATES] = { .type = NLA_NESTED },
180}; 181};
181 182
182/* policy for the key attributes */ 183/* policy for the key attributes */
@@ -205,6 +206,10 @@ nl80211_wowlan_policy[NUM_NL80211_WOWLAN_TRIG] = {
205 [NL80211_WOWLAN_TRIG_DISCONNECT] = { .type = NLA_FLAG }, 206 [NL80211_WOWLAN_TRIG_DISCONNECT] = { .type = NLA_FLAG },
206 [NL80211_WOWLAN_TRIG_MAGIC_PKT] = { .type = NLA_FLAG }, 207 [NL80211_WOWLAN_TRIG_MAGIC_PKT] = { .type = NLA_FLAG },
207 [NL80211_WOWLAN_TRIG_PKT_PATTERN] = { .type = NLA_NESTED }, 208 [NL80211_WOWLAN_TRIG_PKT_PATTERN] = { .type = NLA_NESTED },
209 [NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE] = { .type = NLA_FLAG },
210 [NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST] = { .type = NLA_FLAG },
211 [NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE] = { .type = NLA_FLAG },
212 [NL80211_WOWLAN_TRIG_RFKILL_RELEASE] = { .type = NLA_FLAG },
208}; 213};
209 214
210/* policy for GTK rekey offload attributes */ 215/* policy for GTK rekey offload attributes */
@@ -692,8 +697,12 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
692 dev->wiphy.coverage_class); 697 dev->wiphy.coverage_class);
693 NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS, 698 NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
694 dev->wiphy.max_scan_ssids); 699 dev->wiphy.max_scan_ssids);
700 NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
701 dev->wiphy.max_sched_scan_ssids);
695 NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN, 702 NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN,
696 dev->wiphy.max_scan_ie_len); 703 dev->wiphy.max_scan_ie_len);
704 NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
705 dev->wiphy.max_sched_scan_ie_len);
697 706
698 if (dev->wiphy.flags & WIPHY_FLAG_IBSS_RSN) 707 if (dev->wiphy.flags & WIPHY_FLAG_IBSS_RSN)
699 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_IBSS_RSN); 708 NLA_PUT_FLAG(msg, NL80211_ATTR_SUPPORT_IBSS_RSN);
@@ -929,6 +938,16 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
929 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT); 938 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT);
930 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_MAGIC_PKT) 939 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_MAGIC_PKT)
931 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT); 940 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT);
941 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_SUPPORTS_GTK_REKEY)
942 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED);
943 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE)
944 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE);
945 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ)
946 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST);
947 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_4WAY_HANDSHAKE)
948 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE);
949 if (dev->wiphy.wowlan.flags & WIPHY_WOWLAN_RFKILL_RELEASE)
950 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE);
932 if (dev->wiphy.wowlan.n_patterns) { 951 if (dev->wiphy.wowlan.n_patterns) {
933 struct nl80211_wowlan_pattern_support pat = { 952 struct nl80211_wowlan_pattern_support pat = {
934 .max_patterns = dev->wiphy.wowlan.n_patterns, 953 .max_patterns = dev->wiphy.wowlan.n_patterns,
@@ -3306,7 +3325,6 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
3306 struct nlattr *attr; 3325 struct nlattr *attr;
3307 struct wiphy *wiphy; 3326 struct wiphy *wiphy;
3308 int err, tmp, n_ssids = 0, n_channels, i; 3327 int err, tmp, n_ssids = 0, n_channels, i;
3309 enum ieee80211_band band;
3310 size_t ie_len; 3328 size_t ie_len;
3311 3329
3312 if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) 3330 if (!is_valid_ie_attr(info->attrs[NL80211_ATTR_IE]))
@@ -3326,6 +3344,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
3326 if (!n_channels) 3344 if (!n_channels)
3327 return -EINVAL; 3345 return -EINVAL;
3328 } else { 3346 } else {
3347 enum ieee80211_band band;
3329 n_channels = 0; 3348 n_channels = 0;
3330 3349
3331 for (band = 0; band < IEEE80211_NUM_BANDS; band++) 3350 for (band = 0; band < IEEE80211_NUM_BANDS; band++)
@@ -3386,6 +3405,8 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
3386 i++; 3405 i++;
3387 } 3406 }
3388 } else { 3407 } else {
3408 enum ieee80211_band band;
3409
3389 /* all channels */ 3410 /* all channels */
3390 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 3411 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
3391 int j; 3412 int j;
@@ -3432,6 +3453,30 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
3432 request->ie_len); 3453 request->ie_len);
3433 } 3454 }
3434 3455
3456 for (i = 0; i < IEEE80211_NUM_BANDS; i++)
3457 if (wiphy->bands[i])
3458 request->rates[i] =
3459 (1 << wiphy->bands[i]->n_bitrates) - 1;
3460
3461 if (info->attrs[NL80211_ATTR_SCAN_SUPP_RATES]) {
3462 nla_for_each_nested(attr,
3463 info->attrs[NL80211_ATTR_SCAN_SUPP_RATES],
3464 tmp) {
3465 enum ieee80211_band band = nla_type(attr);
3466
3467 if (band < 0 || band > IEEE80211_NUM_BANDS) {
3468 err = -EINVAL;
3469 goto out_free;
3470 }
3471 err = ieee80211_get_ratemask(wiphy->bands[band],
3472 nla_data(attr),
3473 nla_len(attr),
3474 &request->rates[band]);
3475 if (err)
3476 goto out_free;
3477 }
3478 }
3479
3435 request->dev = dev; 3480 request->dev = dev;
3436 request->wiphy = &rdev->wiphy; 3481 request->wiphy = &rdev->wiphy;
3437 3482
@@ -3497,7 +3542,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
3497 tmp) 3542 tmp)
3498 n_ssids++; 3543 n_ssids++;
3499 3544
3500 if (n_ssids > wiphy->max_scan_ssids) 3545 if (n_ssids > wiphy->max_sched_scan_ssids)
3501 return -EINVAL; 3546 return -EINVAL;
3502 3547
3503 if (info->attrs[NL80211_ATTR_IE]) 3548 if (info->attrs[NL80211_ATTR_IE])
@@ -3505,7 +3550,7 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
3505 else 3550 else
3506 ie_len = 0; 3551 ie_len = 0;
3507 3552
3508 if (ie_len > wiphy->max_scan_ie_len) 3553 if (ie_len > wiphy->max_sched_scan_ie_len)
3509 return -EINVAL; 3554 return -EINVAL;
3510 3555
3511 mutex_lock(&rdev->sched_scan_mtx); 3556 mutex_lock(&rdev->sched_scan_mtx);
@@ -4318,25 +4363,12 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
4318 nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); 4363 nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]);
4319 struct ieee80211_supported_band *sband = 4364 struct ieee80211_supported_band *sband =
4320 wiphy->bands[ibss.channel->band]; 4365 wiphy->bands[ibss.channel->band];
4321 int i, j; 4366 int err;
4322 4367
4323 if (n_rates == 0) 4368 err = ieee80211_get_ratemask(sband, rates, n_rates,
4324 return -EINVAL; 4369 &ibss.basic_rates);
4325 4370 if (err)
4326 for (i = 0; i < n_rates; i++) { 4371 return err;
4327 int rate = (rates[i] & 0x7f) * 5;
4328 bool found = false;
4329
4330 for (j = 0; j < sband->n_bitrates; j++) {
4331 if (sband->bitrates[j].bitrate == rate) {
4332 found = true;
4333 ibss.basic_rates |= BIT(j);
4334 break;
4335 }
4336 }
4337 if (!found)
4338 return -EINVAL;
4339 }
4340 } 4372 }
4341 4373
4342 if (info->attrs[NL80211_ATTR_MCAST_RATE] && 4374 if (info->attrs[NL80211_ATTR_MCAST_RATE] &&
@@ -5272,6 +5304,14 @@ static int nl80211_get_wowlan(struct sk_buff *skb, struct genl_info *info)
5272 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT); 5304 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_DISCONNECT);
5273 if (rdev->wowlan->magic_pkt) 5305 if (rdev->wowlan->magic_pkt)
5274 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT); 5306 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_MAGIC_PKT);
5307 if (rdev->wowlan->gtk_rekey_failure)
5308 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE);
5309 if (rdev->wowlan->eap_identity_req)
5310 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST);
5311 if (rdev->wowlan->four_way_handshake)
5312 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE);
5313 if (rdev->wowlan->rfkill_release)
5314 NLA_PUT_FLAG(msg, NL80211_WOWLAN_TRIG_RFKILL_RELEASE);
5275 if (rdev->wowlan->n_patterns) { 5315 if (rdev->wowlan->n_patterns) {
5276 struct nlattr *nl_pats, *nl_pat; 5316 struct nlattr *nl_pats, *nl_pat;
5277 int i, pat_len; 5317 int i, pat_len;
@@ -5348,6 +5388,33 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info)
5348 new_triggers.magic_pkt = true; 5388 new_triggers.magic_pkt = true;
5349 } 5389 }
5350 5390
5391 if (tb[NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED])
5392 return -EINVAL;
5393
5394 if (tb[NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE]) {
5395 if (!(wowlan->flags & WIPHY_WOWLAN_GTK_REKEY_FAILURE))
5396 return -EINVAL;
5397 new_triggers.gtk_rekey_failure = true;
5398 }
5399
5400 if (tb[NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST]) {
5401 if (!(wowlan->flags & WIPHY_WOWLAN_EAP_IDENTITY_REQ))
5402 return -EINVAL;
5403 new_triggers.eap_identity_req = true;
5404 }
5405
5406 if (tb[NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE]) {
5407 if (!(wowlan->flags & WIPHY_WOWLAN_4WAY_HANDSHAKE))
5408 return -EINVAL;
5409 new_triggers.four_way_handshake = true;
5410 }
5411
5412 if (tb[NL80211_WOWLAN_TRIG_RFKILL_RELEASE]) {
5413 if (!(wowlan->flags & WIPHY_WOWLAN_RFKILL_RELEASE))
5414 return -EINVAL;
5415 new_triggers.rfkill_release = true;
5416 }
5417
5351 if (tb[NL80211_WOWLAN_TRIG_PKT_PATTERN]) { 5418 if (tb[NL80211_WOWLAN_TRIG_PKT_PATTERN]) {
5352 struct nlattr *pat; 5419 struct nlattr *pat;
5353 int n_patterns = 0; 5420 int n_patterns = 0;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 1c4672e35144..2936cb809152 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -862,6 +862,10 @@ int cfg80211_wext_siwscan(struct net_device *dev,
862 creq->n_ssids = 0; 862 creq->n_ssids = 0;
863 } 863 }
864 864
865 for (i = 0; i < IEEE80211_NUM_BANDS; i++)
866 if (wiphy->bands[i])
867 creq->rates[i] = (1 << wiphy->bands[i]->n_bitrates) - 1;
868
865 rdev->scan_req = creq; 869 rdev->scan_req = creq;
866 err = rdev->ops->scan(wiphy, dev, creq); 870 err = rdev->ops->scan(wiphy, dev, creq);
867 if (err) { 871 if (err) {
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 4d7b83fbc32f..be75a3a0424e 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1006,3 +1006,41 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
1006 1006
1007 return -EBUSY; 1007 return -EBUSY;
1008} 1008}
1009
1010int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
1011 const u8 *rates, unsigned int n_rates,
1012 u32 *mask)
1013{
1014 int i, j;
1015
1016 if (!sband)
1017 return -EINVAL;
1018
1019 if (n_rates == 0 || n_rates > NL80211_MAX_SUPP_RATES)
1020 return -EINVAL;
1021
1022 *mask = 0;
1023
1024 for (i = 0; i < n_rates; i++) {
1025 int rate = (rates[i] & 0x7f) * 5;
1026 bool found = false;
1027
1028 for (j = 0; j < sband->n_bitrates; j++) {
1029 if (sband->bitrates[j].bitrate == rate) {
1030 found = true;
1031 *mask |= BIT(j);
1032 break;
1033 }
1034 }
1035 if (!found)
1036 return -EINVAL;
1037 }
1038
1039 /*
1040 * mask must have at least one bit set here since we
1041 * didn't accept a 0-length rates array nor allowed
1042 * entries in the array that didn't exist
1043 */
1044
1045 return 0;
1046}