Difference between revisions of "IoTGateway/Features/Linux/Module"
(→AM Telecom AMM561KT) |
Weichih.lin (talk | contribs) |
||
Line 1: | Line 1: | ||
<noinclude>{{DISPLAYTITLE:Linux Module Features}}</noinclude><includeonly>{{DISPLAYTITLE:Android Module Features}}</includeonly> | <noinclude>{{DISPLAYTITLE:Linux Module Features}}</noinclude><includeonly>{{DISPLAYTITLE:Android Module Features}}</includeonly> | ||
− | ==3G== | + | == 3G == |
− | ===EWM-C106FT01E=== | + | |
− | ===Sierra AirPrime MC8090=== | + | === EWM-C106FT01E === |
+ | |||
+ | === Sierra AirPrime MC8090 === | ||
+ | |||
The following operations are performed with UBC-221 using U221LBV1050. | The following operations are performed with UBC-221 using U221LBV1050. | ||
− | * linux kernel config | + | |
+ | *linux kernel config | ||
+ | |||
:set the following lines to <tt>meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg</tt> | :set the following lines to <tt>meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg</tt> | ||
− | <div style="margin-left: 2em;">< | + | <div style="margin-left: 2em;"><syntaxhighlight lang="text"> |
CONFIG_USB_SERIAL_FTDI_SIO=m | CONFIG_USB_SERIAL_FTDI_SIO=m | ||
CONFIG_USB_SERIAL_SIERRAWIRELESS=m | CONFIG_USB_SERIAL_SIERRAWIRELESS=m | ||
− | </ | + | </syntaxhighlight></div> |
:add the following line to <tt>meta-advantech/recipes-kernel/advantech-init/files/advantech.conf</tt> | :add the following line to <tt>meta-advantech/recipes-kernel/advantech-init/files/advantech.conf</tt> | ||
− | <div style="margin-left: 2em;">< | + | <div style="margin-left: 2em;"><syntaxhighlight lang="text"> |
sierra | sierra | ||
− | </ | + | </syntaxhighlight></div> |
:execute the following command | :execute the following command | ||
− | <div style="margin-left: 2em;">< | + | <div style="margin-left: 2em;"><syntaxhighlight lang="text"> |
$ bitbake advantech-init | $ bitbake advantech-init | ||
− | </ | + | </syntaxhighlight></div> |
− | + | *rebuild the kernel | |
− | * rebuild the kernel | + | <div style="margin-left: 2em;"><syntaxhighlight lang="bash"> |
− | <div style="margin-left: 2em;">< | ||
$ bitbake linux-yocto-clanton | $ bitbake linux-yocto-clanton | ||
− | </ | + | </syntaxhighlight></div> |
− | * rebuild the full image | + | *rebuild the full image |
− | <div style="margin-left: 2em;">< | + | <div style="margin-left: 2em;"><syntaxhighlight lang="bash"> |
$ bitbake image-full | $ bitbake image-full | ||
− | </ | + | </syntaxhighlight></div> |
− | * practical test on target board | + | *practical test on target board |
− | <div style="margin-left: 2em;"> | + | <div style="margin-left: 2em;"><syntaxhighlight lang="text"> |
− | < | ||
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \ | # pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \ | ||
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute & | user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
− | </ | + | </syntaxhighlight>[[File:Sierra AirPrime MC8090 connecting.png|850px|Sierra AirPrime MC8090 connecting.png]]<syntaxhighlight lang="text"> |
− | [[File: | ||
− | < | ||
# ifconfig | # ifconfig | ||
− | </ | + | </syntaxhighlight> [[File:Sierra AirPrime MC8090 ifconfig.png|600px|Sierra AirPrime MC8090 ifconfig.png]]<syntaxhighlight lang="text"> |
− | [[File: | ||
− | < | ||
# pinc -c5 8.8.8.8 | # pinc -c5 8.8.8.8 | ||
− | </ | + | </syntaxhighlight> [[File:Sierra AirPrime MC8090 ping.png|500px|Sierra AirPrime MC8090 ping.png]]</div> |
− | [[File: | + | === Telit HE910-D === |
− | </div> | ||
− | |||
The following operations are performed with UBC-221 using U221LBV1050. | The following operations are performed with UBC-221 using U221LBV1050. | ||
− | * practical test on target board | + | |
− | <div style="margin-left: 2em;"> | + | *practical test on target board |
− | < | + | <div style="margin-left: 2em;"><syntaxhighlight lang="text"> |
# modprobe cdc-acm | # modprobe cdc-acm | ||
− | </ | + | </syntaxhighlight>[[File:Telit HE910-D modprobe.png|750px|Telit HE910-D modprobe.png]]<syntaxhighlight lang="text"> |
− | [[File: | ||
− | < | ||
# dmesg | grep ttyACM | # dmesg | grep ttyACM | ||
− | </ | + | </syntaxhighlight> [[File:Telit HE910-D dmesg.png|480px|Telit HE910-D dmesg.png]]<syntaxhighlight lang="text"> |
− | [[File: | ||
− | < | ||
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \ | # pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \ | ||
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute & | user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute & | ||
# pinc -c5 8.8.8.8 | # pinc -c5 8.8.8.8 | ||
− | </ | + | </syntaxhighlight> [[File:Telit HE910-D pppd 2.png|RTENOTITLE]] [[File:Telit HE910-D ping.png|RTENOTITLE]]</div> |
− | [[File: | + | === Quectel UC20 === |
− | [[File: | + | |
− | </ | + | 3G module Porting (QUECTEL UC20) (1) In linux kernel |
+ | |||
+ | 1. You need to add the mechanism for processing zero packets during transmission of “usb_wwan.c” file under “[KERNEL]/drivers/usb/serial”. | ||
+ | |||
+ | You need to add the following statements to the “usb_wwan_write” and “usb_wwan_setup_urb” function, as shown below: | ||
+ | <pre>#include "usb-wwan.h" | ||
+ | |||
+ | + #ifdef CONFIG_ARCH_ADVANTECH | ||
+ | + #define HW_bcdUSB 0x0110 | ||
+ | + #define HUAWEI_VENDOR_ID 0x12d1 | ||
+ | + #endif | ||
+ | |||
+ | void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) | ||
+ | … | ||
+ | … | ||
+ | … | ||
+ | |||
+ | int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, | ||
+ | const unsigned char *buf, int count) | ||
+ | { | ||
+ | … | ||
+ | … | ||
+ | int left, todo; | ||
+ | struct urb *this_urb = NULL; /* spurious */ | ||
+ | + #ifdef CONFIG_ARCH_ADVANTECH | ||
+ | + struct usb_host_endpoint *ep=NULL; | ||
+ | + #endif | ||
+ | int err; | ||
+ | unsigned long flags; | ||
+ | … | ||
+ | … | ||
+ | … | ||
+ | /* send the data */ | ||
+ | memcpy(this_urb->transfer_buffer, buf, todo); | ||
+ | this_urb->transfer_buffer_length = todo; | ||
+ | |||
+ | + #ifdef CONFIG_ARCH_ADVANTECH | ||
+ | + if (IS_RSB_6410) | ||
+ | + { | ||
+ | + if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor) | ||
+ | + && (HW_bcdUSB != port->serial->dev->descriptor.bcdUSB)){ | ||
+ | + ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe); | ||
+ | + if(ep && (0 != this_urb->transfer_buffer_length) | ||
+ | + && (0 == this_urb->transfer_buffer_length % | ||
+ | + ep->desc.wMaxPacketSize)){ | ||
+ | + this_urb->transfer_flags |= URB_ZERO_PACKET; | ||
+ | + } | ||
+ | + } | ||
+ | + } | ||
+ | + #endif | ||
+ | |||
+ | spin_lock_irqsave(&intfdata->susp_lock, flags); | ||
+ | if (intfdata->suspended) { | ||
+ | usb_anchor_urb(this_urb, &portdata->delayed); | ||
+ | … | ||
+ | … | ||
+ | … | ||
+ | } | ||
+ | … | ||
+ | … | ||
+ | … | ||
+ | /* Helper functions used by usb_wwan_setup_urbs */ | ||
+ | static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, | ||
+ | int endpoint, | ||
+ | int dir, void *ctx, char *buf, int len, | ||
+ | void (*callback) (struct urb *)) | ||
+ | { | ||
+ | struct usb_serial *serial = port->serial; | ||
+ | struct urb *urb; | ||
+ | |||
+ | urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ | ||
+ | if (!urb) | ||
+ | return NULL; | ||
+ | |||
+ | /* Fill URB using supplied data. */ | ||
+ | usb_fill_bulk_urb(urb, serial->dev, | ||
+ | usb_sndbulkpipe(serial->dev, endpoint) | dir, | ||
+ | buf, len, callback, ctx); | ||
+ | |||
+ | + #ifdef CONFIG_ARCH_ADVANTECH | ||
+ | + if (IS_RSB_6410) | ||
+ | + { | ||
+ | + if (dir == USB_DIR_OUT) { | ||
+ | + struct usb_device_descriptor *desc = &serial->dev->descriptor; | ||
+ | + if (desc->idVendor == 0x05C6 && (desc->idProduct == 0x9003 || desc->idProduct == | ||
+ | + 0x9090 || desc->idProduct == 0x9215)) | ||
+ | + urb->transfer_flags |= URB_ZERO_PACKET; | ||
+ | + } | ||
+ | + } | ||
+ | + #endif | ||
+ | return urb; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | 2. Add UC15/UC20/EC20's Vendor ID and Product ID in "option_ids[]" in the file "drivers/usb/serial/option.c": | ||
+ | <pre>static const struct usb_device_id option_ids[] = { | ||
+ | … | ||
+ | + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090) }, //for Quectel UC15 | ||
+ | + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003) }, //for Quectel UC20 | ||
+ | + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9215) }, //for Quectel EC20 | ||
+ | … | ||
+ | } | ||
+ | </pre> | ||
==4G== | ==4G== |
Revision as of 07:56, 2 November 2016
Contents
3G
EWM-C106FT01E
Sierra AirPrime MC8090
The following operations are performed with UBC-221 using U221LBV1050.
- linux kernel config
- set the following lines to meta-advantech/recipes-kernel/linux/linux-yocto-clanton/advantech.cfg
CONFIG_USB_SERIAL_FTDI_SIO=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
- add the following line to meta-advantech/recipes-kernel/advantech-init/files/advantech.conf
sierra
- execute the following command
$ bitbake advantech-init
- rebuild the kernel
$ bitbake linux-yocto-clanton
- rebuild the full image
$ bitbake image-full
- practical test on target board
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyUSB3 460800 nodetach crtscts debug usepeerdns defaultroute &
# ifconfig
# pinc -c5 8.8.8.8
Telit HE910-D
The following operations are performed with UBC-221 using U221LBV1050.
- practical test on target board
# modprobe cdc-acm
# dmesg | grep ttyACM
# pppd connect 'chat -v -s -t 10 "" "AT" "" "ATDT*99#" "CONNECT" ""' \
user username password password /dev/ttyACM0 460800 nodetach crtscts debug usepeerdns defaultroute &
# pinc -c5 8.8.8.8
Quectel UC20
3G module Porting (QUECTEL UC20) (1) In linux kernel
1. You need to add the mechanism for processing zero packets during transmission of “usb_wwan.c” file under “[KERNEL]/drivers/usb/serial”.
You need to add the following statements to the “usb_wwan_write” and “usb_wwan_setup_urb” function, as shown below:
#include "usb-wwan.h" + #ifdef CONFIG_ARCH_ADVANTECH + #define HW_bcdUSB 0x0110 + #define HUAWEI_VENDOR_ID 0x12d1 + #endif void usb_wwan_dtr_rts(struct usb_serial_port *port, int on) … … … int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count) { … … int left, todo; struct urb *this_urb = NULL; /* spurious */ + #ifdef CONFIG_ARCH_ADVANTECH + struct usb_host_endpoint *ep=NULL; + #endif int err; unsigned long flags; … … … /* send the data */ memcpy(this_urb->transfer_buffer, buf, todo); this_urb->transfer_buffer_length = todo; + #ifdef CONFIG_ARCH_ADVANTECH + if (IS_RSB_6410) + { + if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor) + && (HW_bcdUSB != port->serial->dev->descriptor.bcdUSB)){ + ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe); + if(ep && (0 != this_urb->transfer_buffer_length) + && (0 == this_urb->transfer_buffer_length % + ep->desc.wMaxPacketSize)){ + this_urb->transfer_flags |= URB_ZERO_PACKET; + } + } + } + #endif spin_lock_irqsave(&intfdata->susp_lock, flags); if (intfdata->suspended) { usb_anchor_urb(this_urb, &portdata->delayed); … … … } … … … /* Helper functions used by usb_wwan_setup_urbs */ static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port, int endpoint, int dir, void *ctx, char *buf, int len, void (*callback) (struct urb *)) { struct usb_serial *serial = port->serial; struct urb *urb; urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */ if (!urb) return NULL; /* Fill URB using supplied data. */ usb_fill_bulk_urb(urb, serial->dev, usb_sndbulkpipe(serial->dev, endpoint) | dir, buf, len, callback, ctx); + #ifdef CONFIG_ARCH_ADVANTECH + if (IS_RSB_6410) + { + if (dir == USB_DIR_OUT) { + struct usb_device_descriptor *desc = &serial->dev->descriptor; + if (desc->idVendor == 0x05C6 && (desc->idProduct == 0x9003 || desc->idProduct == + 0x9090 || desc->idProduct == 0x9215)) + urb->transfer_flags |= URB_ZERO_PACKET; + } + } + #endif return urb; }
2. Add UC15/UC20/EC20's Vendor ID and Product ID in "option_ids[]" in the file "drivers/usb/serial/option.c":
static const struct usb_device_id option_ids[] = { … + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9090) }, //for Quectel UC15 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9003) }, //for Quectel UC20 + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9215) }, //for Quectel EC20 … }
4G
AM Telecom AMM561KT
The following operations are performed with UBC-222(U222LBV2011).
- linux kernel config
- Device Drivers --->
- [*] USB support --->
- <M> Support for Host-side USB
- [*] Network device support --->
- USB Network Adapters --->
- <M> Multi-purpose USB Networking Framework
- <M> Host for RNDIS and ActiveSync devices (EXPERIMENTAL)
- USB Network Adapters --->
- [*] USB support --->
- Device Drivers --->
- load drivers
# rmmod usbserial # modprobe rndis_host # modprobe usbserial vendor=0x1ECB product=0x0205
- list usb devices
Bluetooth
EWM-W155H01E
Please refer to Bluetooth Testing Guide for Quark Platform for all operations performed using UBC-222 with U222LBV2011.
WiFi
EWM-W142F01E
EWM-W151H01E
EWM-W155H01E
USB
EMIO-200U3
Set CONFIG_USB_XHCI_HCD=y in kernel config