Commit ba4d1613 authored by Maksim Krasnyanskiy's avatar Maksim Krasnyanskiy

Consistent naming for Bluetooth function and constants.

Some of them were named like BT_XXX and bt_xxx others BLUEZ_XXX and bluez_xxx.
From now on use BT_XXX and bt_xxx throughout Bluetooth code, including CONFIG_ defines.
Clean up small typos and misspelling along the way.
parent b7f0e1d2
...@@ -38,7 +38,7 @@ obj-$(CONFIG_I2O) += message/ ...@@ -38,7 +38,7 @@ obj-$(CONFIG_I2O) += message/
obj-$(CONFIG_I2C) += i2c/ obj-$(CONFIG_I2C) += i2c/
obj-$(CONFIG_PHONE) += telephony/ obj-$(CONFIG_PHONE) += telephony/
obj-$(CONFIG_MD) += md/ obj-$(CONFIG_MD) += md/
obj-$(CONFIG_BLUEZ) += bluetooth/ obj-$(CONFIG_BT) += bluetooth/
obj-$(CONFIG_HOTPLUG_PCI) += hotplug/ obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
obj-$(CONFIG_ISDN_BOOL) += isdn/ obj-$(CONFIG_ISDN_BOOL) += isdn/
......
HCI UART driver HCI UART driver
CONFIG_BLUEZ_HCIUART CONFIG_BT_HCIUART
Bluetooth HCI UART driver. Bluetooth HCI UART driver.
This driver is required if you want to use Bluetooth devices with This driver is required if you want to use Bluetooth devices with
serial port interface. You will also need this driver if you have serial port interface. You will also need this driver if you have
...@@ -10,7 +10,7 @@ CONFIG_BLUEZ_HCIUART ...@@ -10,7 +10,7 @@ CONFIG_BLUEZ_HCIUART
kernel or say M to compile it as module (hci_uart.o). kernel or say M to compile it as module (hci_uart.o).
HCI UART (H4) protocol support HCI UART (H4) protocol support
CONFIG_BLUEZ_HCIUART_H4 CONFIG_BT_HCIUART_H4
UART (H4) is serial protocol for communication between Bluetooth UART (H4) is serial protocol for communication between Bluetooth
device and host. This protocol is required for most Bluetooth devices device and host. This protocol is required for most Bluetooth devices
with UART interface, including PCMCIA and CF cards. with UART interface, including PCMCIA and CF cards.
...@@ -18,7 +18,7 @@ CONFIG_BLUEZ_HCIUART_H4 ...@@ -18,7 +18,7 @@ CONFIG_BLUEZ_HCIUART_H4
Say Y here to compile support for HCI UART (H4) protocol. Say Y here to compile support for HCI UART (H4) protocol.
HCI BCSP protocol support HCI BCSP protocol support
CONFIG_BLUEZ_HCIUART_BCSP CONFIG_BT_HCIUART_BCSP
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
...@@ -27,7 +27,7 @@ CONFIG_BLUEZ_HCIUART_BCSP ...@@ -27,7 +27,7 @@ CONFIG_BLUEZ_HCIUART_BCSP
Say Y here to compile support for HCI BCSP protocol. Say Y here to compile support for HCI BCSP protocol.
HCI USB driver HCI USB driver
CONFIG_BLUEZ_HCIUSB CONFIG_BT_HCIUSB
Bluetooth HCI USB driver. Bluetooth HCI USB driver.
This driver is required if you want to use Bluetooth devices with This driver is required if you want to use Bluetooth devices with
USB interface. USB interface.
...@@ -36,7 +36,7 @@ CONFIG_BLUEZ_HCIUSB ...@@ -36,7 +36,7 @@ CONFIG_BLUEZ_HCIUSB
kernel or say M to compile it as module (hci_usb.o). kernel or say M to compile it as module (hci_usb.o).
HCI USB zero packet support HCI USB zero packet support
CONFIG_BLUEZ_USB_ZERO_PACKET CONFIG_BT_USB_ZERO_PACKET
Support for USB zero packets. Support for USB zero packets.
This option is provided only as a work around for buggy Bluetooth USB This option is provided only as a work around for buggy Bluetooth USB
devices. Do _not_ enable it unless you know for sure that your device devices. Do _not_ enable it unless you know for sure that your device
...@@ -44,7 +44,7 @@ CONFIG_BLUEZ_USB_ZERO_PACKET ...@@ -44,7 +44,7 @@ CONFIG_BLUEZ_USB_ZERO_PACKET
Most people should say N here. Most people should say N here.
HCI VHCI Virtual HCI device driver HCI VHCI Virtual HCI device driver
CONFIG_BLUEZ_HCIVHCI CONFIG_BT_HCIVHCI
Bluetooth Virtual HCI device driver. Bluetooth Virtual HCI device driver.
This driver is required if you want to use HCI Emulation software. This driver is required if you want to use HCI Emulation software.
...@@ -52,7 +52,7 @@ CONFIG_BLUEZ_HCIVHCI ...@@ -52,7 +52,7 @@ CONFIG_BLUEZ_HCIVHCI
kernel or say M to compile it as module (hci_vhci.o). kernel or say M to compile it as module (hci_vhci.o).
HCI DTL1 (PC Card) device driver HCI DTL1 (PC Card) device driver
CONFIG_BLUEZ_HCIDTL1 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:
...@@ -63,7 +63,7 @@ CONFIG_BLUEZ_HCIDTL1 ...@@ -63,7 +63,7 @@ CONFIG_BLUEZ_HCIDTL1
kernel or say M to compile it as module (dtl1_cs.o). kernel or say M to compile it as module (dtl1_cs.o).
HCI BT3C (PC Card) device driver HCI BT3C (PC Card) device driver
CONFIG_BLUEZ_HCIBT3C CONFIG_BT_HCIBT3C
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:
...@@ -77,7 +77,7 @@ CONFIG_BLUEZ_HCIBT3C ...@@ -77,7 +77,7 @@ CONFIG_BLUEZ_HCIBT3C
kernel or say M to compile it as module (bt3c_cs.o). kernel or say M to compile it as module (bt3c_cs.o).
HCI BlueCard (PC Card) device driver HCI BlueCard (PC Card) device driver
CONFIG_BLUEZ_HCIBLUECARD CONFIG_BT_HCIBLUECARD
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:
......
mainmenu_option next_comment mainmenu_option next_comment
comment 'Bluetooth device drivers' comment 'Bluetooth device drivers'
dep_tristate 'HCI USB driver' CONFIG_BLUEZ_HCIUSB $CONFIG_BLUEZ $CONFIG_USB dep_tristate 'HCI USB driver' CONFIG_BT_HCIUSB $CONFIG_BT $CONFIG_USB
if [ "$CONFIG_BLUEZ_HCIUSB" != "n" ]; then if [ "$CONFIG_BT_HCIUSB" != "n" ]; then
bool ' USB zero packet support' CONFIG_BLUEZ_USB_ZERO_PACKET bool ' USB zero packet support' CONFIG_BT_USB_ZERO_PACKET
fi fi
dep_tristate 'HCI UART driver' CONFIG_BLUEZ_HCIUART $CONFIG_BLUEZ dep_tristate 'HCI UART driver' CONFIG_BT_HCIUART $CONFIG_BT
if [ "$CONFIG_BLUEZ_HCIUART" != "n" ]; then if [ "$CONFIG_BT_HCIUART" != "n" ]; then
bool ' UART (H4) protocol support' CONFIG_BLUEZ_HCIUART_H4 bool ' UART (H4) protocol support' CONFIG_BT_HCIUART_H4
bool ' BCSP protocol support' CONFIG_BLUEZ_HCIUART_BCSP bool ' BCSP protocol support' CONFIG_BT_HCIUART_BCSP
fi fi
dep_tristate 'HCI DTL1 (PC Card) driver' CONFIG_BLUEZ_HCIDTL1 $CONFIG_PCMCIA $CONFIG_BLUEZ dep_tristate 'HCI DTL1 (PC Card) driver' CONFIG_BT_HCIDTL1 $CONFIG_PCMCIA $CONFIG_BT
dep_tristate 'HCI BT3C (PC Card) driver' CONFIG_BLUEZ_HCIBT3C $CONFIG_PCMCIA $CONFIG_BLUEZ dep_tristate 'HCI BT3C (PC Card) driver' CONFIG_BT_HCIBT3C $CONFIG_PCMCIA $CONFIG_BT
dep_tristate 'HCI BlueCard (PC Card) driver' CONFIG_BLUEZ_HCIBLUECARD $CONFIG_PCMCIA $CONFIG_BLUEZ dep_tristate 'HCI BlueCard (PC Card) driver' CONFIG_BT_HCIBLUECARD $CONFIG_PCMCIA $CONFIG_BT
dep_tristate 'HCI VHCI (Virtual HCI device) driver' CONFIG_BLUEZ_HCIVHCI $CONFIG_BLUEZ dep_tristate 'HCI VHCI (Virtual HCI device) driver' CONFIG_BT_HCIVHCI $CONFIG_BT
endmenu endmenu
...@@ -2,16 +2,16 @@ ...@@ -2,16 +2,16 @@
# Makefile for the Linux Bluetooth HCI device drivers. # Makefile for the Linux Bluetooth HCI device drivers.
# #
obj-$(CONFIG_BLUEZ_HCIUSB) += hci_usb.o obj-$(CONFIG_BT_HCIUSB) += hci_usb.o
obj-$(CONFIG_BLUEZ_HCIVHCI) += hci_vhci.o obj-$(CONFIG_BT_HCIVHCI) += hci_vhci.o
obj-$(CONFIG_BLUEZ_HCIUART) += hci_uart.o obj-$(CONFIG_BT_HCIUART) += hci_uart.o
obj-$(CONFIG_BLUEZ_HCIDTL1) += dtl1_cs.o obj-$(CONFIG_BT_HCIDTL1) += dtl1_cs.o
obj-$(CONFIG_BLUEZ_HCIBT3C) += bt3c_cs.o obj-$(CONFIG_BT_HCIBT3C) += bt3c_cs.o
obj-$(CONFIG_BLUEZ_HCIBLUECARD) += bluecard_cs.o obj-$(CONFIG_BT_HCIBLUECARD) += bluecard_cs.o
hci_uart-y := hci_ldisc.o hci_uart-y := hci_ldisc.o
hci_uart-$(CONFIG_BLUEZ_HCIUART_H4) += hci_h4.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o
hci_uart-$(CONFIG_BLUEZ_HCIUART_BCSP) += hci_bcsp.o hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
hci_uart-objs := $(hci_uart-y) hci_uart-objs := $(hci_uart-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -60,7 +60,7 @@ MODULE_PARM(irq_mask, "i"); ...@@ -60,7 +60,7 @@ MODULE_PARM(irq_mask, "i");
MODULE_PARM(irq_list, "1-4i"); MODULE_PARM(irq_list, "1-4i");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("BlueZ driver for the Anycom BlueCard (LSE039/LSE041)"); MODULE_DESCRIPTION("Bluetooth driver for the Anycom BlueCard (LSE039/LSE041)");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -396,7 +396,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset) ...@@ -396,7 +396,7 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
if (info->rx_skb == NULL) { if (info->rx_skb == NULL) {
info->rx_state = RECV_WAIT_PACKET_TYPE; info->rx_state = RECV_WAIT_PACKET_TYPE;
info->rx_count = 0; info->rx_count = 0;
if (!(info->rx_skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) { if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n"); printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n");
return; return;
} }
...@@ -571,7 +571,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud) ...@@ -571,7 +571,7 @@ static int bluecard_hci_set_baud_rate(struct hci_dev *hdev, int baud)
/* Ericsson baud rate command */ /* Ericsson baud rate command */
unsigned char cmd[] = { HCI_COMMAND_PKT, 0x09, 0xfc, 0x01, 0x03 }; unsigned char cmd[] = { HCI_COMMAND_PKT, 0x09, 0xfc, 0x01, 0x03 };
if (!(skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) { if (!(skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n"); printk(KERN_WARNING "bluecard_cs: Can't allocate mem for new packet.\n");
return -1; return -1;
} }
......
...@@ -72,7 +72,7 @@ MODULE_PARM(irq_mask, "i"); ...@@ -72,7 +72,7 @@ MODULE_PARM(irq_mask, "i");
MODULE_PARM(irq_list, "1-4i"); MODULE_PARM(irq_list, "1-4i");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>, Jose Orlando Pereira <jop@di.uminho.pt>"); MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>, Jose Orlando Pereira <jop@di.uminho.pt>");
MODULE_DESCRIPTION("BlueZ driver for the 3Com Bluetooth PCMCIA card"); MODULE_DESCRIPTION("Bluetooth driver for the 3Com Bluetooth PCMCIA card");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -264,7 +264,7 @@ static void bt3c_receive(bt3c_info_t *info) ...@@ -264,7 +264,7 @@ static void bt3c_receive(bt3c_info_t *info)
if (info->rx_skb == NULL) { if (info->rx_skb == NULL) {
info->rx_state = RECV_WAIT_PACKET_TYPE; info->rx_state = RECV_WAIT_PACKET_TYPE;
info->rx_count = 0; info->rx_count = 0;
if (!(info->rx_skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) { if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "bt3c_cs: Can't allocate mem for new packet.\n"); printk(KERN_WARNING "bt3c_cs: Can't allocate mem for new packet.\n");
return; return;
} }
......
...@@ -66,7 +66,7 @@ MODULE_PARM(irq_mask, "i"); ...@@ -66,7 +66,7 @@ MODULE_PARM(irq_mask, "i");
MODULE_PARM(irq_list, "1-4i"); MODULE_PARM(irq_list, "1-4i");
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("BlueZ driver for Nokia Connectivity Card DTL-1"); MODULE_DESCRIPTION("Bluetooth driver for Nokia Connectivity Card DTL-1");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -238,7 +238,7 @@ static void dtl1_receive(dtl1_info_t *info) ...@@ -238,7 +238,7 @@ static void dtl1_receive(dtl1_info_t *info)
/* Allocate packet */ /* Allocate packet */
if (info->rx_skb == NULL) if (info->rx_skb == NULL)
if (!(info->rx_skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) { if (!(info->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
printk(KERN_WARNING "dtl1_cs: Can't allocate mem for new packet.\n"); printk(KERN_WARNING "dtl1_cs: Can't allocate mem for new packet.\n");
info->rx_state = RECV_WAIT_NSH; info->rx_state = RECV_WAIT_NSH;
info->rx_count = NSHL; info->rx_count = NSHL;
...@@ -433,7 +433,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb) ...@@ -433,7 +433,7 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
nsh.zero = 0; nsh.zero = 0;
nsh.len = skb->len; nsh.len = skb->len;
s = bluez_skb_alloc(NSHL + skb->len + 1, GFP_ATOMIC); s = bt_skb_alloc(NSHL + skb->len + 1, GFP_ATOMIC);
skb_reserve(s, NSHL); skb_reserve(s, NSHL);
memcpy(skb_put(s, skb->len), skb->data, skb->len); memcpy(skb_put(s, skb->len), skb->data, skb->len);
if (skb->len & 0x0001) if (skb->len & 0x0001)
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
#include "hci_uart.h" #include "hci_uart.h"
#include "hci_bcsp.h" #include "hci_bcsp.h"
#ifndef HCI_UART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP #undef BT_DMP
...@@ -176,7 +176,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, ...@@ -176,7 +176,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
u8 hdr[4], chan; u8 hdr[4], chan;
int rel, i; int rel, i;
#ifdef CONFIG_BLUEZ_HCIUART_BCSP_TXCRC #ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
u16 BCSP_CRC_INIT(bcsp_txmsg_crc); u16 BCSP_CRC_INIT(bcsp_txmsg_crc);
#endif #endif
...@@ -228,7 +228,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, ...@@ -228,7 +228,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq); BT_DBG("Sending packet with seqno %u", bcsp->msgq_txseq);
bcsp->msgq_txseq = ++(bcsp->msgq_txseq) & 0x07; bcsp->msgq_txseq = ++(bcsp->msgq_txseq) & 0x07;
} }
#ifdef CONFIG_BLUEZ_HCIUART_BCSP_TXCRC #ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
hdr[0] |= 0x40; hdr[0] |= 0x40;
#endif #endif
...@@ -240,7 +240,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, ...@@ -240,7 +240,7 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
/* Put BCSP header */ /* Put BCSP header */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
bcsp_slip_one_byte(nskb, hdr[i]); bcsp_slip_one_byte(nskb, hdr[i]);
#ifdef CONFIG_BLUEZ_HCIUART_BCSP_TXCRC #ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
bcsp_crc_update(&bcsp_txmsg_crc, hdr[i]); bcsp_crc_update(&bcsp_txmsg_crc, hdr[i]);
#endif #endif
} }
...@@ -248,12 +248,12 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data, ...@@ -248,12 +248,12 @@ static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
/* Put payload */ /* Put payload */
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
bcsp_slip_one_byte(nskb, data[i]); bcsp_slip_one_byte(nskb, data[i]);
#ifdef CONFIG_BLUEZ_HCIUART_BCSP_TXCRC #ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
bcsp_crc_update(&bcsp_txmsg_crc, data[i]); bcsp_crc_update(&bcsp_txmsg_crc, data[i]);
#endif #endif
} }
#ifdef CONFIG_BLUEZ_HCIUART_BCSP_TXCRC #ifdef CONFIG_BT_HCIUART_BCSP_TXCRC
/* Put CRC */ /* Put CRC */
bcsp_txmsg_crc = bcsp_crc_reverse(bcsp_txmsg_crc); bcsp_txmsg_crc = bcsp_crc_reverse(bcsp_txmsg_crc);
bcsp_slip_one_byte(nskb, (u8) ((bcsp_txmsg_crc >> 8) & 0x00ff)); bcsp_slip_one_byte(nskb, (u8) ((bcsp_txmsg_crc >> 8) & 0x00ff));
...@@ -611,7 +611,7 @@ static int bcsp_recv(struct hci_uart *hu, void *data, int count) ...@@ -611,7 +611,7 @@ static int bcsp_recv(struct hci_uart *hu, void *data, int count)
* Allocate packet. Max len of a BCSP pkt= * Allocate packet. Max len of a BCSP pkt=
* 0xFFF (payload) +4 (header) +2 (crc) */ * 0xFFF (payload) +4 (header) +2 (crc) */
bcsp->rx_skb = bluez_skb_alloc(0x1005, GFP_ATOMIC); bcsp->rx_skb = bt_skb_alloc(0x1005, GFP_ATOMIC);
if (!bcsp->rx_skb) { if (!bcsp->rx_skb) {
BT_ERR("Can't allocate mem for new packet"); BT_ERR("Can't allocate mem for new packet");
bcsp->rx_state = BCSP_W4_PKT_DELIMITER; bcsp->rx_state = BCSP_W4_PKT_DELIMITER;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI UART(H4) protocol. * Bluetooth HCI UART(H4) protocol.
* *
* $Id: hci_h4.c,v 1.3 2002/09/09 01:17:32 maxk Exp $ * $Id: hci_h4.c,v 1.3 2002/09/09 01:17:32 maxk Exp $
*/ */
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include "hci_uart.h" #include "hci_uart.h"
#include "hci_h4.h" #include "hci_h4.h"
#ifndef HCI_UART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP #undef BT_DMP
...@@ -238,7 +238,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) ...@@ -238,7 +238,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
ptr++; count--; ptr++; count--;
/* Allocate packet */ /* Allocate packet */
h4->rx_skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC); h4->rx_skb = bt_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC);
if (!h4->rx_skb) { if (!h4->rx_skb) {
BT_ERR("Can't allocate mem for new packet"); BT_ERR("Can't allocate mem for new packet");
h4->rx_state = H4_W4_PACKET_TYPE; h4->rx_state = H4_W4_PACKET_TYPE;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI UART driver. * Bluetooth HCI UART driver.
* *
* $Id: hci_ldisc.c,v 1.5 2002/10/02 18:37:20 maxk Exp $ * $Id: hci_ldisc.c,v 1.5 2002/10/02 18:37:20 maxk Exp $
*/ */
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#include "hci_uart.h" #include "hci_uart.h"
#ifndef HCI_UART_DEBUG #ifndef CONFIG_BT_HCIUART_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP #undef BT_DMP
...@@ -507,11 +507,11 @@ static unsigned int hci_uart_tty_poll(struct tty_struct *tty, struct file *filp, ...@@ -507,11 +507,11 @@ static unsigned int hci_uart_tty_poll(struct tty_struct *tty, struct file *filp,
return 0; return 0;
} }
#ifdef CONFIG_BLUEZ_HCIUART_H4 #ifdef CONFIG_BT_HCIUART_H4
int h4_init(void); int h4_init(void);
int h4_deinit(void); int h4_deinit(void);
#endif #endif
#ifdef CONFIG_BLUEZ_HCIUART_BCSP #ifdef CONFIG_BT_HCIUART_BCSP
int bcsp_init(void); int bcsp_init(void);
int bcsp_deinit(void); int bcsp_deinit(void);
#endif #endif
...@@ -521,7 +521,7 @@ int __init hci_uart_init(void) ...@@ -521,7 +521,7 @@ int __init hci_uart_init(void)
static struct tty_ldisc hci_uart_ldisc; static struct tty_ldisc hci_uart_ldisc;
int err; int err;
BT_INFO("BlueZ HCI UART driver ver %s Copyright (C) 2000,2001 Qualcomm Inc", BT_INFO("Bluetooth HCI UART driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION); VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
...@@ -545,10 +545,10 @@ int __init hci_uart_init(void) ...@@ -545,10 +545,10 @@ int __init hci_uart_init(void)
return err; return err;
} }
#ifdef CONFIG_BLUEZ_HCIUART_H4 #ifdef CONFIG_BT_HCIUART_H4
h4_init(); h4_init();
#endif #endif
#ifdef CONFIG_BLUEZ_HCIUART_BCSP #ifdef CONFIG_BT_HCIUART_BCSP
bcsp_init(); bcsp_init();
#endif #endif
...@@ -559,10 +559,10 @@ void hci_uart_cleanup(void) ...@@ -559,10 +559,10 @@ void hci_uart_cleanup(void)
{ {
int err; int err;
#ifdef CONFIG_BLUEZ_HCIUART_H4 #ifdef CONFIG_BT_HCIUART_H4
h4_deinit(); h4_deinit();
#endif #endif
#ifdef CONFIG_BLUEZ_HCIUART_BCSP #ifdef CONFIG_BT_HCIUART_BCSP
bcsp_deinit(); bcsp_deinit();
#endif #endif
...@@ -575,5 +575,5 @@ module_init(hci_uart_init); ...@@ -575,5 +575,5 @@ module_init(hci_uart_init);
module_exit(hci_uart_cleanup); module_exit(hci_uart_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ HCI UART driver ver " VERSION); MODULE_DESCRIPTION("Bluetooth HCI UART driver ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI USB driver. * Bluetooth HCI USB driver.
* Based on original USB Bluetooth driver for Linux kernel * Based on original USB Bluetooth driver for Linux kernel
* Copyright (c) 2000 Greg Kroah-Hartman <greg@kroah.com> * Copyright (c) 2000 Greg Kroah-Hartman <greg@kroah.com>
* Copyright (c) 2000 Mark Douglas Corner <mcorner@umich.edu> * Copyright (c) 2000 Mark Douglas Corner <mcorner@umich.edu>
...@@ -59,14 +59,14 @@ ...@@ -59,14 +59,14 @@
#define HCI_MAX_PENDING (HCI_MAX_BULK_RX + HCI_MAX_BULK_TX + 1) #define HCI_MAX_PENDING (HCI_MAX_BULK_RX + HCI_MAX_BULK_TX + 1)
#ifndef HCI_USB_DEBUG #ifndef CONFIG_BT_HCIUSB_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#undef BT_DMP #undef BT_DMP
#define BT_DMP( A... ) #define BT_DMP( A... )
#endif #endif
#ifndef CONFIG_BLUEZ_USB_ZERO_PACKET #ifndef CONFIG_BT_USB_ZERO_PACKET
#undef USB_ZERO_PACKET #undef USB_ZERO_PACKET
#define USB_ZERO_PACKET 0 #define USB_ZERO_PACKET 0
#endif #endif
...@@ -167,7 +167,7 @@ static int hci_usb_rx_submit(struct hci_usb *husb, struct urb *urb) ...@@ -167,7 +167,7 @@ static int hci_usb_rx_submit(struct hci_usb *husb, struct urb *urb)
size = HCI_MAX_FRAME_SIZE; size = HCI_MAX_FRAME_SIZE;
if (!(skb = bluez_skb_alloc(size, GFP_ATOMIC))) { if (!(skb = bt_skb_alloc(size, GFP_ATOMIC))) {
usb_free_urb(urb); usb_free_urb(urb);
return -ENOMEM; return -ENOMEM;
} }
...@@ -465,7 +465,7 @@ static void hci_usb_interrupt(struct urb *urb) ...@@ -465,7 +465,7 @@ static void hci_usb_interrupt(struct urb *urb)
if (count > len) if (count > len)
goto bad_len; goto bad_len;
skb = bluez_skb_alloc(len, GFP_ATOMIC); skb = bt_skb_alloc(len, GFP_ATOMIC);
if (!skb) { if (!skb) {
BT_ERR("%s no memory for event packet", husb->hdev.name); BT_ERR("%s no memory for event packet", husb->hdev.name);
goto done; goto done;
...@@ -569,7 +569,7 @@ static void hci_usb_rx_complete(struct urb *urb) ...@@ -569,7 +569,7 @@ static void hci_usb_rx_complete(struct urb *urb)
if (count != size) { if (count != size) {
BT_ERR("%s corrupted ACL packet: count %d, dlen %d", BT_ERR("%s corrupted ACL packet: count %d, dlen %d",
husb->hdev.name, count, dlen); husb->hdev.name, count, dlen);
bluez_dump("hci_usb", skb->data, count); bt_dump("hci_usb", skb->data, count);
husb->hdev.stat.err_rx++; husb->hdev.stat.err_rx++;
goto resubmit; goto resubmit;
} }
...@@ -781,7 +781,7 @@ int hci_usb_init(void) ...@@ -781,7 +781,7 @@ int hci_usb_init(void)
{ {
int err; int err;
BT_INFO("BlueZ HCI USB driver ver %s Copyright (C) 2000,2001 Qualcomm Inc", BT_INFO("Bluetooth HCI USB driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION); VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
...@@ -800,5 +800,5 @@ module_init(hci_usb_init); ...@@ -800,5 +800,5 @@ module_init(hci_usb_init);
module_exit(hci_usb_cleanup); module_exit(hci_usb_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ HCI USB driver ver " VERSION); MODULE_DESCRIPTION("Bluetooth HCI USB driver ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI virtual device driver. * Bluetooth HCI virtual device driver.
* *
* $Id: hci_vhci.c,v 1.3 2002/04/17 17:37:20 maxk Exp $ * $Id: hci_vhci.c,v 1.3 2002/04/17 17:37:20 maxk Exp $
*/ */
...@@ -136,7 +136,7 @@ static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const ...@@ -136,7 +136,7 @@ static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const
if (count > HCI_MAX_FRAME_SIZE) if (count > HCI_MAX_FRAME_SIZE)
return -EINVAL; return -EINVAL;
if (!(skb = bluez_skb_alloc(count, GFP_KERNEL))) if (!(skb = bt_skb_alloc(count, GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
if (copy_from_user(skb_put(skb, count), buf, count)) { if (copy_from_user(skb_put(skb, count), buf, count)) {
...@@ -331,7 +331,7 @@ static struct miscdevice hci_vhci_miscdev= ...@@ -331,7 +331,7 @@ static struct miscdevice hci_vhci_miscdev=
int __init hci_vhci_init(void) int __init hci_vhci_init(void)
{ {
BT_INFO("BlueZ VHCI driver ver %s Copyright (C) 2000,2001 Qualcomm Inc", BT_INFO("Bluetooth VHCI driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION); VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
...@@ -352,5 +352,5 @@ module_init(hci_vhci_init); ...@@ -352,5 +352,5 @@ module_init(hci_vhci_init);
module_exit(hci_vhci_cleanup); module_exit(hci_vhci_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ VHCI driver ver " VERSION); MODULE_DESCRIPTION("Bluetooth VHCI driver ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#endif #endif
/* Reserv for core and drivers use */ /* Reserv for core and drivers use */
#define BLUEZ_SKB_RESERVE 8 #define BT_SKB_RESERVE 8
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b))
...@@ -57,29 +57,12 @@ ...@@ -57,29 +57,12 @@
#define SOL_SCO 17 #define SOL_SCO 17
#define SOL_RFCOMM 18 #define SOL_RFCOMM 18
/* Debugging */
#ifdef CONFIG_BLUEZ_DEBUG
#define HCI_CORE_DEBUG 1
#define HCI_SOCK_DEBUG 1
#define HCI_UART_DEBUG 1
#define HCI_USB_DEBUG 1
//#define HCI_DATA_DUMP 1
#define L2CAP_DEBUG 1
#define SCO_DEBUG 1
#define AF_BLUETOOTH_DEBUG 1
#endif /* CONFIG_BLUEZ_DEBUG */
extern void bluez_dump(char *pref, __u8 *buf, int count);
#define BT_INFO(fmt, arg...) printk(KERN_INFO fmt "\n" , ## arg) #define BT_INFO(fmt, arg...) printk(KERN_INFO fmt "\n" , ## arg)
#define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) #define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg)
#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg)
#ifdef HCI_DATA_DUMP #ifdef HCI_DATA_DUMP
#define BT_DMP(buf, len) bluez_dump(__FUNCTION__, buf, len) #define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len)
#else #else
#define BT_DMP(D...) #define BT_DMP(D...)
#endif #endif
...@@ -127,9 +110,9 @@ bdaddr_t *strtoba(char *str); ...@@ -127,9 +110,9 @@ bdaddr_t *strtoba(char *str);
/* Common socket structures and functions */ /* Common socket structures and functions */
#define bluez_sk(__sk) ((struct bluez_sock *) __sk) #define bt_sk(__sk) ((struct bt_sock *) __sk)
struct bluez_sock { struct bt_sock {
struct sock sk; struct sock sk;
bdaddr_t src; bdaddr_t src;
bdaddr_t dst; bdaddr_t dst;
...@@ -137,48 +120,48 @@ struct bluez_sock { ...@@ -137,48 +120,48 @@ struct bluez_sock {
struct sock *parent; struct sock *parent;
}; };
struct bluez_sock_list { struct bt_sock_list {
struct sock *head; struct sock *head;
rwlock_t lock; rwlock_t lock;
}; };
int bluez_sock_register(int proto, struct net_proto_family *ops); int bt_sock_register(int proto, struct net_proto_family *ops);
int bluez_sock_unregister(int proto); int bt_sock_unregister(int proto);
struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int prio); struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio);
void bluez_sock_link(struct bluez_sock_list *l, struct sock *s); void bt_sock_link(struct bt_sock_list *l, struct sock *s);
void bluez_sock_unlink(struct bluez_sock_list *l, struct sock *s); void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
int bluez_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len, int flags, struct scm_cookie *scm); int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, int len, int flags, struct scm_cookie *scm);
uint bluez_sock_poll(struct file * file, struct socket *sock, poll_table *wait); uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
int bluez_sock_w4_connect(struct sock *sk, int flags); int bt_sock_w4_connect(struct sock *sk, int flags);
void bluez_accept_enqueue(struct sock *parent, struct sock *sk); void bt_accept_enqueue(struct sock *parent, struct sock *sk);
struct sock *bluez_accept_dequeue(struct sock *parent, struct socket *newsock); struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock);
/* Skb helpers */ /* Skb helpers */
struct bluez_skb_cb { struct bt_skb_cb {
int incomming; int incoming;
}; };
#define bluez_cb(skb) ((struct bluez_skb_cb *)(skb->cb)) #define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb))
static inline struct sk_buff *bluez_skb_alloc(unsigned int len, int how) static inline struct sk_buff *bt_skb_alloc(unsigned int len, int how)
{ {
struct sk_buff *skb; struct sk_buff *skb;
if ((skb = alloc_skb(len + BLUEZ_SKB_RESERVE, how))) { if ((skb = alloc_skb(len + BT_SKB_RESERVE, how))) {
skb_reserve(skb, BLUEZ_SKB_RESERVE); skb_reserve(skb, BT_SKB_RESERVE);
bluez_cb(skb)->incomming = 0; bt_cb(skb)->incoming = 0;
} }
return skb; return skb;
} }
static inline struct sk_buff *bluez_skb_send_alloc(struct sock *sk, unsigned long len, static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long len,
int nb, int *err) int nb, int *err)
{ {
struct sk_buff *skb; struct sk_buff *skb;
if ((skb = sock_alloc_send_skb(sk, len + BLUEZ_SKB_RESERVE, nb, err))) { if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) {
skb_reserve(skb, BLUEZ_SKB_RESERVE); skb_reserve(skb, BT_SKB_RESERVE);
bluez_cb(skb)->incomming = 0; bt_cb(skb)->incoming = 0;
} }
return skb; return skb;
...@@ -193,11 +176,8 @@ static inline int skb_frags_no(struct sk_buff *skb) ...@@ -193,11 +176,8 @@ static inline int skb_frags_no(struct sk_buff *skb)
return n; return n;
} }
int hci_core_init(void); void bt_dump(char *pref, __u8 *buf, int count);
int hci_core_cleanup(void);
int hci_sock_init(void);
int hci_sock_cleanup(void);
int bterr(__u16 code); int bt_err(__u16 code);
#endif /* __BLUETOOTH_H */ #endif /* __BLUETOOTH_H */
...@@ -582,7 +582,7 @@ typedef struct { ...@@ -582,7 +582,7 @@ typedef struct {
} __attribute__ ((packed)) evt_read_remote_version_complete; } __attribute__ ((packed)) evt_read_remote_version_complete;
#define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8 #define EVT_READ_REMOTE_VERSION_COMPLETE_SIZE 8
/* Internal events generated by BlueZ stack */ /* Internal events generated by Bluetooth stack */
#define EVT_STACK_INTERNAL 0xfd #define EVT_STACK_INTERNAL 0xfd
typedef struct { typedef struct {
__u16 type; __u16 type;
......
...@@ -27,7 +27,7 @@ obj-$(CONFIG_NETROM) += netrom/ ...@@ -27,7 +27,7 @@ obj-$(CONFIG_NETROM) += netrom/
obj-$(CONFIG_ROSE) += rose/ obj-$(CONFIG_ROSE) += rose/
obj-$(CONFIG_AX25) += ax25/ obj-$(CONFIG_AX25) += ax25/
obj-$(CONFIG_IRDA) += irda/ obj-$(CONFIG_IRDA) += irda/
obj-$(CONFIG_BLUEZ) += bluetooth/ obj-$(CONFIG_BT) += bluetooth/
obj-$(CONFIG_SUNRPC) += sunrpc/ obj-$(CONFIG_SUNRPC) += sunrpc/
obj-$(CONFIG_ATM) += atm/ obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_DECNET) += decnet/ obj-$(CONFIG_DECNET) += decnet/
......
Bluetooth subsystem support Bluetooth subsystem support
CONFIG_BLUEZ CONFIG_BT
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
...@@ -25,7 +25,7 @@ CONFIG_BLUEZ ...@@ -25,7 +25,7 @@ CONFIG_BLUEZ
If you want to compile Bluetooth Core as module (bluetooth.o) say M here. If you want to compile Bluetooth Core as module (bluetooth.o) say M here.
L2CAP protocol support L2CAP protocol support
CONFIG_BLUEZ_L2CAP CONFIG_BT_L2CAP
L2CAP (Logical Link Control and Adaptation Protocol) provides L2CAP (Logical Link Control and Adaptation Protocol) provides
connection oriented and connection-less data transport. L2CAP connection oriented and connection-less data transport. L2CAP
support is required for most Bluetooth applications. support is required for most Bluetooth applications.
...@@ -34,7 +34,7 @@ CONFIG_BLUEZ_L2CAP ...@@ -34,7 +34,7 @@ CONFIG_BLUEZ_L2CAP
compile it as module (l2cap.o). compile it as module (l2cap.o).
SCO links support SCO links support
CONFIG_BLUEZ_SCO CONFIG_BT_SCO
SCO link provides voice transport over Bluetooth. SCO support is SCO link provides voice transport over Bluetooth. SCO support is
required for voice applications like Headset and Audio. required for voice applications like Headset and Audio.
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
export-objs := syms.o export-objs := syms.o
obj-$(CONFIG_BLUEZ) += bluetooth.o obj-$(CONFIG_BT) += bluetooth.o
obj-$(CONFIG_BLUEZ_L2CAP) += l2cap.o obj-$(CONFIG_BT_L2CAP) += l2cap.o
obj-$(CONFIG_BLUEZ_SCO) += sco.o obj-$(CONFIG_BT_SCO) += sco.o
obj-$(CONFIG_BLUEZ_RFCOMM) += rfcomm/ obj-$(CONFIG_BT_RFCOMM) += rfcomm/
obj-$(CONFIG_BLUEZ_BNEP) += bnep/ obj-$(CONFIG_BT_BNEP) += bnep/
bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o lib.o syms.o bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o lib.o syms.o
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ Bluetooth address family and sockets. * Bluetooth address family and sockets.
* *
* $Id: af_bluetooth.c,v 1.3 2002/04/17 17:37:15 maxk Exp $ * $Id: af_bluetooth.c,v 1.3 2002/04/17 17:37:15 maxk Exp $
*/ */
...@@ -51,66 +51,66 @@ ...@@ -51,66 +51,66 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#ifndef AF_BLUETOOTH_DEBUG #ifndef CONFIG_BT_SOCK_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
/* Bluetooth sockets */ /* Bluetooth sockets */
#define BLUEZ_MAX_PROTO 5 #define BT_MAX_PROTO 5
static struct net_proto_family *bluez_proto[BLUEZ_MAX_PROTO]; static struct net_proto_family *bt_proto[BT_MAX_PROTO];
static kmem_cache_t *bluez_sock_cache; static kmem_cache_t *bt_sock_cache;
int bluez_sock_register(int proto, struct net_proto_family *ops) int bt_sock_register(int proto, struct net_proto_family *ops)
{ {
if (proto >= BLUEZ_MAX_PROTO) if (proto >= BT_MAX_PROTO)
return -EINVAL; return -EINVAL;
if (bluez_proto[proto]) if (bt_proto[proto])
return -EEXIST; return -EEXIST;
bluez_proto[proto] = ops; bt_proto[proto] = ops;
return 0; return 0;
} }
int bluez_sock_unregister(int proto) int bt_sock_unregister(int proto)
{ {
if (proto >= BLUEZ_MAX_PROTO) if (proto >= BT_MAX_PROTO)
return -EINVAL; return -EINVAL;
if (!bluez_proto[proto]) if (!bt_proto[proto])
return -ENOENT; return -ENOENT;
bluez_proto[proto] = NULL; bt_proto[proto] = NULL;
return 0; return 0;
} }
static int bluez_sock_create(struct socket *sock, int proto) static int bt_sock_create(struct socket *sock, int proto)
{ {
if (proto > BLUEZ_MAX_PROTO) if (proto > BT_MAX_PROTO)
return -EINVAL; return -EINVAL;
#if defined(CONFIG_KMOD) #if defined(CONFIG_KMOD)
if (!bluez_proto[proto]) { if (!bt_proto[proto]) {
char module_name[30]; char module_name[30];
sprintf(module_name, "bt-proto-%d", proto); sprintf(module_name, "bt-proto-%d", proto);
request_module(module_name); request_module(module_name);
} }
#endif #endif
if (!bluez_proto[proto]) if (!bt_proto[proto])
return -ENOENT; return -ENOENT;
return bluez_proto[proto]->create(sock, proto); return bt_proto[proto]->create(sock, proto);
} }
struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int prio) struct sock *bt_sock_alloc(struct socket *sock, int proto, int pi_size, int prio)
{ {
struct sock *sk; struct sock *sk;
void *pi; void *pi;
sk = sk_alloc(PF_BLUETOOTH, prio, sizeof(struct bluez_sock), bluez_sock_cache); sk = sk_alloc(PF_BLUETOOTH, prio, sizeof(struct bt_sock), bt_sock_cache);
if (!sk) if (!sk)
return NULL; return NULL;
...@@ -125,7 +125,7 @@ struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int p ...@@ -125,7 +125,7 @@ struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int p
} }
sock_init_data(sock, sk); sock_init_data(sock, sk);
INIT_LIST_HEAD(&bluez_sk(sk)->accept_q); INIT_LIST_HEAD(&bt_sk(sk)->accept_q);
sk->zapped = 0; sk->zapped = 0;
sk->protocol = proto; sk->protocol = proto;
...@@ -134,7 +134,7 @@ struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int p ...@@ -134,7 +134,7 @@ struct sock *bluez_sock_alloc(struct socket *sock, int proto, int pi_size, int p
return sk; return sk;
} }
void bluez_sock_link(struct bluez_sock_list *l, struct sock *sk) void bt_sock_link(struct bt_sock_list *l, struct sock *sk)
{ {
write_lock_bh(&l->lock); write_lock_bh(&l->lock);
sk->next = l->head; sk->next = l->head;
...@@ -143,7 +143,7 @@ void bluez_sock_link(struct bluez_sock_list *l, struct sock *sk) ...@@ -143,7 +143,7 @@ void bluez_sock_link(struct bluez_sock_list *l, struct sock *sk)
write_unlock_bh(&l->lock); write_unlock_bh(&l->lock);
} }
void bluez_sock_unlink(struct bluez_sock_list *l, struct sock *sk) void bt_sock_unlink(struct bt_sock_list *l, struct sock *sk)
{ {
struct sock **skp; struct sock **skp;
...@@ -158,45 +158,45 @@ void bluez_sock_unlink(struct bluez_sock_list *l, struct sock *sk) ...@@ -158,45 +158,45 @@ void bluez_sock_unlink(struct bluez_sock_list *l, struct sock *sk)
write_unlock_bh(&l->lock); write_unlock_bh(&l->lock);
} }
void bluez_accept_enqueue(struct sock *parent, struct sock *sk) void bt_accept_enqueue(struct sock *parent, struct sock *sk)
{ {
BT_DBG("parent %p, sk %p", parent, sk); BT_DBG("parent %p, sk %p", parent, sk);
sock_hold(sk); sock_hold(sk);
list_add_tail(&bluez_sk(sk)->accept_q, &bluez_sk(parent)->accept_q); list_add_tail(&bt_sk(sk)->accept_q, &bt_sk(parent)->accept_q);
bluez_sk(sk)->parent = parent; bt_sk(sk)->parent = parent;
parent->ack_backlog++; parent->ack_backlog++;
} }
static void bluez_accept_unlink(struct sock *sk) static void bt_accept_unlink(struct sock *sk)
{ {
BT_DBG("sk %p state %d", sk, sk->state); BT_DBG("sk %p state %d", sk, sk->state);
list_del_init(&bluez_sk(sk)->accept_q); list_del_init(&bt_sk(sk)->accept_q);
bluez_sk(sk)->parent->ack_backlog--; bt_sk(sk)->parent->ack_backlog--;
bluez_sk(sk)->parent = NULL; bt_sk(sk)->parent = NULL;
sock_put(sk); sock_put(sk);
} }
struct sock *bluez_accept_dequeue(struct sock *parent, struct socket *newsock) struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
{ {
struct list_head *p, *n; struct list_head *p, *n;
struct sock *sk; struct sock *sk;
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
list_for_each_safe(p, n, &bluez_sk(parent)->accept_q) { list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
sk = (struct sock *) list_entry(p, struct bluez_sock, accept_q); sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
lock_sock(sk); lock_sock(sk);
if (sk->state == BT_CLOSED) { if (sk->state == BT_CLOSED) {
release_sock(sk); release_sock(sk);
bluez_accept_unlink(sk); bt_accept_unlink(sk);
continue; continue;
} }
if (sk->state == BT_CONNECTED || !newsock) { if (sk->state == BT_CONNECTED || !newsock) {
bluez_accept_unlink(sk); bt_accept_unlink(sk);
if (newsock) if (newsock)
sock_graft(sk, newsock); sock_graft(sk, newsock);
release_sock(sk); release_sock(sk);
...@@ -207,7 +207,7 @@ struct sock *bluez_accept_dequeue(struct sock *parent, struct socket *newsock) ...@@ -207,7 +207,7 @@ struct sock *bluez_accept_dequeue(struct sock *parent, struct socket *newsock)
return NULL; return NULL;
} }
int bluez_sock_recvmsg(struct kiocb *iocb, struct socket *sock, int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
struct msghdr *msg, int len, int flags, struct scm_cookie *scm) struct msghdr *msg, int len, int flags, struct scm_cookie *scm)
{ {
int noblock = flags & MSG_DONTWAIT; int noblock = flags & MSG_DONTWAIT;
...@@ -242,7 +242,7 @@ int bluez_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -242,7 +242,7 @@ int bluez_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
return err ? : copied; return err ? : copied;
} }
unsigned int bluez_sock_poll(struct file * file, struct socket *sock, poll_table *wait) unsigned int bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
unsigned int mask; unsigned int mask;
...@@ -259,7 +259,7 @@ unsigned int bluez_sock_poll(struct file * file, struct socket *sock, poll_table ...@@ -259,7 +259,7 @@ unsigned int bluez_sock_poll(struct file * file, struct socket *sock, poll_table
mask |= POLLHUP; mask |= POLLHUP;
if (!skb_queue_empty(&sk->receive_queue) || if (!skb_queue_empty(&sk->receive_queue) ||
!list_empty(&bluez_sk(sk)->accept_q) || !list_empty(&bt_sk(sk)->accept_q) ||
(sk->shutdown & RCV_SHUTDOWN)) (sk->shutdown & RCV_SHUTDOWN))
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
...@@ -277,7 +277,7 @@ unsigned int bluez_sock_poll(struct file * file, struct socket *sock, poll_table ...@@ -277,7 +277,7 @@ unsigned int bluez_sock_poll(struct file * file, struct socket *sock, poll_table
return mask; return mask;
} }
int bluez_sock_w4_connect(struct sock *sk, int flags) int bt_sock_w4_connect(struct sock *sk, int flags)
{ {
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
long timeo = sock_sndtimeo(sk, flags & O_NONBLOCK); long timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);
...@@ -316,50 +316,51 @@ int bluez_sock_w4_connect(struct sock *sk, int flags) ...@@ -316,50 +316,51 @@ int bluez_sock_w4_connect(struct sock *sk, int flags)
return err; return err;
} }
struct net_proto_family bluez_sock_family_ops = struct net_proto_family bt_sock_family_ops =
{ {
PF_BLUETOOTH, bluez_sock_create PF_BLUETOOTH, bt_sock_create
}; };
static int __init bluez_init(void) extern int hci_sock_init(void);
extern int hci_sock_cleanup(void);
static int __init bt_init(void)
{ {
BT_INFO("BlueZ Core ver %s Copyright (C) 2000,2001 Qualcomm Inc", BT_INFO("Bluetooth Core ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION); VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
proc_mkdir("bluetooth", NULL); proc_mkdir("bluetooth", NULL);
/* Init socket cache */ /* Init socket cache */
bluez_sock_cache = kmem_cache_create("bluez_sock", bt_sock_cache = kmem_cache_create("bt_sock",
sizeof(struct bluez_sock), 0, sizeof(struct bt_sock), 0,
SLAB_HWCACHE_ALIGN, 0, 0); SLAB_HWCACHE_ALIGN, 0, 0);
if (!bluez_sock_cache) { if (!bt_sock_cache) {
BT_ERR("BlueZ socket cache creation failed"); BT_ERR("Bluetooth socket cache creation failed");
return -ENOMEM; return -ENOMEM;
} }
sock_register(&bluez_sock_family_ops); sock_register(&bt_sock_family_ops);
hci_core_init();
hci_sock_init(); hci_sock_init();
return 0; return 0;
} }
static void __exit bluez_cleanup(void) static void __exit bt_cleanup(void)
{ {
hci_sock_cleanup(); hci_sock_cleanup();
hci_core_cleanup();
sock_unregister(PF_BLUETOOTH); sock_unregister(PF_BLUETOOTH);
kmem_cache_destroy(bluez_sock_cache); kmem_cache_destroy(bt_sock_cache);
remove_proc_entry("bluetooth", NULL); remove_proc_entry("bluetooth", NULL);
} }
subsys_initcall(bluez_init); subsys_initcall(bt_init);
module_exit(bluez_cleanup); module_exit(bt_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ Core ver " VERSION); MODULE_DESCRIPTION("Bluetooth Core ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
BNEP protocol support BNEP protocol support
CONFIG_BLUEZ_BNEP CONFIG_BT_BNEP
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).
...@@ -12,10 +12,10 @@ CONFIG_BLUEZ_BNEP ...@@ -12,10 +12,10 @@ CONFIG_BLUEZ_BNEP
compile it as module (bnep.o). compile it as module (bnep.o).
BNEP multicast filter support BNEP multicast filter support
CONFIG_BLUEZ_BNEP_MC_FILTER CONFIG_BT_BNEP_MC_FILTER
This option enables the multicast filter support for BNEP. This option enables the multicast filter support for BNEP.
BNEP protocol filter support BNEP protocol filter support
CONFIG_BLUEZ_BNEP_PROTO_FILTER CONFIG_BT_BNEP_PROTO_FILTER
This option enables the protocol filter support for BNEP. This option enables the protocol filter support for BNEP.
dep_tristate 'BNEP protocol support' CONFIG_BLUEZ_BNEP $CONFIG_BLUEZ_L2CAP dep_tristate 'BNEP protocol support' CONFIG_BT_BNEP $CONFIG_BT_L2CAP
if [ "$CONFIG_BLUEZ_BNEP" != "n" ]; then if [ "$CONFIG_BT_BNEP" != "n" ]; then
bool ' Multicast filter support' CONFIG_BLUEZ_BNEP_MC_FILTER bool ' Multicast filter support' CONFIG_BT_BNEP_MC_FILTER
bool ' Protocol filter support' CONFIG_BLUEZ_BNEP_PROTO_FILTER bool ' Protocol filter support' CONFIG_BT_BNEP_PROTO_FILTER
fi fi
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the Linux Bluetooth BNEP layer. # Makefile for the Linux Bluetooth BNEP layer.
# #
obj-$(CONFIG_BLUEZ_BNEP) += bnep.o obj-$(CONFIG_BT_BNEP) += bnep.o
bnep-objs := core.o sock.o netdev.o crc32.o bnep-objs := core.o sock.o netdev.o crc32.o
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
#include "bnep.h" #include "bnep.h"
#ifndef CONFIG_BLUEZ_BNEP_DEBUG #ifndef CONFIG_BT_BNEP_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG(D...) #define BT_DBG(D...)
#endif #endif
...@@ -144,7 +144,7 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, struct sk_buff *skb) ...@@ -144,7 +144,7 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, struct sk_buff *skb)
BT_DBG("filter len %d", n); BT_DBG("filter len %d", n);
#ifdef CONFIG_BLUEZ_BNEP_PROTO_FILTER #ifdef CONFIG_BT_BNEP_PROTO_FILTER
n /= 4; n /= 4;
if (n <= BNEP_MAX_PROTO_FILTERS) { if (n <= BNEP_MAX_PROTO_FILTERS) {
struct bnep_proto_filter *f = s->proto_filter; struct bnep_proto_filter *f = s->proto_filter;
...@@ -186,7 +186,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, struct sk_buff *skb) ...@@ -186,7 +186,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, struct sk_buff *skb)
BT_DBG("filter len %d", n); BT_DBG("filter len %d", n);
#ifdef CONFIG_BLUEZ_BNEP_MC_FILTER #ifdef CONFIG_BT_BNEP_MC_FILTER
n /= (ETH_ALEN * 2); n /= (ETH_ALEN * 2);
if (n > 0) { if (n > 0) {
...@@ -538,8 +538,8 @@ int bnep_add_connection(struct bnep_conadd_req *req, struct socket *sock) ...@@ -538,8 +538,8 @@ int bnep_add_connection(struct bnep_conadd_req *req, struct socket *sock)
BT_DBG(""); BT_DBG("");
baswap((void *) dst, &bluez_sk(sock->sk)->dst); baswap((void *) dst, &bt_sk(sock->sk)->dst);
baswap((void *) src, &bluez_sk(sock->sk)->src); baswap((void *) src, &bt_sk(sock->sk)->src);
s = kmalloc(sizeof(struct bnep_session), GFP_KERNEL); s = kmalloc(sizeof(struct bnep_session), GFP_KERNEL);
if (!s) if (!s)
...@@ -572,12 +572,12 @@ int bnep_add_connection(struct bnep_conadd_req *req, struct socket *sock) ...@@ -572,12 +572,12 @@ int bnep_add_connection(struct bnep_conadd_req *req, struct socket *sock)
s->msg.msg_flags = MSG_NOSIGNAL; s->msg.msg_flags = MSG_NOSIGNAL;
#ifdef CONFIG_BLUEZ_BNEP_MC_FILTER #ifdef CONFIG_BT_BNEP_MC_FILTER
/* Set default mc filter */ /* Set default mc filter */
set_bit(bnep_mc_hash(dev->broadcast), (ulong *) &s->mc_filter); set_bit(bnep_mc_hash(dev->broadcast), (ulong *) &s->mc_filter);
#endif #endif
#ifdef CONFIG_BLUEZ_BNEP_PROTO_FILTER #ifdef CONFIG_BT_BNEP_PROTO_FILTER
/* Set default protocol filter */ /* Set default protocol filter */
/* (IPv4, ARP) */ /* (IPv4, ARP) */
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
#include "bnep.h" #include "bnep.h"
#ifndef CONFIG_BLUEZ_BNEP_DEBUG #ifndef CONFIG_BT_BNEP_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
...@@ -73,7 +73,7 @@ static struct net_device_stats *bnep_net_get_stats(struct net_device *dev) ...@@ -73,7 +73,7 @@ static struct net_device_stats *bnep_net_get_stats(struct net_device *dev)
static void bnep_net_set_mc_list(struct net_device *dev) static void bnep_net_set_mc_list(struct net_device *dev)
{ {
#ifdef CONFIG_BLUEZ_BNEP_MC_FILTER #ifdef CONFIG_BT_BNEP_MC_FILTER
struct bnep_session *s = dev->priv; struct bnep_session *s = dev->priv;
struct sock *sk = s->sock->sk; struct sock *sk = s->sock->sk;
struct bnep_set_filter_req *r; struct bnep_set_filter_req *r;
...@@ -143,7 +143,7 @@ static int bnep_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -143,7 +143,7 @@ static int bnep_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_BLUEZ_BNEP_MC_FILTER #ifdef CONFIG_BT_BNEP_MC_FILTER
static inline int bnep_net_mc_filter(struct sk_buff *skb, struct bnep_session *s) static inline int bnep_net_mc_filter(struct sk_buff *skb, struct bnep_session *s)
{ {
struct ethhdr *eh = (void *) skb->data; struct ethhdr *eh = (void *) skb->data;
...@@ -154,7 +154,7 @@ static inline int bnep_net_mc_filter(struct sk_buff *skb, struct bnep_session *s ...@@ -154,7 +154,7 @@ static inline int bnep_net_mc_filter(struct sk_buff *skb, struct bnep_session *s
} }
#endif #endif
#ifdef CONFIG_BLUEZ_BNEP_PROTO_FILTER #ifdef CONFIG_BT_BNEP_PROTO_FILTER
/* Determine ether protocol. Based on eth_type_trans. */ /* Determine ether protocol. Based on eth_type_trans. */
static inline u16 bnep_net_eth_proto(struct sk_buff *skb) static inline u16 bnep_net_eth_proto(struct sk_buff *skb)
{ {
...@@ -192,14 +192,14 @@ static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -192,14 +192,14 @@ static int bnep_net_xmit(struct sk_buff *skb, struct net_device *dev)
BT_DBG("skb %p, dev %p", skb, dev); BT_DBG("skb %p, dev %p", skb, dev);
#ifdef CONFIG_BLUEZ_BNEP_MC_FILTER #ifdef CONFIG_BT_BNEP_MC_FILTER
if (bnep_net_mc_filter(skb, s)) { if (bnep_net_mc_filter(skb, s)) {
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }
#endif #endif
#ifdef CONFIG_BLUEZ_BNEP_PROTO_FILTER #ifdef CONFIG_BT_BNEP_PROTO_FILTER
if (bnep_net_proto_filter(skb, s)) { if (bnep_net_proto_filter(skb, s)) {
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "bnep.h" #include "bnep.h"
#ifndef CONFIG_BLUEZ_BNEP_DEBUG #ifndef CONFIG_BT_BNEP_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
...@@ -198,7 +198,7 @@ static int bnep_sock_create(struct socket *sock, int protocol) ...@@ -198,7 +198,7 @@ static int bnep_sock_create(struct socket *sock, int protocol)
if (sock->type != SOCK_RAW) if (sock->type != SOCK_RAW)
return -ESOCKTNOSUPPORT; return -ESOCKTNOSUPPORT;
if (!(sk = bluez_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL))) if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
sock->ops = &bnep_sock_ops; sock->ops = &bnep_sock_ops;
...@@ -219,13 +219,13 @@ static struct net_proto_family bnep_sock_family_ops = { ...@@ -219,13 +219,13 @@ static struct net_proto_family bnep_sock_family_ops = {
int bnep_sock_init(void) int bnep_sock_init(void)
{ {
bluez_sock_register(BTPROTO_BNEP, &bnep_sock_family_ops); bt_sock_register(BTPROTO_BNEP, &bnep_sock_family_ops);
return 0; return 0;
} }
int bnep_sock_cleanup(void) int bnep_sock_cleanup(void)
{ {
if (bluez_sock_unregister(BTPROTO_BNEP)) if (bt_sock_unregister(BTPROTO_BNEP))
BT_ERR("Can't unregister BNEP socket"); BT_ERR("Can't unregister BNEP socket");
return 0; return 0;
} }
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#ifndef HCI_CORE_DEBUG #ifndef CONFIG_BT_HCI_CORE_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI Core. * Bluetooth HCI Core.
* *
* $Id: hci_core.c,v 1.6 2002/04/17 17:37:16 maxk Exp $ * $Id: hci_core.c,v 1.6 2002/04/17 17:37:16 maxk Exp $
*/ */
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#ifndef HCI_CORE_DEBUG #ifndef CONFIG_BT_HCI_CORE_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
...@@ -168,7 +168,7 @@ static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev, ...@@ -168,7 +168,7 @@ static int __hci_request(struct hci_dev *hdev, void (*req)(struct hci_dev *hdev,
switch (hdev->req_status) { switch (hdev->req_status) {
case HCI_REQ_DONE: case HCI_REQ_DONE:
err = -bterr(hdev->req_result); err = -bt_err(hdev->req_result);
break; break;
case HCI_REQ_CANCELED: case HCI_REQ_CANCELED:
...@@ -877,7 +877,7 @@ int hci_recv_frame(struct sk_buff *skb) ...@@ -877,7 +877,7 @@ int hci_recv_frame(struct sk_buff *skb)
BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len); BT_DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len);
/* Incomming skb */ /* Incomming skb */
bluez_cb(skb)->incomming = 1; bt_cb(skb)->incoming = 1;
/* Time stamp */ /* Time stamp */
do_gettimeofday(&skb->stamp); do_gettimeofday(&skb->stamp);
...@@ -1001,7 +1001,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p ...@@ -1001,7 +1001,7 @@ int hci_send_cmd(struct hci_dev *hdev, __u16 ogf, __u16 ocf, __u32 plen, void *p
BT_DBG("%s ogf 0x%x ocf 0x%x plen %d", hdev->name, ogf, ocf, plen); BT_DBG("%s ogf 0x%x ocf 0x%x plen %d", hdev->name, ogf, ocf, plen);
if (!(skb = bluez_skb_alloc(len, GFP_ATOMIC))) { if (!(skb = bt_skb_alloc(len, GFP_ATOMIC))) {
BT_ERR("%s Can't allocate memory for HCI command", hdev->name); BT_ERR("%s Can't allocate memory for HCI command", hdev->name);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1250,7 +1250,7 @@ static void hci_tx_task(unsigned long arg) ...@@ -1250,7 +1250,7 @@ static void hci_tx_task(unsigned long arg)
read_unlock(&hci_task_lock); read_unlock(&hci_task_lock);
} }
/* ----- HCI RX task (incomming data proccessing) ----- */ /* ----- HCI RX task (incoming data proccessing) ----- */
/* ACL data packet */ /* ACL data packet */
static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
...@@ -1406,15 +1406,3 @@ static void hci_cmd_task(unsigned long arg) ...@@ -1406,15 +1406,3 @@ static void hci_cmd_task(unsigned long arg)
} }
} }
} }
/* ---- Initialization ---- */
int hci_core_init(void)
{
return 0;
}
int hci_core_cleanup(void)
{
return 0;
}
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#ifndef HCI_CORE_DEBUG #ifndef CONFIG_BT_HCI_CORE_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
...@@ -68,7 +68,7 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb ...@@ -68,7 +68,7 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
default: default:
BT_DBG("%s Command complete: ogf LINK_CTL ocf %x", hdev->name, ocf); BT_DBG("%s Command complete: ogf LINK_CTL ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Command Complete OGF LINK_POLICY */ /* Command Complete OGF LINK_POLICY */
...@@ -103,7 +103,7 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff * ...@@ -103,7 +103,7 @@ static void hci_cc_link_policy(struct hci_dev *hdev, __u16 ocf, struct sk_buff *
BT_DBG("%s: Command complete: ogf LINK_POLICY ocf %x", BT_DBG("%s: Command complete: ogf LINK_POLICY ocf %x",
hdev->name, ocf); hdev->name, ocf);
break; break;
}; }
} }
/* Command Complete OGF HOST_CTL */ /* Command Complete OGF HOST_CTL */
...@@ -213,7 +213,7 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb ...@@ -213,7 +213,7 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
default: default:
BT_DBG("%s Command complete: ogf HOST_CTL ocf %x", hdev->name, ocf); BT_DBG("%s Command complete: ogf HOST_CTL ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Command Complete OGF INFO_PARAM */ /* Command Complete OGF INFO_PARAM */
...@@ -287,7 +287,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s ...@@ -287,7 +287,7 @@ static void hci_cc_info_param(struct hci_dev *hdev, __u16 ocf, struct sk_buff *s
default: default:
BT_DBG("%s Command complete: ogf INFO_PARAM ocf %x", hdev->name, ocf); BT_DBG("%s Command complete: ogf INFO_PARAM ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Command Status OGF LINK_CTL */ /* Command Status OGF LINK_CTL */
...@@ -376,7 +376,7 @@ static void hci_cs_link_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status) ...@@ -376,7 +376,7 @@ static void hci_cs_link_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status)
BT_DBG("%s Command status: ogf LINK_CTL ocf %x status %d", BT_DBG("%s Command status: ogf LINK_CTL ocf %x status %d",
hdev->name, ocf, status); hdev->name, ocf, status);
break; break;
}; }
} }
/* Command Status OGF LINK_POLICY */ /* Command Status OGF LINK_POLICY */
...@@ -388,7 +388,7 @@ static void hci_cs_link_policy(struct hci_dev *hdev, __u16 ocf, __u8 status) ...@@ -388,7 +388,7 @@ static void hci_cs_link_policy(struct hci_dev *hdev, __u16 ocf, __u8 status)
default: default:
BT_DBG("%s Command status: ogf HOST_POLICY ocf %x", hdev->name, ocf); BT_DBG("%s Command status: ogf HOST_POLICY ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Command Status OGF HOST_CTL */ /* Command Status OGF HOST_CTL */
...@@ -400,7 +400,7 @@ static void hci_cs_host_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status) ...@@ -400,7 +400,7 @@ static void hci_cs_host_ctl(struct hci_dev *hdev, __u16 ocf, __u8 status)
default: default:
BT_DBG("%s Command status: ogf HOST_CTL ocf %x", hdev->name, ocf); BT_DBG("%s Command status: ogf HOST_CTL ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Command Status OGF INFO_PARAM */ /* Command Status OGF INFO_PARAM */
...@@ -412,7 +412,7 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status) ...@@ -412,7 +412,7 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status)
default: default:
BT_DBG("%s Command status: ogf INFO_PARAM ocf %x", hdev->name, ocf); BT_DBG("%s Command status: ogf INFO_PARAM ocf %x", hdev->name, ocf);
break; break;
}; }
} }
/* Inquiry Complete */ /* Inquiry Complete */
...@@ -849,7 +849,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data) ...@@ -849,7 +849,7 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data)
void *ptr; void *ptr;
size = HCI_EVENT_HDR_SIZE + EVT_STACK_INTERNAL_SIZE + dlen; size = HCI_EVENT_HDR_SIZE + EVT_STACK_INTERNAL_SIZE + dlen;
skb = bluez_skb_alloc(size, GFP_ATOMIC); skb = bt_skb_alloc(size, GFP_ATOMIC);
if (!skb) if (!skb)
return; return;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ HCI socket layer. * Bluetooth HCI socket layer.
* *
* $Id: hci_sock.c,v 1.4 2002/04/18 22:26:14 maxk Exp $ * $Id: hci_sock.c,v 1.4 2002/04/18 22:26:14 maxk Exp $
*/ */
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#ifndef HCI_SOCK_DEBUG #ifndef CONFIG_BT_HCI_SOCK_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
...@@ -79,7 +79,7 @@ static struct hci_sec_filter hci_sec_filter = { ...@@ -79,7 +79,7 @@ static struct hci_sec_filter hci_sec_filter = {
} }
}; };
static struct bluez_sock_list hci_sk_list = { static struct bt_sock_list hci_sk_list = {
.lock = RW_LOCK_UNLOCKED .lock = RW_LOCK_UNLOCKED
}; };
...@@ -144,7 +144,7 @@ static int hci_sock_release(struct socket *sock) ...@@ -144,7 +144,7 @@ static int hci_sock_release(struct socket *sock)
if (!sk) if (!sk)
return 0; return 0;
bluez_sock_unlink(&hci_sk_list, sk); bt_sock_unlink(&hci_sk_list, sk);
if (hdev) { if (hdev) {
atomic_dec(&hdev->promisc); atomic_dec(&hdev->promisc);
...@@ -310,7 +310,7 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_ ...@@ -310,7 +310,7 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
__u32 mask = hci_pi(sk)->cmsg_mask; __u32 mask = hci_pi(sk)->cmsg_mask;
if (mask & HCI_CMSG_DIR) if (mask & HCI_CMSG_DIR)
put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(int), &bluez_cb(skb)->incomming); put_cmsg(msg, SOL_HCI, HCI_CMSG_DIR, sizeof(int), &bt_cb(skb)->incoming);
if (mask & HCI_CMSG_TSTAMP) if (mask & HCI_CMSG_TSTAMP)
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp); put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, sizeof(skb->stamp), &skb->stamp);
...@@ -378,7 +378,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh ...@@ -378,7 +378,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
goto done; goto done;
} }
if (!(skb = bluez_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err))) if (!(skb = bt_skb_send_alloc(sk, len, msg->msg_flags & MSG_DONTWAIT, &err)))
goto done; goto done;
if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) { if (memcpy_fromiovec(skb_put(skb, len), msg->msg_iov, len)) {
...@@ -568,14 +568,14 @@ static int hci_sock_create(struct socket *sock, int protocol) ...@@ -568,14 +568,14 @@ static int hci_sock_create(struct socket *sock, int protocol)
sock->ops = &hci_sock_ops; sock->ops = &hci_sock_ops;
sk = bluez_sock_alloc(sock, protocol, sizeof(struct hci_pinfo), GFP_KERNEL); sk = bt_sock_alloc(sock, protocol, sizeof(struct hci_pinfo), GFP_KERNEL);
if (!sk) if (!sk)
return -ENOMEM; return -ENOMEM;
sock->state = SS_UNCONNECTED; sock->state = SS_UNCONNECTED;
sk->state = BT_OPEN; sk->state = BT_OPEN;
bluez_sock_link(&hci_sk_list, sk); bt_sock_link(&hci_sk_list, sk);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return 0; return 0;
...@@ -627,7 +627,7 @@ struct notifier_block hci_sock_nblock = { ...@@ -627,7 +627,7 @@ struct notifier_block hci_sock_nblock = {
int hci_sock_init(void) int hci_sock_init(void)
{ {
if (bluez_sock_register(BTPROTO_HCI, &hci_sock_family_ops)) { if (bt_sock_register(BTPROTO_HCI, &hci_sock_family_ops)) {
BT_ERR("Can't register HCI socket"); BT_ERR("Can't register HCI socket");
return -EPROTO; return -EPROTO;
} }
...@@ -638,7 +638,7 @@ int hci_sock_init(void) ...@@ -638,7 +638,7 @@ int hci_sock_init(void)
int hci_sock_cleanup(void) int hci_sock_cleanup(void)
{ {
if (bluez_sock_unregister(BTPROTO_HCI)) if (bt_sock_unregister(BTPROTO_HCI))
BT_ERR("Can't unregister HCI socket"); BT_ERR("Can't unregister HCI socket");
hci_unregister_notifier(&hci_sock_nblock); hci_unregister_notifier(&hci_sock_nblock);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ L2CAP core and sockets. * Bluetooth L2CAP core and sockets.
* *
* $Id: l2cap.c,v 1.15 2002/09/09 01:14:52 maxk Exp $ * $Id: l2cap.c,v 1.15 2002/09/09 01:14:52 maxk Exp $
*/ */
...@@ -57,14 +57,14 @@ ...@@ -57,14 +57,14 @@
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h> #include <net/bluetooth/l2cap.h>
#ifndef L2CAP_DEBUG #ifndef CONFIG_BT_L2CAP_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
static struct proto_ops l2cap_sock_ops; static struct proto_ops l2cap_sock_ops;
struct bluez_sock_list l2cap_sk_list = { struct bt_sock_list l2cap_sk_list = {
.lock = RW_LOCK_UNLOCKED .lock = RW_LOCK_UNLOCKED
}; };
...@@ -188,8 +188,8 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, stru ...@@ -188,8 +188,8 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, stru
int l2cap_connect(struct sock *sk) int l2cap_connect(struct sock *sk)
{ {
bdaddr_t *src = &bluez_sk(sk)->src; bdaddr_t *src = &bt_sk(sk)->src;
bdaddr_t *dst = &bluez_sk(sk)->dst; bdaddr_t *dst = &bt_sk(sk)->dst;
struct l2cap_conn *conn; struct l2cap_conn *conn;
struct hci_conn *hcon; struct hci_conn *hcon;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -248,7 +248,7 @@ static struct sock *__l2cap_get_sock_by_addr(__u16 psm, bdaddr_t *src) ...@@ -248,7 +248,7 @@ static struct sock *__l2cap_get_sock_by_addr(__u16 psm, bdaddr_t *src)
struct sock *sk; struct sock *sk;
for (sk = l2cap_sk_list.head; sk; sk = sk->next) { for (sk = l2cap_sk_list.head; sk; sk = sk->next) {
if (l2cap_pi(sk)->psm == psm && if (l2cap_pi(sk)->psm == psm &&
!bacmp(&bluez_sk(sk)->src, src)) !bacmp(&bt_sk(sk)->src, src))
break; break;
} }
return sk; return sk;
...@@ -267,11 +267,11 @@ static struct sock *__l2cap_get_sock_by_psm(int state, __u16 psm, bdaddr_t *src) ...@@ -267,11 +267,11 @@ static struct sock *__l2cap_get_sock_by_psm(int state, __u16 psm, bdaddr_t *src)
if (l2cap_pi(sk)->psm == psm) { if (l2cap_pi(sk)->psm == psm) {
/* Exact match. */ /* Exact match. */
if (!bacmp(&bluez_sk(sk)->src, src)) if (!bacmp(&bt_sk(sk)->src, src))
break; break;
/* Closest match */ /* Closest match */
if (!bacmp(&bluez_sk(sk)->src, BDADDR_ANY)) if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
sk1 = sk; sk1 = sk;
} }
} }
...@@ -310,7 +310,7 @@ static void l2cap_sock_cleanup_listen(struct sock *parent) ...@@ -310,7 +310,7 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
/* Close not yet accepted channels */ /* Close not yet accepted channels */
while ((sk = bluez_accept_dequeue(parent, NULL))) while ((sk = bt_accept_dequeue(parent, NULL)))
l2cap_sock_close(sk); l2cap_sock_close(sk);
parent->state = BT_CLOSED; parent->state = BT_CLOSED;
...@@ -328,7 +328,7 @@ static void l2cap_sock_kill(struct sock *sk) ...@@ -328,7 +328,7 @@ static void l2cap_sock_kill(struct sock *sk)
BT_DBG("sk %p state %d", sk, sk->state); BT_DBG("sk %p state %d", sk, sk->state);
/* Kill poor orphan */ /* Kill poor orphan */
bluez_sock_unlink(&l2cap_sk_list, sk); bt_sock_unlink(&l2cap_sk_list, sk);
sk->dead = 1; sk->dead = 1;
sock_put(sk); sock_put(sk);
} }
...@@ -409,7 +409,7 @@ static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -409,7 +409,7 @@ static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, int prio)
{ {
struct sock *sk; struct sock *sk;
sk = bluez_sock_alloc(sock, proto, sizeof(struct l2cap_pinfo), prio); sk = bt_sock_alloc(sock, proto, sizeof(struct l2cap_pinfo), prio);
if (!sk) if (!sk)
return NULL; return NULL;
...@@ -421,7 +421,7 @@ static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -421,7 +421,7 @@ static struct sock *l2cap_sock_alloc(struct socket *sock, int proto, int prio)
l2cap_sock_init_timer(sk); l2cap_sock_init_timer(sk);
bluez_sock_link(&l2cap_sk_list, sk); bt_sock_link(&l2cap_sk_list, sk);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return sk; return sk;
...@@ -471,7 +471,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_ ...@@ -471,7 +471,7 @@ static int l2cap_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_
err = -EADDRINUSE; err = -EADDRINUSE;
} else { } else {
/* Save source address */ /* Save source address */
bacpy(&bluez_sk(sk)->src, &la->l2_bdaddr); bacpy(&bt_sk(sk)->src, &la->l2_bdaddr);
l2cap_pi(sk)->psm = la->l2_psm; l2cap_pi(sk)->psm = la->l2_psm;
sk->state = BT_BOUND; sk->state = BT_BOUND;
} }
...@@ -524,14 +524,14 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al ...@@ -524,14 +524,14 @@ static int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int al
} }
/* Set destination address and psm */ /* Set destination address and psm */
bacpy(&bluez_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_connect(sk)))
goto done; goto done;
wait: wait:
err = bluez_sock_w4_connect(sk, flags); err = bt_sock_w4_connect(sk, flags);
done: done:
release_sock(sk); release_sock(sk);
...@@ -586,7 +586,7 @@ int l2cap_sock_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -586,7 +586,7 @@ int l2cap_sock_accept(struct socket *sock, struct socket *newsock, int flags)
/* Wait for an incoming connection. (wake-one). */ /* Wait for an incoming connection. (wake-one). */
add_wait_queue_exclusive(sk->sleep, &wait); add_wait_queue_exclusive(sk->sleep, &wait);
while (!(nsk = bluez_accept_dequeue(sk, newsock))) { while (!(nsk = bt_accept_dequeue(sk, newsock))) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (!timeo) { if (!timeo) {
err = -EAGAIN; err = -EAGAIN;
...@@ -633,9 +633,9 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *l ...@@ -633,9 +633,9 @@ static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *l
*len = sizeof(struct sockaddr_l2); *len = sizeof(struct sockaddr_l2);
if (peer) if (peer)
bacpy(&la->l2_bdaddr, &bluez_sk(sk)->dst); bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
else else
bacpy(&la->l2_bdaddr, &bluez_sk(sk)->src); bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
la->l2_psm = l2cap_pi(sk)->psm; la->l2_psm = l2cap_pi(sk)->psm;
return 0; return 0;
...@@ -892,7 +892,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct so ...@@ -892,7 +892,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct so
__l2cap_chan_link(l, sk); __l2cap_chan_link(l, sk);
if (parent) if (parent)
bluez_accept_enqueue(parent, sk); bt_accept_enqueue(parent, sk);
} }
/* Delete channel. /* Delete channel.
...@@ -900,7 +900,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct so ...@@ -900,7 +900,7 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, struct so
static void l2cap_chan_del(struct sock *sk, int err) static void l2cap_chan_del(struct sock *sk, int err)
{ {
struct l2cap_conn *conn = l2cap_pi(sk)->conn; struct l2cap_conn *conn = l2cap_pi(sk)->conn;
struct sock *parent = bluez_sk(sk)->parent; struct sock *parent = bt_sk(sk)->parent;
l2cap_sock_clear_timer(sk); l2cap_sock_clear_timer(sk);
...@@ -954,7 +954,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn) ...@@ -954,7 +954,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
static void l2cap_chan_ready(struct sock *sk) static void l2cap_chan_ready(struct sock *sk)
{ {
struct sock *parent = bluez_sk(sk)->parent; struct sock *parent = bt_sk(sk)->parent;
BT_DBG("sk %p, parent %p", sk, parent); BT_DBG("sk %p, parent %p", sk, parent);
...@@ -1019,7 +1019,7 @@ static int l2cap_chan_send(struct sock *sk, struct msghdr *msg, int len) ...@@ -1019,7 +1019,7 @@ static int l2cap_chan_send(struct sock *sk, struct msghdr *msg, int len)
count = MIN(conn->mtu - hlen, len); count = MIN(conn->mtu - hlen, len);
skb = bluez_skb_send_alloc(sk, hlen + count, skb = bt_skb_send_alloc(sk, hlen + count,
msg->msg_flags & MSG_DONTWAIT, &err); msg->msg_flags & MSG_DONTWAIT, &err);
if (!skb) if (!skb)
return err; return err;
...@@ -1045,7 +1045,7 @@ static int l2cap_chan_send(struct sock *sk, struct msghdr *msg, int len) ...@@ -1045,7 +1045,7 @@ static int l2cap_chan_send(struct sock *sk, struct msghdr *msg, int len)
while (len) { while (len) {
count = MIN(conn->mtu, len); count = MIN(conn->mtu, len);
*frag = bluez_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err); *frag = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err);
if (!*frag) if (!*frag)
goto fail; goto fail;
...@@ -1105,7 +1105,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, ...@@ -1105,7 +1105,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen; len = L2CAP_HDR_SIZE + L2CAP_CMD_HDR_SIZE + dlen;
count = MIN(conn->mtu, len); count = MIN(conn->mtu, len);
skb = bluez_skb_alloc(count, GFP_ATOMIC); skb = bt_skb_alloc(count, GFP_ATOMIC);
if (!skb) if (!skb)
return NULL; return NULL;
...@@ -1131,7 +1131,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn, ...@@ -1131,7 +1131,7 @@ static struct sk_buff *l2cap_build_cmd(struct l2cap_conn *conn,
while (len) { while (len) {
count = MIN(conn->mtu, len); count = MIN(conn->mtu, len);
*frag = bluez_skb_alloc(count, GFP_ATOMIC); *frag = bt_skb_alloc(count, GFP_ATOMIC);
if (!*frag) if (!*frag)
goto fail; goto fail;
...@@ -1374,8 +1374,8 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, l2cap_cmd_hdr *cmd, ...@@ -1374,8 +1374,8 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, l2cap_cmd_hdr *cmd,
hci_conn_hold(conn->hcon); hci_conn_hold(conn->hcon);
l2cap_sock_init(sk, parent); l2cap_sock_init(sk, parent);
bacpy(&bluez_sk(sk)->src, conn->src); bacpy(&bt_sk(sk)->src, conn->src);
bacpy(&bluez_sk(sk)->dst, conn->dst); bacpy(&bt_sk(sk)->dst, conn->dst);
l2cap_pi(sk)->psm = psm; l2cap_pi(sk)->psm = psm;
l2cap_pi(sk)->dcid = scid; l2cap_pi(sk)->dcid = scid;
...@@ -1785,10 +1785,10 @@ static int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) ...@@ -1785,10 +1785,10 @@ static int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type)
if (sk->state != BT_LISTEN) if (sk->state != BT_LISTEN)
continue; continue;
if (!bacmp(&bluez_sk(sk)->src, bdaddr)) { if (!bacmp(&bt_sk(sk)->src, bdaddr)) {
lm1 |= (HCI_LM_ACCEPT | l2cap_pi(sk)->link_mode); lm1 |= (HCI_LM_ACCEPT | l2cap_pi(sk)->link_mode);
exact++; exact++;
} else if (!bacmp(&bluez_sk(sk)->src, BDADDR_ANY)) } else if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
lm2 |= (HCI_LM_ACCEPT | l2cap_pi(sk)->link_mode); lm2 |= (HCI_LM_ACCEPT | l2cap_pi(sk)->link_mode);
} }
read_unlock(&l2cap_sk_list.lock); read_unlock(&l2cap_sk_list.lock);
...@@ -1810,7 +1810,7 @@ static int l2cap_connect_cfm(struct hci_conn *hcon, __u8 status) ...@@ -1810,7 +1810,7 @@ static int l2cap_connect_cfm(struct hci_conn *hcon, __u8 status)
if (conn) if (conn)
l2cap_conn_ready(conn); l2cap_conn_ready(conn);
} else } else
l2cap_conn_del(hcon, bterr(status)); l2cap_conn_del(hcon, bt_err(status));
return 0; return 0;
} }
...@@ -1822,7 +1822,7 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, __u8 reason) ...@@ -1822,7 +1822,7 @@ static int l2cap_disconn_ind(struct hci_conn *hcon, __u8 reason)
if (hcon->type != ACL_LINK) if (hcon->type != ACL_LINK)
return 0; return 0;
l2cap_conn_del(hcon, bterr(reason)); l2cap_conn_del(hcon, bt_err(reason));
return 0; return 0;
} }
...@@ -1958,7 +1958,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, __u16 ...@@ -1958,7 +1958,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, __u16
} }
/* Allocate skb for the complete frame (with header) */ /* Allocate skb for the complete frame (with header) */
if (!(conn->rx_skb = bluez_skb_alloc(len, GFP_ATOMIC))) if (!(conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC)))
goto drop; goto drop;
memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len); memcpy(skb_put(conn->rx_skb, skb->len), skb->data, skb->len);
...@@ -1996,7 +1996,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, __u16 ...@@ -1996,7 +1996,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, __u16
} }
/* ----- Proc fs support ------ */ /* ----- Proc fs support ------ */
static int l2cap_sock_dump(char *buf, struct bluez_sock_list *list) static int l2cap_sock_dump(char *buf, struct bt_sock_list *list)
{ {
struct l2cap_pinfo *pi; struct l2cap_pinfo *pi;
struct sock *sk; struct sock *sk;
...@@ -2007,7 +2007,7 @@ static int l2cap_sock_dump(char *buf, struct bluez_sock_list *list) ...@@ -2007,7 +2007,7 @@ static int l2cap_sock_dump(char *buf, struct bluez_sock_list *list)
for (sk = list->head; sk; sk = sk->next) { for (sk = list->head; sk; sk = sk->next) {
pi = l2cap_pi(sk); pi = l2cap_pi(sk);
ptr += sprintf(ptr, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d 0x%x\n", ptr += sprintf(ptr, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d 0x%x\n",
batostr(&bluez_sk(sk)->src), batostr(&bluez_sk(sk)->dst), batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
sk->state, pi->psm, pi->scid, pi->dcid, pi->imtu, pi->omtu, sk->state, pi->psm, pi->scid, pi->dcid, pi->imtu, pi->omtu,
pi->link_mode); pi->link_mode);
} }
...@@ -2051,8 +2051,8 @@ static struct proto_ops l2cap_sock_ops = { ...@@ -2051,8 +2051,8 @@ static struct proto_ops l2cap_sock_ops = {
.accept = l2cap_sock_accept, .accept = l2cap_sock_accept,
.getname = l2cap_sock_getname, .getname = l2cap_sock_getname,
.sendmsg = l2cap_sock_sendmsg, .sendmsg = l2cap_sock_sendmsg,
.recvmsg = bluez_sock_recvmsg, .recvmsg = bt_sock_recvmsg,
.poll = bluez_sock_poll, .poll = bt_sock_poll,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.ioctl = sock_no_ioctl, .ioctl = sock_no_ioctl,
...@@ -2081,7 +2081,7 @@ int __init l2cap_init(void) ...@@ -2081,7 +2081,7 @@ int __init l2cap_init(void)
{ {
int err; int err;
if ((err = bluez_sock_register(BTPROTO_L2CAP, &l2cap_sock_family_ops))) { if ((err = bt_sock_register(BTPROTO_L2CAP, &l2cap_sock_family_ops))) {
BT_ERR("Can't register L2CAP socket"); BT_ERR("Can't register L2CAP socket");
return err; return err;
} }
...@@ -2093,7 +2093,7 @@ int __init l2cap_init(void) ...@@ -2093,7 +2093,7 @@ int __init l2cap_init(void)
create_proc_read_entry("bluetooth/l2cap", 0, 0, l2cap_read_proc, NULL); create_proc_read_entry("bluetooth/l2cap", 0, 0, l2cap_read_proc, NULL);
BT_INFO("BlueZ L2CAP ver %s Copyright (C) 2000,2001 Qualcomm Inc", VERSION); BT_INFO("Bluetooth L2CAP ver %s Copyright (C) 2000,2001 Qualcomm Inc", VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
return 0; return 0;
} }
...@@ -2103,7 +2103,7 @@ void l2cap_cleanup(void) ...@@ -2103,7 +2103,7 @@ void l2cap_cleanup(void)
remove_proc_entry("bluetooth/l2cap", NULL); remove_proc_entry("bluetooth/l2cap", NULL);
/* Unregister socket and protocol */ /* Unregister socket and protocol */
if (bluez_sock_unregister(BTPROTO_L2CAP)) if (bt_sock_unregister(BTPROTO_L2CAP))
BT_ERR("Can't unregister L2CAP socket"); BT_ERR("Can't unregister L2CAP socket");
if (hci_unregister_proto(&l2cap_hci_proto)) if (hci_unregister_proto(&l2cap_hci_proto))
...@@ -2114,5 +2114,5 @@ module_init(l2cap_init); ...@@ -2114,5 +2114,5 @@ module_init(l2cap_init);
module_exit(l2cap_cleanup); module_exit(l2cap_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ L2CAP ver " VERSION); MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ kernel library. * Bluetooth kernel library.
* *
* $Id: lib.c,v 1.1 2002/03/08 21:06:59 maxk Exp $ * $Id: lib.c,v 1.1 2002/03/08 21:06:59 maxk Exp $
*/ */
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
void bluez_dump(char *pref, __u8 *buf, int count) void bt_dump(char *pref, __u8 *buf, int count)
{ {
char *ptr; char *ptr;
char line[100]; char line[100];
...@@ -83,7 +83,7 @@ char *batostr(bdaddr_t *ba) ...@@ -83,7 +83,7 @@ char *batostr(bdaddr_t *ba)
} }
/* Bluetooth error codes to Unix errno mapping */ /* Bluetooth error codes to Unix errno mapping */
int bterr(__u16 code) int bt_err(__u16 code)
{ {
switch (code) { switch (code) {
case 0: case 0:
...@@ -171,5 +171,5 @@ int bterr(__u16 code) ...@@ -171,5 +171,5 @@ int bterr(__u16 code)
default: default:
return ENOSYS; return ENOSYS;
}; }
} }
RFCOMM protocol support RFCOMM protocol support
CONFIG_BLUEZ_RFCOMM CONFIG_BT_RFCOMM
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
applications. applications.
...@@ -8,5 +8,5 @@ CONFIG_BLUEZ_RFCOMM ...@@ -8,5 +8,5 @@ CONFIG_BLUEZ_RFCOMM
compile it as module (rfcomm.o). compile it as module (rfcomm.o).
RFCOMM TTY emulation support RFCOMM TTY emulation support
CONFIG_BLUEZ_RFCOMM_TTY CONFIG_BT_RFCOMM_TTY
This option enables TTY emulation support for RFCOMM channels. This option enables TTY emulation support for RFCOMM channels.
dep_tristate 'RFCOMM protocol support' CONFIG_BLUEZ_RFCOMM $CONFIG_BLUEZ_L2CAP dep_tristate 'RFCOMM protocol support' CONFIG_BT_RFCOMM $CONFIG_BT_L2CAP
if [ "$CONFIG_BLUEZ_RFCOMM" != "n" ]; then if [ "$CONFIG_BT_RFCOMM" != "n" ]; then
bool ' RFCOMM TTY support' CONFIG_BLUEZ_RFCOMM_TTY bool ' RFCOMM TTY support' CONFIG_BT_RFCOMM_TTY
fi fi
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
# Makefile for the Linux Bluetooth RFCOMM layer. # Makefile for the Linux Bluetooth RFCOMM layer.
# #
obj-$(CONFIG_BLUEZ_RFCOMM) += rfcomm.o obj-$(CONFIG_BT_RFCOMM) += rfcomm.o
rfcomm-y := core.o sock.o crc.o rfcomm-y := core.o sock.o crc.o
rfcomm-$(CONFIG_BLUEZ_RFCOMM_TTY) += tty.o rfcomm-$(CONFIG_BT_RFCOMM_TTY) += tty.o
rfcomm-objs := $(rfcomm-y) rfcomm-objs := $(rfcomm-y)
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
*/ */
/* /*
* RFCOMM core. * Bluetooth RFCOMM core.
* *
* $Id: core.c,v 1.42 2002/10/01 23:26:25 maxk Exp $ * $Id: core.c,v 1.42 2002/10/01 23:26:25 maxk Exp $
*/ */
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#define VERSION "0.3" #define VERSION "0.3"
#ifndef CONFIG_BLUEZ_RFCOMM_DEBUG #ifndef CONFIG_BT_RFCOMM_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG(D...) #define BT_DBG(D...)
#endif #endif
...@@ -489,10 +489,10 @@ struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst) ...@@ -489,10 +489,10 @@ struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst)
{ {
struct rfcomm_session *s; struct rfcomm_session *s;
struct list_head *p, *n; struct list_head *p, *n;
struct bluez_sock *sk; struct bt_sock *sk;
list_for_each_safe(p, n, &session_list) { list_for_each_safe(p, n, &session_list) {
s = list_entry(p, struct rfcomm_session, list); s = list_entry(p, struct rfcomm_session, list);
sk = bluez_sk(s->sock->sk); sk = bt_sk(s->sock->sk);
if ((!bacmp(src, BDADDR_ANY) || !bacmp(&sk->src, src)) && if ((!bacmp(src, BDADDR_ANY) || !bacmp(&sk->src, src)) &&
!bacmp(&sk->dst, dst)) !bacmp(&sk->dst, dst))
...@@ -577,9 +577,9 @@ void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *d ...@@ -577,9 +577,9 @@ void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *d
{ {
struct sock *sk = s->sock->sk; struct sock *sk = s->sock->sk;
if (src) if (src)
bacpy(src, &bluez_sk(sk)->src); bacpy(src, &bt_sk(sk)->src);
if (dst) if (dst)
bacpy(dst, &bluez_sk(sk)->dst); bacpy(dst, &bt_sk(sk)->dst);
} }
/* ---- RFCOMM frame sending ---- */ /* ---- RFCOMM frame sending ---- */
...@@ -1509,7 +1509,7 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s) ...@@ -1509,7 +1509,7 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
/* Fast check for a new connection. /* Fast check for a new connection.
* Avoids unnesesary socket allocations. */ * Avoids unnesesary socket allocations. */
if (list_empty(&bluez_sk(sock->sk)->accept_q)) if (list_empty(&bt_sk(sock->sk)->accept_q))
return; return;
BT_DBG("session %p", s); BT_DBG("session %p", s);
...@@ -1727,7 +1727,7 @@ static int rfcomm_dlc_dump(char *buf) ...@@ -1727,7 +1727,7 @@ static int rfcomm_dlc_dump(char *buf)
d = list_entry(pp, struct rfcomm_dlc, list); d = list_entry(pp, struct rfcomm_dlc, list);
ptr += sprintf(ptr, "dlc %s %s %ld %d %d %d %d\n", ptr += sprintf(ptr, "dlc %s %s %ld %d %d %d %d\n",
batostr(&bluez_sk(sk)->src), batostr(&bluez_sk(sk)->dst), batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits); d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits);
} }
} }
...@@ -1771,13 +1771,13 @@ int __init rfcomm_init(void) ...@@ -1771,13 +1771,13 @@ int __init rfcomm_init(void)
rfcomm_init_sockets(); rfcomm_init_sockets();
#ifdef CONFIG_BLUEZ_RFCOMM_TTY #ifdef CONFIG_BT_RFCOMM_TTY
rfcomm_init_ttys(); rfcomm_init_ttys();
#endif #endif
create_proc_read_entry("bluetooth/rfcomm", 0, 0, rfcomm_read_proc, NULL); create_proc_read_entry("bluetooth/rfcomm", 0, 0, rfcomm_read_proc, NULL);
BT_INFO("BlueZ RFCOMM ver %s", VERSION); BT_INFO("Bluetooth RFCOMM ver %s", VERSION);
BT_INFO("Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com>");
BT_INFO("Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>"); BT_INFO("Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org>");
return 0; return 0;
...@@ -1796,7 +1796,7 @@ void rfcomm_cleanup(void) ...@@ -1796,7 +1796,7 @@ void rfcomm_cleanup(void)
remove_proc_entry("bluetooth/rfcomm", NULL); remove_proc_entry("bluetooth/rfcomm", NULL);
#ifdef CONFIG_BLUEZ_RFCOMM_TTY #ifdef CONFIG_BT_RFCOMM_TTY
rfcomm_cleanup_ttys(); rfcomm_cleanup_ttys();
#endif #endif
...@@ -1808,5 +1808,5 @@ module_init(rfcomm_init); ...@@ -1808,5 +1808,5 @@ module_init(rfcomm_init);
module_exit(rfcomm_cleanup); module_exit(rfcomm_cleanup);
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("BlueZ RFCOMM ver " VERSION); MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/rfcomm.h> #include <net/bluetooth/rfcomm.h>
#ifndef CONFIG_BLUEZ_RFCOMM_DEBUG #ifndef CONFIG_BT_RFCOMM_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG(D...) #define BT_DBG(D...)
#endif #endif
static struct proto_ops rfcomm_sock_ops; static struct proto_ops rfcomm_sock_ops;
static struct bluez_sock_list rfcomm_sk_list = { static struct bt_sock_list rfcomm_sk_list = {
.lock = RW_LOCK_UNLOCKED .lock = RW_LOCK_UNLOCKED
}; };
...@@ -98,10 +98,10 @@ static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err) ...@@ -98,10 +98,10 @@ static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
sk->err = err; sk->err = err;
sk->state = d->state; sk->state = d->state;
parent = bluez_sk(sk)->parent; parent = bt_sk(sk)->parent;
if (!parent) { if (!parent) {
if (d->state == BT_CONNECTED) if (d->state == BT_CONNECTED)
rfcomm_session_getaddr(d->session, &bluez_sk(sk)->src, NULL); rfcomm_session_getaddr(d->session, &bt_sk(sk)->src, NULL);
sk->state_change(sk); sk->state_change(sk);
} else } else
parent->data_ready(parent, 0); parent->data_ready(parent, 0);
...@@ -122,7 +122,7 @@ static struct sock *__rfcomm_get_sock_by_addr(int channel, bdaddr_t *src) ...@@ -122,7 +122,7 @@ static struct sock *__rfcomm_get_sock_by_addr(int channel, bdaddr_t *src)
for (sk = rfcomm_sk_list.head; sk; sk = sk->next) { for (sk = rfcomm_sk_list.head; sk; sk = sk->next) {
if (rfcomm_pi(sk)->channel == channel && if (rfcomm_pi(sk)->channel == channel &&
!bacmp(&bluez_sk(sk)->src, src)) !bacmp(&bt_sk(sk)->src, src))
break; break;
} }
...@@ -142,11 +142,11 @@ static struct sock *__rfcomm_get_sock_by_channel(int state, __u16 channel, bdadd ...@@ -142,11 +142,11 @@ static struct sock *__rfcomm_get_sock_by_channel(int state, __u16 channel, bdadd
if (rfcomm_pi(sk)->channel == channel) { if (rfcomm_pi(sk)->channel == channel) {
/* Exact match. */ /* Exact match. */
if (!bacmp(&bluez_sk(sk)->src, src)) if (!bacmp(&bt_sk(sk)->src, src))
break; break;
/* Closest match */ /* Closest match */
if (!bacmp(&bluez_sk(sk)->src, BDADDR_ANY)) if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
sk1 = sk; sk1 = sk;
} }
} }
...@@ -197,7 +197,7 @@ static void rfcomm_sock_cleanup_listen(struct sock *parent) ...@@ -197,7 +197,7 @@ static void rfcomm_sock_cleanup_listen(struct sock *parent)
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
/* Close not yet accepted dlcs */ /* Close not yet accepted dlcs */
while ((sk = bluez_accept_dequeue(parent, NULL))) while ((sk = bt_accept_dequeue(parent, NULL)))
rfcomm_sock_close(sk); rfcomm_sock_close(sk);
parent->state = BT_CLOSED; parent->state = BT_CLOSED;
...@@ -215,7 +215,7 @@ static void rfcomm_sock_kill(struct sock *sk) ...@@ -215,7 +215,7 @@ static void rfcomm_sock_kill(struct sock *sk)
BT_DBG("sk %p state %d refcnt %d", sk, sk->state, atomic_read(&sk->refcnt)); BT_DBG("sk %p state %d refcnt %d", sk, sk->state, atomic_read(&sk->refcnt));
/* Kill poor orphan */ /* Kill poor orphan */
bluez_sock_unlink(&rfcomm_sk_list, sk); bt_sock_unlink(&rfcomm_sk_list, sk);
sk->dead = 1; sk->dead = 1;
sock_put(sk); sock_put(sk);
} }
...@@ -265,7 +265,7 @@ static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -265,7 +265,7 @@ static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, int prio)
struct rfcomm_dlc *d; struct rfcomm_dlc *d;
struct sock *sk; struct sock *sk;
sk = bluez_sock_alloc(sock, BTPROTO_RFCOMM, sizeof(struct rfcomm_pinfo), prio); sk = bt_sock_alloc(sock, BTPROTO_RFCOMM, sizeof(struct rfcomm_pinfo), prio);
if (!sk) if (!sk)
return NULL; return NULL;
...@@ -290,7 +290,7 @@ static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -290,7 +290,7 @@ static struct sock *rfcomm_sock_alloc(struct socket *sock, int proto, int prio)
sk->protocol = proto; sk->protocol = proto;
sk->state = BT_OPEN; sk->state = BT_OPEN;
bluez_sock_link(&rfcomm_sk_list, sk); bt_sock_link(&rfcomm_sk_list, sk);
BT_DBG("sk %p", sk); BT_DBG("sk %p", sk);
...@@ -342,7 +342,7 @@ static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr ...@@ -342,7 +342,7 @@ static int rfcomm_sock_bind(struct socket *sock, struct sockaddr *addr, int addr
err = -EADDRINUSE; err = -EADDRINUSE;
} else { } else {
/* Save source address */ /* Save source address */
bacpy(&bluez_sk(sk)->src, &sa->rc_bdaddr); bacpy(&bt_sk(sk)->src, &sa->rc_bdaddr);
rfcomm_pi(sk)->channel = sa->rc_channel; rfcomm_pi(sk)->channel = sa->rc_channel;
sk->state = BT_BOUND; sk->state = BT_BOUND;
} }
...@@ -375,12 +375,12 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a ...@@ -375,12 +375,12 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a
lock_sock(sk); lock_sock(sk);
sk->state = BT_CONNECT; sk->state = BT_CONNECT;
bacpy(&bluez_sk(sk)->dst, &sa->rc_bdaddr); bacpy(&bt_sk(sk)->dst, &sa->rc_bdaddr);
rfcomm_pi(sk)->channel = sa->rc_channel; rfcomm_pi(sk)->channel = sa->rc_channel;
err = rfcomm_dlc_open(d, &bluez_sk(sk)->src, &sa->rc_bdaddr, sa->rc_channel); err = rfcomm_dlc_open(d, &bt_sk(sk)->src, &sa->rc_bdaddr, sa->rc_channel);
if (!err) if (!err)
err = bluez_sock_w4_connect(sk, flags); err = bt_sock_w4_connect(sk, flags);
release_sock(sk); release_sock(sk);
return err; return err;
...@@ -429,7 +429,7 @@ int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -429,7 +429,7 @@ int rfcomm_sock_accept(struct socket *sock, struct socket *newsock, int flags)
/* Wait for an incoming connection. (wake-one). */ /* Wait for an incoming connection. (wake-one). */
add_wait_queue_exclusive(sk->sleep, &wait); add_wait_queue_exclusive(sk->sleep, &wait);
while (!(nsk = bluez_accept_dequeue(sk, newsock))) { while (!(nsk = bt_accept_dequeue(sk, newsock))) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (!timeo) { if (!timeo) {
err = -EAGAIN; err = -EAGAIN;
...@@ -475,9 +475,9 @@ static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int * ...@@ -475,9 +475,9 @@ static int rfcomm_sock_getname(struct socket *sock, struct sockaddr *addr, int *
sa->rc_family = AF_BLUETOOTH; sa->rc_family = AF_BLUETOOTH;
sa->rc_channel = rfcomm_pi(sk)->channel; sa->rc_channel = rfcomm_pi(sk)->channel;
if (peer) if (peer)
bacpy(&sa->rc_bdaddr, &bluez_sk(sk)->dst); bacpy(&sa->rc_bdaddr, &bt_sk(sk)->dst);
else else
bacpy(&sa->rc_bdaddr, &bluez_sk(sk)->src); bacpy(&sa->rc_bdaddr, &bt_sk(sk)->src);
*len = sizeof(struct sockaddr_rc); *len = sizeof(struct sockaddr_rc);
return 0; return 0;
...@@ -707,7 +707,7 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon ...@@ -707,7 +707,7 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
lock_sock(sk); lock_sock(sk);
#ifdef CONFIG_BLUEZ_RFCOMM_TTY #ifdef CONFIG_BT_RFCOMM_TTY
err = rfcomm_dev_ioctl(sk, cmd, arg); err = rfcomm_dev_ioctl(sk, cmd, arg);
#else #else
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
...@@ -762,12 +762,12 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc * ...@@ -762,12 +762,12 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
goto done; goto done;
rfcomm_sock_init(sk, parent); rfcomm_sock_init(sk, parent);
bacpy(&bluez_sk(sk)->src, &src); bacpy(&bt_sk(sk)->src, &src);
bacpy(&bluez_sk(sk)->dst, &dst); bacpy(&bt_sk(sk)->dst, &dst);
rfcomm_pi(sk)->channel = channel; rfcomm_pi(sk)->channel = channel;
sk->state = BT_CONFIG; sk->state = BT_CONFIG;
bluez_accept_enqueue(parent, sk); bt_accept_enqueue(parent, sk);
/* Accept connection and return socket DLC */ /* Accept connection and return socket DLC */
*d = rfcomm_pi(sk)->dlc; *d = rfcomm_pi(sk)->dlc;
...@@ -781,7 +781,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc * ...@@ -781,7 +781,7 @@ int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc *
/* ---- Proc fs support ---- */ /* ---- Proc fs support ---- */
int rfcomm_sock_dump(char *buf) int rfcomm_sock_dump(char *buf)
{ {
struct bluez_sock_list *list = &rfcomm_sk_list; struct bt_sock_list *list = &rfcomm_sk_list;
struct rfcomm_pinfo *pi; struct rfcomm_pinfo *pi;
struct sock *sk; struct sock *sk;
char *ptr = buf; char *ptr = buf;
...@@ -791,7 +791,7 @@ int rfcomm_sock_dump(char *buf) ...@@ -791,7 +791,7 @@ int rfcomm_sock_dump(char *buf)
for (sk = list->head; sk; sk = sk->next) { for (sk = list->head; sk; sk = sk->next) {
pi = rfcomm_pi(sk); pi = rfcomm_pi(sk);
ptr += sprintf(ptr, "sk %s %s %d %d\n", ptr += sprintf(ptr, "sk %s %s %d %d\n",
batostr(&bluez_sk(sk)->src), batostr(&bluez_sk(sk)->dst), batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
sk->state, rfcomm_pi(sk)->channel); sk->state, rfcomm_pi(sk)->channel);
} }
...@@ -814,7 +814,7 @@ static struct proto_ops rfcomm_sock_ops = { ...@@ -814,7 +814,7 @@ static struct proto_ops rfcomm_sock_ops = {
.setsockopt = rfcomm_sock_setsockopt, .setsockopt = rfcomm_sock_setsockopt,
.getsockopt = rfcomm_sock_getsockopt, .getsockopt = rfcomm_sock_getsockopt,
.ioctl = rfcomm_sock_ioctl, .ioctl = rfcomm_sock_ioctl,
.poll = bluez_sock_poll, .poll = bt_sock_poll,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
.mmap = sock_no_mmap .mmap = sock_no_mmap
}; };
...@@ -828,7 +828,7 @@ int rfcomm_init_sockets(void) ...@@ -828,7 +828,7 @@ int rfcomm_init_sockets(void)
{ {
int err; int err;
if ((err = bluez_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops))) { if ((err = bt_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops))) {
BT_ERR("Can't register RFCOMM socket layer"); BT_ERR("Can't register RFCOMM socket layer");
return err; return err;
} }
...@@ -841,6 +841,6 @@ void rfcomm_cleanup_sockets(void) ...@@ -841,6 +841,6 @@ void rfcomm_cleanup_sockets(void)
int err; int err;
/* Unregister socket, protocol and notifier */ /* Unregister socket, protocol and notifier */
if ((err = bluez_sock_unregister(BTPROTO_RFCOMM))) if ((err = bt_sock_unregister(BTPROTO_RFCOMM)))
BT_ERR("Can't unregister RFCOMM socket layer %d", err); BT_ERR("Can't unregister RFCOMM socket layer %d", err);
} }
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#include <net/bluetooth/bluetooth.h> #include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/rfcomm.h> #include <net/bluetooth/rfcomm.h>
#ifndef CONFIG_BLUEZ_RFCOMM_DEBUG #ifndef CONFIG_BT_RFCOMM_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG(D...) #define BT_DBG(D...)
#endif #endif
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ SCO sockets. * Bluetooth SCO sockets.
* *
* $Id: sco.c,v 1.3 2002/04/17 17:37:16 maxk Exp $ * $Id: sco.c,v 1.3 2002/04/17 17:37:16 maxk Exp $
*/ */
...@@ -56,14 +56,14 @@ ...@@ -56,14 +56,14 @@
#include <net/bluetooth/hci_core.h> #include <net/bluetooth/hci_core.h>
#include <net/bluetooth/sco.h> #include <net/bluetooth/sco.h>
#ifndef SCO_DEBUG #ifndef CONFIG_BT_SCO_DEBUG
#undef BT_DBG #undef BT_DBG
#define BT_DBG( A... ) #define BT_DBG( A... )
#endif #endif
static struct proto_ops sco_sock_ops; static struct proto_ops sco_sock_ops;
static struct bluez_sock_list sco_sk_list = { static struct bt_sock_list sco_sk_list = {
.lock = RW_LOCK_UNLOCKED .lock = RW_LOCK_UNLOCKED
}; };
...@@ -200,8 +200,8 @@ static inline int sco_chan_add(struct sco_conn *conn, struct sock *sk, struct so ...@@ -200,8 +200,8 @@ static inline int sco_chan_add(struct sco_conn *conn, struct sock *sk, struct so
int sco_connect(struct sock *sk) int sco_connect(struct sock *sk)
{ {
bdaddr_t *src = &bluez_sk(sk)->src; bdaddr_t *src = &bt_sk(sk)->src;
bdaddr_t *dst = &bluez_sk(sk)->dst; bdaddr_t *dst = &bt_sk(sk)->dst;
struct sco_conn *conn; struct sco_conn *conn;
struct hci_conn *hcon; struct hci_conn *hcon;
struct hci_dev *hdev; struct hci_dev *hdev;
...@@ -259,7 +259,7 @@ static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len) ...@@ -259,7 +259,7 @@ static inline int sco_send_frame(struct sock *sk, struct msghdr *msg, int len)
BT_DBG("sk %p len %d", sk, len); BT_DBG("sk %p len %d", sk, len);
count = MIN(conn->mtu, len); count = MIN(conn->mtu, len);
if (!(skb = bluez_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err))) if (!(skb = bt_skb_send_alloc(sk, count, msg->msg_flags & MSG_DONTWAIT, &err)))
return err; return err;
if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) { if (memcpy_fromiovec(skb_put(skb, count), msg->msg_iov, count)) {
...@@ -303,7 +303,7 @@ static struct sock *__sco_get_sock_by_addr(bdaddr_t *ba) ...@@ -303,7 +303,7 @@ static struct sock *__sco_get_sock_by_addr(bdaddr_t *ba)
struct sock *sk; struct sock *sk;
for (sk = sco_sk_list.head; sk; sk = sk->next) { for (sk = sco_sk_list.head; sk; sk = sk->next) {
if (!bacmp(&bluez_sk(sk)->src, ba)) if (!bacmp(&bt_sk(sk)->src, ba))
break; break;
} }
...@@ -324,11 +324,11 @@ static struct sock *sco_get_sock_listen(bdaddr_t *src) ...@@ -324,11 +324,11 @@ static struct sock *sco_get_sock_listen(bdaddr_t *src)
continue; continue;
/* Exact match. */ /* Exact match. */
if (!bacmp(&bluez_sk(sk)->src, src)) if (!bacmp(&bt_sk(sk)->src, src))
break; break;
/* Closest match */ /* Closest match */
if (!bacmp(&bluez_sk(sk)->src, BDADDR_ANY)) if (!bacmp(&bt_sk(sk)->src, BDADDR_ANY))
sk1 = sk; sk1 = sk;
} }
...@@ -357,7 +357,7 @@ static void sco_sock_cleanup_listen(struct sock *parent) ...@@ -357,7 +357,7 @@ static void sco_sock_cleanup_listen(struct sock *parent)
BT_DBG("parent %p", parent); BT_DBG("parent %p", parent);
/* Close not yet accepted channels */ /* Close not yet accepted channels */
while ((sk = bluez_accept_dequeue(parent, NULL))) while ((sk = bt_accept_dequeue(parent, NULL)))
sco_sock_close(sk); sco_sock_close(sk);
parent->state = BT_CLOSED; parent->state = BT_CLOSED;
...@@ -375,7 +375,7 @@ static void sco_sock_kill(struct sock *sk) ...@@ -375,7 +375,7 @@ static void sco_sock_kill(struct sock *sk)
BT_DBG("sk %p state %d", sk, sk->state); BT_DBG("sk %p state %d", sk, sk->state);
/* Kill poor orphan */ /* Kill poor orphan */
bluez_sock_unlink(&sco_sk_list, sk); bt_sock_unlink(&sco_sk_list, sk);
sk->dead = 1; sk->dead = 1;
sock_put(sk); sock_put(sk);
} }
...@@ -429,7 +429,7 @@ static struct sock *sco_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -429,7 +429,7 @@ static struct sock *sco_sock_alloc(struct socket *sock, int proto, int prio)
{ {
struct sock *sk; struct sock *sk;
sk = bluez_sock_alloc(sock, proto, sizeof(struct sco_pinfo), prio); sk = bt_sock_alloc(sock, proto, sizeof(struct sco_pinfo), prio);
if (!sk) if (!sk)
return NULL; return NULL;
...@@ -439,7 +439,7 @@ static struct sock *sco_sock_alloc(struct socket *sock, int proto, int prio) ...@@ -439,7 +439,7 @@ static struct sock *sco_sock_alloc(struct socket *sock, int proto, int prio)
sco_sock_init_timer(sk); sco_sock_init_timer(sk);
bluez_sock_link(&sco_sk_list, sk); bt_sock_link(&sco_sk_list, sk);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return sk; return sk;
...@@ -490,7 +490,7 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le ...@@ -490,7 +490,7 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_le
err = -EADDRINUSE; err = -EADDRINUSE;
} else { } else {
/* Save source address */ /* Save source address */
bacpy(&bluez_sk(sk)->src, &sa->sco_bdaddr); bacpy(&bt_sk(sk)->src, &sa->sco_bdaddr);
sk->state = BT_BOUND; sk->state = BT_BOUND;
} }
...@@ -522,12 +522,12 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen ...@@ -522,12 +522,12 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen
lock_sock(sk); lock_sock(sk);
/* Set destination address and psm */ /* Set destination address and psm */
bacpy(&bluez_sk(sk)->dst, &sa->sco_bdaddr); bacpy(&bt_sk(sk)->dst, &sa->sco_bdaddr);
if ((err = sco_connect(sk))) if ((err = sco_connect(sk)))
goto done; goto done;
err = bluez_sock_w4_connect(sk, flags); err = bt_sock_w4_connect(sk, flags);
done: done:
release_sock(sk); release_sock(sk);
...@@ -577,7 +577,7 @@ int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags) ...@@ -577,7 +577,7 @@ int sco_sock_accept(struct socket *sock, struct socket *newsock, int flags)
/* Wait for an incoming connection. (wake-one). */ /* Wait for an incoming connection. (wake-one). */
add_wait_queue_exclusive(sk->sleep, &wait); add_wait_queue_exclusive(sk->sleep, &wait);
while (!(ch = bluez_accept_dequeue(sk, newsock))) { while (!(ch = bt_accept_dequeue(sk, newsock))) {
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
if (!timeo) { if (!timeo) {
err = -EAGAIN; err = -EAGAIN;
...@@ -624,9 +624,9 @@ static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len ...@@ -624,9 +624,9 @@ static int sco_sock_getname(struct socket *sock, struct sockaddr *addr, int *len
*len = sizeof(struct sockaddr_sco); *len = sizeof(struct sockaddr_sco);
if (peer) if (peer)
bacpy(&sa->sco_bdaddr, &bluez_sk(sk)->dst); bacpy(&sa->sco_bdaddr, &bt_sk(sk)->dst);
else else
bacpy(&sa->sco_bdaddr, &bluez_sk(sk)->src); bacpy(&sa->sco_bdaddr, &bt_sk(sk)->src);
return 0; return 0;
} }
...@@ -751,7 +751,7 @@ static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock * ...@@ -751,7 +751,7 @@ static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *
conn->sk = sk; conn->sk = sk;
if (parent) if (parent)
bluez_accept_enqueue(parent, sk); bt_accept_enqueue(parent, sk);
} }
/* Delete channel. /* Delete channel.
...@@ -808,8 +808,8 @@ static void sco_conn_ready(struct sco_conn *conn) ...@@ -808,8 +808,8 @@ static void sco_conn_ready(struct sco_conn *conn)
sco_sock_init(sk, parent); sco_sock_init(sk, parent);
bacpy(&bluez_sk(sk)->src, conn->src); bacpy(&bt_sk(sk)->src, conn->src);
bacpy(&bluez_sk(sk)->dst, conn->dst); bacpy(&bt_sk(sk)->dst, conn->dst);
hci_conn_hold(conn->hcon); hci_conn_hold(conn->hcon);
__sco_chan_add(conn, sk, parent); __sco_chan_add(conn, sk, parent);
...@@ -849,7 +849,7 @@ int sco_connect_cfm(struct hci_conn *hcon, __u8 status) ...@@ -849,7 +849,7 @@ int sco_connect_cfm(struct hci_conn *hcon, __u8 status)
if (conn) if (conn)
sco_conn_ready(conn); sco_conn_ready(conn);
} else } else
sco_conn_del(hcon, bterr(status)); sco_conn_del(hcon, bt_err(status));
return 0; return 0;
} }
...@@ -861,7 +861,7 @@ int sco_disconn_ind(struct hci_conn *hcon, __u8 reason) ...@@ -861,7 +861,7 @@ int sco_disconn_ind(struct hci_conn *hcon, __u8 reason)
if (hcon->type != SCO_LINK) if (hcon->type != SCO_LINK)
return 0; return 0;
sco_conn_del(hcon, bterr(reason)); sco_conn_del(hcon, bt_err(reason));
return 0; return 0;
} }
...@@ -885,7 +885,7 @@ int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) ...@@ -885,7 +885,7 @@ int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)
} }
/* ----- Proc fs support ------ */ /* ----- Proc fs support ------ */
static int sco_sock_dump(char *buf, struct bluez_sock_list *list) static int sco_sock_dump(char *buf, struct bt_sock_list *list)
{ {
struct sco_pinfo *pi; struct sco_pinfo *pi;
struct sock *sk; struct sock *sk;
...@@ -896,7 +896,7 @@ static int sco_sock_dump(char *buf, struct bluez_sock_list *list) ...@@ -896,7 +896,7 @@ static int sco_sock_dump(char *buf, struct bluez_sock_list *list)
for (sk = list->head; sk; sk = sk->next) { for (sk = list->head; sk; sk = sk->next) {
pi = sco_pi(sk); pi = sco_pi(sk);
ptr += sprintf(ptr, "%s %s %d\n", ptr += sprintf(ptr, "%s %s %d\n",
batostr(&bluez_sk(sk)->src), batostr(&bluez_sk(sk)->dst), batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst),
sk->state); sk->state);
} }
...@@ -940,8 +940,8 @@ static struct proto_ops sco_sock_ops = { ...@@ -940,8 +940,8 @@ static struct proto_ops sco_sock_ops = {
.accept = sco_sock_accept, .accept = sco_sock_accept,
.getname = sco_sock_getname, .getname = sco_sock_getname,
.sendmsg = sco_sock_sendmsg, .sendmsg = sco_sock_sendmsg,
.recvmsg = bluez_sock_recvmsg, .recvmsg = bt_sock_recvmsg,
.poll = bluez_sock_poll, .poll = bt_sock_poll,
.ioctl = sock_no_ioctl, .ioctl = sock_no_ioctl,
.mmap = sock_no_mmap, .mmap = sock_no_mmap,
.socketpair = sock_no_socketpair, .socketpair = sock_no_socketpair,
...@@ -968,7 +968,7 @@ int __init sco_init(void) ...@@ -968,7 +968,7 @@ int __init sco_init(void)
{ {
int err; int err;
if ((err = bluez_sock_register(BTPROTO_SCO, &sco_sock_family_ops))) { if ((err = bt_sock_register(BTPROTO_SCO, &sco_sock_family_ops))) {
BT_ERR("Can't register SCO socket layer"); BT_ERR("Can't register SCO socket layer");
return err; return err;
} }
...@@ -980,7 +980,7 @@ int __init sco_init(void) ...@@ -980,7 +980,7 @@ int __init sco_init(void)
create_proc_read_entry("bluetooth/sco", 0, 0, sco_read_proc, NULL); create_proc_read_entry("bluetooth/sco", 0, 0, sco_read_proc, NULL);
BT_INFO("BlueZ SCO ver %s Copyright (C) 2000,2001 Qualcomm Inc", VERSION); BT_INFO("Bluetooth SCO ver %s Copyright (C) 2000,2001 Qualcomm Inc", VERSION);
BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>"); BT_INFO("Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>");
return 0; return 0;
} }
...@@ -992,7 +992,7 @@ void sco_cleanup(void) ...@@ -992,7 +992,7 @@ void sco_cleanup(void)
remove_proc_entry("bluetooth/sco", NULL); remove_proc_entry("bluetooth/sco", NULL);
/* Unregister socket, protocol and notifier */ /* Unregister socket, protocol and notifier */
if ((err = bluez_sock_unregister(BTPROTO_SCO))) if ((err = bt_sock_unregister(BTPROTO_SCO)))
BT_ERR("Can't unregister SCO socket layer %d", err); BT_ERR("Can't unregister SCO socket layer %d", err);
if ((err = hci_unregister_proto(&sco_hci_proto))) if ((err = hci_unregister_proto(&sco_hci_proto)))
...@@ -1003,5 +1003,5 @@ module_init(sco_init); ...@@ -1003,5 +1003,5 @@ module_init(sco_init);
module_exit(sco_cleanup); module_exit(sco_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>"); MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>");
MODULE_DESCRIPTION("BlueZ SCO ver " VERSION); MODULE_DESCRIPTION("Bluetooth SCO ver " VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
/* /*
* BlueZ symbols. * Bluetooth symbols.
* *
* $Id: syms.c,v 1.1 2002/03/08 21:06:59 maxk Exp $ * $Id: syms.c,v 1.1 2002/03/08 21:06:59 maxk Exp $
*/ */
...@@ -59,20 +59,20 @@ EXPORT_SYMBOL(hci_send_sco); ...@@ -59,20 +59,20 @@ EXPORT_SYMBOL(hci_send_sco);
EXPORT_SYMBOL(hci_send_raw); EXPORT_SYMBOL(hci_send_raw);
EXPORT_SYMBOL(hci_si_event); EXPORT_SYMBOL(hci_si_event);
/* BlueZ lib */ /* Bluetooth lib */
EXPORT_SYMBOL(bluez_dump); EXPORT_SYMBOL(bt_dump);
EXPORT_SYMBOL(baswap); EXPORT_SYMBOL(baswap);
EXPORT_SYMBOL(batostr); EXPORT_SYMBOL(batostr);
EXPORT_SYMBOL(bterr); EXPORT_SYMBOL(bt_err);
/* BlueZ sockets */ /* Bluetooth sockets */
EXPORT_SYMBOL(bluez_sock_register); EXPORT_SYMBOL(bt_sock_register);
EXPORT_SYMBOL(bluez_sock_unregister); EXPORT_SYMBOL(bt_sock_unregister);
EXPORT_SYMBOL(bluez_sock_alloc); EXPORT_SYMBOL(bt_sock_alloc);
EXPORT_SYMBOL(bluez_sock_link); EXPORT_SYMBOL(bt_sock_link);
EXPORT_SYMBOL(bluez_sock_unlink); EXPORT_SYMBOL(bt_sock_unlink);
EXPORT_SYMBOL(bluez_sock_recvmsg); EXPORT_SYMBOL(bt_sock_recvmsg);
EXPORT_SYMBOL(bluez_sock_poll); EXPORT_SYMBOL(bt_sock_poll);
EXPORT_SYMBOL(bluez_accept_enqueue); EXPORT_SYMBOL(bt_accept_enqueue);
EXPORT_SYMBOL(bluez_accept_dequeue); EXPORT_SYMBOL(bt_accept_dequeue);
EXPORT_SYMBOL(bluez_sock_w4_connect); EXPORT_SYMBOL(bt_sock_w4_connect);
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