diff options
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/usb.c | 10 | ||||
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 | ||||
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 8 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 11 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 5 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 12 |
8 files changed, 45 insertions, 20 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index f7868c0d79ed..2062ea1d7c80 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1853,14 +1853,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1853 | /*like read eeprom and so on */ | 1853 | /*like read eeprom and so on */ |
1854 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 1854 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
1855 | 1855 | ||
1856 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
1857 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
1858 | err = -ENODEV; | ||
1859 | goto fail3; | ||
1860 | } | ||
1861 | |||
1862 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
1863 | |||
1864 | /*aspm */ | 1856 | /*aspm */ |
1865 | rtl_pci_init_aspm(hw); | 1857 | rtl_pci_init_aspm(hw); |
1866 | 1858 | ||
@@ -1879,6 +1871,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1879 | goto fail3; | 1871 | goto fail3; |
1880 | } | 1872 | } |
1881 | 1873 | ||
1874 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
1875 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
1876 | err = -ENODEV; | ||
1877 | goto fail3; | ||
1878 | } | ||
1879 | |||
1880 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
1881 | |||
1882 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); | 1882 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); |
1883 | if (err) { | 1883 | if (err) { |
1884 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1884 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index d04dbda13f5a..a6049d7d51b3 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
971 | rtlpriv->cfg->ops->read_chip_version(hw); | 971 | rtlpriv->cfg->ops->read_chip_version(hw); |
972 | /*like read eeprom and so on */ | 972 | /*like read eeprom and so on */ |
973 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 973 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
974 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
975 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
976 | goto error_out; | ||
977 | } | ||
978 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
979 | err = _rtl_usb_init(hw); | 974 | err = _rtl_usb_init(hw); |
980 | if (err) | 975 | if (err) |
981 | goto error_out; | 976 | goto error_out; |
@@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
987 | "Can't allocate sw for mac80211\n"); | 982 | "Can't allocate sw for mac80211\n"); |
988 | goto error_out; | 983 | goto error_out; |
989 | } | 984 | } |
985 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
986 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
987 | goto error_out; | ||
988 | } | ||
989 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
990 | 990 | ||
991 | return 0; | 991 | return 0; |
992 | error_out: | 992 | error_out: |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 2fb268f2895b..c34a9a6184a1 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -195,6 +195,7 @@ struct bt_sock { | |||
195 | struct list_head accept_q; | 195 | struct list_head accept_q; |
196 | struct sock *parent; | 196 | struct sock *parent; |
197 | u32 defer_setup; | 197 | u32 defer_setup; |
198 | bool suspended; | ||
198 | }; | 199 | }; |
199 | 200 | ||
200 | struct bt_sock_list { | 201 | struct bt_sock_list { |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 72eb187a5f60..6fb68a9743af 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -450,7 +450,7 @@ unsigned int bt_sock_poll(struct file *file, struct socket *sock, poll_table *wa | |||
450 | sk->sk_state == BT_CONFIG) | 450 | sk->sk_state == BT_CONFIG) |
451 | return mask; | 451 | return mask; |
452 | 452 | ||
453 | if (sock_writeable(sk)) | 453 | if (!bt_sk(sk)->suspended && sock_writeable(sk)) |
454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; | 454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; |
455 | else | 455 | else |
456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); | 456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 83d3d3563bcc..a8962382f9c5 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2715,6 +2715,14 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
2715 | if (conn) { | 2715 | if (conn) { |
2716 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); | 2716 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); |
2717 | 2717 | ||
2718 | hci_dev_lock(hdev); | ||
2719 | if (test_bit(HCI_MGMT, &hdev->dev_flags) && | ||
2720 | !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) | ||
2721 | mgmt_device_connected(hdev, &conn->dst, conn->type, | ||
2722 | conn->dst_type, 0, NULL, 0, | ||
2723 | conn->dev_class); | ||
2724 | hci_dev_unlock(hdev); | ||
2725 | |||
2718 | /* Send to upper protocol */ | 2726 | /* Send to upper protocol */ |
2719 | l2cap_recv_acldata(conn, skb, flags); | 2727 | l2cap_recv_acldata(conn, skb, flags); |
2720 | return; | 2728 | return; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d81262aff263..4edbfd929f6e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -2062,6 +2062,12 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
2062 | 2062 | ||
2063 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | 2063 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
2064 | 2064 | ||
2065 | if (ev->status && conn->state == BT_CONNECTED) { | ||
2066 | hci_acl_disconn(conn, 0x13); | ||
2067 | hci_conn_put(conn); | ||
2068 | goto unlock; | ||
2069 | } | ||
2070 | |||
2065 | if (conn->state == BT_CONFIG) { | 2071 | if (conn->state == BT_CONFIG) { |
2066 | if (!ev->status) | 2072 | if (!ev->status) |
2067 | conn->state = BT_CONNECTED; | 2073 | conn->state = BT_CONNECTED; |
@@ -2072,6 +2078,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
2072 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); | 2078 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); |
2073 | } | 2079 | } |
2074 | 2080 | ||
2081 | unlock: | ||
2075 | hci_dev_unlock(hdev); | 2082 | hci_dev_unlock(hdev); |
2076 | } | 2083 | } |
2077 | 2084 | ||
@@ -2125,7 +2132,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff | |||
2125 | goto unlock; | 2132 | goto unlock; |
2126 | } | 2133 | } |
2127 | 2134 | ||
2128 | if (!ev->status) { | 2135 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
2129 | struct hci_cp_remote_name_req cp; | 2136 | struct hci_cp_remote_name_req cp; |
2130 | memset(&cp, 0, sizeof(cp)); | 2137 | memset(&cp, 0, sizeof(cp)); |
2131 | bacpy(&cp.bdaddr, &conn->dst); | 2138 | bacpy(&cp.bdaddr, &conn->dst); |
@@ -2901,7 +2908,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b | |||
2901 | if (conn->state != BT_CONFIG) | 2908 | if (conn->state != BT_CONFIG) |
2902 | goto unlock; | 2909 | goto unlock; |
2903 | 2910 | ||
2904 | if (!ev->status) { | 2911 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
2905 | struct hci_cp_remote_name_req cp; | 2912 | struct hci_cp_remote_name_req cp; |
2906 | memset(&cp, 0, sizeof(cp)); | 2913 | memset(&cp, 0, sizeof(cp)); |
2907 | bacpy(&cp.bdaddr, &conn->dst); | 2914 | bacpy(&cp.bdaddr, &conn->dst); |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 7adfcecf7a5e..3714c9656459 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -4916,6 +4916,11 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
4916 | 4916 | ||
4917 | if (!status && (chan->state == BT_CONNECTED || | 4917 | if (!status && (chan->state == BT_CONNECTED || |
4918 | chan->state == BT_CONFIG)) { | 4918 | chan->state == BT_CONFIG)) { |
4919 | struct sock *sk = chan->sk; | ||
4920 | |||
4921 | bt_sk(sk)->suspended = false; | ||
4922 | sk->sk_state_change(sk); | ||
4923 | |||
4919 | l2cap_check_encryption(chan, encrypt); | 4924 | l2cap_check_encryption(chan, encrypt); |
4920 | l2cap_chan_unlock(chan); | 4925 | l2cap_chan_unlock(chan); |
4921 | continue; | 4926 | continue; |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 6bf8ff75d95f..b7bc7b981ee2 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -596,10 +596,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
596 | sk->sk_state = BT_CONFIG; | 596 | sk->sk_state = BT_CONFIG; |
597 | chan->state = BT_CONFIG; | 597 | chan->state = BT_CONFIG; |
598 | 598 | ||
599 | /* or for ACL link, under defer_setup time */ | 599 | /* or for ACL link */ |
600 | } else if (sk->sk_state == BT_CONNECT2 && | 600 | } else if ((sk->sk_state == BT_CONNECT2 && |
601 | bt_sk(sk)->defer_setup) { | 601 | bt_sk(sk)->defer_setup) || |
602 | err = l2cap_chan_check_security(chan); | 602 | sk->sk_state == BT_CONNECTED) { |
603 | if (!l2cap_chan_check_security(chan)) | ||
604 | bt_sk(sk)->suspended = true; | ||
605 | else | ||
606 | sk->sk_state_change(sk); | ||
603 | } else { | 607 | } else { |
604 | err = -EINVAL; | 608 | err = -EINVAL; |
605 | } | 609 | } |