Commit 3bb3bdc7 authored by Maksim Krasnyanskiy's avatar Maksim Krasnyanskiy

Merge qualcomm.com:/usr/src/bt-2.5 into qualcomm.com:/usr/src/linux-2.5

parents bfd9dd69 5be1167f
menu "Bluetooth device drivers" menu "Bluetooth device drivers"
depends on BT!=n depends on BT
config BT_HCIUSB config BT_HCIUSB
tristate "HCI USB driver" tristate "HCI USB driver"
...@@ -52,11 +52,19 @@ config BT_HCIUART_BCSP ...@@ -52,11 +52,19 @@ config BT_HCIUART_BCSP
help help
BCSP (BlueCore Serial Protocol) is serial protocol for communication BCSP (BlueCore Serial Protocol) is serial protocol for communication
between Bluetooth device and host. This protocol is required for non between Bluetooth device and host. This protocol is required for non
USB Bluetooth devices based on CSR BlueCore chip, including PCMCIA and USB Bluetooth devices based on CSR BlueCore chip, including PCMCIA and
CF cards. CF cards.
Say Y here to compile support for HCI BCSP protocol. Say Y here to compile support for HCI BCSP protocol.
config BT_HCIUART_BCSP_TXCRC
bool "Transmit CRC with every BCSP packet"
depends on BT_HCIUART_BCSP
help
If you say Y here, a 16-bit CRC checksum will be transmitted along with
every BCSP (BlueCore Serial Protocol) packet sent to the Bluetooth chip.
This increases reliability, but slightly reduces efficiency.
config BT_HCIDTL1 config BT_HCIDTL1
tristate "HCI DTL1 (PC Card) driver" tristate "HCI DTL1 (PC Card) driver"
depends on PCMCIA && BT depends on PCMCIA && BT
...@@ -64,8 +72,8 @@ config BT_HCIDTL1 ...@@ -64,8 +72,8 @@ config BT_HCIDTL1
Bluetooth HCI DTL1 (PC Card) driver. Bluetooth HCI DTL1 (PC Card) driver.
This driver provides support for Bluetooth PCMCIA devices with This driver provides support for Bluetooth PCMCIA devices with
Nokia DTL1 interface: Nokia DTL1 interface:
Nokia Bluetooth Card Nokia Bluetooth Card
Socket Bluetooth CF Card Socket Bluetooth CF Card
Say Y here to compile support for HCI DTL1 devices into the Say Y here to compile support for HCI DTL1 devices into the
kernel or say M to compile it as module (dtl1_cs.o). kernel or say M to compile it as module (dtl1_cs.o).
...@@ -73,12 +81,12 @@ config BT_HCIDTL1 ...@@ -73,12 +81,12 @@ config BT_HCIDTL1
config BT_HCIBT3C config BT_HCIBT3C
tristate "HCI BT3C (PC Card) driver" tristate "HCI BT3C (PC Card) driver"
depends on PCMCIA && BT depends on PCMCIA && BT
---help--- help
Bluetooth HCI BT3C (PC Card) driver. Bluetooth HCI BT3C (PC Card) driver.
This driver provides support for Bluetooth PCMCIA devices with This driver provides support for Bluetooth PCMCIA devices with
3Com BT3C interface: 3Com BT3C interface:
3Com Bluetooth Card (3CRWB6096) 3Com Bluetooth Card (3CRWB6096)
HP Bluetooth Card HP Bluetooth Card
The HCI BT3C driver uses external firmware loader program provided in The HCI BT3C driver uses external firmware loader program provided in
the BlueFW package. For more information, see <http://bluez.sf.net>. the BlueFW package. For more information, see <http://bluez.sf.net>.
...@@ -92,9 +100,9 @@ config BT_HCIBLUECARD ...@@ -92,9 +100,9 @@ config BT_HCIBLUECARD
help help
Bluetooth HCI BlueCard (PC Card) driver. Bluetooth HCI BlueCard (PC Card) driver.
This driver provides support for Bluetooth PCMCIA devices with This driver provides support for Bluetooth PCMCIA devices with
Anycom BlueCard interface: Anycom BlueCard interface:
Anycom Bluetooth PC Card Anycom Bluetooth PC Card
Anycom Bluetooth CF Card Anycom Bluetooth CF Card
Say Y here to compile support for HCI BlueCard devices into the Say Y here to compile support for HCI BlueCard devices into the
kernel or say M to compile it as module (bluecard_cs.o). kernel or say M to compile it as module (bluecard_cs.o).
......
...@@ -7,7 +7,7 @@ menu "Bluetooth support" ...@@ -7,7 +7,7 @@ menu "Bluetooth support"
config BT config BT
tristate "Bluetooth subsystem support" tristate "Bluetooth subsystem support"
---help--- help
Bluetooth is low-cost, low-power, short-range wireless technology. Bluetooth is low-cost, low-power, short-range wireless technology.
It was designed as a replacement for cables and other short-range It was designed as a replacement for cables and other short-range
technologies like IrDA. Bluetooth operates in personal area range technologies like IrDA. Bluetooth operates in personal area range
...@@ -15,12 +15,12 @@ config BT ...@@ -15,12 +15,12 @@ config BT
Bluetooth can be found at <http://www.bluetooth.com/>. Bluetooth can be found at <http://www.bluetooth.com/>.
Linux Bluetooth subsystem consist of several layers: Linux Bluetooth subsystem consist of several layers:
Bluetooth Core (HCI device and connection manager, scheduler) Bluetooth Core (HCI device and connection manager, scheduler)
HCI Device drivers (interface to the hardware) HCI Device drivers (interface to the hardware)
L2CAP Module (L2CAP protocol) L2CAP Module (L2CAP protocol)
SCO Module (SCO links) SCO Module (SCO links)
RFCOMM Module (RFCOMM protocol) RFCOMM Module (RFCOMM protocol)
BNEP Module (BNEP protocol) BNEP Module (BNEP protocol)
Say Y here to enable Linux Bluetooth support and to build Bluetooth Core Say Y here to enable Linux Bluetooth support and to build Bluetooth Core
layer. layer.
......
config BT_BNEP config BT_BNEP
tristate "BNEP protocol support" tristate "BNEP protocol support"
depends on BT_L2CAP depends on BT && BT_L2CAP
---help--- help
BNEP (Bluetooth Network Encapsulation Protocol) is Ethernet BNEP (Bluetooth Network Encapsulation Protocol) is Ethernet
emulation layer on top of Bluetooth. BNEP is required for Bluetooth emulation layer on top of Bluetooth. BNEP is required for Bluetooth
PAN (Personal Area Network). PAN (Personal Area Network).
......
...@@ -186,62 +186,6 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, stru ...@@ -186,62 +186,6 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, stru
write_unlock(&l->lock); write_unlock(&l->lock);
} }
int l2cap_connect(struct sock *sk)
{
bdaddr_t *src = &bt_sk(sk)->src;
bdaddr_t *dst = &bt_sk(sk)->dst;
struct l2cap_conn *conn;
struct hci_conn *hcon;
struct hci_dev *hdev;
int err = 0;
BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), l2cap_pi(sk)->psm);
if (!(hdev = hci_get_route(dst, src)))
return -EHOSTUNREACH;
hci_dev_lock_bh(hdev);
err = -ENOMEM;
hcon = hci_connect(hdev, ACL_LINK, dst);
if (!hcon)
goto done;
conn = l2cap_conn_add(hcon, 0);
if (!conn) {
hci_conn_put(hcon);
goto done;
}
err = 0;
/* Update source addr of the socket */
bacpy(src, conn->src);
l2cap_chan_add(conn, sk, NULL);
sk->state = BT_CONNECT;
l2cap_sock_set_timer(sk, sk->sndtimeo);
if (hcon->state == BT_CONNECTED) {
if (sk->type == SOCK_SEQPACKET) {
struct l2cap_conn_req req;
req.scid = __cpu_to_le16(l2cap_pi(sk)->scid);
req.psm = l2cap_pi(sk)->psm;
l2cap_send_req(conn, L2CAP_CONN_REQ, sizeof(req), &req);
} else {
l2cap_sock_clear_timer(sk);
sk->state = BT_CONNECTED;
}
}
done:
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);
return err;
}
/* ---- Socket interface ---- */ /* ---- Socket interface ---- */
static struct sock *__l2cap_get_sock_by_addr(u16 psm, bdaddr_t *src) static struct sock *__l2cap_get_sock_by_addr(u16 psm, bdaddr_t *src)
{ {
...@@ -482,6 +426,62 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_ ...@@ -482,6 +426,62 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
return err; return err;
} }
static int l2cap_do_connect(struct sock *sk)
{
bdaddr_t *src = &bt_sk(sk)->src;
bdaddr_t *dst = &bt_sk(sk)->dst;
struct l2cap_conn *conn;
struct hci_conn *hcon;
struct hci_dev *hdev;
int err = 0;
BT_DBG("%s -> %s psm 0x%2.2x", batostr(src), batostr(dst), l2cap_pi(sk)->psm);
if (!(hdev = hci_get_route(dst, src)))
return -EHOSTUNREACH;
hci_dev_lock_bh(hdev);
err = -ENOMEM;
hcon = hci_connect(hdev, ACL_LINK, dst);
if (!hcon)
goto done;
conn = l2cap_conn_add(hcon, 0);
if (!conn) {
hci_conn_put(hcon);
goto done;
}
err = 0;
/* Update source addr of the socket */
bacpy(src, conn->src);
l2cap_chan_add(conn, sk, NULL);
sk->state = BT_CONNECT;
l2cap_sock_set_timer(sk, sk->sndtimeo);
if (hcon->state == BT_CONNECTED) {
if (sk->type == SOCK_SEQPACKET) {
struct l2cap_conn_req req;
req.scid = __cpu_to_le16(l2cap_pi(sk)->scid);
req.psm = l2cap_pi(sk)->psm;
l2cap_send_req(conn, L2CAP_CONN_REQ, sizeof(req), &req);
} else {
l2cap_sock_clear_timer(sk);
sk->state = BT_CONNECTED;
}
}
done:
hci_dev_unlock_bh(hdev);
hci_dev_put(hdev);
return err;
}
static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags) static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags)
{ {
struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr; struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
...@@ -527,7 +527,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al ...@@ -527,7 +527,7 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
bacpy(&bt_sk(sk)->dst, &la->l2_bdaddr); bacpy(&bt_sk(sk)->dst, &la->l2_bdaddr);
l2cap_pi(sk)->psm = la->l2_psm; l2cap_pi(sk)->psm = la->l2_psm;
if ((err = l2cap_connect(sk))) if ((err = l2cap_do_connect(sk)))
goto done; goto done;
wait: wait:
......
config BT_RFCOMM config BT_RFCOMM
tristate "RFCOMM protocol support" tristate "RFCOMM protocol support"
depends on BT_L2CAP depends on BT && BT_L2CAP
help help
RFCOMM provides connection oriented stream transport. RFCOMM RFCOMM provides connection oriented stream transport. RFCOMM
support is required for Dialup Networking, OBEX and other Bluetooth support is required for Dialup Networking, OBEX and other Bluetooth
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment