Hello, Everyone,
With a lots of helps, I have been successfully install the Bluetooth Driver
module into my Ultra SPARC 2.2.14 kernel. The poor thing is when I began to
test the driver, the output is a kind of different from what I got from a
x86 machine. The "ioctl" system call failed. I tried to figure it out, but
got no answer, I wonder what brings that gap between these two kernels, the
detail information is as following, hope some expert can give me some clue.
tks!
I have following command number definition,
/* Define the ioctls to the bt driver */
#define BT_IOC_MAGIC 'B' /* Use B as a magic number */
#define BT_IOC_MAXNR 255
#define BTSETSERTTY _IOW(BT_IOC_MAGIC, 4, s32)
and then in the test application, following system call is issued, after
device is open and line discipline is registerd,
-----------------------------
int i = 0;
serfd = open(serdev, O_RDWR);
tcflush(serfd, TCIOFLUSH);
/* Set the current tty to the bluetooth discpline */
if (ioctl(serfd, TIOCSETD, &bt_disc) < 0)
{
perror("Set bt line disc");
exit(1);
}
/* FIXME - temp setting of sertty in bt driver */
if (ioctl(serfd, BTSETSERTTY, &i)<0)
{
perror("Set sertty");
exit(1);
}
------------------------------------
When I run the same piece of code in the two machine, one PC and anoter
UltraSPARC, under "strace", I got different results,
In x86 PC,
------------------
open("/dev/ttyS0", O_RDWR) = 3
ioctl(3, TCFLSH, TCIOFLUSH) = 0
ioctl(3, TCGETS, {B9600 opost isig icanon echo ...}) = 0
ioctl(3, SNDCTL_TMR_START, {0x1001 /* B??? */ -opost -isig -icanon -echo
...}) = 0
ioctl(3, TCGETS, {0x1001 /* B??? */ -opost -isig -icanon -echo ...}) = 0
ioctl(3, TIOCSETD, [15]) = 0
ioctl(3, 0x40044204, 0xbffffa10) = 0
-----------------------------------
and in Sparc Workstation,
----------------------------
open("/dev/ttyS0", O_RDWR) = 3
ioctl(3, TCFLSH, TCIOFLUSH) = 0
ioctl(3, TCGETS, {0x1001 /* B??? */ -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCSETS, {0x1001 /* B??? */ -opost -isig -icanon -echo ...}) = 0
ioctl(3, TCGETS, {0x1001 /* B??? */ -opost -isig -icanon -echo ...}) = 0
ioctl(3, TIOCSETD, 0x22944) = 0
ioctl(3, 0x80044204, 0xeffff950) = -1 EINVAL (Invalid argument)
------------------------------------------------------------------------
I can not quite understand the reason, since the definition of command
number is the same, why they are differnt in execution. I have a question, I
build the kernel module using "sparc64-linux-gcc" which produces 64 bit ELF
binary. Should I use it for application building also? I just compile the
test applicaiton using "gcc" which generate 32 bit ELF binary, will this
bring any problem?
Thanks a lot for any helpful input!
Best Rgds,
-Ling
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:27 EST