type
stringclasses
5 values
content
stringlengths
9
163k
functions
int viotap_release(struct inode *inode, struct file *file) { HvLpEvent_Rc hvrc; struct viot_devinfo_struct devi; int ret = 0; struct op_struct *op = get_op_struct(); if (op == NULL) return -ENOMEM; init_completion(&op->com); get_dev_info(file->f_path.dentry->d_inode, &devi); if (devi.devno >= viotape_numde...
functions
void vioHandleTapeEvent(struct HvLpEvent *event) { int tapeminor; struct op_struct *op; struct viotapelpevent *tevent = (struct viotapelpevent *)event; if (event == NULL) { /* Notification that a partition went away! */ if (!viopath_isactive(viopath_hostLp)) { /* TODO! Clean up */ }
functions
int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id) { int i = vdev->unit_address; int j; struct device_node *node = vdev->dev.of_node; if (i >= VIOTAPE_MAX_TAPE) return -ENODEV; if (!node) return -ENODEV; if (i >= viotape_numdev) viotape_numdev = i + 1; tape_device[i] = &vdev->dev; ...
functions
int viotape_remove(struct vio_dev *vdev) { int i = vdev->unit_address; device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i | 0x80)); device_destroy(tape_class, MKDEV(VIOTAPE_MAJOR, i)); return 0; }
functions
__init viotap_init(void) { int ret; if (!firmware_has_feature(FW_FEATURE_ISERIES)) return -ENODEV; op_struct_list = NULL; if ((ret = add_op_structs(VIOTAPE_MAXREQ)) < 0) { printk(VIOTAPE_KERN_WARN "couldn't allocate op structs\n"); return ret; }
functions
int chg_state(int index, unsigned char new_state, struct file *file) { unsigned char *cur_state = &state[index].part_stat_rwi[state[index].cur_part]; int rc = 0; /* if the same state, don't bother */ if (*cur_state == new_state) return 0; /* write an EOF if changing from writing to some other state */ if...
functions
__exit viotap_exit(void) { remove_proc_entry("iSeries/viotape", NULL); vio_unregister_driver(&viotape_driver); class_destroy(tape_class); unregister_chrdev(VIOTAPE_MAJOR, "viotape"); viopath_close(viopath_hostLp, viomajorsubtype_tape, VIOTAPE_MAXREQ + 2); vio_clearHandler(viomajorsubtype_tape); clear_op_struct_p...
includes
#include <linux/miscdevice.h>
includes
#include <linux/gfp.h>
includes
#include <linux/file.h>
includes
#include <linux/export.h>
includes
#include <net/tcp.h>
includes
#include <scsi/scsi.h>
includes
#include <scsi/scsi_cmnd.h>
includes
#include <scsi/scsi_device.h>
includes
#include <scsi/scsi_host.h>
includes
#include <scsi/scsi_tgt.h>
includes
#include <scsi/scsi_tgt_if.h>
includes
#include <asm/cacheflush.h>
defines
#define TGT_RING_PAGES (TGT_RING_SIZE >> PAGE_SHIFT)
defines
#define TGT_EVENT_PER_PAGE (PAGE_SIZE / sizeof(struct tgt_event))
defines
#define TGT_MAX_EVENTS (TGT_EVENT_PER_PAGE * TGT_RING_PAGES)
structs
struct tgt_ring { u32 tr_idx; unsigned long tr_pages[TGT_RING_PAGES]; spinlock_t tr_lock; };
functions
void tgt_ring_idx_inc(struct tgt_ring *ring) { if (ring->tr_idx == TGT_MAX_EVENTS - 1) ring->tr_idx = 0; else ring->tr_idx++; }
functions
int tgt_uspace_send_event(u32 type, struct tgt_event *p) { struct tgt_event *ev; struct tgt_ring *ring = &tx_ring; unsigned long flags; int err = 0; spin_lock_irqsave(&ring->tr_lock, flags); ev = tgt_head_event(ring, ring->tr_idx); if (!ev->hdr.status) tgt_ring_idx_inc(ring); else err = -BUSY; spin_unlo...
functions
int scsi_tgt_uspace_send_cmd(struct scsi_cmnd *cmd, u64 itn_id, struct scsi_lun *lun, u64 tag) { struct Scsi_Host *shost = scsi_tgt_cmd_to_host(cmd); struct tgt_event ev; int err; memset(&ev, 0, sizeof(ev)); ev.p.cmd_req.host_no = shost->host_no; ev.p.cmd_req.itn_id = itn_id; ev.p.cmd_req.data_len = scs...
functions
int scsi_tgt_uspace_send_status(struct scsi_cmnd *cmd, u64 itn_id, u64 tag) { struct Scsi_Host *shost = scsi_tgt_cmd_to_host(cmd); struct tgt_event ev; int err; memset(&ev, 0, sizeof(ev)); ev.p.cmd_done.host_no = shost->host_no; ev.p.cmd_done.itn_id = itn_id; ev.p.cmd_done.tag = tag; ev.p.cmd_done.result = cmd...
functions
int scsi_tgt_uspace_send_tsk_mgmt(int host_no, u64 itn_id, int function, u64 tag, struct scsi_lun *scsilun, void *data) { struct tgt_event ev; int err; memset(&ev, 0, sizeof(ev)); ev.p.tsk_mgmt_req.host_no = host_no; ev.p.tsk_mgmt_req.itn_id = itn_id; ev.p.tsk_mgmt_req.function = function; ev.p.tsk_mgmt_r...
functions
int scsi_tgt_uspace_send_it_nexus_request(int host_no, u64 itn_id, int function, char *initiator_id) { struct tgt_event ev; int err; memset(&ev, 0, sizeof(ev)); ev.p.it_nexus_req.host_no = host_no; ev.p.it_nexus_req.function = function; ev.p.it_nexus_req.itn_id = itn_id; if (initiator_id) strncpy(ev.p....
functions
int event_recv_msg(struct tgt_event *ev) { int err = 0; switch (ev->hdr.type) { case TGT_UEVENT_CMD_RSP: err = scsi_tgt_kspace_exec(ev->p.cmd_rsp.host_no, ev->p.cmd_rsp.itn_id, ev->p.cmd_rsp.result, ev->p.cmd_rsp.tag, ev->p.cmd_rsp.uaddr, ev->p.cmd_rsp.len, ev->p.cm...
functions
ssize_t tgt_write(struct file *file, const char __user * buffer, size_t count, loff_t * ppos) { struct tgt_event *ev; struct tgt_ring *ring = &rx_ring; while (1) { ev = tgt_head_event(ring, ring->tr_idx); /* do we need this? */ flush_dcache_page(virt_to_page(ev)); if (!ev->hdr.status) break; tgt_...
functions
int tgt_poll(struct file * file, struct poll_table_struct *wait) { struct tgt_event *ev; struct tgt_ring *ring = &tx_ring; unsigned long flags; unsigned int mask = 0; u32 idx; poll_wait(file, &tgt_poll_wait, wait); spin_lock_irqsave(&ring->tr_lock, flags); idx = ring->tr_idx ? ring->tr_idx - 1 : TGT_MAX_EVEN...
functions
int uspace_ring_map(struct vm_area_struct *vma, unsigned long addr, struct tgt_ring *ring) { int i, err; for (i = 0; i < TGT_RING_PAGES; i++) { struct page *page = virt_to_page(ring->tr_pages[i]); err = vm_insert_page(vma, addr, page); if (err) return err; addr += PAGE_SIZE; }
functions
int tgt_mmap(struct file *filp, struct vm_area_struct *vma) { unsigned long addr; int err; if (vma->vm_pgoff) return -EINVAL; if (vma->vm_end - vma->vm_start != TGT_RING_SIZE * 2) { eprintk("mmap size must be %lu, not %lu \n", TGT_RING_SIZE * 2, vma->vm_end - vma->vm_start); return -EINVAL; }
functions
int tgt_open(struct inode *inode, struct file *file) { tx_ring.tr_idx = rx_ring.tr_idx = 0; return 0; }
functions
void tgt_ring_exit(struct tgt_ring *ring) { int i; for (i = 0; i < TGT_RING_PAGES; i++) free_page(ring->tr_pages[i]); }
functions
int tgt_ring_init(struct tgt_ring *ring) { int i; spin_lock_init(&ring->tr_lock); for (i = 0; i < TGT_RING_PAGES; i++) { ring->tr_pages[i] = get_zeroed_page(GFP_KERNEL); if (!ring->tr_pages[i]) { eprintk("out of memory\n"); return -ENOMEM; }
functions
void scsi_tgt_if_exit(void) { tgt_ring_exit(&tx_ring); tgt_ring_exit(&rx_ring); misc_deregister(&tgt_miscdev); }
functions
int scsi_tgt_if_init(void) { int err; err = tgt_ring_init(&tx_ring); if (err) return err; err = tgt_ring_init(&rx_ring); if (err) goto free_tx_ring; err = misc_register(&tgt_miscdev); if (err) goto free_rx_ring; return 0; free_rx_ring: tgt_ring_exit(&rx_ring); free_tx_ring: tgt_ring_exit(&tx_ring); ...
defines
#define TEST_ASSIGN(TYPE1, OP, TYPE2) \
defines
#define TEST_ASSIGN_ARITHR(TYPE1, OP) \
defines
#define TEST_ASSIGN_ARITHBOTH(OP) \
defines
#define TEST_ASSIGN_INTR(TYPE1, OP) \
defines
#define TEST_ASSIGN_INTBOTH(OP) \
functions
void test_simple (void) { TEST_ASSIGN_ARITHBOTH (=); }
functions
void test_mult (void) { TEST_ASSIGN_ARITHBOTH (*=); }
functions
void test_div (void) { TEST_ASSIGN_ARITHBOTH (/=); }
functions
void test_mod (void) { TEST_ASSIGN_INTBOTH (%=); }
functions
void test_plus (void) { TEST_ASSIGN_ARITHBOTH (+=); }
functions
void test_minus (void) { TEST_ASSIGN_ARITHBOTH (-=); }
functions
void test_lshift (void) { TEST_ASSIGN_INTBOTH (<<=); }
functions
void test_rshift (void) { TEST_ASSIGN_INTBOTH (>>=); }
functions
void test_and (void) { TEST_ASSIGN_INTBOTH (&=); }
functions
void test_xor (void) { TEST_ASSIGN_INTBOTH (^=); }
functions
void test_or (void) { TEST_ASSIGN_INTBOTH (|=); }
includes
#include <linux/module.h>
includes
#include <linux/kernel.h>
includes
#include <linux/errno.h>
includes
#include <linux/string.h>
includes
#include <linux/mm.h>
includes
#include <linux/tty.h>
includes
#include <linux/sysrq.h>
includes
#include <linux/delay.h>
includes
#include <linux/fb.h>
includes
#include <linux/init.h>
includes
#include <linux/screen_info.h>
includes
#include <linux/vga_switcheroo.h>
includes
#include <linux/console.h>
functions
void nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { struct nouveau_fbdev *nfbdev = info->par; struct drm_device *dev = nfbdev->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; int ret; if (info->state != FBINFO_STATE_RUNNING) return; ret = -ENODEV; if (!in_interru...
functions
void nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image) { struct nouveau_fbdev *nfbdev = info->par; struct drm_device *dev = nfbdev->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; int ret; if (info->state != FBINFO_STATE_RUNNING) return; ret = -ENODEV; if (!in_interr...
functions
void nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) { struct nouveau_fbdev *nfbdev = info->par; struct drm_device *dev = nfbdev->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; int ret; if (info->state != FBINFO_STATE_RUNNING) return; ret = -ENODEV; if (!in_interrup...
functions
int nouveau_fbcon_sync(struct fb_info *info) { struct nouveau_fbdev *nfbdev = info->par; struct drm_device *dev = nfbdev->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_channel *chan = dev_priv->channel; int ret; if (!chan || !chan->accel_done || in_interrupt() || info->state !...
functions
void nouveau_fbcon_gamma_set(struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); nv_crtc->lut.r[regno] = red; nv_crtc->lut.g[regno] = green; nv_crtc->lut.b[regno] = blue; }
functions
void nouveau_fbcon_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno) { struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); *red = nv_crtc->lut.r[regno]; *green = nv_crtc->lut.g[regno]; *blue = nv_crtc->lut.b[regno]; }
functions
void nouveau_fbcon_zfill(struct drm_device *dev, struct nouveau_fbdev *nfbdev) { struct fb_info *info = nfbdev->helper.fbdev; struct fb_fillrect rect; /* Clear the entire fbcon. The drm will program every connector * with it's preferred mode. If the sizes differ, one display will * quite likely have garbage a...
functions
int nouveau_fbcon_create(struct nouveau_fbdev *nfbdev, struct drm_fb_helper_surface_size *sizes) { struct drm_device *dev = nfbdev->dev; struct drm_nouveau_private *dev_priv = dev->dev_private; struct fb_info *info; struct drm_framebuffer *fb; struct nouveau_framebuffer *nouveau_fb; struct nouveau_channel ...
functions
int nouveau_fbcon_find_or_create_single(struct drm_fb_helper *helper, struct drm_fb_helper_surface_size *sizes) { struct nouveau_fbdev *nfbdev = (struct nouveau_fbdev *)helper; int new_fb = 0; int ret; if (!helper->fb) { ret = nouveau_fbcon_create(nfbdev, sizes); if (ret) return ret; new_fb = 1; ...
functions
void nouveau_fbcon_output_poll_changed(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper); }
functions
int nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *nfbdev) { struct nouveau_framebuffer *nouveau_fb = &nfbdev->nouveau_fb; struct fb_info *info; if (nfbdev->helper.fbdev) { info = nfbdev->helper.fbdev; unregister_framebuffer(info); if (info->cmap.len) fb_dealloc_cmap(&info->cmap); fr...
functions
void nouveau_fbcon_gpu_lockup(struct fb_info *info) { struct nouveau_fbdev *nfbdev = info->par; struct drm_device *dev = nfbdev->dev; NV_ERROR(dev, "GPU lockup - switching to software fbcon\n"); info->flags |= FBINFO_HWACCEL_DISABLED; }
functions
int nouveau_fbcon_init(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_fbdev *nfbdev; int preferred_bpp; int ret; nfbdev = kzalloc(sizeof(struct nouveau_fbdev), GFP_KERNEL); if (!nfbdev) return -ENOMEM; nfbdev->dev = dev; dev_priv->nfbdev = nfbdev; nfbdev->...
functions
void nouveau_fbcon_fini(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; if (!dev_priv->nfbdev) return; nouveau_fbcon_destroy(dev, dev_priv->nfbdev); kfree(dev_priv->nfbdev); dev_priv->nfbdev = NULL; }
functions
void nouveau_fbcon_save_disable_accel(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; dev_priv->nfbdev->saved_flags = dev_priv->nfbdev->helper.fbdev->flags; dev_priv->nfbdev->helper.fbdev->flags |= FBINFO_HWACCEL_DISABLED; }
functions
void nouveau_fbcon_restore_accel(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; dev_priv->nfbdev->helper.fbdev->flags = dev_priv->nfbdev->saved_flags; }
functions
void nouveau_fbcon_set_suspend(struct drm_device *dev, int state) { struct drm_nouveau_private *dev_priv = dev->dev_private; console_lock(); if (state == 0) nouveau_fbcon_save_disable_accel(dev); fb_set_suspend(dev_priv->nfbdev->helper.fbdev, state); if (state == 1) nouveau_fbcon_restore_accel(dev); console_u...
functions
void nouveau_fbcon_zfill_all(struct drm_device *dev) { struct drm_nouveau_private *dev_priv = dev->dev_private; nouveau_fbcon_zfill(dev, dev_priv->nfbdev); }
defines
#define LSI_SIGNATURE "$XIDE$"
functions
FAST_FUNC volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size) { uint64_t meta_off; struct lsi_meta *lsi; dbg("probing at offset 0x%llx, size 0x%llx", (unsigned long long) off, (unsigned long long) size); if (size < 0x10000) return -1; meta_off = ((size / 0x200)-1) * 0x200; l...
functions
void TIFFInitOrder(TIFF* tif, int magic, int bigendian) { tif->tif_typemask = typemask; if (magic == TIFF_BIGENDIAN) { tif->tif_typeshift = bigTypeshift; if (!bigendian) tif->tif_flags |= TIFF_SWAB; }
functions
int _TIFFgetMode(const char* mode, const char* module) { int m = -1; switch (mode[0]) { case 'r': m = O_RDONLY; if (mode[1] == '+') m = O_RDWR; break; case 'w': case 'a': m = O_RDWR|O_CREAT; if (mode[0] == 'w') m |= O_TRUNC; break; default: TIFFError(module, "\"%s\": Bad mode", mode); break...
functions
int TIFFFileno(TIFF* tif) { return (int)(tif->tif_fd); }
functions
int TIFFGetMode(TIFF* tif) { return (tif->tif_mode); }
functions
int TIFFIsTiled(TIFF* tif) { return (isTiled(tif)); }
functions
uint32 TIFFCurrentRow(TIFF* tif) { return (tif->tif_row); }
functions
tdir_t TIFFCurrentDirectory(TIFF* tif) { return (tif->tif_curdir); }
functions
tstrip_t TIFFCurrentStrip(TIFF* tif) { return (tif->tif_curstrip); }
functions
ttile_t TIFFCurrentTile(TIFF* tif) { return (tif->tif_curtile); }
functions
int TIFFIsByteSwapped(TIFF* tif) { return ((tif->tif_flags & TIFF_SWAB) != 0); }
functions
int TIFFIsUpSampled(TIFF* tif) { return (isUpSampled(tif)); }
functions
int TIFFIsMSB2LSB(TIFF* tif) { return (isFillOrder(tif, FILLORDER_MSB2LSB)); }