[求助]关于ch34x驱动交叉编译的问题!

limingade 2009-04-01 07:31:37
我使用GPS接受器 用USB转串口线接到PC机上 可以使用
但我打算进行交叉编译的时候 arm-linux-gcc的时候 出现了一堆问题 很头痛~!不知道怎么解决 有哪位大哥能帮忙解决下吗?
make出现:
[root@ade redhat]# make
arm-linux-gcc -D__KERNEL__ -I/root/kernel/include -I/root/kernel/drivers/usb/serial -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -DMODULE -c ch34x.c
ch34x.c:70: unknown field `owner' specified in initializer
ch34x.c:70: warning: initialization from incompatible pointer type
ch34x.c:71: field `name' already initialized
ch34x.c:71: warning: initialization from incompatible pointer type
ch34x.c:72: field `id_table' already initialized
ch34x.c:72: warning: initialization makes integer from pointer without a cast
ch34x.c:72: initializer element is not computable at load time
ch34x.c:72: (near initialization for `ch34x_device.needs_interrupt_in')
ch34x.c: In function `set_control_lines':
ch34x.c:100: parse error before `int'
ch34x.c:101: `retval' undeclared (first use in this function)
ch34x.c:101: (Each undeclared identifier is reported only once
ch34x.c:101: for each function it appears in.)
ch34x.c:104: warning: control reaches end of non-void function
ch34x.c: In function `SetBaudrate':
ch34x.c:109: parse error before `struct'
ch34x.c:112: `mValue' undeclared (first use in this function)
ch34x.c:112: `mIndex' undeclared (first use in this function)
ch34x.c:114: parse error before `int'
ch34x.c:117: `mTimerCtrl' undeclared (first use in this function)
ch34x.c:117: `mTimerCount' undeclared (first use in this function)
ch34x.c:148: `i' undeclared (first use in this function)
ch34x.c:148: `serial' undeclared (first use in this function)
ch34x.c: In function `ch34x_startup':
ch34x.c:155: parse error before `struct'
ch34x.c:157: `i' undeclared (first use in this function)
ch34x.c:159: `priv' undeclared (first use in this function)
ch34x.c: In function `ch34x_open':
ch34x.c:171: parse error before `struct'
ch34x.c:181: `tmp_termios' undeclared (first use in this function)
ch34x.c:184: `priv' undeclared (first use in this function)
ch34x.c:189: `serial' undeclared (first use in this function)
ch34x.c:190: `result' undeclared (first use in this function)
ch34x.c: In function `ch34x_write':
ch34x.c:212: parse error before `int'
ch34x.c:232: `result' undeclared (first use in this function)
ch34x.c:238: warning: control reaches end of non-void function
ch34x.c: In function `ch34x_set_termios':
ch34x.c:243: parse error before `unsigned'
ch34x.c:256: `cflag' undeclared (first use in this function)
ch34x.c: In function `ch34x_close':
ch34x.c:274: parse error before `struct'
ch34x.c:280: `serial' undeclared (first use in this function)
ch34x.c:288: `c_cflag' undeclared (first use in this function)
ch34x.c:292: `priv' undeclared (first use in this function)
ch34x.c:300: `result' undeclared (first use in this function)
ch34x.c: In function `ch34x_shutdown':
ch34x.c:384: parse error before `int'
ch34x.c:386: `i' undeclared (first use in this function)
ch34x.c: In function `ch34x_read_int_callback':
ch34x.c:393: parse error before `struct'
ch34x.c:396: `serial' undeclared (first use in this function)
ch34x.c: In function `ch34x_read_bulk_callback':
ch34x.c:415: parse error before `struct'
ch34x.c:421: `port' undeclared (first use in this function)
ch34x.c:424: `serial' undeclared (first use in this function)
ch34x.c:442: `result' undeclared (first use in this function)
ch34x.c:450: `data' undeclared (first use in this function)
ch34x.c:451: `tty' undeclared (first use in this function)
ch34x.c:454: `i' undeclared (first use in this function)
ch34x.c: In function `ch34x_write_bulk_callback':
ch34x.c:478: parse error before `struct'
ch34x.c:481: `port' undeclared (first use in this function)
ch34x.c:495: `result' undeclared (first use in this function)
make: *** [ch34x.o] Error 1

我的makefile是:
KINCLUDES=/root/kernel/include
DRVINCLUDES=/root/kernel/drivers/usb/serial

MODULE= ch34x
BASE_MODULE= usbserial
CC= arm-linux-gcc
CPPFLAGS= -D__KERNEL__ -I$(KINCLUDES) -I$(DRVINCLUDES)
MODFLAGS= -DMODULE
KERNFLAGS= $(CPPFLAGS) $(CPUFLAGS) $(SMPFLAGS) \
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer \
-fno-strict-aliasing -fno-common -Wno-unused
# EXTRA_CFLAGS= -DEXPORT_SYMTAB
# DBGCFLAGS= -DDEBUG -DCONFIG_USB_SERIAL_DEBUG
CFLAGS= $(KERNFLAGS) $(DBGCFLAGS) $(MODFLAGS)

RELVER= $(shell uname -r)

all:: $(MODULE).o

$(MODULE).o: $(MODULE).c
$(CC) $(CFLAGS) -c $<

.PHONY: inst, uninst, uninst_all, clean

能帮忙看下 看问题出在哪里吗? 先谢谢先了
...全文
297 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
morris88 2009-05-01
  • 打赏
  • 举报
回复
不熟,帮顶...

4,444

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧