|
From: Gordon M. <gm...@us...> - 2001-03-12 15:52:39
|
The following files were modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
Makefile 1.17 1.18=20=20=20=20=20=20=20=20=20=20=20=20
hci.c 1.124 1.125=20=20=20=20=20=20=20=20=20=20=20
l2cap.c 1.91 1.92=20=20=20=20=20=20=20=20=20=20=20=20
rfcomm.c 1.94 1.95=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
--Part of Matthias Fuchs big-endian patch
The diff of the modified file(s):
--- Makefile 2001/03/10 13:00:15 1.17
+++ Makefile 2001/03/12 15:54:35 1.18
@@ -2,6 +2,9 @@
# Makefile for the Bluetooth device driver.
#
=20
+CC=3D$(CROSSCOMPILE)gcc
+LD=3D$(CROSSCOMPILE)ld
+
# This would have worked had it not been for test.c which is not to be
# included by default
#OBJS =3D $(patsubst %.c, %.o, $(wildcard *.c))
--- hci.c 2001/03/05 16:56:45 1.124
+++ hci.c 2001/03/12 15:54:35 1.125
@@ -32,10 +32,10 @@
* General Public License. Your use of that executable is in no way
* restricted on account of using the AXIS OpenBT Stack code with it.
*
- * This exception does not however invalidate any other reasons why
+ * This exception does not however invalidate any other reasons wh
* the executable file might be covered by the provisions of the GNU
* General Public License.
- *
+=20
* $Id$
*
*/
@@ -69,6 +69,7 @@
#include "include/btmem.h"
#include "include/tcs.h"
#include "include/sec_client.h"
+#include "include/local.h"
#endif
=20
/****************** CONSTANT AND MACRO SECTION ***************************=
***/
@@ -85,10 +86,10 @@
(((x2)&1)<<1) + ((x1)&1))
=20
=20
-#define MAKE_ACL_HDR(hci_hdl,pb,bc,len) (((len & 0xffff) << 16) + \
+#define MAKE_ACL_HDR(hci_hdl,pb,bc,len) (cpu_to_le32(((len & 0xffff) << 16=
) + \
((bc & 0x3) << 14) + \
((pb & 0x3) << 12) + \
- (hci_hdl & 0xfff))
+ (hci_hdl & 0xfff)))
=20
#define ACL_LINK 1
#define SCO_LINK 0
@@ -1791,7 +1792,8 @@
c_pkt.type =3D CMD_PKT;
c_pkt.opcode =3D hci_put_opcode(DISCONNECT, HCI_LC) ;
=20
- memcpy(c_pkt.data, &hdl, 2);
+ c_pkt.data[0] =3D hdl & 0xff;
+ c_pkt.data[1] =3D hdl >> 8;
c_pkt.data[2] =3D reason;
c_pkt.len =3D 3;
=20
@@ -2529,11 +2531,13 @@
c_pkt.type =3D CMD_PKT;
c_pkt.opcode =3D hci_put_opcode(HOST_BUFFER_SIZE, HCI_HC) ;
=20=20=20
- memcpy(c_pkt.data + c, &acl_len, 2);
- c_pkt.data[(c+=3D 2)] =3D sco_len;
- memcpy(c_pkt.data + (c+=3D 1), & acl_num, 2);
- memcpy(c_pkt.data + (c+=3D 2), & sco_num, 2);
- c_pkt.len =3D (c+=3D 2);
+ c_pkt.data[c++] =3D acl_len & 0xff;
+ c_pkt.data[c++] =3D (acl_len >> 8) & 0xff;
+ c_pkt.data[c++] =3D sco_len;
+ c_pkt.data[c++] =3D acl_num & 0xff;
+ c_pkt.data[c++] =3D (acl_num >> 8) & 0xff;
+ c_pkt.data[c++] =3D sco_num & 0xff;
+ c_pkt.data[c++] =3D (sco_num >> 8) & 0xff;
=20
return send_cmd_block((u8*) &c_pkt, c + CMD_HDR_LEN + HCI_HDR_LEN);
#else
--- l2cap.c 2001/03/05 16:41:45 1.91
+++ l2cap.c 2001/03/12 15:54:35 1.92
@@ -70,6 +70,7 @@
#include "include/sdp.h"
#include "include/test.h"
#include "include/btmem.h"
+#include "include/local.h"
#endif
=20
/****************** DEBUG CONSTANT AND MACRO SECTION *********************=
***/
@@ -507,8 +508,10 @@
/*u8 bc_flag,*/ u32 *l2cap_len)
{
#define FNC "l2cap_receive_data : "
- l2cap_packet *pkt;
+ l2cap_packet *pkt =3D NULL;
l2cap_con *con;
+ u16 pkt_len;
+ CID pkt_cid;
=20
D_RCV(FNC" got %d bytes on hci_handle : %d\n", len, hci_handle);
PRINTPKT("l2cap_receive_data : ", data, len);
@@ -524,14 +527,17 @@
=20
pkt =3D (l2cap_packet *)data;
=20
+ pkt_len =3D le16_to_cpu(pkt->len);
+ pkt_cid =3D le16_to_cpu(pkt->cid);
+
/* l2cap_len is checked in hci, when l2cap_len bytes=20
has been received in hci this function is called again */
- *l2cap_len =3D pkt->len + L2CAP_HDRSIZE;
+ *l2cap_len =3D pkt_len + L2CAP_HDRSIZE;
=20=20=20=20=20
- D_RCV(FNC"New frame len:%d cid:%d\n", pkt->len, pkt->cid);
+ D_RCV(FNC"New frame len:%d cid:%d\n", pkt_len, pkt_cid);
=20
/* check length */
- if (!(pkt->len =3D=3D (len - L2CAP_HDRSIZE)))
+ if (!(pkt_len =3D=3D (len - L2CAP_HDRSIZE)))
return;
} else if (len !=3D *l2cap_len) {
/* Not recieved full frame yet or BIG packet */
@@ -545,8 +551,10 @@
=20
/* A whole frame is received */
pkt =3D (l2cap_packet *)data;
+ pkt_len =3D le16_to_cpu(pkt->len);
+ pkt_cid =3D le16_to_cpu(pkt->cid);
=20
- switch (pkt->cid) {
+ switch (pkt_cid) {
case CIDSIG:
/* Signalling channel */
D_RCV("l2cap_receive_data : Signal data !\n");
@@ -568,18 +576,18 @@
con =3D get_con_hcihdl(hci_handle);
=20=09=09
get_upper(CHAR2INT16(pkt->data[1], pkt->data[0]))->
- receive_data(con, pkt->data + 2, pkt->len - 2);
+ receive_data(con, pkt->data + 2, pkt_len - 2);
break;
=20=20=20=20=20
default:
/* Data channel */
- con =3D get_lcon(pkt->cid);
+ con =3D get_lcon(pkt_cid);
=20=20=20=20=20
if (con =3D=3D NULL)
return;
=20
if (con->current_state =3D=3D OPEN ) {=20=20=20=20=20=20
- process_frame(con, pkt->data, pkt->len);
+ process_frame(con, pkt->data, pkt_len);
} else {
D_ERR("l2cap_receive_data : not OPEN yet, discard data\n");
}
@@ -603,6 +611,8 @@
=20
cmd =3D (struct sig_cmd *)(data + pos);
=20=20=20
+ cmd->len =3D le16_to_cpu(cmd->len);
+
D_RCV(FNC"received %d bytes\n", len);
PRINTPKT(FNC"data", data, len);
=20
@@ -630,6 +640,7 @@
/* parse next command header if more cmds left in packet */
if (pos < len){
cmd =3D (struct sig_cmd *)(data + pos);
+ cmd->len =3D le16_to_cpu(cmd->len);
printk("pos %d, len %d\n", pos, len);
DSYS("another command in same packet...(%d bytes)\n",
cmd->len);
@@ -656,6 +667,8 @@
case SIG_CONREQ:
/* Request for connection */
conreq =3D (sig_conreq *)req->data;
+ conreq->psm =3D le16_to_cpu(conreq->psm);
+ conreq->src_cid =3D le16_to_cpu(conreq->src_cid);
=20=09=09
D_STATE(FNC"Connection request\n");
D_STATE(FNC"id:%d len:%d PSM 0x%x src_cid:%d\n",
@@ -712,6 +725,8 @@
case SIG_CONFREQ:
/* Request for configuration */
confreq =3D (sig_confreq *)req->data;
+ confreq->dst_cid =3D le16_to_cpu(confreq->dst_cid);
+ confreq->flags =3D le16_to_cpu(confreq->flags);
=20=09=09
D_STATE(FNC"config request cid:%d flags: 0x%x\n",=20
confreq->dst_cid, confreq->flags);
@@ -809,6 +824,8 @@
=20=09=09=09
case SIG_DISCREQ:
discreq =3D (sig_discreq *)req->data;
+ discreq->dst_cid =3D le16_to_cpu(discreq->dst_cid);
+ discreq->src_cid =3D le16_to_cpu(discreq->src_cid);
=20
D_STATE(FNC"disconnection request id %d\n",=20
req->id);
@@ -853,6 +870,7 @@
D_STATE(FNC"info request\n");
=20=09=09
info =3D (sig_info_req*)(req->data);
+ info->type =3D le16_to_cpu(info->type);
=20=09=09
switch(info->type) {
case INFO_CONNLESS_MTU:
@@ -909,6 +927,7 @@
D_STATE(FNC"Command reject - \n");
=20=20=20=20=20=20=20=20=20=20
cmdreject =3D (sig_cmdreject*)rsp->data;
+ cmdreject->reason =3D le16_to_cpu(cmdreject->reason);
opt_len =3D rsp->len - sizeof(sig_cmdreject);
switch (cmdreject->reason) {
case 0:
@@ -937,6 +956,10 @@
/* client */
D_STATE(FNC"Got connection response\n");
conrsp =3D (sig_conrsp *)rsp->data;
+ conrsp->src_cid =3D le16_to_cpu(conrsp->src_cid);
+ conrsp->dst_cid =3D le16_to_cpu(conrsp->dst_cid);
+ conrsp->result =3D le16_to_cpu(conrsp->result);
+ conrsp->status =3D le16_to_cpu(conrsp->status);
=20
/* find connection */
if ((con =3D get_lcon(conrsp->src_cid)) =3D=3D NULL) {
@@ -1017,6 +1040,9 @@
case SIG_CONFRSP:
D_STATE(FNC"Got configuration response\n");
confrsp =3D (sig_confrsp *)rsp->data;
+ confrsp->src_cid =3D le16_to_cpu(confrsp->src_cid);
+ confrsp->flags =3D le16_to_cpu(confrsp->flags);
+ confrsp->result =3D le16_to_cpu(confrsp->result);
opt_len =3D rsp->len - sizeof(sig_confrsp);
=20
PRINTPKT(FNC"config response", rsp->data, rsp->len);
@@ -1109,6 +1135,8 @@
case SIG_DISCRSP:
D_STATE(FNC"Got disconnect response\n");
discrsp =3D (sig_discrsp *)rsp->data;
+ discrsp->dst_cid =3D le16_to_cpu(discrsp->dst_cid);
+ discrsp->src_cid =3D le16_to_cpu(discrsp->src_cid);
PRINTPKT(FNC"disconnect response", rsp->data, rsp->len);
=20
/* find connection */
@@ -1167,6 +1195,8 @@
=20=20=20=20=20=20=20=20
case SIG_INFORSP:
info =3D (sig_info_rsp *)(rsp->data);
+ info->type =3D le16_to_cpu(info->type);
+ info->result =3D le16_to_cpu(info->result);
D_STATE(FNC"Got info response : result %d\n", info->result);
break;
=20=20=20=20=20=20=20=20
@@ -1795,7 +1825,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_conreq *req;
- s32 payload_len;
+ u16 payload_len;
=20
D_XMIT("l2cap_connect_req: Connecting %s (rcid:%d)\n",psm2str(psm)=
,=20
con->remote_cid);
@@ -1805,7 +1835,7 @@
return -1;
}
=20
- payload_len =3D SIGCMD_HDRSIZE + CON_REQSIZE;=20=20
+ payload_len =3D SIGCMD_HDRSIZE + CON_REQSIZE; /*2 x 4*/
=20
tx =3D subscribe_bt_buf(sizeof(l2cap_tx_buf) + L2CAP_HDRSIZE+payload_len);
if (!tx) {
@@ -1819,12 +1849,12 @@
req =3D (sig_conreq*)(l2cap_buf->frame + L2CAP_HDRSIZE + SIGCMD_HDRSIZE);
=20
/* Now fill in header fields */=20=20
- req->psm =3D con->psm;
- req->src_cid =3D con->local_cid;
+ req->psm =3D cpu_to_le16(con->psm);
+ req->src_cid =3D cpu_to_le16(con->local_cid);
=20=20=20
cmd->code =3D SIG_CONREQ;
cmd->id =3D set_id(con); /* Sets sig_id_sent in l2cap_con */
- cmd->len =3D CON_REQSIZE;
+ cmd->len =3D cpu_to_le16(CON_REQSIZE);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -1850,7 +1880,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_confreq *req;
- s32 payload_len;
+ u16 payload_len;
s32 opt_len=3D0;
struct l2cap_option *opt;
=20
@@ -1935,13 +1965,13 @@
}
=20
/* Request header */
- req->dst_cid =3D con->remote_cid; /* Sending end */
+ req->dst_cid =3D cpu_to_le16(con->remote_cid); /* Sending end */
req->flags =3D 0; /* Negotiate same as remote */
=20
/* Signalling header */
cmd->code =3D SIG_CONFREQ;
cmd->id =3D set_id(con); /* Sets sig_id_sent in l2cap_con */
- cmd->len =3D CONF_REQSIZE + opt_len;
+ cmd->len =3D cpu_to_le16(CONF_REQSIZE + opt_len);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -1969,7 +1999,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_discreq *req;
- s32 payload_len;
+ u16 payload_len;
=20=20
D_XMIT("l2cap_disconnect_req : rcid %d\n", con->remote_cid);
=20
@@ -1987,12 +2017,12 @@
req =3D (sig_discreq*)(l2cap_buf->frame + L2CAP_HDRSIZE + SIGCMD_HDRSIZE);
=20
/* Now fill in header fields */=20=20
- req->dst_cid =3D con->remote_cid;
- req->src_cid =3D con->local_cid;
+ req->dst_cid =3D cpu_to_le16(con->remote_cid);
+ req->src_cid =3D cpu_to_le16(con->local_cid);
=20=20=20
cmd->code =3D SIG_DISCREQ;
cmd->id =3D set_id(con); /* Sets sig_id_sent in l2cap_con */
- cmd->len =3D DISC_REQSIZE;
+ cmd->len =3D cpu_to_le16(DISC_REQSIZE);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
tx->hci_hdl =3D con->hci_hdl;
@@ -2013,7 +2043,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_echo_pkt *req;
- s32 payload_len;
+ u16 payload_len;
u16 hci_hdl =3D con->hci_hdl;
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_echo_pkt) + opt_len;
@@ -2037,7 +2067,7 @@
cmd->code =3D SIG_ECHOREQ;
cmd->id =3D get_id();
=20=20=20
- cmd->len =3D opt_len;
+ cmd->len =3D cpu_to_le16(opt_len);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2059,7 +2089,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_echo_pkt *rsp;
- s32 payload_len;
+ u16 payload_len;
=20
D_XMIT("l2cap_echo_rsp\n");
=20
@@ -2082,7 +2112,7 @@
=20=20=20
cmd->code =3D SIG_ECHORSP;
cmd->id =3D id;
- cmd->len =3D opt_len;
+ cmd->len =3D cpu_to_le16(opt_len);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2118,11 +2148,11 @@
=20=20=20
cmd =3D (sig_cmd*)(l2cap_buf->frame + L2CAP_HDRSIZE);
req =3D (sig_info_req*)(l2cap_buf->frame + L2CAP_HDRSIZE +SIGCMD_HDRSIZE);
- req->type =3D info_type;
+ req->type =3D cpu_to_le16(info_type);
=20=20=20=20=20
cmd->code =3D SIG_INFOREQ;
cmd->id =3D get_id();
- cmd->len =3D sizeof(sig_info_req);
+ cmd->len =3D cpu_to_le16(sizeof(sig_info_req));
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2162,8 +2192,8 @@
cmd =3D (sig_cmd*)(l2cap_buf->frame + L2CAP_HDRSIZE);
rsp =3D (sig_info_rsp*)(l2cap_buf->frame + L2CAP_HDRSIZE +SIGCMD_HDRSIZE);
=20
- rsp->type =3D info_type;
- rsp->result =3D result;=09
+ rsp->type =3D cpu_to_le16(info_type);
+ rsp->result =3D cpu_to_le16(result);=09
=20
/* Now fill in header fields */
if (info_len) {
@@ -2172,7 +2202,7 @@
=20
cmd->code =3D SIG_INFORSP;
cmd->id =3D id;
- cmd->len =3D sizeof(sig_info_rsp) + info_len;
+ cmd->len =3D cpu_to_le16(sizeof(sig_info_rsp) + info_len);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2191,7 +2221,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_cmdreject *cmdrej;
- s32 payload_len;
+ u16 payload_len;
=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_cmdreject) + opt_len;
=20
@@ -2215,10 +2245,11 @@
=20=20=20
cmd->code =3D SIG_CMDREJECT;
cmd->id =3D get_id();
- cmd->len =3D sizeof(sig_cmdreject) + opt_len;
+ cmd->len =3D cpu_to_le16(sizeof(sig_cmdreject) + opt_len);
=20
/* FIXME: set the reason parameter */
-
+ /* Ok. Does this work? (gjm) */
+ cmdrej->reason =3D cpu_to_le16((u16)reason);
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
/* pb_flag is set from hci_send_data */
@@ -2240,7 +2271,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_conrsp *rsp;
- s32 payload_len;
+ u16 payload_len;
=20=20=20
D_XMIT("l2cap_connect_rsp : rcid:%d lcid:%d result:%d status:%d \n",
con->remote_cid, con->local_cid, response, status);
@@ -2259,19 +2290,19 @@
rsp =3D (sig_conrsp*)(l2cap_buf->frame + L2CAP_HDRSIZE + SIGCMD_HDRSIZE);
=20=20=20
/* Now fill in header fields */
- rsp->dst_cid =3D con->local_cid; /* sending end */
- rsp->src_cid =3D con->remote_cid; /* receiving end */
+ rsp->dst_cid =3D cpu_to_le16(con->local_cid); /* sending end */
+ rsp->src_cid =3D cpu_to_le16(con->remote_cid); /* receiving end */
=20
- if ((rsp->result =3D response) =3D=3D RES_PENDING)
- rsp->status =3D status;
+ if ((rsp->result =3D cpu_to_le16(response)) =3D=3D RES_PENDING)
+ rsp->status =3D cpu_to_le16(status);
else {
printk("Result not pending, force status =3D no further info\n");
- rsp->status =3D STAT_NOINFO;
+ rsp->status =3D cpu_to_le16(STAT_NOINFO);
}
=20=09
cmd->code =3D SIG_CONRSP;
cmd->id =3D con->sig_id_rcv; /* Send back same id as received on req */
- cmd->len =3D CON_RSPSIZE;
+ cmd->len =3D cpu_to_le16(CON_RSPSIZE);
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2290,7 +2321,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_confrsp *rsp;
- s32 payload_len;
+ u16 payload_len;
=20
D_XMIT("l2cap_config_rsp : rcid : %d, out_mtu: %d \n",=20
con->remote_cid, out_mtu);
@@ -2315,16 +2346,16 @@
rsp =3D (sig_confrsp*)(l2cap_buf->frame + L2CAP_HDRSIZE + SIGCMD_HDRSIZE);
=20=20=20
/* Now fill in header fields */=20=20
- rsp->src_cid =3D con->remote_cid;
+ rsp->src_cid =3D cpu_to_le16(con->remote_cid);
=20
/* FIXME - WHERE ARE THIS DETERMINED ??? */
rsp->flags =3D 0; /* No more config responses to follow */
=20
- rsp->result =3D CONF_SUCCESS;
+ rsp->result =3D cpu_to_le16(CONF_SUCCESS);
=20=20=20
cmd->code =3D SIG_CONFRSP;
cmd->id =3D con->sig_id_rcv; /* Send back same id as received on request =
*/
- cmd->len =3D CONF_RSPSIZE;
+ cmd->len =3D cpu_to_le16(CONF_RSPSIZE);
=20
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
@@ -2345,7 +2376,7 @@
l2cap_tx_buf *l2cap_buf; /* Entire l2cap frame + lower layer hdrs */
sig_cmd *cmd;
sig_discrsp *rsp;
- s32 payload_len;
+ u16 payload_len;
=20=20
payload_len =3D SIGCMD_HDRSIZE + sizeof(sig_discrsp);
=20
@@ -2362,12 +2393,12 @@
rsp =3D (sig_discrsp*)(l2cap_buf->frame + L2CAP_HDRSIZE + SIGCMD_HDRSIZE);
=20=20=20=20=20
/* Now fill in header fields */
- rsp->dst_cid =3D con->local_cid;
- rsp->src_cid =3D con->remote_cid;
+ rsp->dst_cid =3D cpu_to_le16(con->local_cid);
+ rsp->src_cid =3D cpu_to_le16(con->remote_cid);
=20=20=20
cmd->code =3D SIG_DISCRSP;
cmd->id =3D con->sig_id_rcv; /* Send back same id as received on req */
- cmd->len =3D sizeof(sig_discrsp);
+ cmd->len =3D cpu_to_le16(sizeof(sig_discrsp));
=20
SET_L2CAP_HDR(l2cap_buf->frame, payload_len, CIDSIG);
=20
@@ -2895,7 +2926,8 @@
opt =3D (l2cap_option*)(data + pos);
switch (opt->type) {
case OPT_MTU:
- con->remote_mtu =3D *((u16*)opt->option_data);
+ con->remote_mtu =3D *(opt->option_data) |=20
+ (*(opt->option_data + 1) << 8);
=20
if ((con->remote_mtu < MTU_MIN) &&=20
((con->remote_mtu + L2CAP_HDRSIZE) > HCI_IN_SIZE)) {
@@ -2915,7 +2947,8 @@
break;
=20=20=20=20=20=20=20
case OPT_FLUSH:
- con->flush_timeout =3D *((u16*)opt->option_data);
+ con->flush_timeout =3D *(opt->option_data) |=20
+ (*(opt->option_data + 1) << 8);
=20
/* FIXME -- return error code if not accepted */
=20=09=09=09
--- rfcomm.c 2001/03/08 15:22:45 1.94
+++ rfcomm.c 2001/03/12 15:54:35 1.95
@@ -65,6 +65,7 @@
#include "include/btmem.h"
#include "include/l2cap.h"
#include "include/bluetooth.h"
+#include "include/local.h"
#endif
=20
/****************** DEBUG CONSTANT AND MACRO SECTION *********************=
***/
@@ -162,29 +163,6 @@
#define swap_long_frame(x) ((x)->h.length.val =3D le16_to_cpu((x)->h.lengt=
h.val))
#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))
-
-#ifdef BTD_USERSTACK
-
-# include <asm/byteorder.h>
-# ifdef __LITTLE_ENDIAN
-# define cpu_to_le16(x) (x)
-# define cpu_to_le32(x) (x)
-# define cpu_to_be16(x) htons((x))
-# define cpu_to_be32(x) htonl((x))
-# else
-# define cpu_to_be16(x) (x)
-# define cpu_to_be32(x) (x)
- extern inline __u16 cpu_to_le16(__u16 x) { return (x<<8) | (x>>8);}
- extern inline __u32 cpu_to_le32(__u32 x) { return((x>>24) |
- ((x>>8)&0xff00) | ((x<<8)&0xff0000) | (x<<24));}
-# endif
-
-# define le16_to_cpu(x) cpu_to_le16(x)
-# define le32_to_cpu(x) cpu_to_le32(x)
-# define be16_to_cpu(x) cpu_to_be16(x)
-# define be32_to_cpu(x) cpu_to_be32(x)
-
-#endif
=20
/****************** TYPE DEFINITION SECTION ******************************=
***/
=20
|