Commit 1d49f2e7 authored by David S. Miller's avatar David S. Miller

Merge http://linux-mh.bkbits.net/bluetooth-2.6

into nuts.davemloft.net:/disk1/BK/net-2.6
parents 846cd60b 957389f9
......@@ -264,7 +264,7 @@ static void bcm203x_disconnect(struct usb_interface *intf)
BT_DBG("intf %p", intf);
usb_unlink_urb(data->urb);
usb_kill_urb(data->urb);
usb_set_intfdata(intf, NULL);
......
......@@ -123,7 +123,7 @@ static void bfusb_unlink_urbs(struct bfusb *bfusb)
while ((skb = skb_dequeue(&bfusb->pending_q))) {
urb = ((struct bfusb_scb *) skb->cb)->urb;
usb_unlink_urb(urb);
usb_kill_urb(urb);
skb_queue_tail(&bfusb->completed_q, skb);
}
......
......@@ -92,14 +92,14 @@ typedef struct bluecard_info_t {
} bluecard_info_t;
void bluecard_config(dev_link_t *link);
void bluecard_release(dev_link_t *link);
int bluecard_event(event_t event, int priority, event_callback_args_t *args);
static void bluecard_config(dev_link_t *link);
static void bluecard_release(dev_link_t *link);
static int bluecard_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "bluecard_cs";
dev_link_t *bluecard_attach(void);
void bluecard_detach(dev_link_t *);
static dev_link_t *bluecard_attach(void);
static void bluecard_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
......@@ -172,7 +172,7 @@ static dev_link_t *dev_list = NULL;
/* ======================== LED handling routines ======================== */
void bluecard_activity_led_timeout(u_long arg)
static void bluecard_activity_led_timeout(u_long arg)
{
bluecard_info_t *info = (bluecard_info_t *)arg;
unsigned int iobase = info->link.io.BasePort1;
......@@ -721,7 +721,7 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l
/* ======================== Card services HCI interaction ======================== */
int bluecard_open(bluecard_info_t *info)
static int bluecard_open(bluecard_info_t *info)
{
unsigned int iobase = info->link.io.BasePort1;
struct hci_dev *hdev;
......@@ -839,7 +839,7 @@ int bluecard_open(bluecard_info_t *info)
}
int bluecard_close(bluecard_info_t *info)
static int bluecard_close(bluecard_info_t *info)
{
unsigned int iobase = info->link.io.BasePort1;
struct hci_dev *hdev = info->hdev;
......@@ -866,7 +866,7 @@ int bluecard_close(bluecard_info_t *info)
return 0;
}
dev_link_t *bluecard_attach(void)
static dev_link_t *bluecard_attach(void)
{
bluecard_info_t *info;
client_reg_t client_reg;
......@@ -924,7 +924,7 @@ dev_link_t *bluecard_attach(void)
}
void bluecard_detach(dev_link_t *link)
static void bluecard_detach(dev_link_t *link)
{
bluecard_info_t *info = link->priv;
dev_link_t **linkp;
......@@ -969,7 +969,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse
return pcmcia_parse_tuple(handle, tuple, parse);
}
void bluecard_config(dev_link_t *link)
static void bluecard_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
bluecard_info_t *info = link->priv;
......@@ -1044,7 +1044,7 @@ void bluecard_config(dev_link_t *link)
}
void bluecard_release(dev_link_t *link)
static void bluecard_release(dev_link_t *link)
{
bluecard_info_t *info = link->priv;
......@@ -1063,7 +1063,7 @@ void bluecard_release(dev_link_t *link)
}
int bluecard_event(event_t event, int priority, event_callback_args_t *args)
static int bluecard_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
bluecard_info_t *info = link->priv;
......
......@@ -96,14 +96,14 @@ typedef struct bt3c_info_t {
} bt3c_info_t;
void bt3c_config(dev_link_t *link);
void bt3c_release(dev_link_t *link);
int bt3c_event(event_t event, int priority, event_callback_args_t *args);
static void bt3c_config(dev_link_t *link);
static void bt3c_release(dev_link_t *link);
static int bt3c_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "bt3c_cs";
dev_link_t *bt3c_attach(void);
void bt3c_detach(dev_link_t *);
static dev_link_t *bt3c_attach(void);
static void bt3c_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
......@@ -132,28 +132,28 @@ static dev_link_t *dev_list = NULL;
#define CONTROL 4
inline void bt3c_address(unsigned int iobase, unsigned short addr)
static inline void bt3c_address(unsigned int iobase, unsigned short addr)
{
outb(addr & 0xff, iobase + ADDR_L);
outb((addr >> 8) & 0xff, iobase + ADDR_H);
}
inline void bt3c_put(unsigned int iobase, unsigned short value)
static inline void bt3c_put(unsigned int iobase, unsigned short value)
{
outb(value & 0xff, iobase + DATA_L);
outb((value >> 8) & 0xff, iobase + DATA_H);
}
inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value)
static inline void bt3c_io_write(unsigned int iobase, unsigned short addr, unsigned short value)
{
bt3c_address(iobase, addr);
bt3c_put(iobase, value);
}
inline unsigned short bt3c_get(unsigned int iobase)
static inline unsigned short bt3c_get(unsigned int iobase)
{
unsigned short value = inb(iobase + DATA_L);
......@@ -163,7 +163,7 @@ inline unsigned short bt3c_get(unsigned int iobase)
}
inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr)
static inline unsigned short bt3c_read(unsigned int iobase, unsigned short addr)
{
bt3c_address(iobase, addr);
......@@ -587,7 +587,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int co
}
int bt3c_open(bt3c_info_t *info)
static int bt3c_open(bt3c_info_t *info)
{
const struct firmware *firmware;
struct hci_dev *hdev;
......@@ -657,7 +657,7 @@ int bt3c_open(bt3c_info_t *info)
}
int bt3c_close(bt3c_info_t *info)
static int bt3c_close(bt3c_info_t *info)
{
struct hci_dev *hdev = info->hdev;
......@@ -674,7 +674,7 @@ int bt3c_close(bt3c_info_t *info)
return 0;
}
dev_link_t *bt3c_attach(void)
static dev_link_t *bt3c_attach(void)
{
bt3c_info_t *info;
client_reg_t client_reg;
......@@ -732,7 +732,7 @@ dev_link_t *bt3c_attach(void)
}
void bt3c_detach(dev_link_t *link)
static void bt3c_detach(dev_link_t *link)
{
bt3c_info_t *info = link->priv;
dev_link_t **linkp;
......@@ -786,7 +786,7 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
return get_tuple(handle, tuple, parse);
}
void bt3c_config(dev_link_t *link)
static void bt3c_config(dev_link_t *link)
{
static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
client_handle_t handle = link->handle;
......@@ -899,7 +899,7 @@ void bt3c_config(dev_link_t *link)
}
void bt3c_release(dev_link_t *link)
static void bt3c_release(dev_link_t *link)
{
bt3c_info_t *info = link->priv;
......@@ -916,7 +916,7 @@ void bt3c_release(dev_link_t *link)
}
int bt3c_event(event_t event, int priority, event_callback_args_t *args)
static int bt3c_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
bt3c_info_t *info = link->priv;
......
......@@ -92,14 +92,14 @@ typedef struct btuart_info_t {
} btuart_info_t;
void btuart_config(dev_link_t *link);
void btuart_release(dev_link_t *link);
int btuart_event(event_t event, int priority, event_callback_args_t *args);
static void btuart_config(dev_link_t *link);
static void btuart_release(dev_link_t *link);
static int btuart_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "btuart_cs";
dev_link_t *btuart_attach(void);
void btuart_detach(dev_link_t *);
static dev_link_t *btuart_attach(void);
static void btuart_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
......@@ -492,7 +492,7 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon
/* ======================== Card services HCI interaction ======================== */
int btuart_open(btuart_info_t *info)
static int btuart_open(btuart_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
......@@ -561,7 +561,7 @@ int btuart_open(btuart_info_t *info)
}
int btuart_close(btuart_info_t *info)
static int btuart_close(btuart_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
......@@ -590,7 +590,7 @@ int btuart_close(btuart_info_t *info)
return 0;
}
dev_link_t *btuart_attach(void)
static dev_link_t *btuart_attach(void)
{
btuart_info_t *info;
client_reg_t client_reg;
......@@ -648,7 +648,7 @@ dev_link_t *btuart_attach(void)
}
void btuart_detach(dev_link_t *link)
static void btuart_detach(dev_link_t *link)
{
btuart_info_t *info = link->priv;
dev_link_t **linkp;
......@@ -702,7 +702,7 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
return get_tuple(handle, tuple, parse);
}
void btuart_config(dev_link_t *link)
static void btuart_config(dev_link_t *link)
{
static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
client_handle_t handle = link->handle;
......@@ -816,7 +816,7 @@ void btuart_config(dev_link_t *link)
}
void btuart_release(dev_link_t *link)
static void btuart_release(dev_link_t *link)
{
btuart_info_t *info = link->priv;
......@@ -833,7 +833,7 @@ void btuart_release(dev_link_t *link)
}
int btuart_event(event_t event, int priority, event_callback_args_t *args)
static int btuart_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
btuart_info_t *info = link->priv;
......
......@@ -95,14 +95,14 @@ typedef struct dtl1_info_t {
} dtl1_info_t;
void dtl1_config(dev_link_t *link);
void dtl1_release(dev_link_t *link);
int dtl1_event(event_t event, int priority, event_callback_args_t *args);
static void dtl1_config(dev_link_t *link);
static void dtl1_release(dev_link_t *link);
static int dtl1_event(event_t event, int priority, event_callback_args_t *args);
static dev_info_t dev_info = "dtl1_cs";
dev_link_t *dtl1_attach(void);
void dtl1_detach(dev_link_t *);
static dev_link_t *dtl1_attach(void);
static void dtl1_detach(dev_link_t *);
static dev_link_t *dev_list = NULL;
......@@ -469,7 +469,7 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
/* ======================== Card services HCI interaction ======================== */
int dtl1_open(dtl1_info_t *info)
static int dtl1_open(dtl1_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
......@@ -540,7 +540,7 @@ int dtl1_open(dtl1_info_t *info)
}
int dtl1_close(dtl1_info_t *info)
static int dtl1_close(dtl1_info_t *info)
{
unsigned long flags;
unsigned int iobase = info->link.io.BasePort1;
......@@ -569,7 +569,7 @@ int dtl1_close(dtl1_info_t *info)
return 0;
}
dev_link_t *dtl1_attach(void)
static dev_link_t *dtl1_attach(void)
{
dtl1_info_t *info;
client_reg_t client_reg;
......@@ -627,7 +627,7 @@ dev_link_t *dtl1_attach(void)
}
void dtl1_detach(dev_link_t *link)
static void dtl1_detach(dev_link_t *link)
{
dtl1_info_t *info = link->priv;
dev_link_t **linkp;
......@@ -681,7 +681,7 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse)
return get_tuple(handle, tuple, parse);
}
void dtl1_config(dev_link_t *link)
static void dtl1_config(dev_link_t *link)
{
client_handle_t handle = link->handle;
dtl1_info_t *info = link->priv;
......@@ -768,7 +768,7 @@ void dtl1_config(dev_link_t *link)
}
void dtl1_release(dev_link_t *link)
static void dtl1_release(dev_link_t *link)
{
dtl1_info_t *info = link->priv;
......@@ -785,7 +785,7 @@ void dtl1_release(dev_link_t *link)
}
int dtl1_event(event_t event, int priority, event_callback_args_t *args)
static int dtl1_event(event_t event, int priority, event_callback_args_t *args)
{
dev_link_t *link = args->client_data;
dtl1_info_t *info = link->priv;
......
......@@ -120,7 +120,7 @@ static struct usb_device_id blacklist_ids[] = {
{ } /* Terminating entry */
};
struct _urb *_urb_alloc(int isoc, int gfp)
static struct _urb *_urb_alloc(int isoc, int gfp)
{
struct _urb *_urb = kmalloc(sizeof(struct _urb) +
sizeof(struct usb_iso_packet_descriptor) * isoc, gfp);
......@@ -131,7 +131,7 @@ struct _urb *_urb_alloc(int isoc, int gfp)
return _urb;
}
struct _urb *_urb_dequeue(struct _urb_queue *q)
static struct _urb *_urb_dequeue(struct _urb_queue *q)
{
struct _urb *_urb = NULL;
unsigned long flags;
......@@ -805,7 +805,7 @@ static void hci_usb_notify(struct hci_dev *hdev, unsigned int evt)
BT_DBG("%s evt %d", hdev->name, evt);
}
int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_host_endpoint *bulk_out_ep = NULL;
......
......@@ -56,8 +56,6 @@ struct _urb {
struct urb urb;
};
struct _urb *_urb_alloc(int isoc, int gfp);
static inline void _urb_free(struct _urb *_urb)
{
kfree(_urb);
......@@ -96,8 +94,6 @@ static inline void _urb_unlink(struct _urb *_urb)
}
}
struct _urb *_urb_dequeue(struct _urb_queue *q);
struct hci_usb {
struct hci_dev *hdev;
......
......@@ -338,7 +338,7 @@ static struct miscdevice hci_vhci_miscdev=
&hci_vhci_fops
};
int __init hci_vhci_init(void)
static int __init hci_vhci_init(void)
{
BT_INFO("VHCI driver ver %s", VERSION);
......@@ -350,7 +350,7 @@ int __init hci_vhci_init(void)
return 0;
}
void hci_vhci_cleanup(void)
static void hci_vhci_cleanup(void)
{
misc_deregister(&hci_vhci_miscdev);
}
......
......@@ -366,6 +366,11 @@ struct hci_cp_set_conn_encrypt {
__u8 encrypt;
} __attribute__ ((packed));
#define OCF_CHANGE_CONN_LINK_KEY 0x0015
struct hci_cp_change_conn_link_key {
__u16 handle;
} __attribute__ ((packed));
#define OCF_READ_REMOTE_FEATURES 0x001B
struct hci_cp_read_rmt_features {
__u16 handle;
......@@ -482,6 +487,12 @@ struct hci_ev_encrypt_change {
__u8 encrypt;
} __attribute__ ((packed));
#define HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
struct hci_ev_change_conn_link_key_complete {
__u8 status;
__u16 handle;
} __attribute__ ((packed));
#define HCI_EV_QOS_SETUP_COMPLETE 0x0D
struct hci_qos {
__u8 service_type;
......@@ -522,6 +533,14 @@ struct hci_ev_role_change {
__u8 role;
} __attribute__ ((packed));
#define HCI_EV_MODE_CHANGE 0x14
struct hci_ev_mode_change {
__u8 status;
__u16 handle;
__u8 mode;
__u16 interval;
} __attribute__ ((packed));
#define HCI_EV_PIN_CODE_REQ 0x16
struct hci_ev_pin_code_req {
bdaddr_t bdaddr;
......
......@@ -277,6 +277,7 @@ void hci_conn_hash_flush(struct hci_dev *hdev);
struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *src);
int hci_conn_auth(struct hci_conn *conn);
int hci_conn_encrypt(struct hci_conn *conn);
int hci_conn_change_link_key(struct hci_conn *conn);
static inline void hci_conn_set_timer(struct hci_conn *conn, unsigned long timeout)
{
......
......@@ -333,6 +333,20 @@ int hci_conn_encrypt(struct hci_conn *conn)
}
EXPORT_SYMBOL(hci_conn_encrypt);
/* Change link key */
int hci_conn_change_link_key(struct hci_conn *conn)
{
BT_DBG("conn %p", conn);
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
struct hci_cp_change_conn_link_key cp;
cp.handle = __cpu_to_le16(conn->handle);
hci_send_cmd(conn->hdev, OGF_LINK_CTL, OCF_CHANGE_CONN_LINK_KEY, sizeof(cp), &cp);
}
return 0;
}
EXPORT_SYMBOL(hci_conn_change_link_key);
/* Drop all connection on the device */
void hci_conn_hash_flush(struct hci_dev *hdev)
{
......
......@@ -786,6 +786,11 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
hci_dev_unlock(hdev);
}
/* Change Connection Link Key Complete */
static inline void hci_change_conn_link_key_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
}
/* Pin Code Request*/
static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
......@@ -853,6 +858,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
hci_encrypt_change_evt(hdev, skb);
break;
case HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE:
hci_change_conn_link_key_complete_evt(hdev, skb);
break;
case HCI_EV_PIN_CODE_REQ:
hci_pin_code_request_evt(hdev, skb);
break;
......
......@@ -114,7 +114,8 @@ static struct class bt_class = {
int hci_register_sysfs(struct hci_dev *hdev)
{
struct class_device *cdev = &hdev->class_dev;
int i, err;
unsigned int i;
int err;
BT_DBG("%p name %s type %d", hdev, hdev->name, hdev->type);
......
This diff is collapsed.
......@@ -38,13 +38,13 @@ void bt_dump(char *pref, __u8 *buf, int count)
{
char *ptr;
char line[100];
int i;
unsigned int i;
printk(KERN_INFO "%s: dump, len %d\n", pref, count);
ptr = line;
*ptr = 0;
for (i = 0; i<count; i++) {
for (i = 0; i < count; i++) {
ptr += sprintf(ptr, " %2.2X", buf[i]);
if (i && !((i + 1) % 20)) {
......@@ -63,7 +63,7 @@ void baswap(bdaddr_t *dst, bdaddr_t *src)
{
unsigned char *d = (unsigned char *) dst;
unsigned char *s = (unsigned char *) src;
int i;
unsigned int i;
for (i = 0; i < 6; i++)
d[i] = s[5 - i];
......
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