Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/char/tpm/tpm_tis_i2c_cr50.c | static irqreturn_t tpm_cr50_i2c_int_handler(int dummy, void *tpm_info) {
struct tpm_chip *chip = tpm_info;
struct tpm_i2c_cr50_priv_data *priv = dev_get_drvdata(&chip->dev);
complete(&priv->tpm_ready);
return IRQ_HANDLED;
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_i2c_cr50.c | static int tpm_cr50_i2c_wait_tpm_ready(struct tpm_chip *chip) {
struct tpm_i2c_cr50_priv_data *priv = dev_get_drvdata(&chip->dev);
if (priv->irq <= 0) {
msleep(TPM_CR50_TIMEOUT_NOIRQ_MS);
return 0;
}
/* Wait for interrupt to indicate TPM is ready to respond */
if (!wait_for_completion_timeout(&priv-... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_i2c_cr50.c | static int tpm_cr50_i2c_write(struct tpm_chip *chip, u8 addr, u8 *buffer,
size_t len) {
struct tpm_i2c_cr50_priv_data *priv = dev_get_drvdata(&chip->dev);
struct i2c_client *client = to_i2c_client(chip->dev.parent);
struct i2c_msg msg = {.addr = client->addr, .len = len + 1, .buf = p... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_i2c_cr50.c | static int tpm_cr50_check_locality(struct tpm_chip *chip) {
u8 mask = TPM_ACCESS_VALID | TPM_ACCESS_ACTIVE_LOCALITY;
u8 buf;
int rc;
rc = tpm_cr50_i2c_read(chip, TPM_I2C_ACCESS(0), &buf, sizeof(buf));
if (rc < 0)
return rc;
if ((buf & mask) == mask)
return 0;
return -EIO;
} | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_i2c_cr50.c | static void tpm_cr50_release_locality(struct tpm_chip *chip, bool force) {
u8 mask = TPM_ACCESS_VALID | TPM_ACCESS_REQUEST_PENDING;
u8 addr = TPM_I2C_ACCESS(0);
u8 buf;
if (tpm_cr50_i2c_read(chip, addr, &buf, sizeof(buf)) < 0)
return;
if (force || (buf & mask) == mask) {
buf = TPM_ACCESS_ACTIVE_LOCA... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_cr50.c | static irqreturn_t cr50_spi_irq_handler(int dummy, void *dev_id) {
struct cr50_spi_phy *cr50_phy = dev_id;
cr50_phy->irq_confirmed = true;
complete(&cr50_phy->spi_phy.ready);
return IRQ_HANDLED;
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_cr50.c | static bool cr50_needs_waking(struct cr50_spi_phy *phy) {
return !time_in_range_open(jiffies, phy->last_access,
phy->spi_phy.wake_after);
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_cr50.c | static int tpm_tis_spi_cr50_transfer(struct tpm_tis_data *data, u32 addr,
u16 len, u8 *in, const u8 *out) {
struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data);
struct cr50_spi_phy *cr50_phy = to_cr50_spi_phy(phy);
int ret;
mutex_lock(&cr50_phy->time_track_mutex);
cr5... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_cr50.c | int tpm_tis_spi_resume(struct device *dev) {
struct tpm_chip *chip = dev_get_drvdata(dev);
struct tpm_tis_data *data = dev_get_drvdata(&chip->dev);
struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data);
phy->wake_after = jiffies;
return tpm_tis_resume(dev);
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_main.c |
static int tpm_tis_spi_driver_probe(struct spi_device *spi) {
const struct spi_device_id *spi_dev_id = spi_get_device_id(spi);
tpm_tis_spi_probe_func probe_func;
probe_func = of_device_get_match_data(&spi->dev);
if (!probe_func) {
if (spi_dev_id) {
probe_func = (tpm_tis_spi_probe_func)spi_dev_id->dr... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_spi_main.c |
static void tpm_tis_spi_remove(struct spi_device *dev) {
struct tpm_chip *chip = spi_get_drvdata(dev);
tpm_chip_unregister(chip);
tpm_tis_remove(chip);
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_synquacer.c |
static int tpm_tis_synquacer_init(struct device *dev,
struct tpm_tis_synquacer_info *tpm_info) {
struct tpm_tis_synquacer_phy *phy;
phy = devm_kzalloc(dev, sizeof(struct tpm_tis_synquacer_phy), GFP_KERNEL);
if (phy == NULL)
return -ENOMEM;
phy->iobase = devm_ioremap_reso... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_synquacer.c |
static int tpm_tis_synquacer_probe(struct platform_device *pdev) {
struct tpm_tis_synquacer_info tpm_info = {};
struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n");
return -ENODEV;
}
tpm_info.res = *res;... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_synquacer.c |
static int __init tpm_tis_synquacer_module_init(void) {
int rc;
rc = platform_driver_register(&tis_synquacer_drv);
if (rc)
return rc;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_tis_synquacer.c |
static void __exit tpm_tis_synquacer_module_exit(void) {
platform_driver_unregister(&tis_synquacer_drv);
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c | static void vtpm_proxy_fops_undo_open(struct proxy_dev *proxy_dev) {
mutex_lock(&proxy_dev->buf_lock);
proxy_dev->state &= ~STATE_OPENED_FLAG;
mutex_unlock(&proxy_dev->buf_lock);
wake_up_interruptible(&proxy_dev->wq);
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c | static int vtpm_proxy_tpm_op_recv(struct tpm_chip *chip, u8 *buf,
size_t count) {
struct proxy_dev *proxy_dev = dev_get_drvdata(&chip->dev);
size_t len;
mutex_lock(&proxy_dev->buf_lock);
if (!(proxy_dev->state & STATE_OPENED_FLAG)) {
mutex_unlock(&proxy_dev->buf_lock);
... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c |
static int vtpm_proxy_is_driver_command(struct tpm_chip *chip, u8 *buf,
size_t count) {
struct tpm_header *hdr = (struct tpm_header *)buf;
if (count < sizeof(struct tpm_header))
return 0;
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
switch (be32_to_cpu(hdr->ordinal)) ... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c |
static u8 vtpm_proxy_tpm_op_status(struct tpm_chip *chip) {
struct proxy_dev *proxy_dev = dev_get_drvdata(&chip->dev);
if (proxy_dev->resp_len)
return VTPM_PROXY_REQ_COMPLETE_FLAG;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c | static struct proxy_dev *vtpm_proxy_create_proxy_dev(void) {
struct proxy_dev *proxy_dev;
struct tpm_chip *chip;
int err;
proxy_dev = kzalloc(sizeof(*proxy_dev), GFP_KERNEL);
if (proxy_dev == NULL)
return ERR_PTR(-ENOMEM);
init_waitqueue_head(&proxy_dev->wq);
mutex_init(&proxy_dev->buf_lock);
INIT... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c |
static void vtpmx_cleanup(void) { misc_deregister(&vtpmx_miscdev); } | [
0,
0
] |
Linux Kernel | drivers/char/tpm/tpm_vtpm_proxy.c |
static int __init vtpm_module_init(void) {
int rc;
rc = vtpmx_init();
if (rc) {
pr_err("couldn't create vtpmx device\n");
return rc;
}
workqueue = create_workqueue("tpm-vtpm");
if (!workqueue) {
pr_err("couldn't create workqueue\n");
rc = -ENOMEM;
goto err_vtpmx_cleanup;
}
return... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c |
static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask,
bool check_cancel, bool *canceled) {
u8 status = chip->ops->status(chip);
*canceled = false;
if ((status & mask) == mask)
return true;
if (check_cancel && chip->ops->req_canceled(chip, status)) {
*can... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c | static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) {
struct tpm_private *priv = dev_get_drvdata(&chip->dev);
struct vtpm_shared_page *shr = priv->shr;
size_t offset = shr_data_offset(shr);
u32 ordinal;
unsigned long duration;
if (offset > PAGE_SIZE)
return -EINVAL;
if (offset + coun... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c | static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) {
struct tpm_private *priv = dev_get_drvdata(&chip->dev);
struct vtpm_shared_page *shr = priv->shr;
size_t offset = shr_data_offset(shr);
size_t length = shr->length;
if (shr->state == VTPM_STATE_IDLE)
return -ECANCELED;
if (wait_for_t... | [
1,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c |
static irqreturn_t tpmif_interrupt(int dummy, void *dev_id) {
struct tpm_private *priv = dev_id;
switch (priv->shr->state) {
case VTPM_STATE_IDLE:
case VTPM_STATE_FINISH:
wake_up_interruptible(&priv->read_queue);
break;
case VTPM_STATE_SUBMIT:
case VTPM_STATE_CANCEL:
default:
break;
}
re... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c |
static int tpmfront_probe(struct xenbus_device *dev,
const struct xenbus_device_id *id) {
struct tpm_private *priv;
int rv;
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
xenbus_dev_fatal(dev, -ENOMEM, "allocating priv structure");
return -ENOMEM;
}
rv = setup_c... | [
0,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c |
static int tpmfront_remove(struct xenbus_device *dev) {
struct tpm_chip *chip = dev_get_drvdata(&dev->dev);
struct tpm_private *priv = dev_get_drvdata(&chip->dev);
tpm_chip_unregister(chip);
ring_free(priv);
dev_set_drvdata(&chip->dev, NULL);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/char/tpm/xen-tpmfront.c |
static void __exit xen_tpmfront_exit(void) {
xenbus_unregister_driver(&tpmfront_driver);
} | [
0,
0
] |
Linux Kernel | drivers/char/ttyprintk.c |
static void tpk_flush(void) {
if (tpk_curr > 0) {
tpk_buffer[tpk_curr] = '\0';
printk(TPK_PREFIX "[U] %s\n", tpk_buffer);
tpk_curr = 0;
}
} | [
0,
0
] |
Linux Kernel | drivers/char/ttyprintk.c | static int tpk_open(struct tty_struct *tty, struct file *filp) {
tty->driver_data = &tpk_port;
return tty_port_open(&tpk_port.port, tty, filp);
} | [
0,
0
] |
Linux Kernel | drivers/char/ttyprintk.c | static int tpk_write(struct tty_struct *tty, const unsigned char *buf,
int count) {
struct ttyprintk_port *tpkp = tty->driver_data;
unsigned long flags;
int ret;
spin_lock_irqsave(&tpkp->spinlock, flags);
ret = tpk_printk(buf, count);
spin_unlock_irqrestore(&tpkp->spinlock, flags);
... | [
0,
0
] |
Linux Kernel | drivers/char/ttyprintk.c |
static int __init ttyprintk_init(void) {
int ret;
spin_lock_init(&tpk_port.spinlock);
ttyprintk_driver =
tty_alloc_driver(1, TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW |
TTY_DRIVER_UNNUMBERED_NODE);
if (IS_ERR(ttyprintk_driver))
return PTR_ERR(ttyprintk_driver);
... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static struct port *find_port_by_vtermno(u32 vtermno) {
struct port *port;
struct console *cons;
unsigned long flags;
spin_lock_irqsave(&pdrvdata_lock, flags);
list_for_each_entry(cons, &pdrvdata.consoles, list) {
if (cons->vtermno == vtermno) {
port = container_of(cons, struct port, cons);
... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static struct port *find_port_by_devt_in_portdev(struct ports_device *portdev,
dev_t dev) {
struct port *port;
unsigned long flags;
spin_lock_irqsave(&portdev->ports_lock, flags);
list_for_each_entry(port, &portdev->ports, list) {
if (port->cdev->dev == dev... | [
1,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static struct port *find_port_by_id(struct ports_device *portdev, u32 id) {
struct port *port;
unsigned long flags;
spin_lock_irqsave(&portdev->ports_lock, flags);
list_for_each_entry(port, &portdev->ports, list) if (port->id == id) goto out;
port = NULL;
out:
spin_unlock_irqrestore(&portdev->ports_lock, ... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static bool is_rproc_serial(const struct virtio_device *vdev) {
return is_rproc_enabled && vdev->id.device == VIRTIO_ID_RPROC_SERIAL;
} | [
1,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static struct port_buffer *alloc_buf(struct virtio_device *vdev,
size_t buf_size, int pages) {
struct port_buffer *buf;
reclaim_dma_bufs();
buf = kmalloc(struct_size(buf, sg, pages), GFP_KERNEL);
if (!buf)
goto fail;
buf->sgpages = pages;
if (pages > 0) {
buf-... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static void reclaim_consumed_buffers(struct port *port) {
struct port_buffer *buf;
unsigned int len;
if (!port->portdev) {
return;
}
while ((buf = virtqueue_get_buf(port->out_vq, &len))) {
free_buf(buf, false);
port->outvq_full = false;
}
} | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static bool will_read_block(struct port *port) {
if (!port->guest_connected) {
return false;
}
return !port_has_data(port) && port->host_connected;
} | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static bool will_write_block(struct port *port) {
bool ret;
if (!port->guest_connected) {
return false;
}
if (!port->host_connected)
return true;
spin_lock_irq(&port->outvq_lock);
/*
* Check if the Host has consumed any buffers since we last
* sent data (this is only applicable for nonblock... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static int wait_port_writable(struct port *port, bool nonblock) {
int ret;
if (will_write_block(port)) {
if (nonblock)
return -EAGAIN;
ret = wait_event_freezable(port->waitqueue, !will_write_block(port));
if (ret < 0)
return ret;
}
if (!port->guest_connected)
return -ENODEV;
re... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
size_t count, loff_t *offp) {
struct port *port;
struct port_buffer *buf;
ssize_t ret;
bool nonblock;
struct scatterlist sg[1];
if (!count)
return 0;
port = filp->private_data;
nonblock = fil... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static int pipe_to_sg(struct pipe_inode_info *pipe, struct pipe_buffer *buf,
struct splice_desc *sd) {
struct sg_list *sgl = sd->u.data;
unsigned int offset, len;
if (sgl->n == sgl->size)
return 0;
if (pipe_buf_try_steal(pipe, buf)) {
/* Get reference and unlock page for moving *... | [
1,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
struct file *filp, loff_t *ppos,
size_t len, unsigned int flags) {
struct port *port = filp->private_data;
struct sg_list sgl;
ssize_t ret;
struct port_buffer *buf;
s... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static int port_fops_open(struct inode *inode, struct file *filp) {
struct cdev *cdev = inode->i_cdev;
struct port *port;
int ret;
port = find_port_by_devt(cdev->dev);
if (!port) {
/* Port was unplugged before we could proceed */
return -ENXIO;
}
filp->private_data = port;
/*
* Don't allow ... | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c | static int notifier_add_vio(struct hvc_struct *hp, int data) {
struct port *port;
port = find_port_by_vtermno(hp->vtermno);
if (!port)
return -EINVAL;
hp->irq_requested = 1;
resize_console(port);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static ssize_t show_port_name(struct device *dev, struct device_attribute *attr,
char *buffer) {
struct port *port;
port = dev_get_drvdata(dev);
return sprintf(buffer, "%s\n", port->name);
} | [
1,
0
] |
Linux Kernel | drivers/char/virtio_console.c |
static void out_intr(struct virtqueue *vq) {
struct port *port;
port = find_port_by_vq(vq->vdev->priv, vq);
if (!port) {
flush_bufs(vq, false);
return;
}
wake_up_interruptible(&port->waitqueue);
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/buffer_icap.c | static inline u32 buffer_icap_get_bram(void __iomem *base_address, u32 offset) {
return in_be32(base_address + (offset << 2));
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/buffer_icap.c | static inline void buffer_icap_set_offset(void __iomem *base_address,
u32 data) {
out_be32(base_address + XHI_BRAM_OFFSET_REG_OFFSET, data);
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/buffer_icap.c | static inline void buffer_icap_set_rnc(void __iomem *base_address, u32 data) {
out_be32(base_address + XHI_RNC_REG_OFFSET, data);
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/buffer_icap.c | void buffer_icap_reset(struct hwicap_drvdata *drvdata) {
out_be32(drvdata->base_address + XHI_STATUS_REG_OFFSET, 0xFEFE);
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/fifo_icap.c | static inline void fifo_icap_start_readback(struct hwicap_drvdata *drvdata) {
out_be32(drvdata->base_address + XHI_CR_OFFSET, XHI_CR_READ_MASK);
dev_dbg(drvdata->dev, "readback started\n");
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/fifo_icap.c | static inline u32 fifo_icap_busy(struct hwicap_drvdata *drvdata) {
u32 status = in_be32(drvdata->base_address + XHI_SR_OFFSET);
return (status & XHI_SR_DONE_MASK) ? 0 : 1;
} | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/fifo_icap.c | int fifo_icap_get_configuration(struct hwicap_drvdata *drvdata,
u32 *frame_buffer, u32 num_words) {
u32 read_fifo_occupancy = 0;
u32 retries = 0;
u32 *data = frame_buffer;
u32 remaining_words;
u32 words_to_read;
dev_dbg(drvdata->dev, "fifo_get_configuration\n");
if (fifo... | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/fifo_icap.c | void fifo_icap_reset(struct hwicap_drvdata *drvdata) {
u32 reg_data;
reg_data = in_be32(drvdata->base_address + XHI_CR_OFFSET);
out_be32(drvdata->base_address + XHI_CR_OFFSET,
reg_data | XHI_CR_SW_RESET_MASK);
out_be32(drvdata->base_address + XHI_CR_OFFSET,
reg_data & (~XHI_CR_SW_RESET_... | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/xilinx_hwicap.c | static int hwicap_command_desync(struct hwicap_drvdata *drvdata) {
u32 buffer[4];
u32 index = 0;
buffer[index++] = hwicap_type_1_write(drvdata->config_regs->CMD) | 1;
buffer[index++] = XHI_CMD_DESYNCH;
buffer[index++] = XHI_NOOP_PACKET;
buffer[index++] = XHI_NOOP_PACKET;
/*
* Write the data to the FI... | [
1,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/xilinx_hwicap.c | static int hwicap_release(struct inode *inode, struct file *file) {
struct hwicap_drvdata *drvdata = file->private_data;
int i;
int status = 0;
mutex_lock(&drvdata->sem);
if (drvdata->write_buffer_in_use) {
for (i = drvdata->write_buffer_in_use; i < 4; i++)
drvdata->write_buffer[i] = 0;
stat... | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/xilinx_hwicap.c | static int hwicap_of_probe(struct platform_device *op,
const struct hwicap_driver_config *config) {
struct resource res;
const unsigned int *id;
const char *family;
int rc;
const struct config_registers *regs;
rc = of_address_to_resource(op->dev.of_node, 0, &res);
if (rc) {
... | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/xilinx_hwicap.c | static int hwicap_drv_probe(struct platform_device *pdev) {
const struct of_device_id *match;
struct resource *res;
const struct config_registers *regs;
const char *family;
match = of_match_device(hwicap_of_match, &pdev->dev);
if (match)
return hwicap_of_probe(pdev, match->data);
res = platform_get_... | [
0,
0
] |
Linux Kernel | drivers/char/xilinx_hwicap/xilinx_hwicap.h | static inline u32 hwicap_type_1_read(u32 reg) {
return (XHI_TYPE_1 << XHI_TYPE_SHIFT) | (reg << XHI_REGISTER_SHIFT) |
(XHI_OP_READ << XHI_OP_SHIFT);
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_class.c |
static int __init xillybus_class_init(void) {
xillybus_class = class_create(THIS_MODULE, "xillybus");
if (IS_ERR(xillybus_class)) {
pr_warn("Failed to register xillybus class\n");
return PTR_ERR(xillybus_class);
}
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_class.c |
static void __exit xillybus_class_exit(void) { class_destroy(xillybus_class); } | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_core.c |
static void xilly_unmap(void *ptr) {
struct xilly_mapping *data = ptr;
dma_unmap_single(data->device, data->dma_addr, data->size, data->direction);
kfree(ptr);
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_core.c |
static int xilly_map_single(struct xilly_endpoint *ep, void *ptr, size_t size,
int direction, dma_addr_t *ret_dma_handle) {
dma_addr_t addr;
struct xilly_mapping *this;
this = kzalloc(sizeof(*this), GFP_KERNEL);
if (!this)
return -ENOMEM;
addr = dma_map_single(ep->dev, ptr, ... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_core.c | static int xillybus_flush(struct file *filp, fl_owner_t id) {
if (!(filp->f_mode & FMODE_WRITE))
return 0;
return xillybus_myflush(filp->private_data, HZ);
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_core.c |
static void xillybus_autoflush(struct work_struct *work) {
struct delayed_work *workitem = container_of(work, struct delayed_work, work);
struct xilly_channel *channel =
container_of(workitem, struct xilly_channel, rd_workitem);
int rc;
rc = xillybus_myflush(channel, -1);
if (rc == -EINTR)
dev_war... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillybus_core.c |
struct xilly_endpoint *xillybus_init_endpoint(struct device *dev) {
struct xilly_endpoint *endpoint;
endpoint = devm_kzalloc(dev, sizeof(*endpoint), GFP_KERNEL);
if (!endpoint)
return NULL;
endpoint->dev = dev;
endpoint->msg_counter = 0x0b;
endpoint->failed_messages = 0;
endpoint->fatal_error = 0;
... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int fifo_write(struct xillyfifo *fifo, const void *data,
unsigned int len,
int (*copier)(void *, const void *, int)) {
unsigned int done = 0;
unsigned int todo = len;
unsigned int nmax;
unsigned int writepos = fifo->writepos;
unsigned int writebuf = fifo->wri... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int fifo_read(struct xillyfifo *fifo, void *data, unsigned int len,
int (*copier)(void *, const void *, int)) {
unsigned int done = 0;
unsigned int todo = len;
unsigned int fill;
unsigned int readpos = fifo->readpos;
unsigned int readbuf = fifo->readbuf;
unsigned long flags;
in... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static void endpoint_quiesce(struct xillyusb_endpoint *ep) {
mutex_lock(&ep->ep_mutex);
ep->shutting_down = true;
mutex_unlock(&ep->ep_mutex);
usb_kill_anchored_urbs(&ep->anchor);
cancel_work_sync(&ep->workitem);
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static void endpoint_dealloc(struct xillyusb_endpoint *ep) {
struct list_head *this, *next;
fifo_mem_release(&ep->fifo);
list_splice(&ep->filled_buffers, &ep->buffers);
list_for_each_safe(this, next, &ep->buffers) {
struct xillybuffer *xb = list_entry(this, struct xillybuffer, entry);
free_pages((un... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c |
static struct xillyusb_endpoint *
endpoint_alloc(struct xillyusb_dev *xdev, u8 ep_num,
void (*work)(struct work_struct *), unsigned int order,
int bufnum) {
int i;
struct xillyusb_endpoint *ep;
ep = kzalloc(sizeof(*ep), GFP_KERNEL);
if (!ep)
return NULL;
INIT_LIST_HEAD(&... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c |
static void bulk_out_work(struct work_struct *work) {
struct xillyusb_endpoint *ep =
container_of(work, struct xillyusb_endpoint, workitem);
try_queue_bulk_out(ep);
} | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int process_in_opcode(struct xillyusb_dev *xdev, int opcode,
int chan_num) {
struct xillyusb_channel *chan;
struct device *dev = xdev->dev;
int chan_idx = chan_num >> 1;
if (chan_idx >= xdev->num_channels) {
dev_err(dev, "Received illegal channel ID %d from FPGA\n", chan... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int request_read_anything(struct xillyusb_channel *chan, char opcode) {
struct xillyusb_dev *xdev = chan->xdev;
unsigned int sh = chan->in_log2_element_size;
int chan_num = (chan->chan_idx << 1) | 1;
u32 mercy = chan->in_consumed_bytes + (2 << sh) - 1;
return xillyusb_send_opcode(xdev, chan_num, opcod... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int xillyusb_flush(struct file *filp, fl_owner_t id) {
struct xillyusb_channel *chan = filp->private_data;
int rc;
if (!(filp->f_mode & FMODE_WRITE))
return 0;
rc = mutex_lock_interruptible(&chan->out_mutex);
if (rc)
return rc;
rc = flush_downstream(chan, HZ, false);
mutex_unlock(&chan... | [
0,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static __poll_t xillyusb_poll(struct file *filp, poll_table *wait) {
struct xillyusb_channel *chan = filp->private_data;
__poll_t mask = 0;
if (chan->in_fifo)
poll_wait(filp, &chan->in_fifo->waitq, wait);
if (chan->out_ep)
poll_wait(filp, &chan->out_ep->fifo.waitq, wait);
if (!chan->poll_used && ch... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int xillyusb_setup_base_eps(struct xillyusb_dev *xdev) {
xdev->msg_ep =
endpoint_alloc(xdev, MSG_EP_NUM | USB_DIR_OUT, bulk_out_work, 1, 2);
if (!xdev->msg_ep)
return -ENOMEM;
if (fifo_init(&xdev->msg_ep->fifo, 13))
goto dealloc;
xdev->msg_ep->fill_mask = -8; /* 8 bytes granularity */
... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c | static int setup_channels(struct xillyusb_dev *xdev, __le16 *chandesc,
int num_channels) {
struct xillyusb_channel *chan;
int i;
chan = kcalloc(num_channels, sizeof(*chan), GFP_KERNEL);
if (!chan)
return -ENOMEM;
xdev->channels = chan;
for (i = 0; i < num_channels; i++, chan... | [
1,
0
] |
Linux Kernel | drivers/char/xillybus/xillyusb.c |
static void __exit xillyusb_exit(void) { usb_deregister(&xillyusb_driver); } | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-common.h |
static inline struct owl_clk_common *
hw_to_owl_clk_common(const struct clk_hw *hw) {
return container_of(hw, struct owl_clk_common, hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-composite.c |
static u8 owl_comp_get_parent(struct clk_hw *hw) {
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_mux_helper_get_parent(&comp->common, &comp->mux_hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-composite.c |
static int owl_comp_enable(struct clk_hw *hw) {
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_clk_common *common = &comp->common;
owl_gate_set(common, &comp->gate_hw, true);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-composite.c |
static int owl_comp_is_enabled(struct clk_hw *hw) {
struct owl_composite *comp = hw_to_owl_comp(hw);
struct owl_clk_common *common = &comp->common;
return owl_gate_clk_is_enabled(common, &comp->gate_hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-composite.c |
static unsigned long owl_comp_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_divider_helper_recalc_rate(&comp->common, &comp->rate.div_hw,
parent_rate)... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-composite.c |
static unsigned long owl_comp_fact_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct owl_composite *comp = hw_to_owl_comp(hw);
return owl_factor_helper_recalc_rate(&comp->common, &comp->rate.factor_hw,
parent_ra... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
static int _get_table_div_mul(const struct clk_factor_table *table,
unsigned int val, unsigned int *mul,
unsigned int *div) {
const struct clk_factor_table *clkt;
for (clkt = table; clkt->div; clkt++) {
if (clkt->val == val) {
*mul = clkt->mul;... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
static unsigned int _get_table_val(const struct clk_factor_table *table,
unsigned long rate,
unsigned long parent_rate) {
const struct clk_factor_table *clkt;
int val = -1;
u64 calc_rate;
for (clkt = table; clkt->div; clkt++) {
calc_rat... | [
1,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
static long owl_factor_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate) {
struct owl_factor *factor = hw_to_owl_factor(hw);
struct owl_factor_hw *factor_hw = &factor->factor_hw;
return owl_factor_helper_round_rate(&factor->common, factor_hw, rate,
... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
static unsigned long owl_factor_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate) {
struct owl_factor *factor = hw_to_owl_factor(hw);
struct owl_factor_hw *factor_hw = &factor->factor_hw;
struct owl_clk_common *common = &factor->common;
return owl_factor_hel... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
int owl_factor_helper_set_rate(const struct owl_clk_common *common,
const struct owl_factor_hw *factor_hw,
unsigned long rate, unsigned long parent_rate) {
u32 val, reg;
val = _get_table_val(factor_hw->table, rate, parent_rate);
if (val > div_mask(f... | [
1,
0
] |
Linux Kernel | drivers/clk/actions/owl-factor.c |
static int owl_factor_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate) {
struct owl_factor *factor = hw_to_owl_factor(hw);
struct owl_factor_hw *factor_hw = &factor->factor_hw;
struct owl_clk_common *common = &factor->common;
return owl_factor_helper_se... | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-gate.c |
static int owl_gate_enable(struct clk_hw *hw) {
struct owl_gate *gate = hw_to_owl_gate(hw);
struct owl_clk_common *common = &gate->common;
owl_gate_set(common, &gate->gate_hw, true);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-gate.c |
static int owl_gate_is_enabled(struct clk_hw *hw) {
struct owl_gate *gate = hw_to_owl_gate(hw);
struct owl_clk_common *common = &gate->common;
return owl_gate_clk_is_enabled(common, &gate->gate_hw);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-mux.c |
u8 owl_mux_helper_get_parent(const struct owl_clk_common *common,
const struct owl_mux_hw *mux_hw) {
u32 reg;
u8 parent;
regmap_read(common->regmap, mux_hw->reg, ®);
parent = reg >> mux_hw->shift;
parent &= BIT(mux_hw->width) - 1;
return parent;
} | [
1,
0
] |
Linux Kernel | drivers/clk/actions/owl-mux.c |
static int owl_mux_set_parent(struct clk_hw *hw, u8 index) {
struct owl_mux *mux = hw_to_owl_mux(hw);
return owl_mux_helper_set_parent(&mux->common, &mux->mux_hw, index);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-mux.h |
static inline struct owl_mux *hw_to_owl_mux(const struct clk_hw *hw) {
struct owl_clk_common *common = hw_to_owl_clk_common(hw);
return container_of(common, struct owl_mux, common);
} | [
0,
0
] |
Linux Kernel | drivers/clk/actions/owl-pll.c |
static const struct clk_pll_table *
_get_pll_table(const struct clk_pll_table *table, unsigned long rate) {
const struct clk_pll_table *clkt;
for (clkt = table; clkt->rate; clkt++) {
if (clkt->rate == rate) {
table = clkt;
break;
} else if (clkt->rate < rate)
table = clkt;
}
return ... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.