|
From: Mattias A. <mat...@us...> - 2001-03-30 09:40:55
|
The following file was modified in linux/include/linux/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
btcommon.h 1.66 1.67=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* added blocking calls on l2cap messages
* rewrote rtx/ertx timer handling
* added result and internal connection status in l2cap con obj
* added ping_struct used to send ping via ioctl
* removed l2cap command backup, use blocking calls instead when=20
resending lost l2cap messages.
* added ioctls for enabling m/s switch, sending test cmd and do ping
* minor changes
The diff of the modified file(s):
--- btcommon.h 2001/03/06 10:11:34 1.66
+++ btcommon.h 2001/03/30 09:40:53 1.67
@@ -176,12 +176,22 @@
/* ioctls vendor specific HCI commands */
#define HCISETBAUDRATE _IOW(BT_IOC_MAGIC, 0x70, s32)
#define HCIWRITEBDADDR _IOW(BT_IOC_MAGIC, 0x71, u8[6])
-#define HCISENDRAWDATA _IOW(BT_IOC_MAGIC, 0x72, u8[64])
+
+/* | len 1 byte | 4 bytes hci header | data (max 256) | */
+#define HCISENDRAWDATA _IOW(BT_IOC_MAGIC, 0x72, u8[261])
=20
/* other ioctls used for testing */
#define BTSENDTESTDATA _IOW(BT_IOC_MAGIC, 0xf0, s32[2])
#define HCITESTCONNECTREQ _IOW(BT_IOC_MAGIC, 0xf1, u8[6])
+#define BTTESTCOMMAND _IOW(BT_IOC_MAGIC, 0xf2, u8[261])
+#define BTSETMSSWITCH _IOW(BT_IOC_MAGIC, 0xf3, u8)
=20
+/* | BD(6) | len(2) | data |*/
+#define BTPING _IOW(BT_IOC_MAGIC, 0x73, ping_struct)
+
+/* | BD(6) | type (2) |*/
+#define BTGETINFO _IOW(BT_IOC_MAGIC, 0x74, u8[8])
+
/* NOTE !
* N_BT should be defined in /include/asm/termios.h=20
* However, if you are compiling this source standalone
@@ -276,18 +286,32 @@
/* FIXME -- move all layer specific structs into each layers .h file=20
and fix include order ! */
=20
-/* used to resend lost l2cap commands */
-typedef struct l2cap_cmd_backup {
- u8 type; /* conreq/confreq/discreq */=09
- u8 nbr_resends;
- /* params for config req */
- u16 in_mtu;
- u16 flush_timeout;
- u16 link_to;
- flow *outflow; /* danger if this is deallocated in upper layers */
- u16 inforeq_type;
-} l2cap_cmd_backup;
+/* RTX Actions */
+#define RTX_ACTION_DISCONNECT 0 /* default */
+#define RTX_ACTION_START_ERTX 1 /* during con*/
+#define RTX_ACTION_TERMINATE 2 /* if we tried to disconnect and got no res=
p */
+
+#define ERTX_ACTION_DISCONNECT 0xf0 /* default */
+#define ERTX_ACTION_TERMINATE 0xf1
=20
+typedef struct l2cap_timer_obj
+{
+#ifdef __KERNEL__
+ struct timer_list rtx;
+ struct timer_list ertx;
+#else
+ /* fixme */
+#endif
+ u16 rtx_no; /* nbr retries */
+ u16 rtx_action; /* preferred action when rtx expires */=09
+ u16 rtx_inuse; /* to avoid concurrent use */
+
+ u16 ertx_action; /* preferred action when ertx expires */=09
+ u16 ertx_inuse;
+
+ //struct timeval caller_id; /* used to identify caller */
+} __attribute__ ((packed)) l2cap_timer_obj;
+
typedef struct l2cap_con {
s32 magic;
BD_ADDR remote_bd; /* 6 bytes */
@@ -302,33 +326,38 @@
u16 psm;
u16 local_mtu;
=20
- /* remote options temp stored when receiving config req */
+ /* Config options from remote peer */
u16 remote_mtu;
u16 flush_timeout;
flow remote_qos;
+ u16 remote_flags; /* more config options to come */
=20
+ u16 local_flags; /* indicates more config options to be sent */
+
u8 initiator;
=20
u8 link_up;=20=20
u8 sig_id_sent; /* last sent command id */
u8 sig_id_rcv; /* last received command id*/
=20=09
-
- u8 ping_sent;
- u8 inforeq_sent;
-
- s32 reconfiguring; /* indicates if we are currently reconfiguring */
-=09
s32 conf_req_ready; /* indicates if we received pos rsp on our req */
s32 conf_rsp_ready; /* indicates if we replied pos on a config req */
=20
-#ifdef __KERNEL__
- struct timer_list rtx_timer;
- struct timer_list ertx_timer;
+ /* Fixme -- fix multicall */
+ struct l2cap_timer_obj timer;
+
+ /* Fixme -- fix all return values according this system */
+ s32 c_result; /* returns result to higher layers, used together with
+ MSGCODE macro */
+ s32 c_status; /* used to indicate status up caller */
+ u32 c_flags; /* internal connection flags see l2cap_con.h for=20
+ flag codes */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+ struct wait_queue *wq;
#else
- /* timers for usermode is in l2cap.c */
-#endif
- struct l2cap_cmd_backup last_cmd; /* used to resend signals */
+ wait_queue_head_t wq;
+#endif /* LINUX_VERSION_CODE */
=20
/* stats packets sent/received/lost etc*/
=20
@@ -429,8 +458,8 @@
{
/* general */
struct tty_struct *upper_tty;
- s32 connect_status;
-
+ volatile s32 connect_status;
+ volatile s32 disconnect_status;
/* hci link */
=20
/* rfcomm */
@@ -491,6 +520,13 @@
u8 bd_addr[0];
} inquiry_results;
=20
+typedef struct ping_struct
+{
+ u8 bd[6];
+ u16 len;
+ u8 data[1024];
+} ping_struct;
+
typedef struct serport_profile_info {
s32 rfcomm_serv_chan;
u32 serport_name_length;
@@ -499,18 +535,6 @@
=20
extern s32 bt_current_hw;
extern u8 bt_hw_firmware_info[255];
-
-/* unique status codes 32 bits : | layer 16 bits | code 16 bits | */
-
-#define MSG_LAYER_HCI 0
-#define MSG_LAYER_L2CAP 1
-#define MSG_LAYER_RFCOMM 2
-#define MSG_LAYER_SDP 4
-#define MSG_LAYER_TCS 8
-
-/* unique status codes 32 bits : | layer 16 bits | code 16 bits | */
-
-#define MSGCODE(layer, msgcode) ((((layer)<<16)&0xffff0000) | ((msgcode)&0=
xffff))
=20
#endif
/****************** END OF FILE btcommon.h *******************************=
***/
|