在linux(核心2.6.x)下驅動 USB ADSL(轉)
在linux(核心2.6.x)下驅動 USB ADSL(轉)[@more@] 1.準備工作
現在確認你有一支Conexant USB ADSL的Modem和以下檔案,(如果您沒有備齊這些東西,下面的工作將無法進行)
引用:
cxacru.tar.bz2 rp-pppoe-3.5.tar.gz Kernel-2.6.x patch-2.6.X_date_accessrunner.gz
說明:
其中cxacru.tar.bz2(要在此處下載我已經打好補丁的檔案)是USB ADSL的驅動程式檔案原始碼包
rp-pppoe-3.5.tar.gz(或更高版本)是pppoe的撥號程式原始碼包
Kernel-2.6.x是Kernel的原始碼包
patch-2.6.X_date_accessrunner.gz是核心的補丁檔案
確定備齊以上檔案後就可以進行下面的工作了
2.開始安裝
首先將裝置聯結好
2.1給核心打補丁並編譯核心
解壓核心包把patch-2.6.X_date_accessrunner.gz複製到核心目錄的上級目錄
執行 程式碼:
gunzip -c patch-2.6.x_YYYYMMDD_accessrunner.gz | patch -p1
如果你的Kernel已經有如下支援(可以在Kernel的.config檔案中查詢到)就不必重新編譯
程式碼:
Code maturity level options
Prompt for development and/or incomplete code/drivers
Loadable module support
Enable loadable module support
Set version information on all module symbols
Kernel module loader
Networking options
< *> Packet socket
< *> Unix domain sockets
TCP/IP networking
Asynchronous Transfer Mode (ATM)
USB support
< *> Support for USB
Preliminary USB device filesystem
UHCI
OHCI
Alcatel Speedtouch USB support (USB_SPEEDTOUCH)
Networking options
Asynchronous Transfer Mode (ATM)
Classical IP over ATM
Networking options
[M] RFC1483/2684 Bridged protocols
Network Device Support
PPP (point-to-point protocol) support
PPP Deflate compression
PPP over Ethernet (EXPERIMENTAL)
Network Device Support
PPP (point-to-point protocol) support
PPP Deflate compression
PPP over ATM
Processor type and features
[ ] Symmetric multi-processing support
Cryptographic API (CRYPTO)
CRC32c CRC algorithm (CRYPTO_CRC32C)
Library routines
CRC32c (Castagnoli, et al) Cyclic Redundancy-Check (LIBCRC32C)
設定好後 make 、make modules 、make modules_install、make install、reboot
2.2編譯驅動和撥號程式
解壓cxacru.tar.bz2,ln /核心原始碼目錄 /usr/linux -s
然後在原始碼目錄中make,
解壓rp-pppoe-3.5.tar.gz,在其目錄中執行./go 如果你用X 就可以用./go-gui
設定好你的撥號程式,要注意的是在填寫裝置的時候要填寫nas0
nas0是驅動程式虛擬出來的USB Modem
2.3設定協議
編輯/etc/cxacru檔案,像這個樣子:
程式碼:
#
# Config file for Conexant AccessRunner
#
# Driver mode
DRIVER_MODE=1 # 1 = normal, 2 = debug, 3 = normal+max speed (without ask adsl status), 4 = debug+max speed (without ask adsl status)
# Protocol
PROTOCOL_MODE=4 # 1 = RFC1483/2684 routed, 2 = PPP over ATM (pppoa), 3 = RFC1483/2684 bridged, 4 = PPP over Ethernet (pppoe)
# Paths
BINARY_PATH="/usr/sbin"
ATM_PATH=""
# ADSL
# if OPEN_MODE is blank then cxload uses default mode acoording VID & PID
# Values for OPEN_MODE are:
# 0 = auto selection, G.Handshake
# 1 = auto selection, T1.413
# 2 = G.Handshake
# 3 = ANSI T1.413
# 4 = ITU-T G.992.1 (G.DMT)
# 5 = ITU-T G.992.2 (G.LITE)
OPEN_MODE=4
# ATM
VPI=0
VCI=33
# Specific for RFC1483/2684 routed/bridged
# if IP_ADDRESS is blank in bridged mode then it uses DHCP to get IP
IP_ADDRESS=
NETMASK=255.255.255.255
GATEWAY=
需要更改的是# Protocol # ADSL # ATM
如果你用的是RFC1483/2684協議還要設定# Specific for RFC1483/2684 routed/bridged
PPPOE和PPPOA的使用者只要修改# Protocol # ADSL # ATM 這3項就可以了
3.撥號
在終端下輸入cxstart.sh建立連線 cxstop.sh斷掉連線
用ifconfig檢查一下你是否已經連上了,像這個樣子:
程式碼:
[root@Love root]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
nas0 Link encap:Ethernet HWaddr 00:00:01:00:00:00
inet6 addr: fe80::200:1ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17650 errors:0 dropped:0 overruns:0 frame:0
TX packets:15790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15856545 (15.1 Mb) TX bytes:2128934 (2.0 Mb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:221.214.196.80 P-t-P:221.0.64.38 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:16454 errors:0 dropped:0 overruns:0 frame:0
TX packets:14588 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:15674609 (14.9 Mb) TX bytes:1613794 (1.5 Mb)
[root@Love root]#
現在確認你有一支Conexant USB ADSL的Modem和以下檔案,(如果您沒有備齊這些東西,下面的工作將無法進行)
引用:
cxacru.tar.bz2 rp-pppoe-3.5.tar.gz Kernel-2.6.x patch-2.6.X_date_accessrunner.gz
說明:
其中cxacru.tar.bz2(要在此處下載我已經打好補丁的檔案)是USB ADSL的驅動程式檔案原始碼包
rp-pppoe-3.5.tar.gz(或更高版本)是pppoe的撥號程式原始碼包
Kernel-2.6.x是Kernel的原始碼包
patch-2.6.X_date_accessrunner.gz是核心的補丁檔案
確定備齊以上檔案後就可以進行下面的工作了
2.開始安裝
首先將裝置聯結好
2.1給核心打補丁並編譯核心
解壓核心包把patch-2.6.X_date_accessrunner.gz複製到核心目錄的上級目錄
執行 程式碼:
gunzip -c patch-2.6.x_YYYYMMDD_accessrunner.gz | patch -p1
如果你的Kernel已經有如下支援(可以在Kernel的.config檔案中查詢到)就不必重新編譯
程式碼:
Code maturity level options
Loadable module support
Networking options
< *> Packet socket
< *> Unix domain sockets
USB support
< *> Support for USB
UHCI
OHCI
Alcatel Speedtouch USB support (USB_SPEEDTOUCH)
Networking options
Networking options
[M] RFC1483/2684 Bridged protocols
Network Device Support
PPP (point-to-point protocol) support
PPP Deflate compression
PPP over Ethernet (EXPERIMENTAL)
Network Device Support
PPP (point-to-point protocol) support
PPP Deflate compression
PPP over ATM
Processor type and features
[ ] Symmetric multi-processing support
Cryptographic API (CRYPTO)
CRC32c CRC algorithm (CRYPTO_CRC32C)
Library routines
CRC32c (Castagnoli, et al) Cyclic Redundancy-Check (LIBCRC32C)
設定好後 make 、make modules 、make modules_install、make install、reboot
2.2編譯驅動和撥號程式
解壓cxacru.tar.bz2,ln /核心原始碼目錄 /usr/linux -s
然後在原始碼目錄中make,
解壓rp-pppoe-3.5.tar.gz,在其目錄中執行./go 如果你用X 就可以用./go-gui
設定好你的撥號程式,要注意的是在填寫裝置的時候要填寫nas0
nas0是驅動程式虛擬出來的USB Modem
2.3設定協議
編輯/etc/cxacru檔案,像這個樣子:
程式碼:
#
# Config file for Conexant AccessRunner
#
# Driver mode
DRIVER_MODE=1 # 1 = normal, 2 = debug, 3 = normal+max speed (without ask adsl status), 4 = debug+max speed (without ask adsl status)
# Protocol
PROTOCOL_MODE=4 # 1 = RFC1483/2684 routed, 2 = PPP over ATM (pppoa), 3 = RFC1483/2684 bridged, 4 = PPP over Ethernet (pppoe)
# Paths
BINARY_PATH="/usr/sbin"
ATM_PATH=""
# ADSL
# if OPEN_MODE is blank then cxload uses default mode acoording VID & PID
# Values for OPEN_MODE are:
# 0 = auto selection, G.Handshake
# 1 = auto selection, T1.413
# 2 = G.Handshake
# 3 = ANSI T1.413
# 4 = ITU-T G.992.1 (G.DMT)
# 5 = ITU-T G.992.2 (G.LITE)
OPEN_MODE=4
# ATM
VPI=0
VCI=33
# Specific for RFC1483/2684 routed/bridged
# if IP_ADDRESS is blank in bridged mode then it uses DHCP to get IP
IP_ADDRESS=
NETMASK=255.255.255.255
GATEWAY=
需要更改的是# Protocol # ADSL # ATM
如果你用的是RFC1483/2684協議還要設定# Specific for RFC1483/2684 routed/bridged
PPPOE和PPPOA的使用者只要修改# Protocol # ADSL # ATM 這3項就可以了
3.撥號
在終端下輸入cxstart.sh建立連線 cxstop.sh斷掉連線
用ifconfig檢查一下你是否已經連上了,像這個樣子:
程式碼:
[root@Love root]# ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
nas0 Link encap:Ethernet HWaddr 00:00:01:00:00:00
inet6 addr: fe80::200:1ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:17650 errors:0 dropped:0 overruns:0 frame:0
TX packets:15790 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15856545 (15.1 Mb) TX bytes:2128934 (2.0 Mb)
ppp0 Link encap:Point-to-Point Protocol
inet addr:221.214.196.80 P-t-P:221.0.64.38 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:16454 errors:0 dropped:0 overruns:0 frame:0
TX packets:14588 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:15674609 (14.9 Mb) TX bytes:1613794 (1.5 Mb)
[root@Love root]#
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10617542/viewspace-946617/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- garmin USB: linux USB host驅動Linux
- Linux USB ECM Gadget 驅動介紹Linux
- extcon驅動及其在USB驅動中的應用
- 04_Linux下把驅動編譯進核心Linux編譯
- linux核心匯流排驅動模型-驅動篇Linux模型
- USB驅動正常,USB沒有反應
- 對USB驅動下載失敗的解決
- 【linux】驅動-2-核心模組Linux
- linux3.4.2核心-LCD驅動程式的移植Linux
- 在ubuntu下按照nvidia驅動Ubuntu
- HarmonyOS USB DDK助你輕鬆實現USB驅動開發
- 在 Linux 下使用 fstrim 延長 SSD 驅動器的壽命Linux
- linux核心原始碼閱讀-塊裝置驅動Linux原始碼
- 如何從USB驅動器執行Jutoh?
- Linux核心模組驅動載入與dmesg除錯Linux除錯
- linux驅動之LED驅動Linux
- Linux裝置驅動開發詳解:基於Linux4.0核心Linux
- Linux驅動實踐:帶你一步一步編譯核心驅動程式Linux編譯
- 如何編寫linux下nandflash驅動-4LinuxNaN
- 核心下gpio模擬i2c驅動修改
- 重磅!英偉達宣佈開源 Linux GPU 核心驅動LinuxGPU
- NVIDIA開始開源其Linux核心圖形驅動程式Linux
- NanoPi-NEO 全志H3移植Ubuntu 22.04 LTS、u-boot、Linux核心/核心樹、mt7601u USB-Wi-Fi支援、配置CLion用於Linux驅動開發NaNUbuntubootLinux
- 在linux下啟動tomcat命令LinuxTomcat
- 核心必須懂(四): 撰寫核心驅動
- 驅動篇——核心空間與核心模組
- Windows核心驅動-程序回撥Windows
- 在Linux上建立Windows 10可引導USBLinuxWindows
- Linux 驅動之IoctlLinux
- 學Linux驅動: 應該先了解驅動模型Linux模型
- 【linux】驅動-7-平臺裝置驅動Linux
- 由驅動原始碼編譯的.o檔案在不同版本的核心環境下無法通用原始碼編譯
- 在 Linux 上如何得到一個段錯誤的核心轉儲Linux
- 在Linux下製作Linux&windows啟動盤LinuxWindows
- linuxI2C驅動核心梳理Linux
- 領域驅動設計核心概念
- Linux核心 6.6版本將遏制NVIDIA驅動的不正當行為Linux
- xmake v2.6.2 釋出,新增 Linux 核心驅動模組構建支援Linux
- 港大發布OpenCity: 大模型驅動下的智慧城市"新核心"大模型