type
stringclasses
5 values
content
stringlengths
9
163k
functions
int a3700_spi_fifo_write(struct a3700_spi *a3700_spi) { struct a3700_spi_status *status = &a3700_spi->status; u32 val; if (status->buf_len % status->byte_len) return -EINVAL; while (!a3700_is_wfifo_full(a3700_spi) && status->buf_len) { /* Write bytes to data out register */ val = 0; if (status->byte_len =...
functions
void a3700_spi_transfer_abort_non_legacy(struct a3700_spi *a3700_spi) { int timeout = A3700_SPI_TIMEOUT; u32 val; val = spireg_read(a3700_spi, A3700_SPI_IF_CFG_REG); val |= A3700_SPI_XFER_STOP; spireg_write(a3700_spi, A3700_SPI_IF_CFG_REG, val); while (--timeout) { val = spireg_read(a3700_spi, A3700_SPI_IF_CF...
functions
int a3700_spi_do_transfer_non_legacy(struct spi_device *spi) { struct a3700_spi *a3700_spi; int ret = 0; a3700_spi = spi_master_get_devdata(spi->master); while (a3700_spi->status.buf_len) { if (a3700_spi->status.tx_buf) { /* Wait wfifo ready */ if (!a3700_spi_transfer_wait(spi, A3700_SPI_WFIFO_...
functions
else if (a3700_spi->status.rx_buf) { /* Wait rfifo ready */ if (!a3700_spi_transfer_wait(spi, A3700_SPI_RFIFO_RDY)) { dev_err(&spi->dev, "wait rfifo ready timed out\n"); ret = -ETIMEDOUT; goto error; }
functions
int a3700_spi_transfer_finish_non_legacy(struct spi_device *spi, struct spi_transfer *xfer) { struct a3700_spi *a3700_spi; int timeout = A3700_SPI_TIMEOUT; u32 val; a3700_spi = spi_master_get_devdata(spi->master); /* * Stop a write transfer in fifo mode: * - wait all the bytes in wfifo to be shifted out *...
functions
int a3700_spi_transfer_one_message(struct spi_master *master, struct spi_message *mesg) { struct spi_device *spi = mesg->spi; struct a3700_spi *a3700_spi = spi_master_get_devdata(master); struct spi_transfer *xfer = NULL; struct a3700_spi_status *xfer_stat = &a3700_spi->status; int ret = 0; list_for_each_entry(...
functions
int a3700_spi_probe(struct platform_device *pdev) { const struct of_device_id *of_id; const struct a3700_spi_initdata *initdata; struct device_node *of_node; struct resource *res; struct spi_master *master; struct a3700_spi *spi; u32 cell_index; int ret = 0; of_node = pdev->dev.of_node; of_id = of_match_dev...
functions
int a3700_spi_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); /* TO-DO: when gating clock is ready, need to disable the clock. */ spi_unregister_master(master); return 0; }
includes
#include <linux/kernel.h>
includes
#include <linux/module.h>
includes
#include <linux/init.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/dma-mapping.h>
includes
#include <linux/usb/musb.h>
includes
#include <linux/usb/otg.h>
includes
#include <mach/common.h>
includes
#include <mach/hardware.h>
includes
#include <mach/irqs.h>
functions
__init setup_usb(unsigned mA, unsigned potpgt_msec) { usb_data.power = mA / 2; usb_data.potpgt = potpgt_msec / 2; platform_device_register(&usb_dev); }
functions
__init setup_usb(unsigned mA, unsigned potpgt_msec) { }
includes
#include <glib.h>
includes
#include <epan/packet.h>
includes
#include <epan/etypes.h>
defines
#define TAG_REPORT_TYPE 0x01
defines
#define TAG_SEQ_NUM 0x02
defines
#define TAG_DATA_INST 0x03
functions
gint dissect_elmi_info_elem( tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, proto_tree *tree) { gint offset_start; guint8 tag, len; proto_item *tree_pi; proto_tree *info_elem_tree; offset_start = offset; tag = tvb_get_guint8(tvb, offset); if (tag==0) return...
functions
int dissect_elmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { proto_item *pi; proto_tree *elmi_tree; gint offset=0; guint8 msg_type; gint ret; col_clear(pinfo->cinfo, COL_INFO); col_set_str(pinfo->cinfo, COL_PROTOCOL, "E-LMI"); pi = proto_tr...
functions
void proto_register_elmi(void) { static hf_register_info hf[] = { { &hf_elmi_ver, { "Version", "elmi.version", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
functions
void proto_reg_handoff_elmi(void) { dissector_handle_t elmi_handle; elmi_handle = new_create_dissector_handle(dissect_elmi, proto_elmi); dissector_add_uint("ethertype", ETHERTYPE_ELMI, elmi_handle); }
defines
#define SFTP_SCP_ST_MODE_MASK (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)
defines
#define SFTP_SCP_OPT_ISSRC 0x0001
defines
#define SFTP_SCP_OPT_ISDST 0x0002
defines
#define SFTP_SCP_OPT_DIR 0x0004
defines
#define SFTP_SCP_OPT_VERBOSE 0x0008
defines
#define SFTP_SCP_OPT_PRESERVE 0x0010
defines
#define SFTP_SCP_OPT_RECURSE 0x0020
structs
struct scp_path { char *path; pr_fh_t *fh; /* Points to the directory "context" path, if we're receiving a file * from a client sub-directory and we're in recursive mode. */ struct scp_path *recv_dir; /* Points to the previous directory "context" path, if any. For handling * the push/pop approach ...
structs
struct scp_session { struct scp_session *next, *prev; pool *pool; uint32_t channel_id; array_header *dirs; array_header *paths; unsigned int path_idx; };
structs
struct scp_paths { struct scp_paths *next, *prev; pool *pool; uint32_t channel_id; array_header *paths; unsigned int path_idx; };
functions
int scp_destroy_paths(struct scp_paths *paths) { if (paths == NULL) { return 0; }
functions
void reset_path(struct scp_path *sp) { if (sp->fh) { pr_fsio_close(sp->fh); sp->fh = NULL; }
functions
int read_confirm(struct ssh2_packet *pkt, char **buf, uint32_t *buflen) { char code; code = sftp_msg_read_byte(pkt->pool, buf, buflen); pr_trace_msg(trace_channel, 9, "recvd confirmation/error code = %d", code); switch (code) { case 0: break; case 1: { register unsigned int i; c...
functions
int write_confirm(pool *p, uint32_t channel_id, int code, const char *msg) { char *buf, *ptr; uint32_t buflen, bufsz; /* XXX Is this big enough? Too big? */ buflen = bufsz = 128; buf = ptr = palloc(p, bufsz); if (code == 0) { pr_trace_msg(trace_channel, 9, "sending confirmation/error code = %d", ...
functions
int recv_errors(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { /* Check for error messages from the client first. */ if (data[0] == '\01') { register unsigned int i; char *msg; for (i = 1; i < datalen; i++) { if (data[i] == '\n') { break; }
functions
int recv_timeinfo(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { register unsigned int i; char *msg, *ptr = NULL, *tmp = NULL; if (data[0] != 'T') { pr_trace_msg(trace_channel, 2, "expected T control message, got '%c'", data[0]); write_confirm(p, channel_id, ...
functions
int recv_perms(pool *p, uint32_t channel_id, char *mode_str, mode_t *perms) { register unsigned int i; if (strlen(mode_str) < 5) { /* This needs to be at least 5 characters: 4 mode digits, and space. */ pr_trace_msg(trace_channel, 2, "mode string too short: '%s'", mode_str); write_confirm(p, channe...
functions
int recv_filesz(pool *p, uint32_t channel_id, char *size_str, off_t *filesz) { register unsigned int i; size_t size_strlen; size_strlen = strlen(size_str); /* The file size field could be of arbitrary length. */ for (i = 0, *filesz = 0; isdigit((int) size_str[i]); i++) { pr_signals_handle(); *f...
functions
int recv_filename(pool *p, uint32_t channel_id, char *name_str, struct scp_path *sp) { if (strchr(name_str, '/') != NULL || strcmp(name_str, "..") == 0) { pr_trace_msg(trace_channel, 2, "bad filename: '%s'", name_str); write_confirm(p, channel_id, 1, pstrcat(p, "unexpected filename: ", name_s...
functions
int recv_finfo(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { register unsigned int i; char *hiddenstore_path = NULL, *msg, *ptr = NULL; int have_dir = FALSE; cmd_rec *cmd = NULL; switch (data[0]) { case 'C': break; case 'D': if (!(scp_opts & SFTP...
functions
int recv_data(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { uint32_t writelen; writelen = datalen; if (writelen > (sp->filesz - sp->recvlen)) { writelen = (sp->filesz - sp->recvlen); }
functions
int recv_eod(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { struct scp_path *dir_sp; int ok = TRUE; if (data[0] != 'E') { return 0; }
functions
int recv_path(pool *p, uint32_t channel_id, struct scp_path *sp, char *data, uint32_t datalen) { int res; cmd_rec *cmd = NULL; if (!sp->checked_errors) { res = recv_errors(p, channel_id, sp, data, datalen); if (res == 1) return res; }
functions
int send_timeinfo(pool *p, uint32_t channel_id, struct scp_path *sp, struct stat *st) { int res; char ctrl_msg[64]; size_t ctrl_msglen; memset(ctrl_msg, '\0', sizeof(ctrl_msg)); /* The field of this message are: * * T (time info) * number (mtime, in secs) * 0 (future proof fi...
functions
int send_dirinfo(pool *p, uint32_t channel_id, struct scp_path *sp, struct stat *st) { int res; char ctrl_msg[1536]; size_t ctrl_msglen; char *tmp; /* We need to find the last path component, if any; no path separators * in the control messages. */ tmp = strrchr(sp->path, '/'); if (tmp == NULL)...
functions
int send_finfo(pool *p, uint32_t channel_id, struct scp_path *sp, struct stat *st) { int res; char ctrl_msg[1536]; size_t ctrl_msglen; char *tmp; /* We need to find the last path component, if any; no path separators * in the control messages. */ tmp = strrchr(sp->path, '/'); if (tmp == NULL) {...
functions
int send_data(pool *p, uint32_t channel_id, struct scp_path *sp, struct stat *st) { int res; char *chunk; size_t chunksz; long chunklen; /* Include space for one more character, i.e. for the terminating NUL * character that indicates the last chunk of the file. */ chunksz = (main_server->tcp_rcvb...
functions
int send_dir(pool *p, uint32_t channel_id, struct scp_path *sp, struct stat *st) { struct dirent *dent; int res = 0; if (sp->dirh == NULL) { sp->dirh = pr_fsio_opendir(sp->path); if (sp->dirh == NULL) { (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, "error reading directory '%s':...
functions
int send_path(pool *p, uint32_t channel_id, struct scp_path *sp) { int res; struct stat st; cmd_rec *cmd = NULL; if (sp->sent_data) { /* Already sent everything for this path. */ return 1; }
functions
int sftp_scp_handle_packet(pool *p, void *ssh2, uint32_t channel_id, char *data, uint32_t datalen) { int res = -1; struct ssh2_packet *pkt; scp_session = scp_get_session(channel_id); if (scp_session == NULL) { (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, "no existing SCP session for chan...
functions
else if (scp_opts & SFTP_SCP_OPT_ISDST) { struct scp_path **paths; paths = scp_session->paths->elts; if (session.xfer.p == NULL) { session.xfer.p = pr_pool_create_sz(scp_pool, 64); session.xfer.path = pstrdup(session.xfer.p, paths[scp_session->path_idx]->path); memset(&session.xf...
functions
int sftp_scp_set_params(pool *p, uint32_t channel_id, array_header *req) { register unsigned int i; int optc, use_glob = TRUE; char **reqargv; const char *opts = "dfprtv"; config_rec *c; struct scp_paths *paths; /* Possible options are: * * -d (target should be a directory) * -f (copying data ...
functions
int sftp_scp_open_session(uint32_t channel_id) { register unsigned int i; pool *sub_pool; struct scp_paths *paths; struct scp_session *sess, *last; /* Check to see if we already have an SCP session opened for the given * channel ID. */ sess = last = scp_sessions; while (sess) { pr_signals_handl...
functions
int sftp_scp_close_session(uint32_t channel_id) { struct scp_session *sess; /* Check to see if we have an SCP session opened for this channel ID. */ sess = scp_sessions; while (sess) { pr_signals_handle(); if (sess->channel_id == channel_id) { if (sess->next) sess->next->prev = sess->pr...
includes
#include <linux/module.h>
includes
#include <linux/device.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/clk.h>
includes
#include <linux/slab.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/err.h>
includes
#include <linux/delay.h>
includes
#include <linux/io.h>
includes
#include <linux/ioport.h>
includes
#include <linux/gpio.h>
includes
#include <linux/of_gpio.h>
includes
#include <linux/uaccess.h>
includes
#include <linux/debugfs.h>
includes
#include <linux/seq_file.h>
includes
#include <linux/pm_runtime.h>
includes
#include <linux/suspend.h>
includes
#include <linux/of.h>
includes
#include <linux/dma-mapping.h>
includes
#include <linux/clk/msm-clk.h>
includes
#include <linux/pinctrl/consumer.h>
includes
#include <linux/irqchip/msm-mpm-irq.h>
includes
#include <soc/qcom/scm.h>
includes
#include <linux/usb.h>
includes
#include <linux/usb/otg.h>
includes
#include <linux/usb/ulpi.h>
includes
#include <linux/usb/gadget.h>
includes
#include <linux/usb/hcd.h>
includes
#include <linux/usb/quirks.h>
includes
#include <linux/usb/msm_hsusb.h>
includes
#include <linux/usb/msm_hsusb_hw.h>
includes
#include <linux/usb/msm_ext_chg.h>
includes
#include <linux/regulator/consumer.h>
includes
#include <linux/mfd/pm8xxx/pm8921-charger.h>
includes
#include <linux/mfd/pm8xxx/misc.h>
includes
#include <linux/mhl_8334.h>