aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-06-13 15:35:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-13 15:35:35 -0400
commit211c17aaee644bb808fbdeef547ac99db92c01ed (patch)
tree2acf7fe32b30f537b06fed7e4c536ef0d11f2902
parentec8eb9ae5819da011ac574aa290207a2a47cdbae (diff)
parentbcb7ad7bcbef030e6ba71ede1f9866368aca7c99 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/ath/ath9k/main.c net/bluetooth/hci_event.c
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c18
-rw-r--r--drivers/net/wireless/mwifiex/uap_cmd.c11
-rw-r--r--drivers/net/wireless/rndis_wlan.c2
-rw-r--r--include/net/bluetooth/hci.h6
-rw-r--r--include/net/mac80211.h6
-rw-r--r--net/bluetooth/hci_event.c48
-rw-r--r--net/bluetooth/l2cap_core.c7
-rw-r--r--net/bluetooth/mgmt.c18
-rw-r--r--net/bluetooth/smp.c11
-rw-r--r--net/mac80211/cfg.c3
-rw-r--r--net/mac80211/mlme.c4
-rw-r--r--net/mac80211/sta_info.h5
-rw-r--r--net/wireless/reg.c2
-rw-r--r--net/wireless/util.c2
14 files changed, 115 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a6f83b683db1..52561b341d68 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1036,15 +1036,6 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1036 } 1036 }
1037 } 1037 }
1038 1038
1039 if ((ah->opmode == NL80211_IFTYPE_ADHOC) ||
1040 ((vif->type == NL80211_IFTYPE_ADHOC) &&
1041 sc->nvifs > 0)) {
1042 ath_err(common, "Cannot create ADHOC interface when other"
1043 " interfaces already exist.\n");
1044 ret = -EINVAL;
1045 goto out;
1046 }
1047
1048 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type); 1039 ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
1049 1040
1050 sc->nvifs++; 1041 sc->nvifs++;
@@ -1069,15 +1060,6 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1069 mutex_lock(&sc->mutex); 1060 mutex_lock(&sc->mutex);
1070 ath9k_ps_wakeup(sc); 1061 ath9k_ps_wakeup(sc);
1071 1062
1072 /* See if new interface type is valid. */
1073 if ((new_type == NL80211_IFTYPE_ADHOC) &&
1074 (sc->nvifs > 1)) {
1075 ath_err(common, "When using ADHOC, it must be the only"
1076 " interface.\n");
1077 ret = -EINVAL;
1078 goto out;
1079 }
1080
1081 if (ath9k_uses_beacons(new_type) && 1063 if (ath9k_uses_beacons(new_type) &&
1082 !ath9k_uses_beacons(vif->type)) { 1064 !ath9k_uses_beacons(vif->type)) {
1083 if (sc->nbcnvifs >= ATH_BCBUF) { 1065 if (sc->nbcnvifs >= ATH_BCBUF) {
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c
index 8173ab66066d..89f9a2a45de3 100644
--- a/drivers/net/wireless/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/mwifiex/uap_cmd.c
@@ -27,6 +27,17 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
27 struct cfg80211_ap_settings *params) { 27 struct cfg80211_ap_settings *params) {
28 int i; 28 int i;
29 29
30 if (!params->privacy) {
31 bss_config->protocol = PROTOCOL_NO_SECURITY;
32 bss_config->key_mgmt = KEY_MGMT_NONE;
33 bss_config->wpa_cfg.length = 0;
34 priv->sec_info.wep_enabled = 0;
35 priv->sec_info.wpa_enabled = 0;
36 priv->sec_info.wpa2_enabled = 0;
37
38 return 0;
39 }
40
30 switch (params->auth_type) { 41 switch (params->auth_type) {
31 case NL80211_AUTHTYPE_OPEN_SYSTEM: 42 case NL80211_AUTHTYPE_OPEN_SYSTEM:
32 bss_config->auth_mode = WLAN_AUTH_OPEN; 43 bss_config->auth_mode = WLAN_AUTH_OPEN;
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 2e9e6af21362..dfcd02ab6cae 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2110,7 +2110,7 @@ resize_buf:
2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) { 2110 while (check_bssid_list_item(bssid, bssid_len, buf, len)) {
2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid && 2111 if (rndis_bss_info_update(usbdev, bssid) && match_bssid &&
2112 matched) { 2112 matched) {
2113 if (!ether_addr_equal(bssid->mac, match_bssid)) 2113 if (ether_addr_equal(bssid->mac, match_bssid))
2114 *matched = true; 2114 *matched = true;
2115 } 2115 }
2116 2116
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3f5d682e866f..2a6b0b8b7120 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1195,6 +1195,12 @@ struct extended_inquiry_info {
1195 __u8 data[240]; 1195 __u8 data[240];
1196} __packed; 1196} __packed;
1197 1197
1198#define HCI_EV_KEY_REFRESH_COMPLETE 0x30
1199struct hci_ev_key_refresh_complete {
1200 __u8 status;
1201 __le16 handle;
1202} __packed;
1203
1198#define HCI_EV_IO_CAPA_REQUEST 0x31 1204#define HCI_EV_IO_CAPA_REQUEST 0x31
1199struct hci_ev_io_capa_request { 1205struct hci_ev_io_capa_request {
1200 bdaddr_t bdaddr; 1206 bdaddr_t bdaddr;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index d152f54064fd..6914f9978aea 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1945,6 +1945,11 @@ enum ieee80211_rate_control_changed {
1945 * to also unregister the device. If it returns 1, then mac80211 1945 * to also unregister the device. If it returns 1, then mac80211
1946 * will also go through the regular complete restart on resume. 1946 * will also go through the regular complete restart on resume.
1947 * 1947 *
1948 * @set_wakeup: Enable or disable wakeup when WoWLAN configuration is
1949 * modified. The reason is that device_set_wakeup_enable() is
1950 * supposed to be called when the configuration changes, not only
1951 * in suspend().
1952 *
1948 * @add_interface: Called when a netdevice attached to the hardware is 1953 * @add_interface: Called when a netdevice attached to the hardware is
1949 * enabled. Because it is not called for monitor mode devices, @start 1954 * enabled. Because it is not called for monitor mode devices, @start
1950 * and @stop must be implemented. 1955 * and @stop must be implemented.
@@ -2974,6 +2979,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
2974 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 2979 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
2975 * @hw: pointer obtained from ieee80211_alloc_hw(). 2980 * @hw: pointer obtained from ieee80211_alloc_hw().
2976 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2981 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2982 * @band: the band to calculate the frame duration on
2977 * @frame_len: the length of the frame. 2983 * @frame_len: the length of the frame.
2978 * @rate: the rate at which the frame is going to be transmitted. 2984 * @rate: the rate at which the frame is going to be transmitted.
2979 * 2985 *
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 47656beee14c..1ba929c05d0d 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3040,6 +3040,50 @@ static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
3040 hci_dev_unlock(hdev); 3040 hci_dev_unlock(hdev);
3041} 3041}
3042 3042
3043static void hci_key_refresh_complete_evt(struct hci_dev *hdev,
3044 struct sk_buff *skb)
3045{
3046 struct hci_ev_key_refresh_complete *ev = (void *) skb->data;
3047 struct hci_conn *conn;
3048
3049 BT_DBG("%s status %u handle %u", hdev->name, ev->status,
3050 __le16_to_cpu(ev->handle));
3051
3052 hci_dev_lock(hdev);
3053
3054 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
3055 if (!conn)
3056 goto unlock;
3057
3058 if (!ev->status)
3059 conn->sec_level = conn->pending_sec_level;
3060
3061 clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
3062
3063 if (ev->status && conn->state == BT_CONNECTED) {
3064 hci_acl_disconn(conn, HCI_ERROR_AUTH_FAILURE);
3065 hci_conn_put(conn);
3066 goto unlock;
3067 }
3068
3069 if (conn->state == BT_CONFIG) {
3070 if (!ev->status)
3071 conn->state = BT_CONNECTED;
3072
3073 hci_proto_connect_cfm(conn, ev->status);
3074 hci_conn_put(conn);
3075 } else {
3076 hci_auth_cfm(conn, ev->status);
3077
3078 hci_conn_hold(conn);
3079 conn->disc_timeout = HCI_DISCONN_TIMEOUT;
3080 hci_conn_put(conn);
3081 }
3082
3083unlock:
3084 hci_dev_unlock(hdev);
3085}
3086
3043static u8 hci_get_auth_req(struct hci_conn *conn) 3087static u8 hci_get_auth_req(struct hci_conn *conn)
3044{ 3088{
3045 /* If remote requests dedicated bonding follow that lead */ 3089 /* If remote requests dedicated bonding follow that lead */
@@ -3560,6 +3604,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
3560 hci_extended_inquiry_result_evt(hdev, skb); 3604 hci_extended_inquiry_result_evt(hdev, skb);
3561 break; 3605 break;
3562 3606
3607 case HCI_EV_KEY_REFRESH_COMPLETE:
3608 hci_key_refresh_complete_evt(hdev, skb);
3609 break;
3610
3563 case HCI_EV_IO_CAPA_REQUEST: 3611 case HCI_EV_IO_CAPA_REQUEST:
3564 hci_io_capa_request_evt(hdev, skb); 3612 hci_io_capa_request_evt(hdev, skb);
3565 break; 3613 break;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index f9bffe3af026..4ca88247b7c2 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1314,7 +1314,12 @@ static void security_timeout(struct work_struct *work)
1314 struct l2cap_conn *conn = container_of(work, struct l2cap_conn, 1314 struct l2cap_conn *conn = container_of(work, struct l2cap_conn,
1315 security_timer.work); 1315 security_timer.work);
1316 1316
1317 l2cap_conn_del(conn->hcon, ETIMEDOUT); 1317 BT_DBG("conn %p", conn);
1318
1319 if (test_and_clear_bit(HCI_CONN_LE_SMP_PEND, &conn->hcon->flags)) {
1320 smp_chan_destroy(conn);
1321 l2cap_conn_del(conn->hcon, ETIMEDOUT);
1322 }
1318} 1323}
1319 1324
1320static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status) 1325static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 958f764cc6ab..c72307cc25fc 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1873,6 +1873,22 @@ static void pairing_complete_cb(struct hci_conn *conn, u8 status)
1873 pairing_complete(cmd, mgmt_status(status)); 1873 pairing_complete(cmd, mgmt_status(status));
1874} 1874}
1875 1875
1876static void le_connect_complete_cb(struct hci_conn *conn, u8 status)
1877{
1878 struct pending_cmd *cmd;
1879
1880 BT_DBG("status %u", status);
1881
1882 if (!status)
1883 return;
1884
1885 cmd = find_pairing(conn);
1886 if (!cmd)
1887 BT_DBG("Unable to find a pending command");
1888 else
1889 pairing_complete(cmd, mgmt_status(status));
1890}
1891
1876static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data, 1892static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1877 u16 len) 1893 u16 len)
1878{ 1894{
@@ -1941,6 +1957,8 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
1941 /* For LE, just connecting isn't a proof that the pairing finished */ 1957 /* For LE, just connecting isn't a proof that the pairing finished */
1942 if (cp->addr.type == BDADDR_BREDR) 1958 if (cp->addr.type == BDADDR_BREDR)
1943 conn->connect_cfm_cb = pairing_complete_cb; 1959 conn->connect_cfm_cb = pairing_complete_cb;
1960 else
1961 conn->connect_cfm_cb = le_connect_complete_cb;
1944 1962
1945 conn->security_cfm_cb = pairing_complete_cb; 1963 conn->security_cfm_cb = pairing_complete_cb;
1946 conn->disconn_cfm_cb = pairing_complete_cb; 1964 conn->disconn_cfm_cb = pairing_complete_cb;
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index ff4835b61de9..16ef0dc85a0a 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -649,7 +649,7 @@ static u8 smp_cmd_pairing_rsp(struct l2cap_conn *conn, struct sk_buff *skb)
649 649
650 auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM; 650 auth |= (req->auth_req | rsp->auth_req) & SMP_AUTH_MITM;
651 651
652 ret = tk_request(conn, 0, auth, rsp->io_capability, req->io_capability); 652 ret = tk_request(conn, 0, auth, req->io_capability, rsp->io_capability);
653 if (ret) 653 if (ret)
654 return SMP_UNSPECIFIED; 654 return SMP_UNSPECIFIED;
655 655
@@ -704,7 +704,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
704 return 0; 704 return 0;
705} 705}
706 706
707static u8 smp_ltk_encrypt(struct l2cap_conn *conn) 707static u8 smp_ltk_encrypt(struct l2cap_conn *conn, u8 sec_level)
708{ 708{
709 struct smp_ltk *key; 709 struct smp_ltk *key;
710 struct hci_conn *hcon = conn->hcon; 710 struct hci_conn *hcon = conn->hcon;
@@ -713,6 +713,9 @@ static u8 smp_ltk_encrypt(struct l2cap_conn *conn)
713 if (!key) 713 if (!key)
714 return 0; 714 return 0;
715 715
716 if (sec_level > BT_SECURITY_MEDIUM && !key->authenticated)
717 return 0;
718
716 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags)) 719 if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &hcon->flags))
717 return 1; 720 return 1;
718 721
@@ -733,7 +736,7 @@ static u8 smp_cmd_security_req(struct l2cap_conn *conn, struct sk_buff *skb)
733 736
734 hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req); 737 hcon->pending_sec_level = authreq_to_seclevel(rp->auth_req);
735 738
736 if (smp_ltk_encrypt(conn)) 739 if (smp_ltk_encrypt(conn, hcon->pending_sec_level))
737 return 0; 740 return 0;
738 741
739 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) 742 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
@@ -772,7 +775,7 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level)
772 return 1; 775 return 1;
773 776
774 if (hcon->link_mode & HCI_LM_MASTER) 777 if (hcon->link_mode & HCI_LM_MASTER)
775 if (smp_ltk_encrypt(conn)) 778 if (smp_ltk_encrypt(conn, sec_level))
776 goto done; 779 goto done;
777 780
778 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags)) 781 if (test_and_set_bit(HCI_CONN_LE_SMP_PEND, &hcon->flags))
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 498c94e34427..85ac364f4636 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2097,6 +2097,9 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
2097 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 2097 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
2098 int i, ret; 2098 int i, ret;
2099 2099
2100 if (!ieee80211_sdata_running(sdata))
2101 return -ENETDOWN;
2102
2100 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) { 2103 if (local->hw.flags & IEEE80211_HW_HAS_RATE_CONTROL) {
2101 ret = drv_set_bitrate_mask(local, sdata, mask); 2104 ret = drv_set_bitrate_mask(local, sdata, mask);
2102 if (ret) 2105 if (ret)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d7134c170336..079038d26a14 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1337,6 +1337,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1337 if (WARN_ON(!ifmgd->associated)) 1337 if (WARN_ON(!ifmgd->associated))
1338 return; 1338 return;
1339 1339
1340 ieee80211_stop_poll(sdata);
1341
1340 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN); 1342 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
1341 1343
1342 ifmgd->associated = NULL; 1344 ifmgd->associated = NULL;
@@ -2592,8 +2594,6 @@ static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata,
2592 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 2594 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2593 u8 frame_buf[DEAUTH_DISASSOC_LEN]; 2595 u8 frame_buf[DEAUTH_DISASSOC_LEN];
2594 2596
2595 ieee80211_stop_poll(sdata);
2596
2597 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, 2597 ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason,
2598 false, frame_buf); 2598 false, frame_buf);
2599 mutex_unlock(&ifmgd->mtx); 2599 mutex_unlock(&ifmgd->mtx);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 3bb24a121c95..a470e1123a55 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -271,6 +271,9 @@ struct sta_ampdu_mlme {
271 * @plink_timer: peer link watch timer 271 * @plink_timer: peer link watch timer
272 * @plink_timer_was_running: used by suspend/resume to restore timers 272 * @plink_timer_was_running: used by suspend/resume to restore timers
273 * @t_offset: timing offset relative to this host 273 * @t_offset: timing offset relative to this host
274 * @t_offset_setpoint: reference timing offset of this sta to be used when
275 * calculating clockdrift
276 * @ch_type: peer's channel type
274 * @debugfs: debug filesystem info 277 * @debugfs: debug filesystem info
275 * @dead: set to true when sta is unlinked 278 * @dead: set to true when sta is unlinked
276 * @uploaded: set to true when sta is uploaded to the driver 279 * @uploaded: set to true when sta is uploaded to the driver
@@ -278,6 +281,8 @@ struct sta_ampdu_mlme {
278 * @sta: station information we share with the driver 281 * @sta: station information we share with the driver
279 * @sta_state: duplicates information about station state (for debug) 282 * @sta_state: duplicates information about station state (for debug)
280 * @beacon_loss_count: number of times beacon loss has triggered 283 * @beacon_loss_count: number of times beacon loss has triggered
284 * @supports_40mhz: tracks whether the station advertised 40 MHz support
285 * as we overwrite its HT parameters with the currently used value
281 */ 286 */
282struct sta_info { 287struct sta_info {
283 /* General information, mostly static */ 288 /* General information, mostly static */
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 15f347477a99..baf5704740ee 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1389,7 +1389,7 @@ static void reg_set_request_processed(void)
1389 spin_unlock(&reg_requests_lock); 1389 spin_unlock(&reg_requests_lock);
1390 1390
1391 if (last_request->initiator == NL80211_REGDOM_SET_BY_USER) 1391 if (last_request->initiator == NL80211_REGDOM_SET_BY_USER)
1392 cancel_delayed_work_sync(&reg_timeout); 1392 cancel_delayed_work(&reg_timeout);
1393 1393
1394 if (need_more_processing) 1394 if (need_more_processing)
1395 schedule_work(&reg_work); 1395 schedule_work(&reg_work);
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 8f2d68fc3a44..316cfd00914f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -804,7 +804,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
804 ntype == NL80211_IFTYPE_P2P_CLIENT)) 804 ntype == NL80211_IFTYPE_P2P_CLIENT))
805 return -EBUSY; 805 return -EBUSY;
806 806
807 if (ntype != otype) { 807 if (ntype != otype && netif_running(dev)) {
808 err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr, 808 err = cfg80211_can_change_interface(rdev, dev->ieee80211_ptr,
809 ntype); 809 ntype);
810 if (err) 810 if (err)