Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08bdbb9b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: gadget: Add snapshot of USB GSI function driver"

parents d9668cbb 1dfb4a81
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -233,6 +233,12 @@ config USB_F_DIAG
config USB_F_CDEV
	tristate

config USB_F_CCID
	tristate

config USB_F_GSI
	tristate

config USB_F_QDSS
	tristate

@@ -561,6 +567,30 @@ config USB_CONFIGFS_F_CDEV
	  asynchronous notification to the host. This driver is typically
	  used to support DUN/NMEA functions.

config USB_CONFIGFS_F_CCID
	bool "USB CCID function"
	select USB_F_CCID
	depends on USB_CONFIGFS
	help
	  The Chip Card Interface Device (CCID) function implements a USB
	  interface that exposes a standard CSCID class that consists of a
	  pair of bulk IN and OUT endpoints and a single interrupt IN
	  endpoint. This driver provides a character device interface
	  allowing a userspace component to be able to provide the
	  implementation necessary to interface with the smartcard.

config USB_CONFIGFS_F_GSI
	bool "USB GSI function"
	select USB_F_GSI
	depends on USB_CONFIGFS
	help
	  The GSI function supports the IPA Generic Software Interface found
	  on various Qualcomm SoCs. This provides a hardware accelerated
	  datapath for various tethered data functions, such as RmNet, RNDIS,
	  MBIM, and CDC ECM. The function is configurable when instantiating
	  through ConfigFS. This driver can be used instead of the standard
	  implementations in case your hardware supports this.

config USB_CONFIGFS_F_QDSS
	bool "USB QDSS function"
	select USB_F_QDSS
+4 −0
Original line number Diff line number Diff line
@@ -62,5 +62,9 @@ usb_f_diag-y := f_diag.o
obj-$(CONFIG_USB_F_DIAG)	+= usb_f_diag.o
usb_f_cdev-y			:= f_cdev.o
obj-$(CONFIG_USB_F_CDEV)	+= usb_f_cdev.o
usb_f_ccid-y			:= f_ccid.o
obj-$(CONFIG_USB_F_CCID)	+= usb_f_ccid.o
usb_f_gsi-y			:= f_gsi.o rndis.o
obj-$(CONFIG_USB_F_GSI)		+= usb_f_gsi.o
usb_f_qdss-y			:= f_qdss.o u_qdss.o
obj-$(CONFIG_USB_F_QDSS)	+= usb_f_qdss.o
+1248 −0

File added.

Preview size limit exceeded, changes collapsed.

+83 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2011, 2017 The Linux Foundation. All rights reserved.

 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details
 */

#ifndef __F_CCID_H
#define __F_CCID_H

#define PROTOCOL_TO 0x01
#define PROTOCOL_T1 0x02
#define ABDATA_SIZE 512

/* define for dwFeatures for Smart Card Device Class Descriptors */
/* No special characteristics */
#define CCID_FEATURES_NADA       0x00000000
/* Automatic parameter configuration based on ATR data */
#define CCID_FEATURES_AUTO_PCONF 0x00000002
/* Automatic activation of ICC on inserting */
#define CCID_FEATURES_AUTO_ACTIV 0x00000004
/* Automatic ICC voltage selection */
#define CCID_FEATURES_AUTO_VOLT  0x00000008
/* Automatic ICC clock frequency change */
#define CCID_FEATURES_AUTO_CLOCK 0x00000010
/* Automatic baud rate change */
#define CCID_FEATURES_AUTO_BAUD  0x00000020
/*Automatic parameters negotiation made by the CCID */
#define CCID_FEATURES_AUTO_PNEGO 0x00000040
/* Automatic PPS made by the CCID according to the active parameters */
#define CCID_FEATURES_AUTO_PPS   0x00000080
/* CCID can set ICC in clock stop mode */
#define CCID_FEATURES_ICCSTOP    0x00000100
/* NAD value other than 00 accepted (T=1 protocol in use) */
#define CCID_FEATURES_NAD        0x00000200
/* Automatic IFSD exchange as first exchange (T=1 protocol in use) */
#define CCID_FEATURES_AUTO_IFSD  0x00000400
/* TPDU level exchanges with CCID */
#define CCID_FEATURES_EXC_TPDU   0x00010000
/* Short APDU level exchange with CCID */
#define CCID_FEATURES_EXC_SAPDU  0x00020000
/* Short and Extended APDU level exchange with CCID */
#define CCID_FEATURES_EXC_APDU   0x00040000
/* USB Wake up signaling supported on card insertion and removal */
#define CCID_FEATURES_WAKEUP     0x00100000

#define CCID_NOTIFY_CARD	_IOW('C', 1, struct usb_ccid_notification)
#define CCID_NOTIFY_HWERROR	_IOW('C', 2, struct usb_ccid_notification)
#define CCID_READ_DTR		_IOR('C', 3, int)

struct usb_ccid_notification {
	__u8 buf[4];
} __packed;

struct ccid_bulk_in_header {
	__u8 bMessageType;
	__u32 wLength;
	__u8 bSlot;
	__u8 bSeq;
	__u8 bStatus;
	__u8 bError;
	__u8 bSpecific;
	__u8 abData[ABDATA_SIZE];
	__u8 bSizeToSend;
} __packed;

struct ccid_bulk_out_header {
	__u8 bMessageType;
	__u32 wLength;
	__u8 bSlot;
	__u8 bSeq;
	__u8 bSpecific_0;
	__u8 bSpecific_1;
	__u8 bSpecific_2;
	__u8 APDU[ABDATA_SIZE];
} __packed;
#endif
+3304 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading