日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

全志A33-USB虚拟网卡的配置与使用

發布時間:2023/12/15 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 全志A33-USB虚拟网卡的配置与使用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

開發環境

開發板:A33-Vstar

開發板系統:Linux

USB網卡:三星S4、華為P8(USB共享網絡)

------------------------------------------------

?

1. 配置內核

運行:make menuconfig ARCH=arm

依次進入: Device Drivers --->Network device support ---> USB Network Adapters

將以下三項編譯進內核:

Multi-purpose USB Networking Framework [ m--y ]

CDC Ethernet support (smart devices such as cable modems) [ m--y ]

Host for RNDIS and ActiveSync devices (EXPERIMENTAL) [ n--y ]

注:當將Multi-purpose USB Networking Framework 和 Host for RNDIS and ActiveSync devices (EXPERIMENTAL) 同時選y時,CDC Ethernet support (smart devices such as cable modems) 選項將自動選為y。

?

1)Multi-purpose USB Networking Framework

即usbnet,對應模塊為usbnet.ko。

在linux-3.4/drivers/net/usb/Kconfig中描述如下:

This driver supports several kinds of network links over USB,

with "minidrivers" built around a common network driver core

that supports deep queues for efficient transfers. (This gives

better performance with small packets and at high speeds).

?

The USB host runs "usbnet", and the other end of the link might be:

- Another USB host, when using USB "network" or "data transfer"

cables. These are often used to network laptops to PCs, like

"Laplink" parallel cables or some motherboards. These rely

on specialized chips from many suppliers.

- An intelligent USB gadget, perhaps embedding a Linux system.

These include PDAs running Linux (iPaq, Yopy, Zaurus, and

others), and devices that interoperate using the standard

CDC-Ethernet specification (including many cable modems).

- Network adapter hardware (like those for 10/100 Ethernet) which

uses this driver framework.

?

The link will appear with a name like "usb0", when the link is

a two-node link, or "eth0" for most CDC-Ethernet devices. Those

two-node links are most easily managed with Ethernet Bridging

(CONFIG_BRIDGE) instead of routing.

?

For more information see <http://www.linux-usb.org/usbnet/>.

To compile this driver as a module, choose M here: the module will be called usbnet.

?

2)CDC Ethernet support (smart devices such as cable modems)

對應模塊為cdc_ether.ko。

在linux-3.4/drivers/net/usb/Kconfig中描述如下:

This option supports devices conforming to the Communication Device

Class (CDC) Ethernet Control Model, a specification that's easy to

implement in device firmware. The CDC specifications are available

from <http://www.usb.org/>.

?

CDC Ethernet is an implementation option for DOCSIS cable modems

that support USB connectivity, used for non-Microsoft USB hosts.

The Linux-USB CDC Ethernet Gadget driver is an open implementation.

This driver should work with at least the following devices:

* Dell Wireless 5530 HSPA

* Ericsson PipeRider (all variants)

* Ericsson Mobile Broadband Module (all variants)

* Motorola (DM100 and SB4100)

* Broadcom Cable Modem (reference design)

* Toshiba (PCX1100U and F3507g/F3607gw)

* ...

?

This driver creates an interface named "ethX", where X depends on

what other networking devices you have in use. However, if the

IEEE 802 "local assignment" bit is set in the address, a "usbX"

name is used instead.

?

?

3)Host for RNDIS and ActiveSync devices (EXPERIMENTAL)

即RNDIS_HOST,對應模塊為rndis_host.ko。

在linux-3.4/drivers/net/usb/Kconfig中描述如下:

This option enables hosting "Remote NDIS" USB networking links,

as encouraged by Microsoft (instead of CDC Ethernet!) for use in

various devices that may only support this protocol. A variant

of this protocol (with even less public documentation) seems to

be at the root of Microsoft's "ActiveSync" too.

Avoid using this protocol unless you have no better options.

The protocol specification is incomplete, and is controlled by

(and for) Microsoft; it isn't an "Open" ecosystem or market.

?

注:

1)對于僅支持RNDIS的USB network device,host需要加載以上3個驅動,例如測試的S4和p8;

2)對于支持cdc_ether的device,host只需加載usbnet.ko和cdc_ether.ko,例如配置成cdc_ether gadget的開發板;

3)rndis_host.ko依賴cdc_ether.ko,兩者都依賴usbnet.ko。

4)以下是FreeBSD doc中摘錄:

Many cellphones provide the option to share their data connection over USB (often called "tethering"). This feature uses either the?RNDIS,?CDC?or a custom?Apple??iPhone?/iPad? protocol.

  • Android? devices generally use the?urndis?driver.
  • Apple? devices use the?ipheth?driver.
  • Older devices will often use the?cdce driver.

?

2. 識別USB虛擬網卡

將手機接入開發板USB,打開USB共享網絡。

在minicom中輸入:ifconfig usb0 up

然后:ifconfig

識別USB虛擬網卡成功。

?

3. 使用(ping測試)

1)在手機終端輸入:busybox ifconfig 查看rndis0 ip地址為:192.168.42.129

2)在minicom中配置開發板usb0 IP地址:ifconfig usb0 192.168.42.170

3)在minicom中輸入:ping -c 3 192.168.42.129

ping測試通過。

?

?

?

?

總結

以上是生活随笔為你收集整理的全志A33-USB虚拟网卡的配置与使用的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。