Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
core.c File Reference
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/kthread.h>
#include <asm/unaligned.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h>
#include <net/bluetooth/rfcomm.h>

Go to the source code of this file.

Macros

#define VERSION   "1.11"
 
#define rfcomm_lock()   mutex_lock(&rfcomm_mutex)
 
#define rfcomm_unlock()   mutex_unlock(&rfcomm_mutex)
 
#define __get_dlci(b)   ((b & 0xfc) >> 2)
 
#define __get_channel(b)   ((b & 0xf8) >> 3)
 
#define __get_dir(b)   ((b & 0x04) >> 2)
 
#define __get_type(b)   ((b & 0xef))
 
#define __test_ea(b)   ((b & 0x01))
 
#define __test_cr(b)   ((b & 0x02))
 
#define __test_pf(b)   ((b & 0x10))
 
#define __addr(cr, dlci)   (((dlci & 0x3f) << 2) | (cr << 1) | 0x01)
 
#define __ctrl(type, pf)   (((type & 0xef) | (pf << 4)))
 
#define __dlci(dir, chn)   (((chn & 0x1f) << 1) | dir)
 
#define __srv_channel(dlci)   (dlci >> 1)
 
#define __dir(dlci)   (dlci & 0x01)
 
#define __len8(len)   (((len) << 1) | 1)
 
#define __len16(len)   ((len) << 1)
 
#define __mcc_type(cr, type)   (((type << 2) | (cr << 1) | 0x01))
 
#define __get_mcc_type(b)   ((b & 0xfc) >> 2)
 
#define __get_mcc_len(b)   ((b & 0xfe) >> 1)
 
#define __rpn_line_settings(data, stop, parity)   ((data & 0x3) | ((stop & 0x1) << 2) | ((parity & 0x7) << 3))
 
#define __get_rpn_data_bits(line)   ((line) & 0x3)
 
#define __get_rpn_stop_bits(line)   (((line) >> 2) & 0x1)
 
#define __get_rpn_parity(line)   (((line) >> 3) & 0x7)
 
#define __crc(data)   (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]])
 

Functions

struct rfcomm_dlcrfcomm_dlc_alloc (gfp_t prio)
 
void rfcomm_dlc_free (struct rfcomm_dlc *d)
 
int rfcomm_dlc_open (struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel)
 
int rfcomm_dlc_close (struct rfcomm_dlc *d, int err)
 
int rfcomm_dlc_send (struct rfcomm_dlc *d, struct sk_buff *skb)
 
void __rfcomm_dlc_throttle (struct rfcomm_dlc *d)
 
void __rfcomm_dlc_unthrottle (struct rfcomm_dlc *d)
 
int rfcomm_dlc_set_modem_status (struct rfcomm_dlc *d, u8 v24_sig)
 
int rfcomm_dlc_get_modem_status (struct rfcomm_dlc *d, u8 *v24_sig)
 
void rfcomm_session_getaddr (struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *dst)
 
int rfcomm_send_rpn (struct rfcomm_session *s, int cr, u8 dlci, u8 bit_rate, u8 data_bits, u8 stop_bits, u8 parity, u8 flow_ctrl_settings, u8 xon_char, u8 xoff_char, u16 param_mask)
 
void rfcomm_dlc_accept (struct rfcomm_dlc *d)
 
 module_init (rfcomm_init)
 
 module_exit (rfcomm_exit)
 
 module_param (disable_cfc, bool, 0644)
 
 MODULE_PARM_DESC (disable_cfc,"Disable credit based flow control")
 
 module_param (channel_mtu, int, 0644)
 
 MODULE_PARM_DESC (channel_mtu,"Default MTU for the RFCOMM channel")
 
 module_param (l2cap_mtu, uint, 0644)
 
 MODULE_PARM_DESC (l2cap_mtu,"Default MTU for the L2CAP connection")
 
 module_param (l2cap_ertm, bool, 0644)
 
 MODULE_PARM_DESC (l2cap_ertm,"Use L2CAP ERTM mode for connection")
 
 MODULE_AUTHOR ("Marcel Holtmann <[email protected]>")
 
 MODULE_DESCRIPTION ("Bluetooth RFCOMM ver "VERSION)
 
 MODULE_VERSION (VERSION)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("bt-proto-3")
 

Macro Definition Documentation

#define __addr (   cr,
  dlci 
)    (((dlci & 0x3f) << 2) | (cr << 1) | 0x01)

Definition at line 84 of file core.c.

#define __crc (   data)    (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]])

Definition at line 163 of file core.c.

#define __ctrl (   type,
  pf 
)    (((type & 0xef) | (pf << 4)))

Definition at line 85 of file core.c.

#define __dir (   dlci)    (dlci & 0x01)

Definition at line 88 of file core.c.

#define __dlci (   dir,
  chn 
)    (((chn & 0x1f) << 1) | dir)

Definition at line 86 of file core.c.

#define __get_channel (   b)    ((b & 0xf8) >> 3)

Definition at line 76 of file core.c.

#define __get_dir (   b)    ((b & 0x04) >> 2)

Definition at line 77 of file core.c.

#define __get_dlci (   b)    ((b & 0xfc) >> 2)

Definition at line 75 of file core.c.

#define __get_mcc_len (   b)    ((b & 0xfe) >> 1)

Definition at line 96 of file core.c.

#define __get_mcc_type (   b)    ((b & 0xfc) >> 2)

Definition at line 95 of file core.c.

#define __get_rpn_data_bits (   line)    ((line) & 0x3)

Definition at line 100 of file core.c.

#define __get_rpn_parity (   line)    (((line) >> 3) & 0x7)

Definition at line 102 of file core.c.

#define __get_rpn_stop_bits (   line)    (((line) >> 2) & 0x1)

Definition at line 101 of file core.c.

#define __get_type (   b)    ((b & 0xef))

Definition at line 78 of file core.c.

#define __len16 (   len)    ((len) << 1)

Definition at line 91 of file core.c.

#define __len8 (   len)    (((len) << 1) | 1)

Definition at line 90 of file core.c.

#define __mcc_type (   cr,
  type 
)    (((type << 2) | (cr << 1) | 0x01))

Definition at line 94 of file core.c.

#define __rpn_line_settings (   data,
  stop,
  parity 
)    ((data & 0x3) | ((stop & 0x1) << 2) | ((parity & 0x7) << 3))

Definition at line 99 of file core.c.

#define __srv_channel (   dlci)    (dlci >> 1)

Definition at line 87 of file core.c.

#define __test_cr (   b)    ((b & 0x02))

Definition at line 81 of file core.c.

#define __test_ea (   b)    ((b & 0x01))

Definition at line 80 of file core.c.

#define __test_pf (   b)    ((b & 0x10))

Definition at line 82 of file core.c.

#define rfcomm_lock ( )    mutex_lock(&rfcomm_mutex)

Definition at line 48 of file core.c.

#define rfcomm_unlock ( )    mutex_unlock(&rfcomm_mutex)

Definition at line 49 of file core.c.

#define VERSION   "1.11"

Definition at line 38 of file core.c.

Function Documentation

void __rfcomm_dlc_throttle ( struct rfcomm_dlc d)

Definition at line 526 of file core.c.

void __rfcomm_dlc_unthrottle ( struct rfcomm_dlc d)

Definition at line 537 of file core.c.

MODULE_ALIAS ( "bt-proto-3"  )
MODULE_AUTHOR ( "Marcel Holtmann <[email protected]>"  )
MODULE_DESCRIPTION ( "Bluetooth RFCOMM ver VERSION)
module_exit ( rfcomm_exit  )
module_init ( rfcomm_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( disable_cfc  ,
bool  ,
0644   
)
module_param ( channel_mtu  ,
int  ,
0644   
)
module_param ( l2cap_mtu  ,
uint  ,
0644   
)
module_param ( l2cap_ertm  ,
bool  ,
0644   
)
MODULE_PARM_DESC ( disable_cfc  ,
"Disable credit based flow control  
)
MODULE_PARM_DESC ( channel_mtu  ,
"Default MTU for the RFCOMM channel  
)
MODULE_PARM_DESC ( l2cap_mtu  ,
"Default MTU for the L2CAP connection  
)
MODULE_PARM_DESC ( l2cap_ertm  ,
"Use L2CAP ERTM mode for connection  
)
MODULE_VERSION ( VERSION  )
void rfcomm_dlc_accept ( struct rfcomm_dlc d)

Definition at line 1237 of file core.c.

struct rfcomm_dlc* rfcomm_dlc_alloc ( gfp_t  prio)
read

Definition at line 307 of file core.c.

int rfcomm_dlc_close ( struct rfcomm_dlc d,
int  err 
)

Definition at line 494 of file core.c.

void rfcomm_dlc_free ( struct rfcomm_dlc d)

Definition at line 327 of file core.c.

int rfcomm_dlc_get_modem_status ( struct rfcomm_dlc d,
u8 v24_sig 
)

Definition at line 571 of file core.c.

int rfcomm_dlc_open ( struct rfcomm_dlc d,
bdaddr_t *  src,
bdaddr_t *  dst,
u8  channel 
)

Definition at line 428 of file core.c.

int rfcomm_dlc_send ( struct rfcomm_dlc d,
struct sk_buff skb 
)

Definition at line 506 of file core.c.

int rfcomm_dlc_set_modem_status ( struct rfcomm_dlc d,
u8  v24_sig 
)

Definition at line 553 of file core.c.

int rfcomm_send_rpn ( struct rfcomm_session s,
int  cr,
u8  dlci,
u8  bit_rate,
u8  data_bits,
u8  stop_bits,
u8  parity,
u8  flow_ctrl_settings,
u8  xon_char,
u8  xoff_char,
u16  param_mask 
)

Definition at line 900 of file core.c.

void rfcomm_session_getaddr ( struct rfcomm_session s,
bdaddr_t *  src,
bdaddr_t *  dst 
)

Definition at line 726 of file core.c.