[問題] Re-make driver

看板Linux作者 (.......)時間12年前 (2013/12/19 22:18), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/1
我最近拿到一個Qualcomm的產品 因為插上linux PC後沒反應,去google後發現可以在qmi_wwan.c裡add這個產品 (ubuntu的版本是12.04 LTS,kernel為3.5.0.43) 但是make時一直有錯誤訊息,所以請教各位大大 Makefile: obj-m := qmi_wwan.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) OUTPUTDIR=/lib/modules/`uname -r`/kernel/drivers/net/usb/ all: clean $(MAKE) -I./ -C $(KDIR) M=$(PWD) modules install: all mkdir -p $(OUTPUTDIR) cp -f qmi_wwan.ko $(OUTPUTDIR) depmod clean: rm -rf *.o *.ko .tmp_versions Error message: /home/qmi_wwan/qmi_wwan.c: In function ‘qmi_wwan_mac_addr’: /home/work/qmi_wwan/qmi_wwan.c:127: error: implicit declaration of function ‘ eth_prepare_mac_addr_change’ /home/qmi_wwan/qmi_wwan.c:132: error: implicit declaration of function ‘ eth_commit_mac_addr_change’ /home/qmi_wwan/qmi_wwan.c: At top level: /home/qmi_wwan/qmi_wwan.c:520: error: implicit declaration of function ‘ USB_DEVICE_INTERFACE_NUMBER’ /home/qmi_wwan/qmi_wwan.c:520: error: initializer element is not constant /home/qmi_wwan/qmi_wwan.c:520: error: (near initialization for ‘ products[15].match_flags’) /home/qmi_wwan/qmi_wwan.c:521: error: initializer element is not constant (以下省略) 麻煩各位大大! 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.29.82

12/20 14:57, , 1F
有沒有可能是你加的那行程式的格式出錯啊?
12/20 14:57, 1F

12/20 22:33, , 2F
用原始檔去make也有error
12/20 22:33, 2F
文章代碼(AID): #1Iim1Bjb (Linux)