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_RMNET = 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;
41 gadgets |= USBCLIENT_MODE_MTP;
42 gadgets |= USBCLIENT_MODE_ACM;
43 gadgets |= USBCLIENT_MODE_SDB;
45 case SET_USB_SDB_DIAG:
46 gadgets |= USBCLIENT_MODE_MTP;
47 gadgets |= USBCLIENT_MODE_ACM;
48 gadgets |= USBCLIENT_MODE_SDB;
49 gadgets |= USBCLIENT_MODE_DIAG;
52 case SET_USB_RNDIS_TETHERING:
53 gadgets |= USBCLIENT_MODE_RNDIS;
55 case SET_USB_RNDIS_DIAG:
56 gadgets |= USBCLIENT_MODE_RNDIS;
57 gadgets |= USBCLIENT_MODE_DIAG;
59 case SET_USB_RNDIS_SDB:
60 gadgets |= USBCLIENT_MODE_RNDIS;
61 gadgets |= USBCLIENT_MODE_SDB;
63 case SET_USB_DIAG_SDB:
64 gadgets |= USBCLIENT_MODE_DIAG;
65 gadgets |= USBCLIENT_MODE_SDB;
67 case SET_USB_DIAG_RMNET:
68 gadgets |= USBCLIENT_MODE_DIAG;
69 gadgets |= USBCLIENT_MODE_ACM;
70 gadgets |= USBCLIENT_MODE_RMNET;