|
From: Mattias A. <mat...@us...> - 2001-03-30 12:32:49
|
The following file was modified in apps/bluetooth/experimental:
Name Old version New version Comment
---- ----------- ----------- -------
bt_if.h 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
added includes ueed when running with usermode stack
The diff of the modified file(s):
--- bt_if.h 2001/03/26 15:33:13 1.3
+++ bt_if.h 2001/03/30 12:32:47 1.4
@@ -43,8 +43,11 @@
#ifndef __BT_IF_H__
#define __BT_IP_H__
=20
-#include <pthread.h>
#include "btd.h"
+#ifdef BT_USERSTACK
+#include <pthread.h>
+#include "include/rfcomm.h"
+#endif
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* General defines */=20
@@ -76,12 +79,19 @@
/* SDP server */
=20
#define PID_FILE "/var/run/btd.pid"
+
+#ifdef BT_USERSTACK
+#define SDPSRV_CMD "sdp_user"
+#define SDPSRV_PROC "/tmp/sdp_sock"
+#else
#define SDPSRV_CMD "sdp_server"
-#define SDPSRV_CONF "/etc/sdp.xml"
#define SDPSRV_PROC "/proc/sdp_srv"
+#endif
=20
+#define SDPSRV_CONF "/etc/sdp.xml"
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
-/* Return code defines */
+/* Return code defines (see bt_errno.h in kernel)*/
=20
/* unique message status codes 32 bits : | layer 16 bits | code 16 bits | =
*/
=20
@@ -91,13 +101,20 @@
#define MSG_LAYER_SDP 4
#define MSG_LAYER_TCS 8
=20
+#define L2CAP_SUCCESS 0x0
+#define L2CAP_CON_PENDING 0x1
+
/* Result in responses in L2CAP */
#define L2CAP_PSMNEG 0x02
#define L2CAP_SECNEG 0x03
#define L2CAP_NOSRC 0x04
=20
+#define L2CAP_FAILED 0xf0
#define L2CAP_CON_UNRESPONSIVE 0xf1
=20
+
+#ifndef BT_USERSTACK
+
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* IF Macros */
=20
@@ -192,11 +209,14 @@
#define HCISENDRAWDATA _IOW(BT_IOC_MAGIC, 0x72, unsigned char[261])
=20
/* | BD(6) | len(2) | data(max 256) |*/
-#define BTPING _IOW(BT_IOC_MAGIC, 0x73, unsigned char[264])
+#define BTPING _IOW(BT_IOC_MAGIC, 0x73, ping_struct)
+
+/* | BD(6) | type (2) |*/
+#define BTGETINFO _IOW(BT_IOC_MAGIC, 0x74, unsigned char[8])
=20
/* Used to calculate opcode for HCI commands using raw interface */
-#define OPCODE_MSB(ocf, ogf) ((ocf) & 0xff)
-#define OPCODE_LSB(ocf, ogf) (((ocf) >> 8) | (((ogf) & 0x3f) << 2))
+#define OPCODE_LSB(ocf, ogf) ((ocf) & 0xff)
+#define OPCODE_MSB(ocf, ogf) (((ocf) >> 8) | (((ogf) & 0x3f) << 2))
=20
/* HCI packet types */
#define CMD_PKT 0x01
@@ -217,6 +237,8 @@
=20
#define BTSENDTESTDATA _IOW(BT_IOC_MAGIC, 0xf0, int[2])
#define HCITESTCONNECTREQ _IOW(BT_IOC_MAGIC, 0xf1, unsigned char[6])
+#define BTTESTCOMMAND _IOW(BT_IOC_MAGIC, 0xf2, unsigned char[261])
+#define BTSETMSSWITCH _IOW(BT_IOC_MAGIC, 0xf3, unsigned char)
=20
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* Structs */
@@ -232,7 +254,14 @@
unsigned char bd_addr[0];
} inquiry_results;
=20
+typedef struct ping_struct
+{
+ unsigned char bd[6];
+ unsigned short len;
+ unsigned char data[1024];
+} ping_struct;
=20
+#endif /* BT_USERSTACK */
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* Functions common to both usermode and kernel stack */
=20
@@ -260,6 +289,7 @@
int bt_isconnected(int bt_cfd, int line);
int bt_send(int fd, int len, int repeat);
void bt_showstatus(void);
+int bt_force_msswitch_as_server(int bt_cfd, int enable);
=20
/*=20
* HCI command functions=20
@@ -268,6 +298,8 @@
int bt_send_raw_hci(int bt_cfd, unsigned char *data, char len);
int bt_ping(int bt_cfd, unsigned char bd[6],=20
unsigned char *data, unsigned short len);
+int bt_getinfo(int bt_cfd, unsigned char bd[6], unsigned short type);
+int bt_testcmd(int bt_cfd, unsigned char *cmd);
=20
void bt_inquiry(int bt_cfd, int nbr_rsp, int t);
int bt_set_baudrate(int bt_cfd, int spd);
@@ -276,8 +308,10 @@
void read_remote_bd(int bt_cfd, unsigned char *bd_addr);
void role_switch(int bt_cfd, unsigned char *bd_addr, int role);
=20
-int bt_set_event_filter(int bt_cfd, int filter);
-int bt_set_writescanenable(int bt_cfd, int flags);
+int bt_set_event_filter(int bt_cfd, unsigned int filter);
+int bt_write_scan_enable(int bt_cfd, unsigned int flags);
+void bt_write_pagescan_activity(int bt_cfd, unsigned int interval,=20
+ unsigned int wind);
void bt_set_classofdevice(int bt_cfd, unsigned short service_class,=20
unsigned char major_class,=20
unsigned char minor_class,=20
@@ -303,13 +337,11 @@
=20
=20
=20
-
-
-
/* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */
/* Functions only used in usermode stack */
=20
#ifdef BT_USERSTACK
+
const char* psmname(unsigned short psm);
int bt_write_lower_driver(unsigned char *data, int len);
int bt_write_top(char *buf, int count, int line);
@@ -318,14 +350,15 @@
void bt_sdp_connection_ready(int status);
int bt_initiated(void);
extern int bt_read_proc(char *buf, int len);
+void init_userstack();
=20
+#ifdef BT_USERSTACK
+int bt_register_rfcomm(struct rfcomm_con *rfcomm, unsigned char dlci);
+void bt_connect_cfm(unsigned int con_id, int status);
+#endif
=20
/* FIXME<1> clean this up !!! */
bt_stat_struct bt_stat;
-int bt_initdone =3D 0;
-int ready_for_ppp =3D 0;
-rfcomm_con *test_rfcomm;
-int test_dlci;
=20
/* Thread used to read data on "physical" device i.e where BT HW sits */
pthread_t read_thread;
|