Path: blob/master/arch/arm/mach-msm/include/mach/msm_smd.h
17653 views
/* linux/include/asm-arm/arch-msm/msm_smd.h1*2* Copyright (C) 2007 Google, Inc.3* Author: Brian Swetland <[email protected]>4*5* This software is licensed under the terms of the GNU General Public6* License version 2, as published by the Free Software Foundation, and7* may be copied, distributed, and modified under those terms.8*9* This program is distributed in the hope that it will be useful,10* but WITHOUT ANY WARRANTY; without even the implied warranty of11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the12* GNU General Public License for more details.13*14*/1516#ifndef __ASM_ARCH_MSM_SMD_H17#define __ASM_ARCH_MSM_SMD_H1819typedef struct smd_channel smd_channel_t;2021extern int (*msm_check_for_modem_crash)(void);2223/* warning: notify() may be called before open returns */24int smd_open(const char *name, smd_channel_t **ch, void *priv,25void (*notify)(void *priv, unsigned event));2627#define SMD_EVENT_DATA 128#define SMD_EVENT_OPEN 229#define SMD_EVENT_CLOSE 33031int smd_close(smd_channel_t *ch);3233/* passing a null pointer for data reads and discards */34int smd_read(smd_channel_t *ch, void *data, int len);3536/* Write to stream channels may do a partial write and return37** the length actually written.38** Write to packet channels will never do a partial write --39** it will return the requested length written or an error.40*/41int smd_write(smd_channel_t *ch, const void *data, int len);42int smd_write_atomic(smd_channel_t *ch, const void *data, int len);4344int smd_write_avail(smd_channel_t *ch);45int smd_read_avail(smd_channel_t *ch);4647/* Returns the total size of the current packet being read.48** Returns 0 if no packets available or a stream channel.49*/50int smd_cur_packet_size(smd_channel_t *ch);5152/* used for tty unthrottling and the like -- causes the notify()53** callback to be called from the same lock context as is used54** when it is called from channel updates55*/56void smd_kick(smd_channel_t *ch);575859#if 060/* these are interruptable waits which will block you until the specified61** number of bytes are readable or writable.62*/63int smd_wait_until_readable(smd_channel_t *ch, int bytes);64int smd_wait_until_writable(smd_channel_t *ch, int bytes);65#endif6667typedef enum {68SMD_PORT_DS = 0,69SMD_PORT_DIAG,70SMD_PORT_RPC_CALL,71SMD_PORT_RPC_REPLY,72SMD_PORT_BT,73SMD_PORT_CONTROL,74SMD_PORT_MEMCPY_SPARE1,75SMD_PORT_DATA1,76SMD_PORT_DATA2,77SMD_PORT_DATA3,78SMD_PORT_DATA4,79SMD_PORT_DATA5,80SMD_PORT_DATA6,81SMD_PORT_DATA7,82SMD_PORT_DATA8,83SMD_PORT_DATA9,84SMD_PORT_DATA10,85SMD_PORT_DATA11,86SMD_PORT_DATA12,87SMD_PORT_DATA13,88SMD_PORT_DATA14,89SMD_PORT_DATA15,90SMD_PORT_DATA16,91SMD_PORT_DATA17,92SMD_PORT_DATA18,93SMD_PORT_DATA19,94SMD_PORT_DATA20,95SMD_PORT_GPS_NMEA,96SMD_PORT_BRIDGE_1,97SMD_PORT_BRIDGE_2,98SMD_PORT_BRIDGE_3,99SMD_PORT_BRIDGE_4,100SMD_PORT_BRIDGE_5,101SMD_PORT_LOOPBACK,102SMD_PORT_CS_APPS_MODEM,103SMD_PORT_CS_APPS_DSP,104SMD_PORT_CS_MODEM_DSP,105SMD_NUM_PORTS,106} smd_port_id_type;107108#endif109110111