Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
This commit is contained in:
commit
15c38c6ecd
|
@ -474,18 +474,6 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
|
||||||
/* ======================== Card services HCI interaction ======================== */
|
/* ======================== Card services HCI interaction ======================== */
|
||||||
|
|
||||||
|
|
||||||
static struct device *bt3c_device(void)
|
|
||||||
{
|
|
||||||
static struct device dev = {
|
|
||||||
.bus_id = "pcmcia",
|
|
||||||
};
|
|
||||||
kobject_set_name(&dev.kobj, "bt3c");
|
|
||||||
kobject_init(&dev.kobj);
|
|
||||||
|
|
||||||
return &dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count)
|
static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count)
|
||||||
{
|
{
|
||||||
char *ptr = (char *) firmware;
|
char *ptr = (char *) firmware;
|
||||||
|
@ -574,6 +562,7 @@ static int bt3c_open(bt3c_info_t *info)
|
||||||
{
|
{
|
||||||
const struct firmware *firmware;
|
const struct firmware *firmware;
|
||||||
struct hci_dev *hdev;
|
struct hci_dev *hdev;
|
||||||
|
client_handle_t handle;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
spin_lock_init(&(info->lock));
|
spin_lock_init(&(info->lock));
|
||||||
|
@ -605,8 +594,10 @@ static int bt3c_open(bt3c_info_t *info)
|
||||||
|
|
||||||
hdev->owner = THIS_MODULE;
|
hdev->owner = THIS_MODULE;
|
||||||
|
|
||||||
|
handle = info->link.handle;
|
||||||
|
|
||||||
/* Load firmware */
|
/* Load firmware */
|
||||||
err = request_firmware(&firmware, "BT3CPCC.bin", bt3c_device());
|
err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle));
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
BT_ERR("Firmware request failed");
|
BT_ERR("Firmware request failed");
|
||||||
goto error;
|
goto error;
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#define RFCOMM_DEFAULT_MTU 127
|
#define RFCOMM_DEFAULT_MTU 127
|
||||||
#define RFCOMM_DEFAULT_CREDITS 7
|
#define RFCOMM_DEFAULT_CREDITS 7
|
||||||
|
|
||||||
#define RFCOMM_MAX_L2CAP_MTU 1024
|
#define RFCOMM_MAX_L2CAP_MTU 1013
|
||||||
#define RFCOMM_MAX_CREDITS 40
|
#define RFCOMM_MAX_CREDITS 40
|
||||||
|
|
||||||
#define RFCOMM_SKB_HEAD_RESERVE 8
|
#define RFCOMM_SKB_HEAD_RESERVE 8
|
||||||
|
|
|
@ -143,13 +143,15 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
|
||||||
static int hci_sock_release(struct socket *sock)
|
static int hci_sock_release(struct socket *sock)
|
||||||
{
|
{
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
struct hci_dev *hdev = hci_pi(sk)->hdev;
|
struct hci_dev *hdev;
|
||||||
|
|
||||||
BT_DBG("sock %p sk %p", sock, sk);
|
BT_DBG("sock %p sk %p", sock, sk);
|
||||||
|
|
||||||
if (!sk)
|
if (!sk)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
hdev = hci_pi(sk)->hdev;
|
||||||
|
|
||||||
bt_sock_unlink(&hci_sk_list, sk);
|
bt_sock_unlink(&hci_sk_list, sk);
|
||||||
|
|
||||||
if (hdev) {
|
if (hdev) {
|
||||||
|
@ -311,14 +313,18 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, int *add
|
||||||
{
|
{
|
||||||
struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr;
|
struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr;
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
|
struct hci_dev *hdev = hci_pi(sk)->hdev;
|
||||||
|
|
||||||
BT_DBG("sock %p sk %p", sock, sk);
|
BT_DBG("sock %p sk %p", sock, sk);
|
||||||
|
|
||||||
|
if (!hdev)
|
||||||
|
return -EBADFD;
|
||||||
|
|
||||||
lock_sock(sk);
|
lock_sock(sk);
|
||||||
|
|
||||||
*addr_len = sizeof(*haddr);
|
*addr_len = sizeof(*haddr);
|
||||||
haddr->hci_family = AF_BLUETOOTH;
|
haddr->hci_family = AF_BLUETOOTH;
|
||||||
haddr->hci_dev = hci_pi(sk)->hdev->id;
|
haddr->hci_dev = hdev->id;
|
||||||
|
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -46,13 +46,15 @@
|
||||||
#include <net/bluetooth/l2cap.h>
|
#include <net/bluetooth/l2cap.h>
|
||||||
#include <net/bluetooth/rfcomm.h>
|
#include <net/bluetooth/rfcomm.h>
|
||||||
|
|
||||||
#define VERSION "1.6"
|
|
||||||
|
|
||||||
#ifndef CONFIG_BT_RFCOMM_DEBUG
|
#ifndef CONFIG_BT_RFCOMM_DEBUG
|
||||||
#undef BT_DBG
|
#undef BT_DBG
|
||||||
#define BT_DBG(D...)
|
#define BT_DBG(D...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define VERSION "1.7"
|
||||||
|
|
||||||
|
static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU;
|
||||||
|
|
||||||
static struct task_struct *rfcomm_thread;
|
static struct task_struct *rfcomm_thread;
|
||||||
|
|
||||||
static DECLARE_MUTEX(rfcomm_sem);
|
static DECLARE_MUTEX(rfcomm_sem);
|
||||||
|
@ -623,7 +625,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst
|
||||||
/* Set L2CAP options */
|
/* Set L2CAP options */
|
||||||
sk = sock->sk;
|
sk = sock->sk;
|
||||||
lock_sock(sk);
|
lock_sock(sk);
|
||||||
l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
|
l2cap_pi(sk)->imtu = l2cap_mtu;
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
|
|
||||||
s = rfcomm_session_add(sock, BT_BOUND);
|
s = rfcomm_session_add(sock, BT_BOUND);
|
||||||
|
@ -1868,7 +1870,7 @@ static int rfcomm_add_listener(bdaddr_t *ba)
|
||||||
/* Set L2CAP options */
|
/* Set L2CAP options */
|
||||||
sk = sock->sk;
|
sk = sock->sk;
|
||||||
lock_sock(sk);
|
lock_sock(sk);
|
||||||
l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU;
|
l2cap_pi(sk)->imtu = l2cap_mtu;
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
|
|
||||||
/* Start listening on the socket */
|
/* Start listening on the socket */
|
||||||
|
@ -2070,6 +2072,9 @@ static void __exit rfcomm_exit(void)
|
||||||
module_init(rfcomm_init);
|
module_init(rfcomm_init);
|
||||||
module_exit(rfcomm_exit);
|
module_exit(rfcomm_exit);
|
||||||
|
|
||||||
|
module_param(l2cap_mtu, uint, 0644);
|
||||||
|
MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection");
|
||||||
|
|
||||||
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
|
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>");
|
||||||
MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
|
MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
|
||||||
MODULE_VERSION(VERSION);
|
MODULE_VERSION(VERSION);
|
||||||
|
|
Loading…
Reference in New Issue