blob: fb70da4f2448ea34699cfe71c55bc13425b9f968 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
2 *
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#include <linux/types.h>
14#include <linux/skbuff.h>
15
16#ifndef _BAM_DMUX_H
17#define _BAM_DMUX_H
18
Jeff Hugo7960abd2011-08-02 15:39:38 -060019#define BAM_DMUX_CH_NAME_MAX_LEN 20
20
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070021enum {
22 BAM_DMUX_DATA_RMNET_0,
23 BAM_DMUX_DATA_RMNET_1,
24 BAM_DMUX_DATA_RMNET_2,
25 BAM_DMUX_DATA_RMNET_3,
26 BAM_DMUX_DATA_RMNET_4,
27 BAM_DMUX_DATA_RMNET_5,
28 BAM_DMUX_DATA_RMNET_6,
29 BAM_DMUX_DATA_RMNET_7,
30 BAM_DMUX_USB_RMNET_0,
31 BAM_DMUX_NUM_CHANNELS
32};
33
Manu Gautam7f808962011-08-29 16:38:07 +053034/* event type enum */
35enum {
36 BAM_DMUX_RECEIVE, /* data is struct sk_buff */
37 BAM_DMUX_WRITE_DONE, /* data is struct sk_buff */
Jeff Hugod98b1082011-10-24 10:30:23 -060038 BAM_DMUX_UL_CONNECTED, /* data is null */
39 BAM_DMUX_UL_DISCONNECTED, /*data is null */
Manu Gautam7f808962011-08-29 16:38:07 +053040};
41
42/*
43 * Open a bam_dmux logical channel
44 * id - the logical channel to open
45 * priv - private data pointer to be passed to the notify callback
46 * notify - event callback function
47 * priv - private data pointer passed to msm_bam_dmux_open()
48 * event_type - type of event
49 * data - data relevant to event. May not be valid. See event_type
50 * enum for valid cases.
51 */
52#ifdef CONFIG_MSM_BAM_DMUX
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070053int msm_bam_dmux_open(uint32_t id, void *priv,
Jeff Hugo1c4531c2011-08-02 14:55:37 -060054 void (*notify)(void *priv, int event_type,
55 unsigned long data));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070056
57int msm_bam_dmux_close(uint32_t id);
58
59int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb);
Jeff Hugod98b1082011-10-24 10:30:23 -060060
61void msm_bam_dmux_kickoff_ul_wakeup(void);
Karthikeyan Ramasubramanian7bf5ca82011-11-21 13:33:19 -070062
63int msm_bam_dmux_is_ch_full(uint32_t id);
64
65int msm_bam_dmux_is_ch_low(uint32_t id);
Manu Gautam7f808962011-08-29 16:38:07 +053066#else
67int msm_bam_dmux_open(uint32_t id, void *priv,
Jeff Hugo1c4531c2011-08-02 14:55:37 -060068 void (*notify)(void *priv, int event_type,
69 unsigned long data))
Manu Gautam7f808962011-08-29 16:38:07 +053070{
71 return -ENODEV;
72}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073
Manu Gautam7f808962011-08-29 16:38:07 +053074int msm_bam_dmux_close(uint32_t id)
75{
76 return -ENODEV;
77}
78
79int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb)
80{
81 return -ENODEV;
82}
Jeff Hugod98b1082011-10-24 10:30:23 -060083
84void msm_bam_dmux_kickoff_ul_wakeup(void)
85{
86}
Karthikeyan Ramasubramanian7bf5ca82011-11-21 13:33:19 -070087
88int msm_bam_dmux_is_ch_full(uint32_t id)
89{
90 return -ENODEV;
91}
92
93int msm_bam_dmux_is_ch_low(uint32_t id)
94{
95 return -ENODEV;
96}
Manu Gautam7f808962011-08-29 16:38:07 +053097#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070098#endif /* _BAM_DMUX_H */