type
stringclasses
5 values
content
stringlengths
9
163k
functions
u8 celleb_fake_config_readb(void *addr) { u8 *p = addr; return *p; }
functions
u16 celleb_fake_config_readw(void *addr) { __le16 *p = addr; return le16_to_cpu(*p); }
functions
u32 celleb_fake_config_readl(void *addr) { __le32 *p = addr; return le32_to_cpu(*p); }
functions
void celleb_fake_config_writeb(u32 val, void *addr) { u8 *p = addr; *p = val; }
functions
void celleb_fake_config_writew(u32 val, void *addr) { __le16 val16; __le16 *p = addr; val16 = cpu_to_le16(val); *p = val16; }
functions
void celleb_fake_config_writel(u32 val, void *addr) { __le32 val32; __le32 *p = addr; val32 = cpu_to_le32(val); *p = val32; }
functions
void celleb_config_read_fake(unsigned char *config, int where, int size, u32 *val) { char *p = config + where; switch (size) { case 1: *val = celleb_fake_config_readb(p); break; case 2: *val = celleb_fake_config_readw(p); break; case 4: *val = celleb_fake_config_readl(p); break; }
functions
void celleb_config_write_fake(unsigned char *config, int where, int size, u32 val) { char *p = config + where; switch (size) { case 1: celleb_fake_config_writeb(val, p); break; case 2: celleb_fake_config_writew(val, p); break; case 4: celleb_fake_config_writel(val, p); break; }
functions
int celleb_fake_pci_read_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) { char *config; struct pci_controller *hose = pci_bus_to_host(bus); unsigned int devno = devfn >> 3; unsigned int fn = devfn & 0x7; /* allignment check */ BUG_ON(where % size); pr_debug(" fake read: bus...
functions
int celleb_fake_pci_write_config(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) { char *config; struct pci_controller *hose = pci_bus_to_host(bus); struct celleb_pci_resource *res; unsigned int devno = devfn >> 3; unsigned int fn = devfn & 0x7; /* allignment check */ BUG_ON(where % siz...
functions
void celleb_setup_pci_base_addrs(struct pci_controller *hose, unsigned int devno, unsigned int fn, unsigned int num_base_addr) { u32 val; unsigned char *config; struct celleb_pci_resource *res; config = get_fake_config_start(hose, devno, fn); res = get_resource_start(hose, devno, fn); if (!config || !...
functions
__init celleb_setup_fake_pci_device(struct device_node *node, struct pci_controller *hose) { unsigned int rlen; int num_base_addr = 0; u32 val; const u32 *wi0, *wi1, *wi2, *wi3, *wi4; unsigned int devno, fn; struct celleb_pci_private *private = hose->private_data; unsigned char **config = NULL; stru...
functions
__init phb_set_bus_ranges(struct device_node *dev, struct pci_controller *phb) { const int *bus_range; unsigned int len; bus_range = of_get_property(dev, "bus-range", &len); if (bus_range == NULL || len < 2 * sizeof(int)) return 1; phb->first_busno = bus_range[0]; phb->last_busno = bus_range[1]; re...
functions
__init celleb_alloc_private_mem(struct pci_controller *hose) { hose->private_data = zalloc_maybe_bootmem(sizeof(struct celleb_pci_private), GFP_KERNEL); }
functions
__init celleb_setup_fake_pci(struct device_node *dev, struct pci_controller *phb) { struct device_node *node; phb->ops = &celleb_fake_pci_ops; celleb_alloc_private_mem(phb); for (node = of_get_next_child(dev, NULL); node != NULL; node = of_get_next_child(dev, node)) celleb_setup_fake_pci_device(node,...
functions
__init celleb_setup_phb(struct pci_controller *phb) { struct device_node *dev = phb->dn; const struct of_device_id *match; const struct celleb_phb_spec *phb_spec; int rc; match = of_match_node(celleb_phb_match, dev); if (!match) return 1; phb_set_bus_ranges(dev, phb); phb->buid = 1; phb_spec = match->data...
functions
int celleb_pci_probe_mode(struct pci_bus *bus) { return PCI_PROBE_DEVTREE; }
includes
#include <linux/module.h>
includes
#include <linux/sched.h>
includes
#include <linux/fs.h>
includes
#include <linux/file.h>
includes
#include <linux/stat.h>
includes
#include <linux/errno.h>
includes
#include <linux/major.h>
includes
#include <linux/wait.h>
includes
#include <linux/blkdev.h>
includes
#include <linux/blkpg.h>
includes
#include <linux/init.h>
includes
#include <linux/swap.h>
includes
#include <linux/slab.h>
includes
#include <linux/suspend.h>
includes
#include <linux/writeback.h>
includes
#include <linux/buffer_head.h>
includes
#include <linux/completion.h>
includes
#include <linux/highmem.h>
includes
#include <linux/gfp.h>
includes
#include <linux/pagevec.h>
includes
#include <asm/uaccess.h>
includes
#include <lustre_lib.h>
includes
#include <lustre_lite.h>
defines
#define LLOOP_MAX_SEGMENTS LNET_MAX_IOV
defines
#define MAX_LOOP_DEFAULT 16
functions
loff_t get_loop_size(struct lloop_device *lo, struct file *file) { loff_t size, offset, loopsize; /* Compute loopsize in bytes */ size = i_size_read(file->f_mapping->host); offset = lo->lo_offset; loopsize = size - offset; if (lo->lo_sizelimit > 0 && lo->lo_sizelimit < loopsize) loopsize = lo->lo_sizelimit; ...
functions
int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head) { const struct lu_env *env = lo->lo_env; struct cl_io *io = &lo->lo_io; struct inode *inode = lo->lo_backing_file->f_dentry->d_inode; struct cl_object *obj = ll_i2info(inode)->lli_clob; pgoff_t offset; int ret; int i; ...
functions
void loop_add_bio(struct lloop_device *lo, struct bio *bio) { unsigned long flags; spin_lock_irqsave(&lo->lo_lock, flags); if (lo->lo_biotail) { lo->lo_biotail->bi_next = bio; lo->lo_biotail = bio; }
functions
int loop_get_bio(struct lloop_device *lo, struct bio **req) { struct bio *first; struct bio **bio; unsigned int count = 0; unsigned int page_count = 0; int rw; spin_lock_irq(&lo->lo_lock); first = lo->lo_bio; if (unlikely(first == NULL)) { spin_unlock_irq(&lo->lo_lock); return 0; }
functions
void loop_make_request(struct request_queue *q, struct bio *old_bio) { struct lloop_device *lo = q->queuedata; int rw = bio_rw(old_bio); int inactive; if (!lo) goto err; CDEBUG(D_INFO, "submit bio sector %llu size %u\n", (unsigned long long)old_bio->bi_sector, old_bio->bi_size); spin_lock_irq(&lo->lo...
functions
else if (rw == READA) { rw = READ; }
functions
else if (rw != READ) { CERROR("lloop: unknown command (%x)\n", rw); goto err; }
functions
void loop_handle_bio(struct lloop_device *lo, struct bio *bio) { int ret; ret = do_bio_lustrebacked(lo, bio); while (bio) { struct bio *tmp = bio->bi_next; bio->bi_next = NULL; cfs_bio_endio(bio, bio->bi_size, ret); bio = tmp; }
functions
int loop_active(struct lloop_device *lo) { return atomic_read(&lo->lo_pending) || (lo->lo_state == LLOOP_RUNDOWN); }
functions
int loop_thread(void *data) { struct lloop_device *lo = data; struct bio *bio; unsigned int count; unsigned long times = 0; unsigned long total_count = 0; struct lu_env *env; int refcheck; int ret = 0; set_user_nice(current, -20); lo->lo_state = LLOOP_BOUND; env = cl_env_get(&refcheck); if (IS_ERR(env))...
functions
int loop_set_fd(struct lloop_device *lo, struct file *unused, struct block_device *bdev, struct file *file) { struct inode *inode; struct address_space *mapping; int lo_flags = 0; int error; loff_t size; if (!try_module_get(THIS_MODULE)) return -ENODEV; error = -EBUSY; if (lo->lo_state !=...
functions
int loop_clr_fd(struct lloop_device *lo, struct block_device *bdev, int count) { struct file *filp = lo->lo_backing_file; int gfp = lo->old_gfp_mask; if (lo->lo_state != LLOOP_BOUND) return -ENXIO; if (lo->lo_refcnt > count) /* we needed one fd for the ioctl */ return -EBUSY; if (filp == NULL) re...
functions
int lo_open(struct block_device *bdev, fmode_t mode) { struct lloop_device *lo = bdev->bd_disk->private_data; mutex_lock(&lo->lo_ctl_mutex); lo->lo_refcnt++; mutex_unlock(&lo->lo_ctl_mutex); return 0; }
functions
void lo_release(struct gendisk *disk, fmode_t mode) { struct lloop_device *lo = disk->private_data; mutex_lock(&lo->lo_ctl_mutex); --lo->lo_refcnt; mutex_unlock(&lo->lo_ctl_mutex); }
functions
int lo_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg) { struct lloop_device *lo = bdev->bd_disk->private_data; struct inode *inode = NULL; int err = 0; mutex_lock(&lloop_mutex); switch (cmd) { case LL_IOC_LLOOP_DETACH: { err = loop_clr_fd(lo, bdev, 2); if (err == 0)...
functions
llioc_iter lloop_ioctl(struct inode *unused, struct file *file, unsigned int cmd, unsigned long arg, void *magic, int *rcp) { struct lloop_device *lo = NULL; struct block_device *bdev = NULL; int err = 0; dev_t dev; if (magic != ll_iocontrol_magic) return LLIOC_CONT; if (disks == NULL) GOTO(ou...
functions
__init lloop_init(void) { int i; unsigned int cmdlist[] = { LL_IOC_LLOOP_ATTACH, LL_IOC_LLOOP_DETACH_BYDEV, }
functions
void lloop_exit(void) { int i; ll_iocontrol_unregister(ll_iocontrol_magic); for (i = 0; i < max_loop; i++) { del_gendisk(disks[i]); blk_cleanup_queue(loop_dev[i].lo_queue); put_disk(disks[i]); }
includes
#include <net/rtnetlink.h>
includes
#include <net/cfg802154.h>
functions
void ieee802154_del_iface_deprecated(struct wpan_phy *wpan_phy, struct net_device *dev) { struct ieee802154_sub_if_data *sdata = IEEE802154_DEV_TO_SUB_IF(dev); ieee802154_if_remove(sdata); }
functions
int ieee802154_add_iface(struct wpan_phy *phy, const char *name, enum nl802154_iftype type, __le64 extended_addr) { struct ieee802154_local *local = wpan_phy_priv(phy); struct net_device *err; err = ieee802154_if_add(local, name, type, extended_addr); if (IS_ERR(err)) return PTR_ERR(err); return 0; }
functions
int ieee802154_del_iface(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev) { ieee802154_if_remove(IEEE802154_WPAN_DEV_TO_SUB_IF(wpan_dev)); return 0; }
functions
int ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); int ret; ASSERT_RTNL(); /* check if phy support this setting */ if (!(wpan_phy->channels_supported[page] & BIT(channel))) return -EINVAL; ret = drv_set_channel(local, page, c...
functions
int ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, __le16 pan_id) { ASSERT_RTNL(); /* TODO * I am not sure about to check here on broadcast pan_id. * Broadcast is a valid setting, comment from 802.15.4: * If this value is 0xffff, the device is not associated. * * This c...
functions
int ieee802154_set_backoff_exponent(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, u8 min_be, u8 max_be) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); ASSERT_RTNL(); if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS)) return -EOPNOTSUPP; wpan_dev->min_be = min_be; wpan_dev->max_be...
functions
int ieee802154_set_short_addr(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, __le16 short_addr) { ASSERT_RTNL(); /* TODO * I am not sure about to check here on broadcast short_addr. * Broadcast is a valid setting, comment from 802.15.4: * A value of 0xfffe indicates that the device has * associat...
functions
int ieee802154_set_max_csma_backoffs(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, u8 max_csma_backoffs) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); ASSERT_RTNL(); if (!(local->hw.flags & IEEE802154_HW_CSMA_PARAMS)) return -EOPNOTSUPP; wpan_dev->csma_retries = max_csma_backoff...
functions
int ieee802154_set_max_frame_retries(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, s8 max_frame_retries) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); ASSERT_RTNL(); if (!(local->hw.flags & IEEE802154_HW_FRAME_RETRIES)) return -EOPNOTSUPP; wpan_dev->frame_retries = max_frame_ret...
functions
int ieee802154_set_lbt_mode(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, bool mode) { struct ieee802154_local *local = wpan_phy_priv(wpan_phy); ASSERT_RTNL(); if (!(local->hw.flags & IEEE802154_HW_LBT)) return -EOPNOTSUPP; wpan_dev->lbt = mode; return 0; }
includes
#include <linux/device.h>
includes
#include <linux/clk.h>
includes
#include <linux/err.h>
includes
#include <linux/io.h>
includes
#include <linux/kernel.h>
includes
#include <linux/of_device.h>
includes
#include <linux/of_address.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/random.h>
includes
#include <soc/tegra/fuse.h>
defines
#define FUSE_BEGIN 0x100
defines
#define FUSE_VENDOR_CODE 0x100
defines
#define FUSE_FAB_CODE 0x104
defines
#define FUSE_LOT_CODE_0 0x108
defines
#define FUSE_LOT_CODE_1 0x10c
defines
#define FUSE_WAFER_ID 0x110
defines
#define FUSE_X_COORDINATE 0x114
defines
#define FUSE_Y_COORDINATE 0x118
defines
#define FUSE_HAS_REVISION_INFO BIT(0)
structs
struct tegra_fuse_info { int size; int spare_bit; enum speedo_idx speedo_idx; };
functions
u32 tegra30_fuse_readl(const unsigned int offset) { u32 val; /* * early in the boot, the fuse clock will be enabled by * tegra_init_fuse() */ if (fuse_clk) clk_prepare_enable(fuse_clk); val = readl_relaxed(fuse_base + FUSE_BEGIN + offset); if (fuse_clk) clk_disable_unprepare(fuse_clk); return val; ...
functions
int tegra30_fuse_probe(struct platform_device *pdev) { const struct of_device_id *of_dev_id; of_dev_id = of_match_device(tegra30_fuse_of_match, &pdev->dev); if (!of_dev_id) return -ENODEV; fuse_clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(fuse_clk)) { dev_err(&pdev->dev, "missing clock"); return PTR_ER...
functions
__init tegra30_fuse_init(void) { return platform_driver_register(&tegra30_fuse_driver); }
functions
__init tegra30_fuse_add_randomness(void) { u32 randomness[12]; randomness[0] = tegra_sku_info.sku_id; randomness[1] = tegra_read_straps(); randomness[2] = tegra_read_chipid(); randomness[3] = tegra_sku_info.cpu_process_id << 16; randomness[3] |= tegra_sku_info.core_process_id; randomness[4] = tegra_sku_info.cpu...
functions
__init legacy_fuse_init(void) { switch (tegra_get_chip_id()) { case TEGRA30: fuse_info = &tegra30_info; break; case TEGRA114: fuse_info = &tegra114_info; break; case TEGRA124: fuse_info = &tegra124_info; break; default: return; }
functions
__init tegra30_spare_fuse(int spare_bit) { u32 offset = fuse_info->spare_bit + spare_bit * 4; return tegra30_fuse_readl(offset) & 1; }
functions
__init tegra30_init_fuse_early(void) { struct device_node *np; const struct of_device_id *of_match; np = of_find_matching_node_and_match(NULL, tegra30_fuse_of_match, &of_match); if (np) { fuse_base = of_iomap(np, 0); fuse_info = (struct tegra_fuse_info *)of_match->data; }
includes
#include <linux/kernel.h>