diff options
-rw-r--r-- | drivers/net/wireless/rtlwifi/pci.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 20 | ||||
-rw-r--r-- | net/bluetooth/hci_conn.c | 6 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 21 |
4 files changed, 50 insertions, 10 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 9f8ccae93317..254b64ba4bf6 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1624,6 +1624,16 @@ static bool _rtl_pci_find_adapter(struct pci_dev *pdev, | |||
1624 | pci_read_config_byte(pdev, 0x8, &revisionid); | 1624 | pci_read_config_byte(pdev, 0x8, &revisionid); |
1625 | pci_read_config_word(pdev, 0x3C, &irqline); | 1625 | pci_read_config_word(pdev, 0x3C, &irqline); |
1626 | 1626 | ||
1627 | /* PCI ID 0x10ec:0x8192 occurs for both RTL8192E, which uses | ||
1628 | * r8192e_pci, and RTL8192SE, which uses this driver. If the | ||
1629 | * revision ID is RTL_PCI_REVISION_ID_8192PCIE (0x01), then | ||
1630 | * the correct driver is r8192e_pci, thus this routine should | ||
1631 | * return false. | ||
1632 | */ | ||
1633 | if (deviceid == RTL_PCI_8192SE_DID && | ||
1634 | revisionid == RTL_PCI_REVISION_ID_8192PCIE) | ||
1635 | return false; | ||
1636 | |||
1627 | if (deviceid == RTL_PCI_8192_DID || | 1637 | if (deviceid == RTL_PCI_8192_DID || |
1628 | deviceid == RTL_PCI_0044_DID || | 1638 | deviceid == RTL_PCI_0044_DID || |
1629 | deviceid == RTL_PCI_0047_DID || | 1639 | deviceid == RTL_PCI_0047_DID || |
@@ -1856,7 +1866,8 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
1856 | pci_write_config_byte(pdev, 0x04, 0x07); | 1866 | pci_write_config_byte(pdev, 0x04, 0x07); |
1857 | 1867 | ||
1858 | /* find adapter */ | 1868 | /* find adapter */ |
1859 | _rtl_pci_find_adapter(pdev, hw); | 1869 | if (!_rtl_pci_find_adapter(pdev, hw)) |
1870 | goto fail3; | ||
1860 | 1871 | ||
1861 | /* Init IO handler */ | 1872 | /* Init IO handler */ |
1862 | _rtl_pci_io_handler_init(&pdev->dev, hw); | 1873 | _rtl_pci_io_handler_init(&pdev->dev, hw); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index bee7c1480f63..092e342c19df 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -53,6 +53,8 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); | |||
53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | 53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
54 | { | 54 | { |
55 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 55 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
56 | const struct firmware *firmware; | ||
57 | int err; | ||
56 | 58 | ||
57 | rtlpriv->dm.dm_initialgain_enable = 1; | 59 | rtlpriv->dm.dm_initialgain_enable = 1; |
58 | rtlpriv->dm.dm_flag = 0; | 60 | rtlpriv->dm.dm_flag = 0; |
@@ -64,6 +66,24 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | |||
64 | ("Can't alloc buffer for fw.\n")); | 66 | ("Can't alloc buffer for fw.\n")); |
65 | return 1; | 67 | return 1; |
66 | } | 68 | } |
69 | /* request fw */ | ||
70 | err = request_firmware(&firmware, rtlpriv->cfg->fw_name, | ||
71 | rtlpriv->io.dev); | ||
72 | if (err) { | ||
73 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
74 | ("Failed to request firmware!\n")); | ||
75 | return 1; | ||
76 | } | ||
77 | if (firmware->size > 0x4000) { | ||
78 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
79 | ("Firmware is too big!\n")); | ||
80 | release_firmware(firmware); | ||
81 | return 1; | ||
82 | } | ||
83 | memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); | ||
84 | rtlpriv->rtlhal.fwsize = firmware->size; | ||
85 | release_firmware(firmware); | ||
86 | |||
67 | return 0; | 87 | return 0; |
68 | } | 88 | } |
69 | 89 | ||
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 3163330cd4f1..d3a05b9ade7a 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -608,11 +608,11 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type) | |||
608 | goto encrypt; | 608 | goto encrypt; |
609 | 609 | ||
610 | auth: | 610 | auth: |
611 | if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) | 611 | if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) |
612 | return 0; | 612 | return 0; |
613 | 613 | ||
614 | hci_conn_auth(conn, sec_level, auth_type); | 614 | if (!hci_conn_auth(conn, sec_level, auth_type)) |
615 | return 0; | 615 | return 0; |
616 | 616 | ||
617 | encrypt: | 617 | encrypt: |
618 | if (conn->link_mode & HCI_LM_ENCRYPT) | 618 | if (conn->link_mode & HCI_LM_ENCRYPT) |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index e64a1c2df238..56fdd9162da9 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -4002,21 +4002,30 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
4002 | } | 4002 | } |
4003 | } else if (sk->sk_state == BT_CONNECT2) { | 4003 | } else if (sk->sk_state == BT_CONNECT2) { |
4004 | struct l2cap_conn_rsp rsp; | 4004 | struct l2cap_conn_rsp rsp; |
4005 | __u16 result; | 4005 | __u16 res, stat; |
4006 | 4006 | ||
4007 | if (!status) { | 4007 | if (!status) { |
4008 | sk->sk_state = BT_CONFIG; | 4008 | if (bt_sk(sk)->defer_setup) { |
4009 | result = L2CAP_CR_SUCCESS; | 4009 | struct sock *parent = bt_sk(sk)->parent; |
4010 | res = L2CAP_CR_PEND; | ||
4011 | stat = L2CAP_CS_AUTHOR_PEND; | ||
4012 | parent->sk_data_ready(parent, 0); | ||
4013 | } else { | ||
4014 | sk->sk_state = BT_CONFIG; | ||
4015 | res = L2CAP_CR_SUCCESS; | ||
4016 | stat = L2CAP_CS_NO_INFO; | ||
4017 | } | ||
4010 | } else { | 4018 | } else { |
4011 | sk->sk_state = BT_DISCONN; | 4019 | sk->sk_state = BT_DISCONN; |
4012 | l2cap_sock_set_timer(sk, HZ / 10); | 4020 | l2cap_sock_set_timer(sk, HZ / 10); |
4013 | result = L2CAP_CR_SEC_BLOCK; | 4021 | res = L2CAP_CR_SEC_BLOCK; |
4022 | stat = L2CAP_CS_NO_INFO; | ||
4014 | } | 4023 | } |
4015 | 4024 | ||
4016 | rsp.scid = cpu_to_le16(chan->dcid); | 4025 | rsp.scid = cpu_to_le16(chan->dcid); |
4017 | rsp.dcid = cpu_to_le16(chan->scid); | 4026 | rsp.dcid = cpu_to_le16(chan->scid); |
4018 | rsp.result = cpu_to_le16(result); | 4027 | rsp.result = cpu_to_le16(res); |
4019 | rsp.status = cpu_to_le16(L2CAP_CS_NO_INFO); | 4028 | rsp.status = cpu_to_le16(stat); |
4020 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, | 4029 | l2cap_send_cmd(conn, chan->ident, L2CAP_CONN_RSP, |
4021 | sizeof(rsp), &rsp); | 4030 | sizeof(rsp), &rsp); |
4022 | } | 4031 | } |