4 * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #include "usb-client.h"
22 USBCLIENT_MODE_NONE = 0x00,
23 USBCLIENT_MODE_MTP = 0x01,
24 USBCLIENT_MODE_ACM = 0x02,
25 USBCLIENT_MODE_SDB = 0x04,
26 USBCLIENT_MODE_RNDIS = 0x08,
27 USBCLIENT_MODE_DIAG = 0x10,
28 USBCLIENT_MODE_CONN_GADGET = 0x20,
31 unsigned int get_current_usb_gadget_info(int mode)
33 unsigned int gadgets = USBCLIENT_MODE_NONE;
37 gadgets |= USBCLIENT_MODE_MTP;
38 gadgets |= USBCLIENT_MODE_ACM;
39 gadgets |= USBCLIENT_MODE_CONN_GADGET;
42 gadgets |= USBCLIENT_MODE_MTP;
43 gadgets |= USBCLIENT_MODE_ACM;
44 gadgets |= USBCLIENT_MODE_SDB;
45 gadgets |= USBCLIENT_MODE_CONN_GADGET;
47 case SET_USB_SDB_DIAG:
48 gadgets |= USBCLIENT_MODE_MTP;
49 gadgets |= USBCLIENT_MODE_ACM;
50 gadgets |= USBCLIENT_MODE_SDB;
51 gadgets |= USBCLIENT_MODE_DIAG;
54 case SET_USB_RNDIS_TETHERING:
55 gadgets |= USBCLIENT_MODE_RNDIS;
57 case SET_USB_RNDIS_DIAG:
58 gadgets |= USBCLIENT_MODE_RNDIS;
59 gadgets |= USBCLIENT_MODE_DIAG;
61 case SET_USB_RNDIS_SDB:
62 gadgets |= USBCLIENT_MODE_RNDIS;
63 gadgets |= USBCLIENT_MODE_SDB;
65 case SET_USB_DIAG_SDB:
66 gadgets |= USBCLIENT_MODE_DIAG;
67 gadgets |= USBCLIENT_MODE_SDB;