|
From: Peter K. <pk...@us...> - 2001-09-18 12:59:49
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
rfcomm.c 1.118 1.119=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
Removed some unused code, and cleaned-up a little.
The diff of the modified file(s):
--- rfcomm.c 2001/08/02 16:03:28 1.118
+++ rfcomm.c 2001/09/18 12:59:47 1.119
@@ -102,11 +102,6 @@
=20
/****************** CONSTANT AND MACRO SECTION ***************************=
***/
=20
-#define GET_BIT(pos,bitfield) ((bitfield[(pos)/32]) & (1 << ((pos) % 32)))
-#define SET_BIT(pos,bitfield) ((bitfield[(pos)/32]) |=3D (1 << ((pos) % 32=
)))=20
-#define CLR_BIT(pos,bitfield) ((bitfield[(pos)/32]) &=3D ((1 << ((pos) % 3=
2)) \
- ^ (~0)))
-
#define SET_PF(ctr) ((ctr) | (1 << 4))=20
/* Sets the P/F-bit in the control field */
#define CLR_PF(ctr) ((ctr) & 0xef)
@@ -168,6 +163,8 @@
#define swap_mcc_long_frame(x) (swap_long_frame(x))
#define swap_pn_msg(x) ((x)->frame_size =3D le16_to_cpu((x)->frame_size))
=20
+#define RFCOMM_CON_TIMEOUT (5*HZ)
+
/****************** TYPE DEFINITION SECTION ******************************=
***/
=20
/* Typedefinitions of stuctures used for creating and parsing packets, for=
a
@@ -249,7 +246,7 @@
u8 value[0];
} __attribute__ ((packed)) mcc_long_frame;
=20
-/* MSC-command */
+/* MSC command */
typedef struct v24_signals {
u8 ea:1;
u8 fc:1;
@@ -277,59 +274,7 @@
u8 fcs;
} __attribute__ ((packed)) msc_msg;
=20
-#if 0
/* RPN command */
-#define B2400 0
-#define B4800 1
-#define B7200 2
-#define B9600 3
-#define B19200 4
-#define B38400 5
-#define B57600 6
-#define B115200 7
-#define D230400 8
-
-#endif
-
-#if 0 /* Temporary moved to rfcomm.h during the UnPlugFest */
-typedef struct parameter_mask {
- u8 bit_rate:1;
- u8 data_bits:1;
- u8 stop_bit:1;
- u8 parity:1;
- u8 parity_type:1;
- u8 xon_u8:1;
- u8 xoff_u8:1;
- u8 res1:1;
- u8 xon_input:1;
- u8 xon_output:1;
- u8 rtr_input:1;
- u8 rtr_output:1;
- u8 rtc_input:1;
- u8 rtc_output:1;
- u8 res2:2;
-} parameter_mask;
-
-typedef struct rpn_values {
- u8 bit_rate;
- u8 data_bits:2;
- u8 stop_bit:1;
- u8 parity:1;
- u8 parity_type:2;
- u8 res1:2;
- u8 xon_input:1;
- u8 xon_output:1;
- u8 rtr_input:1;
- u8 rtr_output:1;
- u8 rtc_input:1;
- u8 rtc_output:1;
- u8 res2:2;
- u8 xon_u8;
- u8 xoff_u8;
- parameter_mask pm;
-} rpn_values;
-#endif
-
typedef struct rpn_msg {
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -338,7 +283,7 @@
u8 fcs;
} __attribute__ ((packed)) rpn_msg;
=20
-/* RLS-command */=20=20
+/* RLS command */=20=20
typedef struct rls_msg {
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -348,7 +293,7 @@
u8 fcs;
} __attribute__ ((packed)) rls_msg;
=20
-/* PN-command */
+/* PN command */
typedef struct pn_msg {
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -360,7 +305,7 @@
u8 prior:6;
u8 res2:2;
u8 ack_timer;
- u32 frame_size:16;
+ u16 frame_size;
u8 max_nbrof_retrans;
u8 credits;
u8 fcs;
@@ -419,6 +364,7 @@
u8 data[0];
} __attribute__ ((packed)) long_frame;
=20
+/* Typedefinitions for structures used for the multiplexer commands */
typedef struct mcc_type {=20
u8 type:6;
u8 cr:1;
@@ -447,6 +393,7 @@
u8 value[0];
} __attribute__ ((packed)) mcc_long_frame;
=20
+/* MSC command */
typedef struct v24_signals {=20
u8 dv:1;
u8 ic:1;
@@ -474,6 +421,7 @@
u8 fcs;
} __attribute__ ((packed)) msc_msg;
=20
+/* RPN command */
typedef struct rpn_msg {=20
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -482,6 +430,7 @@
u8 fcs;
} __attribute__ ((packed)) rpn_msg;
=20
+/* RLS command */=20=20
typedef struct rls_msg {=20
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -491,9 +440,11 @@
u8 fcs;
} __attribute__ ((packed)) rls_msg;
=20
+/* PN command */
typedef struct pn_msg {=20
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
+/* The res1, res2 and res3 values have to be set to 0 by the sender */
u8 res1:2;
u8 dlci:6;
u8 credit_flow:4;
@@ -501,12 +452,13 @@
u8 res2:2;
u8 prior:6;
u8 ack_timer;
- u32 frame_size:16;
+ u16 frame_size;
u8 max_nbrof_retrans;
u8 credits;
u8 fcs;
} __attribute__ ((packed)) pn_msg;
=20
+/* NSC-command */
typedef struct nsc_msg {=20
short_frame_head s_head;
mcc_short_frame_head mcc_s_head;
@@ -550,7 +502,6 @@
#ifdef __KERNEL__
static struct timer_list rfcomm_timer;
#endif
-#define RFCOMM_CON_TIMEOUT (5*HZ)
=20
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
static struct wait_queue *rfcomm_disconnect_wq =3D NULL;
@@ -558,9 +509,6 @@
static wait_queue_head_t rfcomm_disconnect_wq;
#endif /* LINUX_VERSION_CODE */
=20
-
-void send_send_data(unsigned long ptr);
-
rpn_values rpn_val;
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
@@ -1641,12 +1589,12 @@
D_CTRL(FNC"Local credits:%d\n", rfcomm->dlci[tmp_dlci].local_credits);=
=20
rfcomm->dlci[tmp_dlci].remote_credits =3D START_CREDITS;
D_CTRL(FNC"Remote credits: %d\n",rfcomm->dlci[tmp_dlci].remote_credits=
);
- send_pn_msg(rfcomm, pn_pkt->prior, frame_size
- , credit ^ 1, MAX_CREDITS,=20
+ send_pn_msg(rfcomm, pn_pkt->prior, frame_size,
+ credit ^ 1, MAX_CREDITS,=20
tmp_dlci, MCC_RSP);
} else {
- send_pn_msg(rfcomm, pn_pkt->prior, frame_size
- , 0, 0, tmp_dlci, MCC_RSP);
+ send_pn_msg(rfcomm, pn_pkt->prior, frame_size,
+ 0, 0, tmp_dlci, MCC_RSP);
}
rfcomm->dlci[tmp_dlci].mtu =3D frame_size;
D_CTRL(FNC"process_mcc : mtu set to %d\n",=20
@@ -1759,6 +1707,7 @@
tx_buf->cur_len =3D rfcomm_frame_size;
=20=20=20
dm_pkt =3D (short_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
+
/* Always one in the address field */
dm_pkt->h.addr.ea =3D 1;
/* If we are the responder the cr bit should be set in a response */
@@ -2045,6 +1994,7 @@
}
=20=09=09
tx_buf->cur_len =3D rfcomm_frame_size;
+
uih_pkt =3D (long_frame*) (tx_buf->data + sizeof(rfcomm_tx_buf));
=20=20=20=20=20
set_uih_hdr((short_frame*) uih_pkt, CTRL_CHAN, len +
|