From: Gordon M. <gm...@us...> - 2001-03-02 21:50:57
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bluetooth.c 1.131 1.132=20=20=20=20=20=20=20=20=20=20=20 bt_proc.c 1.19 1.20=20=20=20=20=20=20=20=20=20=20=20=20 btdebug.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 btmem.c 1.36 1.37=20=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.121 1.122=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.90 1.91=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: --Fixed some annoying compiler warnings. The diff of the modified file(s): --- bluetooth.c 2001/03/02 15:37:49 1.131 +++ bluetooth.c 2001/03/02 21:52:15 1.132 @@ -2468,7 +2468,7 @@ /*---------------------------------------------------------------------= */ if ( bt_ctrl.session[line].sdpRequestResponseData ) { - DSYS("bt_unregister_sdp: Free request data 0x%x\n", (u32 *)bt_ctrl.s= ession[line].sdpRequestResponseData); + DSYS("bt_unregister_sdp: Free request data 0x%x\n", (unsigned int)bt= _ctrl.session[line].sdpRequestResponseData); kfree(bt_ctrl.session[line].sdpRequestResponseData); bt_ctrl.session[line].sdpRequestResponseData =3D NULL; bt_ctrl.session[line].sdpRequestResponseDataLength =3D 0; --- bt_proc.c 2001/02/28 19:01:25 1.19 +++ bt_proc.c 2001/03/02 21:52:15 1.20 @@ -124,6 +124,7 @@ /* Read internal variables used for debugging */ =20 #ifdef __KERNEL__ +extern s32 bt_sprintf_status(u8 *buf); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) s32 bt_read_internal(char *buf, char **start, off_t offset,=20 int len, int unused) --- btdebug.c 2001/02/15 16:27:33 1.16 +++ btdebug.c 2001/03/02 21:52:15 1.17 @@ -78,7 +78,7 @@ } else {=20=20 - len =3D sprintf(buf, "[%d,%d]", tv.tv_sec, tv.tv_usec); + len =3D sprintf(buf, "[%d,%d]", (int)tv.tv_sec, (int)tv.tv_usec); buf[len]=3D0; } return buf; --- btmem.c 2001/02/15 16:27:33 1.36 +++ btmem.c 2001/03/02 21:52:15 1.37 @@ -473,8 +473,8 @@ D_ERR("pid : %d (tx:0x%x - send:0x%x=3D%d) send:%ld free:%ld\n", current->pid, (uint)tx, (uint)bt_buf.send, (int)tx - (int)bt_buf.send, - bt_buf.send - bt_buf.head, - bt_buf.free - bt_buf.head); + (long int)(bt_buf.send - bt_buf.head), + (long int)(bt_buf.free - bt_buf.head)); =20=09=09 D_ERR("count:%d nbr_bufs:%d count:%d\n" , bt_buf.count, bt_buf.nbr_bufs, bt_buf.count); --- hci.c 2001/03/02 10:50:44 1.121 +++ hci.c 2001/03/02 21:52:15 1.122 @@ -318,7 +318,7 @@ =20 static s32 test_hci_hdl; =20 -static u8 do_send =3D 0; + =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 @@ -467,10 +467,10 @@ } } =20 - //if (do_send) { + host_nbrcompleted_packets(hci_hdl, 1); - //} - //do_send =3D !do_send; + + =20 /* When we change state we reset data_index, because we are using separate buffers for @@ -634,7 +634,7 @@ =20 case INQUIRY_RESULT: { - s32 i, j, k; + s32 i, j; u8 tmp_bd[6]; =20 D_CMD(__FUNCTION__", INQUIRY_RESULT\n"); --- rfcomm.c 2001/03/02 10:50:44 1.90 +++ rfcomm.c 2001/03/02 21:52:15 1.91 @@ -823,7 +823,7 @@ { #define FNC "rfcomm_disconnect_ind: " rfcomm_con *rfcomm; - s32 i; + D_CTRL(FNC"remote cid %d\n", l2cap->remote_cid); =20 rfcomm =3D ((rfcomm_con*) l2cap->upper_con); @@ -852,7 +852,7 @@ rfcomm_disconnect_cfm(l2cap_con *l2cap) { #define FNC "rfcomm_disconnect_cfm: " - s32 i; + rfcomm_con *rfcomm; =20=20=20 D_CTRL(FNC" disconnected\n"); |
From: Mats F. <ma...@us...> - 2001-05-15 14:36:52
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.1 Added bcsp_datagram.c 1.1 Added bcsp_integrity.c 1.1 Added bcsp_mux.c 1.1 Added bcsp_sequence.c 1.1 Added bcsp_slip.c 1.1 Added The accompanying log: Initial version |
From: Peter K. <pk...@us...> - 2001-05-17 15:25:17
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.2 1.3=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.1 1.2=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Cleaned up debug messages. The diff of the modified file(s): --- bcsp.c 2001/05/15 15:28:46 1.2 +++ bcsp.c 2001/05/17 15:25:15 1.3 @@ -56,10 +56,10 @@ =20 #if BCSP_DEBUG #define D(fmt...) printk("BCSP: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 #define BCSP_BCCMD_CHN 2 @@ -110,7 +110,7 @@ void bcsp_init(void) { - printk(__FUNCTION__", Initializing BCSP\n"); + printk(__FUNCTION__ ": Initializing BCSP\n"); sequence_init(); send_sync(); cli(); @@ -126,7 +126,7 @@ cli(); bcsp_sync =3D TRUE; sti(); - printk(__FUNCTION__", BCSP initialized and syncronized\n"); + printk(__FUNCTION__ ": BCSP initialized and syncronized\n"); wake_up_interruptible(&bcsp_sync_wq); } =20 @@ -147,7 +147,7 @@ hci_receive_acl(data, (s32)len); break; default: - D_ERR(__FUNCTION__", Unkown channel: %d\n", chn); + D_ERR(__FUNCTION__ ": Unkown channel: %d\n", chn); break; } return 0; @@ -159,13 +159,13 @@ s32 handled =3D 0; struct bcsp bcsp; =20 - D(__FUNCTION__", Incomming data:\n"); - PRINT_PKT(data, len); + D(__FUNCTION__ ": Incomming data:\n"); + PRINTPKT(data, len); =20 while (handled < len) { memset(&bcsp, 0, sizeof(bcsp)); handled +=3D slip_receive(&bcsp, data + handled, len - handled); - D(__FUNCTION__", so far handled:%d bytes\n", handled); + D(__FUNCTION__ ": So far handled: %d bytes\n", handled); if (bcsp.packet) { integrity_receive(&bcsp); kfree(bcsp.packet); @@ -195,16 +195,16 @@ sequence_send(data + 1, len - 1, BCSP_SCO_CHN); break; default: - D_ERR(__FUNCTION__", Unknown packet type: 0x%x\n", data[0]); + D_ERR(__FUNCTION__ ": Unknown packet type: 0x%x\n", data[0]); break; } } + s32 bcsp_write_lower(u8 *data, u32 len) { return bt_write_lower_driver(data, len); } - =20 void init_bcsp_packet(struct bcsp *bcsp) --- bcsp_datagram.c 2001/05/15 14:36:51 1.1 +++ bcsp_datagram.c 2001/05/17 15:25:15 1.2 @@ -57,10 +57,10 @@ =20 #if DATAGRAM_DEBUG #define D(fmt...) printk("DATAGRAM: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -80,24 +80,21 @@ s32 datagram_receive(struct bcsp *bcsp) { -=09 if (handle_sync_pkt(bcsp)) { - D(__FUNCTION__", Sync packet received, sending respose\n"); + D(__FUNCTION__ ": Sync packet received, sending respose\n"); return 0; } =20 - D(__FUNCTION__", Datagram packet received\n"); - PRINT_PKT(bcsp->payload, bcsp->payload_length); + D(__FUNCTION__ ": Datagram packet received\n"); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20=09 return 0; } =20 - s32 datagram_send(u8 *data, u32 len, u8 chn) { struct bcsp bcsp; - s32 tmp; =20=09 init_bcsp_packet(&bcsp); =20 @@ -109,7 +106,6 @@ return mux_send(&bcsp); } =20 - s32 handle_sync_pkt(struct bcsp *bcsp) { @@ -120,11 +116,11 @@ bcsp->payload[1],bcsp->payload[0]); =20 if (sync_string =3D=3D SYNC) { - D(__FUNCTION__", Found SYNC\n"); + D(__FUNCTION__ ": Found SYNC\n"); send_sync_rsp();=09=09 return TRUE; } else if (sync_string =3D=3D CONF) { - D(__FUNCTION__", Found CONF\n"); + D(__FUNCTION__ ": Found CONF\n"); send_conf_rsp(); return TRUE; } else { @@ -140,7 +136,7 @@ u32 sync =3D SYNC; s32 tmp; =20=09 - D(__FUNCTION__",%d \n", sizeof(struct bcsp)); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20=09 @@ -152,7 +148,7 @@ } memcpy(bcsp.payload, &sync, bcsp.payload_length); =20 - PRINT_PKT(bcsp.payload, bcsp.payload_length); + PRINTPKT(bcsp.payload, bcsp.payload_length); =20 tmp =3D mux_send(&bcsp); kfree(bcsp.payload); @@ -166,7 +162,7 @@ s32 tmp; u32 sync_rsp =3D SYNC_RSP; =20 - D(__FUNCTION__",%d \n", sizeof(struct bcsp)); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20 @@ -178,14 +174,13 @@ } memcpy(bcsp.payload, &sync_rsp, bcsp.payload_length); =20 - PRINT_PKT(bcsp.payload, bcsp.payload_length); + PRINTPKT(bcsp.payload, bcsp.payload_length); =20 tmp =3D mux_send(&bcsp); kfree(bcsp.payload); return tmp; } =20 - s32 send_conf_rsp(void) { @@ -193,7 +188,7 @@ s32 tmp; u32 conf_rsp =3D CONF_RSP; =20=09 - D(__FUNCTION__",\n"); + D(__FUNCTION__ "\n"); =20 init_bcsp_packet(&bcsp); =20=09 @@ -209,6 +204,5 @@ kfree(bcsp.payload); return tmp; } - =20 /****************** END OF FILE sequence.c *******************************= ***/ --- bcsp_integrity.c 2001/05/15 14:36:51 1.1 +++ bcsp_integrity.c 2001/05/17 15:25:15 1.2 @@ -52,10 +52,10 @@ =20 #if INTERGRITY_DEBUG #define D(fmt...) printk("INTEGRITY: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -95,12 +95,12 @@ bcsp->checksum =3D BCSP_GET_CHECKSUM(bcsp); =20 if (!verify_checksum(bcsp->packet, bcsp->checksum)) { - BCSP_SYS(__FUNCTION__", Incorrect checksum, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect checksum, discarding data\n"); return -ERR_CHECKSUM; } =20 if (!verify_length(bcsp)) { - BCSP_SYS(__FUNCTION__", Incorrect length, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect length, discarding data\n"); return -ERR_PAYLOAD_LENGTH; } =20=09 @@ -109,13 +109,13 @@ bcsp->packet[bcsp->packet_length - 2]); =20=09=09 if (!verify_crc(bcsp)) { - BCSP_SYS(__FUNCTION__", Incorrect CRC, discarding data\n"); + BCSP_SYS(__FUNCTION__ ": Incorrect CRC, discarding data\n"); } } =20 D("Found the payload\n"); bcsp->payload =3D bcsp->packet + 4; - PRINT_PKT(bcsp->payload, bcsp->payload_length); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20=09 return mux_receive(bcsp); } @@ -142,8 +142,8 @@ if ((u8)(~hdr_sum) =3D=3D checksum) { return TRUE; } else { - D(__FUNCTION__", hdr_sum : 0x%x\n", ~hdr_sum); - D(__FUNCTION__", checksum : 0x%x\n", checksum); + D(__FUNCTION__ ": hdr_sum: 0x%x\n", ~hdr_sum); + D(__FUNCTION__ ": checksum: 0x%x\n", checksum); return FALSE; } } @@ -165,12 +165,12 @@ { =20 if (BCSP_GET_CRC_PRESENT(bcsp)) { - D(__FUNCTION__", CRC is present\n"); - D(__FUNCTION__", payload length field: %d bytes, actual length: %d bytes= \n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE - BCSP_CRC_S= IZE);=20 + D(__FUNCTION__ ": CRC is present\n"); + D(__FUNCTION__ ": Payload length field: %d bytes, actual length: %d byte= s\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE - BCSP_CRC_= SIZE);=20 return (bcsp->payload_length =3D=3D (bcsp->packet_length - BCSP_HDR_SIZE= - BCSP_CRC_SIZE)); } else { - D(__FUNCTION__", CRC is not present\n"); - D(__FUNCTION__", payload length field says %d bytes, actual length is %d= bytes\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE); + D(__FUNCTION__ ": CRC is not present\n"); + D(__FUNCTION__ ": Payload length field says %d bytes, actual length is %= d bytes\n", bcsp->payload_length, bcsp->packet_length - BCSP_HDR_SIZE); return (bcsp->payload_length =3D=3D (bcsp->packet_length - BCSP_HDR_SIZE= )); } } @@ -202,7 +202,7 @@ update_crc(&crc, bcsp->packet[i]); } =20 - D(__FUNCTION__", CRC value is 0x%04x\n", crc); + D(__FUNCTION__ ": CRC value is 0x%04x\n", crc); =20 return crc; } --- bcsp_mux.c 2001/05/15 14:36:51 1.1 +++ bcsp_mux.c 2001/05/17 15:25:15 1.2 @@ -50,10 +50,8 @@ =20 #if MUX_DEBUG #define D(fmt...) printk("MUX: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -73,20 +71,20 @@ /* If we received an ack packet, we discards the packet, sice the ack has already been handled by signal_rxack */ if (bcsp->identifier =3D=3D 0) { - D(__FUNCTION__", received ack, returning\n"); + D(__FUNCTION__ ": Received ack, returning\n"); signal_rxack(BCSP_GET_ACK(bcsp)); return 0; } =20=09 if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_RELIABLE) { - D(__FUNCTION__", Sending to sequencing layer\n"); + D(__FUNCTION__ ": Sending to sequencing layer\n"); return sequence_receive(bcsp); } else if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_UNRELIABLE) { - D(__FUNCTION__", Sending to datagram layer\n"); + D(__FUNCTION__ ": Sending to datagram layer\n"); return datagram_receive(bcsp); } else { /* This shouldn't be possible */ - BCSP_SYS(__FUNCTION__", Packet is neither Reliable nor unreliable \n"); + BCSP_SYS(__FUNCTION__ ": Packet is neither reliable nor unreliable\n"); } return 0; } @@ -94,7 +92,7 @@ s32 mux_send(struct bcsp *bcsp) { - D(__FUNCTION__",\n"); + D(__FUNCTION__ "\n"); return integrity_send(bcsp); } =20 @@ -103,7 +101,7 @@ struct bcsp bcsp; s32 tmp; =20 - D(__FUNCTION__", txack: 0x%x\n", txack); + D(__FUNCTION__ ": txack: 0x%x\n", txack); =20 init_bcsp_packet(&bcsp); =20=09 --- bcsp_sequence.c 2001/05/15 14:36:51 1.1 +++ bcsp_sequence.c 2001/05/17 15:25:15 1.2 @@ -52,10 +52,8 @@ =20 #if SEQUENCE_DEBUG #define D(fmt...) printk("SEQUENCE: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) #endif =20 /****************** TYPE DEFINITION SECTION ******************************= ***/ @@ -148,7 +146,7 @@ remote_ack_nbr =3D ack; =20=09 if (last_ack =3D=3D ack) { - printk(__FUNCTION__", Got incorrect ack:%d, seq_nbr:%d\n", ack, seq_nbr); + printk(__FUNCTION__ ": Got incorrect ack:%d, seq_nbr:%d\n", ack, seq_nbr= ); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) queue_task(&resend_data_task, &tq_scheduler); #else @@ -156,7 +154,7 @@ mark_bh(IMMEDIATE_BH); #endif } else { - D(__FUNCTION__", Got rx ack:%d\n", ack); + D(__FUNCTION__ ": Got rx ack:%d\n", ack); } last_ack =3D ack; } @@ -167,7 +165,7 @@ =20 while (remote_ack_nbr !=3D seq_nbr) { =20=09 - printk(__FUNCTION__", resending seq_nbr:%d, last sent was %d\n", remote_= ack_nbr, seq_nbr); + printk(__FUNCTION__ ": Resending seq_nbr:%d, last sent was %d\n", remote= _ack_nbr, seq_nbr); =20=09=09 init_bcsp_packet(&bcsp); =20=09=09 --- bcsp_slip.c 2001/05/15 14:36:51 1.1 +++ bcsp_slip.c 2001/05/17 15:25:15 1.2 @@ -49,10 +49,10 @@ =20 #if SLIP_DEBUG #define D(fmt...) printk("SLIP: "fmt) -#define PRINT_PKT(data, len) print_data("", data, len) +#define PRINTPKT(data, len) print_data(NULL, data, len) #else #define D(fmt...) -#define PRINT_PKT(data, len) +#define PRINTPKT(data, len) #endif =20 =20 @@ -92,8 +92,8 @@ { s32 i; =20 - D(__FUNCTION__",\n"); - PRINT_PKT(bcsp->payload, bcsp->payload_length); + D(__FUNCTION__ "\n"); + PRINTPKT(bcsp->payload, bcsp->payload_length); =20 if (!(bcsp->packet =3D kmalloc(2 * (4 + bcsp->payload_length) + 2, GFP_AT= OMIC))) { return -ENOMEM; @@ -136,7 +136,7 @@ static s32 skipping =3D TRUE; s32 i =3D 0; =20 - D(__FUNCTION__", \n"); + D(__FUNCTION__ "\n"); =20=09 if (skipping) { while (i < len) { |
From: Peter K. <pk...@us...> - 2001-05-18 16:03:52
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.3 1.4=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made all global function names start with bcsp_. The diff of the modified file(s): --- bcsp.c 2001/05/18 15:38:01 1.7 +++ bcsp.c 2001/05/18 16:03:51 1.8 @@ -113,8 +113,8 @@ bcsp_init(void) { BCSP_SYS(__FUNCTION__ ": Initializing BCSP\n"); - sequence_init(); - send_sync(); + bcsp_sequence_init(); + bcsp_send_sync(); cli(); if (!bcsp_sync) { interruptible_sleep_on(&bcsp_sync_wq); @@ -126,7 +126,7 @@ bcsp_shutdown(void) { BCSP_SYS(__FUNCTION__": Shuting down BCSP\n"); - sequence_shutdown(); + bcsp_sequence_shutdown(); } =20 void @@ -172,11 +172,11 @@ PRINTPKT(data, len); =20 while (handled < len) { - init_bcsp_packet(&bcsp); - handled +=3D slip_receive(&bcsp, data + handled, len - handled); + bcsp_init_packet(&bcsp); + handled +=3D bcsp_slip_receive(&bcsp, data + handled, len - handled); D(__FUNCTION__ ": So far handled: %d bytes\n", handled); if (bcsp.packet) { - integrity_receive(&bcsp); + bcsp_integrity_receive(&bcsp); kfree(bcsp.packet); } } @@ -193,16 +193,16 @@ case CMD_PKT: opcode =3D le16_to_cpu(get_unaligned((u16 *)&data[1])); if (hci_get_ocf(opcode) =3D=3D BCSP_OCF) { - ret =3D sequence_send(data + 5, len - 5, data[4] & 0x3f); + ret =3D bcsp_sequence_send(data + 5, len - 5, data[4] & 0x3f); } else { - ret =3D sequence_send(data + 1, len - 1, BCSP_CMD_CHN); + ret =3D bcsp_sequence_send(data + 1, len - 1, BCSP_CMD_CHN); } break; case ACL_PKT: - ret =3D sequence_send(data + 1, len - 1, BCSP_ACL_CHN); + ret =3D bcsp_sequence_send(data + 1, len - 1, BCSP_ACL_CHN); break; case SCO_PKT: - ret =3D sequence_send(data + 1, len - 1, BCSP_SCO_CHN); + ret =3D bcsp_sequence_send(data + 1, len - 1, BCSP_SCO_CHN); break; default: D_ERR(__FUNCTION__ ": Unknown packet type: 0x%x\n", data[0]); @@ -222,7 +222,7 @@ } =20 void -init_bcsp_packet(struct bcsp *bcsp) +bcsp_init_packet(struct bcsp *bcsp) { memset(bcsp, 0, sizeof *bcsp); }; --- bcsp_datagram.c 2001/05/18 15:42:13 1.3 +++ bcsp_datagram.c 2001/05/18 16:03:51 1.4 @@ -82,7 +82,7 @@ /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 s32 -datagram_receive(struct bcsp *bcsp) +bcsp_datagram_receive(struct bcsp *bcsp) { if (handle_sync_pkt(bcsp)) { D(__FUNCTION__ ": Sync packet received, sending respose\n"); @@ -96,18 +96,18 @@ } =20 s32 -datagram_send(u8 *data, u32 len, u8 chn) +bcsp_datagram_send(u8 *data, u32 len, u8 chn) { struct bcsp bcsp; =20=09 - init_bcsp_packet(&bcsp); + bcsp_init_packet(&bcsp); =20 BCSP_SET_PROTOCOL_TYPE(&bcsp, BCSP_UNRELIABLE); =20=09 bcsp.payload =3D data; bcsp.payload_length =3D len; =20=09 - return mux_send(&bcsp); + return bcsp_mux_send(&bcsp); } =20 s32 @@ -135,7 +135,7 @@ } =20 s32 -send_sync(void) +bcsp_send_sync(void) { return send_sync_pkt(SYNC); } @@ -160,13 +160,13 @@ =20=09 D(__FUNCTION__ "\n"); =20 - init_bcsp_packet(&bcsp); + bcsp_init_packet(&bcsp); =20=09 bcsp.identifier =3D 1;=20 bcsp.payload =3D (u8 *)&payload; bcsp.payload_length =3D sizeof(u32); =20 - return mux_send(&bcsp); + return bcsp_mux_send(&bcsp); } =20 /****************** END OF FILE sequence.c *******************************= ***/ --- bcsp_integrity.c 2001/05/18 15:39:45 1.4 +++ bcsp_integrity.c 2001/05/18 16:03:51 1.5 @@ -89,7 +89,7 @@ /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 s32 -integrity_receive(struct bcsp* bcsp) +bcsp_integrity_receive(struct bcsp* bcsp) { bcsp->flags =3D BCSP_GET_FLAGS(bcsp); bcsp->identifier =3D BCSP_GET_IDENTIFIER(bcsp); @@ -118,11 +118,11 @@ bcsp->payload =3D bcsp->packet + BCSP_HDR_SIZE; PRINTPKT(bcsp->payload, bcsp->payload_length); =20 - return mux_receive(bcsp); + return bcsp_mux_receive(bcsp); } =20 s32 -integrity_send(struct bcsp* bcsp) +bcsp_integrity_send(struct bcsp* bcsp) { bcsp->checksum =3D calc_checksum(bcsp->flags, bcsp->identifier, bcsp->pay= load_length); =20 @@ -130,7 +130,7 @@ bcsp->crc =3D calc_crc(bcsp); } =20 - return slip_send(bcsp); + return bcsp_slip_send(bcsp); } =20 s32 --- bcsp_mux.c 2001/05/18 15:18:17 1.4 +++ bcsp_mux.c 2001/05/18 16:03:51 1.5 @@ -65,22 +65,22 @@ /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 s32 -mux_receive(struct bcsp *bcsp) +bcsp_mux_receive(struct bcsp *bcsp) { /* If we received an ack packet, we discard the packet, sice the ack has already been handled by signal_rxack */ if (bcsp->identifier =3D=3D 0) { D(__FUNCTION__ ": Received ack, returning\n"); - signal_rxack(BCSP_GET_ACK(bcsp)); + bcsp_signal_rxack(BCSP_GET_ACK(bcsp)); return 0; } =20=09 if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_RELIABLE) { D(__FUNCTION__ ": Sending to sequencing layer\n"); - return sequence_receive(bcsp); + return bcsp_sequence_receive(bcsp); } else if (BCSP_GET_PROTOCOL_TYPE(bcsp) =3D=3D BCSP_UNRELIABLE) { D(__FUNCTION__ ": Sending to datagram layer\n"); - return datagram_receive(bcsp); + return bcsp_datagram_receive(bcsp); } else { /* This shouldn't be possible */ BCSP_SYS(__FUNCTION__ ": Packet is neither reliable nor unreliable\n"); @@ -89,26 +89,26 @@ } =20 s32 -mux_send(struct bcsp *bcsp) +bcsp_mux_send(struct bcsp *bcsp) { D(__FUNCTION__ "\n"); - return integrity_send(bcsp); + return bcsp_integrity_send(bcsp); } =20 -s32 send_txack(u8 txack) +s32 bcsp_send_txack(u8 txack) { struct bcsp bcsp; =20 D(__FUNCTION__ ": txack: 0x%x\n", txack); =20 - init_bcsp_packet(&bcsp); + bcsp_init_packet(&bcsp); =20=09 BCSP_SET_ACK(&bcsp, txack); BCSP_SET_SEQ(&bcsp, 0); bcsp.identifier =3D 0; /* According to AN004.pdf page 20 */ bcsp.payload_length =3D 0; =20 - return integrity_send(&bcsp); + return bcsp_integrity_send(&bcsp); } =20 /****************** END OF FILE mux.c ************************************= ***/ --- bcsp_sequence.c 2001/05/18 13:58:17 1.7 +++ bcsp_sequence.c 2001/05/18 16:03:51 1.8 @@ -103,7 +103,7 @@ /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 void -sequence_init(void) +bcsp_sequence_init(void) { resend_data_task.routine =3D (void*)sequence_resend; resend_data_task.data =3D NULL; @@ -113,13 +113,13 @@ } =20 void -sequence_shutdown(void) +bcsp_sequence_shutdown(void) { release_resend_timer(); } =20 s32 -sequence_receive(struct bcsp *bcsp) +bcsp_sequence_receive(struct bcsp *bcsp) { if (!got_packet) { got_packet =3D TRUE; @@ -149,14 +149,13 @@ return 0; } =20 - s32 -sequence_send(u8 *data, u32 len, u8 chn) +bcsp_sequence_send(u8 *data, u32 len, u8 chn) { struct bcsp bcsp; =20=09 if (winspace > 0) { - init_bcsp_packet(&bcsp); + bcsp_init_packet(&bcsp); =20=09=09 bcsp.identifier =3D chn; =20=09=09 @@ -187,13 +186,12 @@ return 0; } =20=09=09 - return mux_send(&bcsp); + return bcsp_mux_send(&bcsp); } =20 void -signal_rxack(u8 new_ack) +bcsp_signal_rxack(u8 new_ack) { - D(__FUNCTION__": Got rxack:%d\n", new_ack); =20=09 if (rxack =3D=3D new_ack) { @@ -239,7 +237,7 @@ while (resend_cnt !=3D txseq) { printk(__FUNCTION__": Resending with seq_nbr:%d, last ack was %d, cur se= q_nbr:%d\n", resend_cnt, rxack, txseq); =20=09=09 - init_bcsp_packet(&bcsp); + bcsp_init_packet(&bcsp); =20=09=09 bcsp.identifier =3D resend_buffer[resend_cnt].chn; =20=09=09 @@ -252,7 +250,7 @@ bcsp.payload =3D resend_buffer[resend_cnt].data; bcsp.payload_length =3D resend_buffer[resend_cnt].len; =20=09=09 - mux_send(&bcsp); + bcsp_mux_send(&bcsp); resend_cnt =3D (resend_cnt + 1) % 8; } =20 @@ -262,7 +260,7 @@ void send_ack(void) { - send_txack(txack); + bcsp_send_txack(txack); } =20 void --- bcsp_slip.c 2001/05/18 13:48:46 1.3 +++ bcsp_slip.c 2001/05/18 16:03:51 1.4 @@ -59,38 +59,20 @@ =20 /****************** LOCAL FUNCTION DECLARATION SECTION *******************= ***/ =20 +static void slip_send_add_byte(struct bcsp* bcsp, u8 data); + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 /****************** FUNCTION DEFINITION SECTION **************************= ***/ =20 -static void -slip_send_add_byte(struct bcsp* bcsp, u8 data) -{ - switch (data) { - case 0xC0: - bcsp->packet[bcsp->packet_length++] =3D 0xDB; - bcsp->packet[bcsp->packet_length++] =3D 0xDC; - break; - - case 0xDB: - bcsp->packet[bcsp->packet_length++] =3D 0xDB; - bcsp->packet[bcsp->packet_length++] =3D 0xDD; - break; - - default: - bcsp->packet[bcsp->packet_length++] =3D data; - break; - } -} - s32 -slip_send(struct bcsp* bcsp) +bcsp_slip_send(struct bcsp* bcsp) { s32 i; =20 - D(__FUNCTION__ "\n"); + D(__FUNCTION__ ":\n"); PRINTPKT(bcsp->payload, bcsp->payload_length); =20 if (!(bcsp->packet =3D kmalloc(2 * (4 + bcsp->payload_length) + 2, GFP_AT= OMIC))) { @@ -127,7 +109,7 @@ } =20 s32 -slip_receive(struct bcsp* bcsp, const u8* packet, u32 len) +bcsp_slip_receive(struct bcsp* bcsp, const u8* packet, u32 len) { static u8 buffer[4 + 4096 + 2 + 1]; static s32 length =3D 0; @@ -188,6 +170,26 @@ } =20 return i; +} + +void +slip_send_add_byte(struct bcsp* bcsp, u8 data) +{ + switch (data) { + case 0xC0: + bcsp->packet[bcsp->packet_length++] =3D 0xDB; + bcsp->packet[bcsp->packet_length++] =3D 0xDC; + break; + + case 0xDB: + bcsp->packet[bcsp->packet_length++] =3D 0xDB; + bcsp->packet[bcsp->packet_length++] =3D 0xDD; + break; + + default: + bcsp->packet[bcsp->packet_length++] =3D data; + break; + } } =20 /****************** END OF FILE slip.c ***********************************= ***/ |
From: Peter K. <pk...@us...> - 2001-05-30 18:43:37
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.10 1.11=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.4 1.5=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Added definition of __NO_VERSION__ to get rid of symbol redefinitions. The diff of the modified file(s): --- bcsp.c 2001/05/25 14:07:56 1.10 +++ bcsp.c 2001/05/30 09:47:00 1.11 @@ -41,6 +41,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <linux/string.h> #include <linux/types.h> --- bcsp_datagram.c 2001/05/25 14:09:17 1.5 +++ bcsp_datagram.c 2001/05/30 09:47:00 1.6 @@ -42,6 +42,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <asm/byteorder.h> #include <asm/unaligned.h> --- bcsp_integrity.c 2001/05/18 16:03:51 1.5 +++ bcsp_integrity.c 2001/05/30 09:47:00 1.6 @@ -42,6 +42,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <asm/byteorder.h> #include <asm/unaligned.h> =20 --- bcsp_mux.c 2001/05/25 14:10:26 1.6 +++ bcsp_mux.c 2001/05/30 09:47:00 1.7 @@ -41,6 +41,8 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> =20 #include <linux/bluetooth/bcsp.h> --- bcsp_sequence.c 2001/05/25 14:12:50 1.9 +++ bcsp_sequence.c 2001/05/30 09:47:00 1.10 @@ -42,12 +42,15 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> #include <linux/types.h> -#include <linux/bluetooth/bcsp.h> #include <linux/interrupt.h> #include <linux/timer.h> + #include <linux/bluetooth/sysdep-2.1.h> +#include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_slip.c 2001/05/18 16:03:51 1.4 +++ bcsp_slip.c 2001/05/30 09:47:00 1.5 @@ -41,7 +41,10 @@ =20 /****************** INCLUDE FILES SECTION ********************************= ***/ =20 +#define __NO_VERSION__ /* don't define kernel_version in module.h */ + #include <linux/malloc.h> + #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> =20 |
From: Peter K. <pk...@us...> - 2001-08-16 13:01:53
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.6 1.7=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.8 1.9=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.16 1.17=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.5 1.6=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Made the BCSP files at least compile for user mode. The diff of the modified file(s): --- bcsp.c 2001/07/06 06:48:54 1.16 +++ bcsp.c 2001/08/16 13:01:22 1.17 @@ -43,22 +43,36 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <linux/malloc.h> #include <linux/string.h> #include <linux/types.h> #include <linux/delay.h> + #include <asm/byteorder.h> #include <asm/unaligned.h> =20 - #include <linux/bluetooth/sysdep-2.1.h> #include <linux/bluetooth/btcommon.h> +#include <linux/bluetooth/bluetooth.h> +#include <linux/bluetooth/hci.h> #include <linux/bluetooth/btmem.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> -#include <linux/bluetooth/bluetooth.h> -#include <linux/bluetooth/hci.h> +#else +#include <stdlib.h> +#include <errno.h> + +#include <asm/unaligned.h> =20 +#include "btcommon.h" +#include "bluetooth.h" +#include "hci.h" +#include "btmem.h" +#include "bcsp.h" +#include "bcsp_debug.h" +#endif + /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 #if BCSP_DEBUG @@ -89,7 +103,9 @@ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 +#ifdef __KERNEL__ static struct timer_list bcsp_sync_timer; +#endif #if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2,4,0) static wait_queue_head_t bcsp_sync_wq; #else --- bcsp_datagram.c 2001/07/31 18:06:40 1.8 +++ bcsp_datagram.c 2001/08/16 13:01:22 1.9 @@ -44,15 +44,23 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <linux/malloc.h> + #include <asm/byteorder.h> #include <asm/unaligned.h> =20 - #include <linux/bluetooth/sysdep-2.1.h> +#include <linux/bluetooth/btcommon.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> -#include <linux/bluetooth/btcommon.h> +#else +#include <asm/unaligned.h> + +#include "btcommon.h" +#include "bcsp.h" +#include "bcsp_debug.h" +#endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 --- bcsp_integrity.c 2001/05/30 09:47:00 1.6 +++ bcsp_integrity.c 2001/08/16 13:01:22 1.7 @@ -44,13 +44,21 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <asm/byteorder.h> #include <asm/unaligned.h> =20 #include <linux/bluetooth/sysdep-2.1.h> +#include <linux/bluetooth/btcommon.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> -#include <linux/bluetooth/btcommon.h> +#else +#include <asm/unaligned.h> + +#include "btcommon.h" +#include "bcsp.h" +#include "bcsp_debug.h" +#endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 --- bcsp_mux.c 2001/07/20 06:41:00 1.8 +++ bcsp_mux.c 2001/08/16 13:01:22 1.9 @@ -43,10 +43,15 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <linux/malloc.h> =20 #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> +#else +#include "bcsp.h" +#include "bcsp_debug.h" +#endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 --- bcsp_sequence.c 2001/07/31 17:59:25 1.16 +++ bcsp_sequence.c 2001/08/16 13:01:22 1.17 @@ -44,6 +44,7 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <linux/malloc.h> #include <linux/types.h> #include <linux/interrupt.h> @@ -54,6 +55,12 @@ #include <linux/bluetooth/hci.h> #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> +#else +#include "btmem.h" +#include "hci.h" +#include "bcsp.h" +#include "bcsp_debug.h" +#endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 @@ -89,8 +96,10 @@ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ =20 +#ifdef __KERNEL__ static struct tq_struct resend_data_task; static struct tq_struct send_ack_task; +#endif =20 #if BCSP_PARSELOWER u8 txseq; @@ -108,7 +117,9 @@ =20 static u8 rtx_count =3D BCSP_RTX_MAX; =20 +#ifdef __KERNEL__ static struct timer_list resend_timer; +#endif =20 static u8 resend_timer_active =3D FALSE; =20 @@ -119,11 +130,13 @@ void bcsp_sequence_init(void) { +#ifdef __KERNEL__ resend_data_task.routine =3D (void*)sequence_resend; resend_data_task.data =3D NULL; =20 send_ack_task.routine =3D (void*)send_ack; send_ack_task.data =3D NULL; +#endif =20 txseq =3D 0; txack =3D 0; @@ -311,7 +324,6 @@ } } =20 - void send_ack(void) { @@ -329,6 +341,7 @@ release_resend_timer(); } =20=09 +#ifdef __KERNEL__ init_timer(&resend_timer); resend_timer.function =3D (void*)sequence_resend; resend_timer.data =3D 0; @@ -337,6 +350,7 @@ resend_timer_active =3D TRUE; =20=09 add_timer(&resend_timer); +#endif } =20 void @@ -344,7 +358,9 @@ { if (resend_timer_active) { resend_timer_active =3D FALSE; +#ifdef __KERNEL__ del_timer(&resend_timer); +#endif } } =20 --- bcsp_slip.c 2001/05/30 09:47:00 1.5 +++ bcsp_slip.c 2001/08/16 13:01:22 1.6 @@ -43,10 +43,19 @@ =20 #define __NO_VERSION__ /* don't define kernel_version in module.h */ =20 +#ifdef __KERNEL__ #include <linux/malloc.h> =20 #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> +#else +#include <stdlib.h> +#include <errno.h> + +#include "btcommon.h" +#include "bcsp.h" +#include "bcsp_debug.h" +#endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ =20 |
From: Peter K. <pk...@us...> - 2001-09-18 13:04:27
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Comment ---- ----------- ----------- ------- bcsp.c 1.20 1.21=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_datagram.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_integrity.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_mux.c 1.9 1.10=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_sequence.c 1.18 1.19=20=20=20=20=20=20=20=20=20=20=20=20 bcsp_slip.c 1.7 1.8=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: Corrected user mode includes. The diff of the modified file(s): --- bcsp.c 2001/09/18 12:10:49 1.20 +++ bcsp.c 2001/09/18 13:04:27 1.21 @@ -64,11 +64,11 @@ =20 #include <asm/unaligned.h> =20 -#include "btcommon.h" -#include "bluetooth.h" -#include "hci.h" -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/btcommon.h" +#include "include/bluetooth.h" +#include "include/hci.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_datagram.c 2001/08/16 13:01:22 1.9 +++ bcsp_datagram.c 2001/09/18 13:04:27 1.10 @@ -57,9 +57,9 @@ #else #include <asm/unaligned.h> =20 -#include "btcommon.h" -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/btcommon.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_integrity.c 2001/08/16 13:01:22 1.7 +++ bcsp_integrity.c 2001/09/18 13:04:27 1.8 @@ -55,9 +55,9 @@ #else #include <asm/unaligned.h> =20 -#include "btcommon.h" -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/btcommon.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_mux.c 2001/08/16 13:01:22 1.9 +++ bcsp_mux.c 2001/09/18 13:04:27 1.10 @@ -49,8 +49,8 @@ #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> #else -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_sequence.c 2001/09/18 12:20:17 1.18 +++ bcsp_sequence.c 2001/09/18 13:04:27 1.19 @@ -56,10 +56,10 @@ #include <linux/bluetooth/bcsp.h> #include <linux/bluetooth/bcsp_debug.h> #else -#include "btmem.h" -#include "hci.h" -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/btmem.h" +#include "include/hci.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ --- bcsp_slip.c 2001/09/18 12:10:49 1.7 +++ bcsp_slip.c 2001/09/18 13:04:27 1.8 @@ -54,10 +54,10 @@ #include <stdlib.h> #include <errno.h> =20 -#include "btcommon.h" -#include "btmem.h" -#include "bcsp.h" -#include "bcsp_debug.h" +#include "include/btcommon.h" +#include "include/btmem.h" +#include "include/bcsp.h" +#include "include/bcsp_debug.h" #endif =20 /****************** CONSTANT AND MACRO SECTION ***************************= ***/ |
From: Anders J. <and...@us...> - 2003-03-06 16:12:22
|
The following files were modified in linux/drivers/char/bluetooth: Name Old version New version Tag Comment ---- ----------- ----------- --- ------- bluetooth.c 1.237 1.238=20=20=20=20=20=20=20=20=20=20=20=20=20 hci.c 1.208 1.209=20=20=20=20=20=20=20=20=20=20=20=20=20 l2cap.c 1.135 1.136=20=20=20=20=20=20=20=20=20=20=20=20=20 rfcomm.c 1.138 1.139=20=20=20=20=20=20=20=20=20=20=20=20=20 test.c 1.38 1.39=20=20=20=20=20=20=20=20=20=20=20=20=20=20 unplug_test.c 1.14 1.15=20=20=20=20=20=20=20=20=20=20=20=20=20=20 The accompanying log: * Added some testcases. * Added more command to testlayer. * Improved errorhandling when receiving corrupt headers in l2cap. * Corrected usage of some bits in rpn-messages in rfcomm. * Corrected read_remote_name, it now uses the length specified correclty (t= hanks to Ed Orchard). The diff of the modified file(s): --- bluetooth.c 6 Feb 2003 15:36:20 -0000 1.237 +++ bluetooth.c 6 Mar 2003 16:04:00 -0000 1.238 @@ -746,12 +746,16 @@ copy_from_user(&length, (s32*)arg + 1, sizeof length); =20=09=09 con_hdl =3D bt_get_conhdl_from_line(line); + if(con_hdl >=3D 0) { + /* get_remote_name will set max BT_NAME_LENGTH chars + in remote_name if specified length happend to be + more than that */ err =3D get_remote_name(con_hdl, remote_name, length); } else { err =3D -EINVAL; } - copy_to_user((s32*)arg, remote_name, BT_NAME_LENGTH); + copy_to_user((s32*)arg, remote_name, length); return err; } =20 --- hci.c 6 Feb 2003 15:36:20 -0000 1.208 +++ hci.c 6 Mar 2003 16:03:57 -0000 1.209 @@ -511,7 +511,8 @@ header and we silently discard the previous packet */ =20 if(get_inbuffer(hci_hdl)) { - D_ERR(__FUNCTION__ ": Discarding data in previous buffer\n"); + D_ERR(__FUNCTION__ ": Received new frame while waiting for a continu= ation frame" + ", channel unreliable\n"); hci_clear_buffer(hci_hdl); } =20 --- l2cap.c 13 Jan 2003 19:48:32 -0000 1.135 +++ l2cap.c 6 Mar 2003 16:03:59 -0000 1.136 @@ -222,6 +222,12 @@ =20 #endif =20 +#if CONFIG_BLUETOOTH_UNPLUG_TEST +extern s32 add_value; +extern u16 contflag; +#endif + + /****************** GLOBAL VARIABLE DECLARATION SECTION ******************= ***/ =20 /****************** LOCAL VARIABLE DECLARATION SECTION *******************= ***/ @@ -525,6 +531,14 @@ =20=20=20=20=20 D_RCV(__FUNCTION__ ": New frame len:%d cid:%d\n", pkt_len, pkt_cid); =20 + if(len > *l2cap_len) { + /* We have received more data than the l2cap header + specified, discard this buffer */ + DSYS(__FUNCTION__ ": Received %d bytes, expected %d bytes, channel unre= liable\n", len, *l2cap_len); + hci_clear_buffer(hci_handle); + return; + } +=09=09 /* check length */ if (!(pkt_len =3D=3D (len - L2CAP_HDRSIZE))) return; @@ -532,7 +546,7 @@ /* Not recieved full frame yet or BIG packet */ =20=09=09 if (len > *l2cap_len) { - DSYS(__FUNCTION__ ": BIG PACKET ! (%d bytes) discard\n", len); + DSYS(__FUNCTION__ ": Received %d bytes, expected %d bytes, channel unre= liable\n", len, *l2cap_len); hci_clear_buffer(hci_handle); } return; @@ -2203,7 +2217,11 @@ =20 /* Request header */ req->dst_cid =3D cpu_to_le16(con->remote_cid); /* Sending end */ - req->flags =3D 0; /* Negotiate same as remote */ +#ifdef CONFIG_BLUETOOTH_UNPLUG_TEST + req->flags =3D cpu_to_le16(contflag); /* Negotiate same as remote */ +#else + req->flags =3D 0; +#endif =20 /* Signalling header */ cmd->code =3D SIG_CONFREQ; @@ -2743,7 +2761,12 @@ =20 l2cap_buf =3D (l2cap_tx_buf *)(tx->data); =20 +#ifdef CONFIG_BLUETOOTH_UNPLUG_TEST + /* Used to send packets with incorrect header */ + SET_L2CAP_HDR(l2cap_buf->frame, tx->cur_len + add_value, con->remote_cid); +#else SET_L2CAP_HDR(l2cap_buf->frame, tx->cur_len, con->remote_cid); +#endif =20 /* pb_flag is set from hci_send_data */ tx->hci_hdl =3D con->hci_hdl; --- rfcomm.c 1 Nov 2002 10:30:16 -0000 1.138 +++ rfcomm.c 6 Mar 2003 16:04:05 -0000 1.139 @@ -138,6 +138,8 @@ =20 #define RFCOMM_MAX_HDR_SIZE 5 =20 +/* Set to 0 if you intend to initiate connections with no credit based flo= w control */ +#define CL_BITS 0xf #define MAX_CREDITS 30 #define START_CREDITS 7 #define MIN_CREDITS 6 @@ -756,8 +758,8 @@ /* must fit i l2cap mtu */ D_CTRL(FNC"negotiate mtu : %d bytes\n", rfcomm->l2cap->remote_mtu - 5); - return send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, 0, 0, - tmp_dlci, TRUE); + return send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, CL_BITS, START= _CREDITS, + tmp_dlci, FALSE); } =20 return 0; @@ -1143,8 +1145,8 @@ ((~rfcomm->initiator) & 0x1)); =20 /* must fit in l2cap mtu incl rfcomm hdrs */ - send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, 0, - 0, tmp_dlci, TRUE); + send_pn_msg(rfcomm, 7, rfcomm->dlci[tmp_dlci].mtu, CL_BITS, + START_CREDITS, tmp_dlci, TRUE); rfcomm->dlci[tmp_dlci].state =3D NEGOTIATING; =20 } else if (rfcomm->dlci[tmp_dlci].state =3D=3D NEGOTIATING) { @@ -1577,6 +1579,7 @@ for now) */ D_CTRL(FNC"Received Remote port negotiation respons\n"); memcpy(&rpn_val, &mcc_short_pkt->value[1], 8); + memset(&rpn_val.pm, 0xff, 2); rfcomm_rpn_msg(rfcomm, MCC_RSP, tmp_dlci, 0); /* Zero the parametermask after respons */ memset(&rpn_val.pm, 0, 2); @@ -2182,6 +2185,7 @@ rpn_msg* rpn_pkt; u32 rfcomm_frame_size; u32 rfcomm_payload_size; + s32 retval; =20 rfcomm_frame_size =3D sizeof(rpn_msg); =20 @@ -2218,17 +2222,20 @@ rpn_pkt->dlci.d =3D dlci & 1; rpn_pkt->dlci.server_chn =3D (dlci >> 1); =20 + memset(&rpn_val.pm, 0xff, 2); + if (req) { rpn_pkt->mcc_s_head.length.len =3D 1; /* Fix, since the packet is ends here when it is a request */ rpn_pkt->rpn_val.bit_rate =3D rpn_pkt->fcs; - return l2cap_send_data(tx_buf, rfcomm->l2cap); } else { rpn_pkt->mcc_s_head.length.len =3D 8; memcpy(&(rpn_pkt->rpn_val), &rpn_val, sizeof(rpn_values)); - //print_data("",(u8*) rpn_pkt, rfcomm_frame_size); - return l2cap_send_data(tx_buf, rfcomm->l2cap); } + + retval =3D l2cap_send_data(tx_buf, rfcomm->l2cap); + memset(&rpn_val.pm, 0, 2); + return retval; } =20 s32 --- test.c 14 Jan 2003 15:19:03 -0000 1.38 +++ test.c 6 Mar 2003 16:04:08 -0000 1.39 @@ -158,6 +158,7 @@ void test_init(void) { protocol_layer this_layer; + int i; =20 DSYS("Initialising TEST\n"); =20 @@ -176,6 +177,9 @@ l2cap_register_upper(L2CAP_TEST_LAYER, &this_layer); l2cap_register_upper(L2CAP_TEST2_LAYER, &this_layer); l2cap_register_upper(L2CAP_TEST3_LAYER, &this_layer); + for(i =3D 0 ; i < UPTEST_DATA_LEN ; i ++) { + testdata[i] =3D (unsigned char)i; + } } =20 void test_shutdown(void) @@ -354,15 +358,7 @@ D_STATE("test_config_ind : remote cid : %d remote_mtu : %d\n", con->remote_cid, con->remote_mtu); =20 - if(dont_accept_mtu) { - if (l2ca_config_rsp(con, 640, NULL, CONF_FAILURE)) { - D_ERR("test_config_ind : Configuration response failed\n"); - } - dont_accept_mtu =3D 0; - } - else if (l2ca_config_rsp(con, 0, NULL, CONF_SUCCESS)) { - D_ERR("test_config_ind : Configuration response failed\n"); - } +=09 =20 /* Are we ready with our sides configuration */ if (!l2ca_local_conf_done(con) && !con->conf_req_sent) { @@ -397,13 +393,23 @@ =20 } else D_RCV("already ready with config req\n"); + + if(dont_accept_mtu) { + if (l2ca_config_rsp(con, 640, NULL, CONF_FAILURE)) { + D_ERR("test_config_ind : Configuration response failed\n"); + } + dont_accept_mtu =3D 0; + } + else if (l2ca_config_rsp(con, 0, NULL, CONF_SUCCESS)) { + D_ERR("test_config_ind : Configuration response failed\n"); + } } =20 void test_config_cfm(l2cap_con *con, s32 status) { D_STATE("test_config_cfm : remote cid : %d\n", con->remote_cid); if(status) { - if(l2ca_config_req(con, con->remote_mtu, &con->remote_qos, con->flush_ti= meout, 0)) { + if(l2ca_config_req(con, con->remote_mtu, NULL, 0, 0)) { D_ERR("test_config_cfm : Configuration request failed\n"); } return; @@ -586,6 +592,27 @@ } else if(!strncmp(cmd, "dont_send_connect_response ", 27)) { dont_send_connect_response =3D strtoul(cmd+27, NULL, 0); return 0; + } else if(!strcmp(cmd, "test_case_use_cont_flag")) { + use_contflag =3D 1; + return 0; + } else if(!strcmp(cmd, "test_case_emulate_pending")) { + emulate_pending =3D 1; + return 0; + } else if(!strncmp(cmd, "configure_mtu ", 8)) { + int lcid, mtu; + char *p =3D cmd+14; + l2cap_con *con; + lcid =3D strtoul(p, &p, 0); + mtu =3D strtoul(p+1, &p, 0); + + /* first find connection based on local cid */ + con =3D get_lcon(lcid); + if (!con) { + printk("Found no connection with lcid : %d\n", lcid); + return -1; + } + + return l2ca_config_req(con, mtu, NULL, 0, 0); } else { printk("Unknown test cmd!\n"); return -1; --- unplug_test.c 1 Aug 2002 16:19:29 -0000 1.14 +++ unplug_test.c 6 Mar 2003 16:04:07 -0000 1.15 @@ -166,6 +166,35 @@ =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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =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 SPP =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 */ +unsigned char spp_data_53111[] =3D { 0x02, 0x77, 0x77, 0x00, 0x08, + 0x35, 0x03, 0x19, 0x00, 0x03, 0x00, 0xff, + 0x00 }; + +unsigned char spp_data_53112[] =3D { 0x04, 0x88, 0x91, 0x00, 0x12, + 0x00, 0x10, 0x00, 0x09,=20 + 0x00, 0xff,=20 + 0x35, 0x09,=20 + 0x09, 0x00, 0x01,=20 + 0x09, 0x00, 0x04, + 0x09, 0x01, 0x00, + 0x00 }; + +unsigned char spp_data_53113[] =3D { 0x06, 0x88, 0x88, 0x00, 0x13, + 0x35, 0x03,=20 + 0x19, 0x00, 0x03,=20 + 0x00, 0xff, + 0x35, 0x09,=20 + 0x09, 0x00, 0x01,=20 + 0x09, 0x00, 0x04, + 0x09, 0x01, 0x00, + 0x00 }; + + +/* =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=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ + + + =20 /* UUID 16 */ unsigned char sdp_data_52111_1[] =3D { 0x02, 0x77, 0x77, 0x00, 0x08, @@ -1773,7 +1802,22 @@ /* * Serial Port Profile Stuff */ +static s32 spp_test_53111(void) +{ + return sdp_send_data(&sdp_con_list[0], spp_data_53111, spp_data_53111[4] = + 5); +} + +static s32 spp_test_53112(void) +{ + return sdp_send_data(&sdp_con_list[0], spp_data_53112, spp_data_53112[4] = + 5); +} + +static s32 spp_test_53113(void) +{ + return sdp_send_data(&sdp_con_list[0], spp_data_53113, spp_data_53113[4] = + 5); +} =20 +#if 0 static s32 spp_test_52211(void) { static int t =3D 0; @@ -1963,11 +2007,12 @@ switch (t) { case 0: retval =3D rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 1000); - t++; + t =3D 1; break; =20 case 1: retval =3D rfcomm_pn_msg(&rfcomm_con_list[0], 2, 0, 667); + t =3D 0; break; } return retval; @@ -2036,6 +2081,8 @@ return 0; } =20 +#endif + /* * RFCOMM stuff */ @@ -2509,7 +2556,7 @@ case 54122: return sdp_test_54122(); case 55111: return sdp_test_55111(); case 55112: return sdp_test_55112(); - +#if 0 case 62211: return spp_test_52211(); =20 case 62311: return spp_test_52311(); @@ -2530,6 +2577,12 @@ case 631111: return spp_test_531111(); case 631112: return spp_test_531112(); case 66211: return spp_test_56211(); +#endif +=20=20=20=20=20=20=20=20=20 + case 653111: return spp_test_53111(); + case 653112: return spp_test_53112(); + case 653113: return spp_test_53113(); +=20=20=20=20=20=20=20=20=20=20 =20 case 41: return test_4_1(); case 421: return test_4_2_1(); |