blob: 03e6e1e866aa07610c89acfbd3790c862a5db5d5 [file] [log] [blame]
Duy Truonge833aca2013-02-12 13:35:08 -08001/* Copyright (c) 2010, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13
14#ifndef _MSM_RMNET_H_
15#define _MSM_RMNET_H_
16
17/* Bitmap macros for RmNET driver operation mode. */
18#define RMNET_MODE_NONE (0x00)
19#define RMNET_MODE_LLP_ETH (0x01)
20#define RMNET_MODE_LLP_IP (0x02)
21#define RMNET_MODE_QOS (0x04)
ChandanaKishori Chiluverub9cabe42013-11-21 11:15:21 +053022#define RMNET_MODE_ALIGNED_QOS (0x08)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070023#define RMNET_MODE_MASK (RMNET_MODE_LLP_ETH | \
24 RMNET_MODE_LLP_IP | \
25 RMNET_MODE_QOS)
26
27#define RMNET_IS_MODE_QOS(mode) \
28 ((mode & RMNET_MODE_QOS) == RMNET_MODE_QOS)
29#define RMNET_IS_MODE_IP(mode) \
30 ((mode & RMNET_MODE_LLP_IP) == RMNET_MODE_LLP_IP)
31
32/* IOCTL command enum
33 * Values chosen to not conflict with other drivers in the ecosystem */
34enum rmnet_ioctl_cmds_e {
35 RMNET_IOCTL_SET_LLP_ETHERNET = 0x000089F1, /* Set Ethernet protocol */
36 RMNET_IOCTL_SET_LLP_IP = 0x000089F2, /* Set RAWIP protocol */
37 RMNET_IOCTL_GET_LLP = 0x000089F3, /* Get link protocol */
38 RMNET_IOCTL_SET_QOS_ENABLE = 0x000089F4, /* Set QoS header enabled */
39 RMNET_IOCTL_SET_QOS_DISABLE = 0x000089F5, /* Set QoS header disabled*/
40 RMNET_IOCTL_GET_QOS = 0x000089F6, /* Get QoS header state */
41 RMNET_IOCTL_GET_OPMODE = 0x000089F7, /* Get operation mode */
42 RMNET_IOCTL_OPEN = 0x000089F8, /* Open transport port */
43 RMNET_IOCTL_CLOSE = 0x000089F9, /* Close transport port */
Tianyi Gou4e287732012-08-06 17:24:25 -070044 RMNET_IOCTL_FLOW_ENABLE = 0x000089FA, /* Flow enable */
45 RMNET_IOCTL_FLOW_DISABLE = 0x000089FB, /* Flow disable */
ChandanaKishori Chiluverub9cabe42013-11-21 11:15:21 +053046 RMNET_IOCTL_SET_ALIGNED_QOS_ENABLE = 0x000089FC, /*Set aligned QoS */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047 RMNET_IOCTL_MAX
48};
49
50/* QMI QoS header definition */
51#define QMI_QOS_HDR_S __attribute((__packed__)) qmi_qos_hdr_s
52struct QMI_QOS_HDR_S {
53 unsigned char version;
54 unsigned char flags;
55 unsigned long flow_id;
56};
57
ChandanaKishori Chiluverub9cabe42013-11-21 11:15:21 +053058/* QMI QoS Aligned header definition */
59#define QMI_QOS_ALIGNED_HDR_S __attribute((__packed__)) qmi_qos_aligned_hdr_s
60struct QMI_QOS_ALIGNED_HDR_S {
61 struct QMI_QOS_HDR_S hdr;
62 unsigned char reserved[2];
63};
64
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070065#endif /* _MSM_RMNET_H_ */