Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1 | /* 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 Hugo | 7960abd | 2011-08-02 15:39:38 -0600 | [diff] [blame] | 19 | #define BAM_DMUX_CH_NAME_MAX_LEN 20 |
| 20 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | enum { |
| 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 Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 34 | /* event type enum */ |
| 35 | enum { |
| 36 | BAM_DMUX_RECEIVE, /* data is struct sk_buff */ |
| 37 | BAM_DMUX_WRITE_DONE, /* data is struct sk_buff */ |
Jeff Hugo | d98b108 | 2011-10-24 10:30:23 -0600 | [diff] [blame] | 38 | BAM_DMUX_UL_CONNECTED, /* data is null */ |
| 39 | BAM_DMUX_UL_DISCONNECTED, /*data is null */ |
Manu Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 40 | }; |
| 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 53 | int msm_bam_dmux_open(uint32_t id, void *priv, |
Jeff Hugo | 1c4531c | 2011-08-02 14:55:37 -0600 | [diff] [blame] | 54 | void (*notify)(void *priv, int event_type, |
| 55 | unsigned long data)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 56 | |
| 57 | int msm_bam_dmux_close(uint32_t id); |
| 58 | |
| 59 | int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb); |
Jeff Hugo | d98b108 | 2011-10-24 10:30:23 -0600 | [diff] [blame] | 60 | |
| 61 | void msm_bam_dmux_kickoff_ul_wakeup(void); |
Karthikeyan Ramasubramanian | 7bf5ca8 | 2011-11-21 13:33:19 -0700 | [diff] [blame^] | 62 | |
| 63 | int msm_bam_dmux_is_ch_full(uint32_t id); |
| 64 | |
| 65 | int msm_bam_dmux_is_ch_low(uint32_t id); |
Manu Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 66 | #else |
| 67 | int msm_bam_dmux_open(uint32_t id, void *priv, |
Jeff Hugo | 1c4531c | 2011-08-02 14:55:37 -0600 | [diff] [blame] | 68 | void (*notify)(void *priv, int event_type, |
| 69 | unsigned long data)) |
Manu Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 70 | { |
| 71 | return -ENODEV; |
| 72 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 73 | |
Manu Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 74 | int msm_bam_dmux_close(uint32_t id) |
| 75 | { |
| 76 | return -ENODEV; |
| 77 | } |
| 78 | |
| 79 | int msm_bam_dmux_write(uint32_t id, struct sk_buff *skb) |
| 80 | { |
| 81 | return -ENODEV; |
| 82 | } |
Jeff Hugo | d98b108 | 2011-10-24 10:30:23 -0600 | [diff] [blame] | 83 | |
| 84 | void msm_bam_dmux_kickoff_ul_wakeup(void) |
| 85 | { |
| 86 | } |
Karthikeyan Ramasubramanian | 7bf5ca8 | 2011-11-21 13:33:19 -0700 | [diff] [blame^] | 87 | |
| 88 | int msm_bam_dmux_is_ch_full(uint32_t id) |
| 89 | { |
| 90 | return -ENODEV; |
| 91 | } |
| 92 | |
| 93 | int msm_bam_dmux_is_ch_low(uint32_t id) |
| 94 | { |
| 95 | return -ENODEV; |
| 96 | } |
Manu Gautam | 7f80896 | 2011-08-29 16:38:07 +0530 | [diff] [blame] | 97 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 98 | #endif /* _BAM_DMUX_H */ |