[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] patch for arm



Xavier DEBREUIL wrote:

> Xavier DEBREUIL wrote:
> >
> > Hello,
> > I try to run in user mode the axis stack for ARM. I have applied your patch and
> > encountered a link problem.
> >
>
> I forgot to say that I am using the user mode...
> I took a look in the kernel header file and found that __u16 is defined only
> when compiling for kernel mode.
> I think that the cpu_to_le16 should be define at the top of l2cap.c for both
> mode (each user should look at its kernel definition to modify it if needed)...
> Hope this help.
>
> As for me, I added the following line :
> #define cpu_to_le16(x) ((unsigned short)(x))
> and everything linked properly.
>
> Am I correct to do such a modification ?
>
> Now I am going to test it on the board...
>
> Xavier
>
> > arm-linux-gcc -g -Wall -I../include -DBTD_USERSTACK   -c btd.c -o btd.o
> > ...
> > arm-linux-gcc -g -Wall -I../include -DBTD_USERSTACK   -c l2cap.c -o l2cap.o
> > l2cap.c: In function `l2cap_connect_req':
> > l2cap.c:1620: warning: implicit declaration of function `cpu_to_le16'
> > ...
> > l2cap.o: In function `l2cap_connect_req':
> > /home/xde/bluetooth/axis/arm/apps/userstack/l2cap.c:1620: undefined reference to
> > `cpu_to_le16'
> > /home/xde/bluetooth/axis/arm/apps/userstack/l2cap.c:1620: relocation truncated
> > to fit: R_ARM_PC24 cpu_to_le16
> > ...
> > /home/xde/bluetooth/axis/arm/apps/userstack/l2cap.c:2026: relocation truncated
> > to fit: R_ARM_PC24 cpu_to_le16
> > collect2: ld returned 1 exit status
> > make: *** [btduser] Error
> > 1
> >
> > This macro is defined in the kernel headers...
> > What did I miss ?
> >
> > Thank you
> >

Hmm... yes, user mode. I neglected to test that since I don't use it. Sorry about the
trouble.

Perhaps the best way to fix it in general would be to make sure those macros are
included in btcommon.h if they are not defined. You can see in sysdep-2.1.h how they
are setup if they are not defined... we probably just need to make that piece of code
visible even when  __KERNEL__ is not defined.

Perhaps you can try that and, if it works, submit a patch.

--Gordon