Skip to content

Commit 8f4e31b

Browse files
committed
add HUAWEI ME906s support
Signed-off-by: yan <[email protected]>
1 parent d2d05d1 commit 8f4e31b

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

arch/arm64/configs/kedge_defconfig

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ CONFIG_STMMAC_ETH=y
241241
# CONFIG_NET_VENDOR_WIZNET is not set
242242
CONFIG_ROCKCHIP_PHY=y
243243
CONFIG_REALTEK_PHY=y
244+
CONFIG_PPP=y
245+
CONFIG_PPP_BSDCOMP=y
246+
CONFIG_PPP_DEFLATE=y
247+
CONFIG_PPP_FILTER=y
248+
CONFIG_PPP_MPPE=y
249+
CONFIG_PPP_MULTILINK=y
250+
CONFIG_PPP_ASYNC=y
251+
CONFIG_PPP_SYNC_TTY=y
244252
CONFIG_USB_RTL8150=y
245253
CONFIG_USB_RTL8152=y
246254
CONFIG_USB_NET_CDC_EEM=y
@@ -679,7 +687,6 @@ CONFIG_CRYPTO_SHA2_ARM64_CE=y
679687
CONFIG_CRYPTO_GHASH_ARM64_CE=y
680688
CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
681689
CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
682-
CONFIG_CRC_CCITT=y
683690
CONFIG_CRC_T10DIF=y
684691
CONFIG_CRC7=y
685692
# CONFIG_XZ_DEC_X86 is not set

drivers/net/usb/usbnet.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include <linux/pm_runtime.h>
4949

5050
#define DRIVER_VERSION "22-Aug-2005"
51-
51+
#define HUAWEI_VENDOR_ID 0x12d1
5252

5353
/*-------------------------------------------------------------------------*/
5454

@@ -1761,6 +1761,12 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
17611761
// ok, it's ready to go.
17621762
usb_set_intfdata (udev, dev);
17631763

1764+
if(xdev->descriptor.idVendor == HUAWEI_VENDOR_ID){
1765+
if( 0 != (xdev->config->desc.bmAttributes & 0x20)){
1766+
usb_enable_autosuspend(xdev);
1767+
}
1768+
}
1769+
17641770
netif_device_attach (net);
17651771

17661772
if (dev->driver_info->flags & FLAG_LINK_INTR)

drivers/usb/core/usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int usb_disabled(void)
6666
EXPORT_SYMBOL_GPL(usb_disabled);
6767

6868
#ifdef CONFIG_PM
69-
static int usb_autosuspend_delay = 2; /* Default delay value,
69+
static int usb_autosuspend_delay = 5; /* Default delay value,
7070
* in seconds */
7171
module_param_named(autosuspend, usb_autosuspend_delay, int, 0644);
7272
MODULE_PARM_DESC(autosuspend, "default autosuspend delay");

drivers/usb/serial/option.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ static const struct usb_device_id option_ids[] = {
967967
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7A) },
968968
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7B) },
969969
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7C) },
970+
{ USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0x06, 0x7D) },
970971

971972
/* Motorola devices */
972973
{ USB_DEVICE_AND_INTERFACE_INFO(0x22b8, 0x2a70, 0xff, 0xff, 0xff) }, /* mdm6600 */
@@ -1913,6 +1914,7 @@ static const struct usb_device_id option_ids[] = {
19131914
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU581) },
19141915
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU582) },
19151916
{ USB_DEVICE(YUGA_VENDOR_ID, YUGA_PRODUCT_CWU583) },
1917+
{ USB_DEVICE(0x12d1, 0x15c1) },
19161918
{ USB_DEVICE_AND_INTERFACE_INFO(VIETTEL_VENDOR_ID, VIETTEL_PRODUCT_VT1000, 0xff, 0xff, 0xff) },
19171919
{ USB_DEVICE_AND_INTERFACE_INFO(ZD_VENDOR_ID, ZD_PRODUCT_7000, 0xff, 0xff, 0xff) },
19181920
{ USB_DEVICE(LG_VENDOR_ID, LG_PRODUCT_L02C) }, /* docomo L-02C modem */
@@ -2080,6 +2082,12 @@ static int option_attach(struct usb_serial *serial)
20802082
struct usb_wwan_intf_private *data;
20812083
unsigned long device_flags;
20822084

2085+
if (serial->dev->descriptor.idVendor == HUAWEI_VENDOR_ID) {
2086+
if ( 0 != (serial->dev->config->desc.bmAttributes & 0x20)){
2087+
usb_enable_autosuspend(serial->dev);
2088+
}
2089+
}
2090+
20832091
data = kzalloc(sizeof(struct usb_wwan_intf_private), GFP_KERNEL);
20842092
if (!data)
20852093
return -ENOMEM;

drivers/usb/serial/usb-serial.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ static struct usb_driver usb_serial_driver = {
12261226
.disconnect = usb_serial_disconnect,
12271227
.suspend = usb_serial_suspend,
12281228
.resume = usb_serial_resume,
1229+
.reset_resume = usb_serial_resume,
12291230
.no_dynamic_id = 1,
12301231
.supports_autosuspend = 1,
12311232
};

drivers/usb/serial/usb_wwan.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#include <linux/serial.h>
3737
#include "usb-wwan.h"
3838

39+
#define HW_bcdUSB 0x0110
40+
#define HUAWEI_VENDOR_ID 0x12d1
41+
3942
/*
4043
* Generate DTR/RTS signals on the port using the SET_CONTROL_LINE_STATE request
4144
* in CDC ACM.
@@ -217,6 +220,7 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
217220
{
218221
struct usb_wwan_port_private *portdata;
219222
struct usb_wwan_intf_private *intfdata;
223+
struct usb_host_endpoint *ep = NULL;
220224
int i;
221225
int left, todo;
222226
struct urb *this_urb = NULL; /* spurious */
@@ -256,6 +260,15 @@ int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
256260
memcpy(this_urb->transfer_buffer, buf, todo);
257261
this_urb->transfer_buffer_length = todo;
258262

263+
if((HUAWEI_VENDOR_ID == port->serial->dev->descriptor.idVendor)
264+
&& (HW_bcdUSB != port->serial->dev->descriptor.bcdUSB)){
265+
ep = usb_pipe_endpoint(this_urb->dev, this_urb->pipe);
266+
if(ep && (0 != this_urb->transfer_buffer_length)
267+
&& (0 == this_urb->transfer_buffer_length % ep->desc.wMaxPacketSize)){
268+
this_urb->transfer_flags |= URB_ZERO_PACKET;
269+
}
270+
}
271+
259272
spin_lock_irqsave(&intfdata->susp_lock, flags);
260273
if (intfdata->suspended) {
261274
usb_anchor_urb(this_urb, &portdata->delayed);

0 commit comments

Comments
 (0)