type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define S3DATA_MAX 5000
defines
#define S3PLUG_MAX 200
defines
#define S3CRC_MAX 200
defines
#define S3INFO_MAX 50
defines
#define S3ADDR_PLUG (0xff000000UL)
defines
#define S3ADDR_CRC (0xff100000UL)
defines
#define S3ADDR_INFO (0xff200000UL)
defines
#define S3ADDR_START (0xff400000UL)
defines
#define CHUNKS_MAX 100
defines
#define WRITESIZE_MAX 4096
functions
int prism2_fwtry(struct usb_device *udev, wlandevice_t *wlandev) { const struct firmware *fw_entry = NULL; printk(KERN_INFO "prism2_usb: Checking for firmware %s\n", PRISM2_USB_FWFILE); if (request_ihex_firmware(&fw_entry, PRISM2_USB_FWFILE, &udev->dev) != 0) { printk(KERN_INFO "prism2_usb: Firmw...
functions
int prism2_fwapply(const struct ihex_binrec *rfptr, wlandevice_t *wlandev) { signed int result = 0; p80211msg_dot11req_mibget_t getmsg; p80211itemd_t *item; u32 *data; /* Initialize the data structures */ ns3data = 0; memset(s3data, 0, sizeof(s3data)); ns3plug = 0; memset(s3plug, 0, sizeof(s3plug)); ns3crc =...
functions
int crcimage(imgchunk_t *fchunk, unsigned int nfchunks, s3crcrec_t *s3crc, unsigned int ns3crc) { int result = 0; int i; int c; u32 crcstart; u32 crcend; u32 cstart = 0; u32 cend; u8 *dest; u32 chunkoff; for (i = 0; i < ns3crc; i++) { if (!s3crc[i].dowrite) continue; crcstart = s3crc[i].addr; ...
functions
void free_chunks(imgchunk_t *fchunk, unsigned int *nfchunks) { int i; for (i = 0; i < *nfchunks; i++) { if (fchunk[i].data != NULL) { kfree(fchunk[i].data); }
functions
void free_srecs(void) { ns3data = 0; memset(s3data, 0, sizeof(s3data)); ns3plug = 0; memset(s3plug, 0, sizeof(s3plug)); ns3crc = 0; memset(s3crc, 0, sizeof(s3crc)); ns3info = 0; memset(s3info, 0, sizeof(s3info)); startaddr = 0; }
functions
int mkimage(imgchunk_t *clist, unsigned int *ccnt) { int result = 0; int i; int j; int currchunk = 0; u32 nextaddr = 0; u32 s3start; u32 s3end; u32 cstart = 0; u32 cend; u32 coffset; /* There may already be data in the chunklist */ *ccnt = 0; /* Establish the location and size of each chunk */ for (i = ...
functions
int mkpdrlist(pda_t *pda) { int result = 0; u16 *pda16 = (u16 *) pda->buf; int curroff; /* in 'words' */ pda->nrec = 0; curroff = 0; while (curroff < (HFA384x_PDA_LEN_MAX / 2) && le16_to_cpu(pda16[curroff + 1]) != HFA384x_PDR_END_OF_PDA) { pda->rec[pda->nrec] = (hfa384x_pdrec_t *) & (pda16[curroff]); ...
functions
int plugimage(imgchunk_t *fchunk, unsigned int nfchunks, s3plugrec_t *s3plug, unsigned int ns3plug, pda_t * pda) { int result = 0; int i; /* plug index */ int j; /* index of PDR or -1 if fname plug */ int c; /* chunk index */ u32 pstart; u32 pend; u32 cstart = 0; u32 cend; u32 chunkoff; u8 *dest;...
functions
int read_cardpda(pda_t *pda, wlandevice_t *wlandev) { int result = 0; p80211msg_p2req_readpda_t msg; /* set up the msg */ msg.msgcode = DIDmsg_p2req_readpda; msg.msglen = sizeof(msg); strcpy(msg.devname, wlandev->name); msg.pda.did = DIDmsg_p2req_readpda_pda; msg.pda.len = HFA384x_PDA_LEN_MAX; msg.pda.status ...
functions
else if (msg.resultcode.data == P80211ENUM_resultcode_success) { memcpy(pda->buf, msg.pda.data, HFA384x_PDA_LEN_MAX); result = mkpdrlist(pda); }
functions
int read_fwfile(const struct ihex_binrec *record) { int i; int rcnt = 0; u16 *tmpinfo; u16 *ptr16; u32 *ptr32, len, addr; pr_debug("Reading fw file ...\n"); while (record) { rcnt++; len = be16_to_cpu(record->len); addr = be32_to_cpu(record->addr); /* Point into data for different word lengths *...
functions
int writeimage(wlandevice_t *wlandev, imgchunk_t *fchunk, unsigned int nfchunks) { int result = 0; p80211msg_p2req_ramdl_state_t rstatemsg; p80211msg_p2req_ramdl_write_t rwritemsg; p80211msg_t *msgp; u32 resultcode; int i; int j; unsigned int nwrites; u32 curroff; u32 currlen; u32 currdaddr; /* Ini...
functions
int validate_identity(void) { int i; int result = 1; int trump = 0; pr_debug("NIC ID: %#x v%d.%d.%d\n", nicid.id, nicid.major, nicid.minor, nicid.variant); pr_debug("MFI ID: %#x v%d %d->%d\n", rfid.id, rfid.variant, rfid.bottom, rfid.top); pr_debug("CFI ID: %#x v%d %d->%d\n", macid.id, macid.variant, ma...
includes
#include <stdlib.h>
includes
#include <sys/resource.h>
defines
#define SMATRIXF_MUL_BENCHMARK_API(M) \
functions
void smatrixf_mul_bench(struct rusage * _start, struct rusage * _finish, unsigned long int * _num_iterations, unsigned int _n) { // normalize number of iterations // time ~ _n ^ 3 *_num_iterations /= _n * _n * _n; if ...
functions
_b for (i=0; i<nnz; i++) { unsigned int row = rand() % _n; unsigned int col = rand() % _n; float value = randf(); smatrixf_set(b, row, col, value); }
includes
#include <sys/types.h>
includes
#include <sys/sysmacros.h>
functions
dev_t sqfs_makedev(int maj, int min) { return makedev(maj, min); }
functions
TFtype __extendsftf2 (SFtype a) { FP_DECL_EX; FP_DECL_S (A); FP_DECL_Q (R); TFtype r; FP_INIT_EXCEPTIONS; FP_UNPACK_RAW_S (A, a); #if (2 * _FP_W_TYPE_SIZE) < _FP_FRACBITS_Q FP_EXTEND (Q, S, 4, 1, R, A); #else FP_EXTEND (Q, S, 2, 1, R, A); #endif FP_PACK_RAW_Q (r, R); FP_HANDLE_EXCEPTIONS; return...
includes
#include <linux/module.h>
includes
#include <linux/kernel.h>
includes
#include <linux/init.h>
includes
#include <linux/slab.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/of.h>
includes
#include <mach/mpm.h>
defines
#define MAX_STR_LEN 30
defines
#define ADJUST_LATENCY(x) \
structs
struct lpm_lookup_table { uint32_t modes; const char *mode_name; };
functions
int msm_pm_get_sleep_mode_value(struct device_node *node, const char *key, uint32_t *sleep_mode_val) { int i; struct lpm_lookup_table { uint32_t modes; const char *mode_name; }
functions
void msm_lpm_level_update(void) { unsigned int lpm_level; struct msm_rpmrs_level *level = NULL; for (lpm_level = 0; lpm_level < msm_lpm_level_count; lpm_level++) { level = &msm_lpm_levels[lpm_level]; level->available = !msm_lpm_level_beyond_limit(&level->rs_limits); }
functions
int msm_lpm_enter_sleep(uint32_t sclk_count, void *limits, bool from_idle, bool notify_rpm) { int ret = 0; int debug_mask; struct msm_rpmrs_limits *l = (struct msm_rpmrs_limits *)limits; struct msm_lpm_sleep_data sleep_data; sleep_data.limits = limits; sleep_data.kernel_sleep = __get_cpu_var(msm_lpm_sleep_time...
functions
void msm_lpm_exit_sleep(void *limits, bool from_idle, bool notify_rpm, bool collapsed) { msm_lpmrs_exit_sleep((struct msm_rpmrs_limits *)limits, from_idle, notify_rpm, collapsed); if (notify_rpm) msm_rpm_exit_sleep(); atomic_notifier_call_chain(&__get_cpu_var(lpm_notify_head), MSM_LPM_STATE_EXIT, NULL); ...
functions
void msm_lpm_show_resources(void) { /* TODO */ return; }
functions
uint32_t msm_pm_get_pxo(struct msm_rpmrs_limits *limits) { return limits->pxo; }
functions
uint32_t msm_pm_get_l2_cache(struct msm_rpmrs_limits *limits) { return limits->l2_cache; }
functions
uint32_t msm_pm_get_vdd_mem(struct msm_rpmrs_limits *limits) { return limits->vdd_mem_upper_bound; }
functions
uint32_t msm_pm_get_vdd_dig(struct msm_rpmrs_limits *limits) { return limits->vdd_dig_upper_bound; }
functions
bool lpm_level_permitted(int cur_level_count) { if (__get_cpu_var(lpm_permitted_level) == msm_lpm_level_count + 1) return true; return (__get_cpu_var(lpm_permitted_level) == cur_level_count); }
functions
int msm_lpm_register_notifier(int cpu, int level_iter, struct notifier_block *nb, bool is_latency_measure) { per_cpu(lpm_permitted_level, cpu) = level_iter; return atomic_notifier_chain_register(&per_cpu(lpm_notify_head, cpu), nb); }
functions
int msm_lpm_unregister_notifier(int cpu, struct notifier_block *nb) { per_cpu(lpm_permitted_level, cpu) = msm_lpm_level_count + 1; return atomic_notifier_chain_unregister(&per_cpu(lpm_notify_head, cpu), nb); }
functions
s32 msm_cpuidle_get_deep_idle_latency(void) { int i; struct msm_rpmrs_level *level = msm_lpm_levels, *best = level; if (!level) return 0; for (i = 0; i < msm_lpm_level_count; i++, level++) { if (!level->available) continue; if (level->sleep_mode != MSM_PM_SLEEP_MODE_POWER_COLLAPSE) continue; /* Pick...
functions
bool msm_lpm_irqs_detectable(struct msm_rpmrs_limits *limits, bool irqs_detectable, bool gpio_detectable) { if (!limits->irqs_detectable) return irqs_detectable; if (!limits->gpio_detectable) return gpio_detectable; return true; }
functions
else if (next_wakeup_us <= lvl_overhead_us) { pwr = lvl_overhead_energy / next_wakeup_us; }
functions
__devinit msm_lpm_levels_probe(struct platform_device *pdev) { struct msm_rpmrs_level *levels = NULL; struct msm_rpmrs_level *level = NULL; struct device_node *node = NULL; char *key = NULL; uint32_t val = 0; int ret = 0; uint32_t num_levels = 0; int idx = 0; unsigned int m_cpu = 0; for_each_child_of_node(pd...
functions
__init msm_lpm_levels_module_init(void) { return platform_driver_register(&msm_lpm_levels_driver); }
defines
#define a_subscr(a_1,a_2) (a_2)*a_dim1 + a_1
defines
#define a_ref(a_1,a_2) a[a_subscr(a_1,a_2)]
defines
#define b_subscr(a_1,a_2) (a_2)*b_dim1 + a_1
defines
#define b_ref(a_1,a_2) b[b_subscr(a_1,a_2)]
functions
int zgglse_(integer *m, integer *n, integer *p, doublecomplex *a, integer *lda, doublecomplex *b, integer *ldb, doublecomplex *c__, doublecomplex *d__, doublecomplex *x, doublecomplex *work, integer *lwork, integer *info) { /* -- LAPACK driver routine (version 3.0) -- Univ. of Tennessee, Univ. of Calif...
functions
else if (*n < 0) { *info = -2; }
functions
else if (*p < 0 || *p > *n || *p < *n - *m) { *info = -3; }
functions
else if (lquery) { return 0; }
includes
#include <linux/i2c.h>
includes
#include <linux/i2c-algo-bit.h>
includes
#include <linux/i2c-gpio.h>
includes
#include <linux/init.h>
includes
#include <linux/module.h>
includes
#include <linux/platform_device.h>
includes
#include <asm/gpio.h>
functions
void i2c_gpio_setsda_dir(void *data, int state) { struct i2c_gpio_platform_data *pdata = data; if (state) gpio_direction_input(pdata->sda_pin); else gpio_direction_output(pdata->sda_pin, 0); }
functions
void i2c_gpio_setsda_val(void *data, int state) { struct i2c_gpio_platform_data *pdata = data; gpio_set_value(pdata->sda_pin, state); }
functions
void i2c_gpio_setscl_dir(void *data, int state) { struct i2c_gpio_platform_data *pdata = data; if (state) gpio_direction_input(pdata->scl_pin); else gpio_direction_output(pdata->scl_pin, 0); }
functions
void i2c_gpio_setscl_val(void *data, int state) { struct i2c_gpio_platform_data *pdata = data; gpio_set_value(pdata->scl_pin, state); }
functions
int i2c_gpio_getsda(void *data) { struct i2c_gpio_platform_data *pdata = data; return gpio_get_value(pdata->sda_pin); }
functions
int i2c_gpio_getscl(void *data) { struct i2c_gpio_platform_data *pdata = data; return gpio_get_value(pdata->scl_pin); }
functions
__devinit i2c_gpio_probe(struct platform_device *pdev) { struct i2c_gpio_platform_data *pdata; struct i2c_algo_bit_data *bit_data; struct i2c_adapter *adap; int ret; pdata = pdev->dev.platform_data; if (!pdata) return -ENXIO; ret = -ENOMEM; adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL); if (!adap)...
functions
__devexit i2c_gpio_remove(struct platform_device *pdev) { struct i2c_gpio_platform_data *pdata; struct i2c_adapter *adap; adap = platform_get_drvdata(pdev); pdata = pdev->dev.platform_data; i2c_del_adapter(adap); gpio_free(pdata->scl_pin); gpio_free(pdata->sda_pin); kfree(adap->algo_data); kfree(adap); ret...
functions
__init i2c_gpio_init(void) { int ret; ret = platform_driver_register(&i2c_gpio_driver); if (ret) printk(KERN_ERR "i2c-gpio: probe failed: %d\n", ret); return ret; }
functions
__exit i2c_gpio_exit(void) { platform_driver_unregister(&i2c_gpio_driver); }
includes
#include <string.h>
functions
void dope_buffer( unsigned char *buff, int buff_size, unsigned char v ) { int i; unsigned char ch; ch = (' ' + (v % (0x7f - ' '))); for (i=0; i<buff_size; i++) { *buff++ = ch++; if (ch >= 0x7f) ch = ' '; }
functions
rtems_task Task_1( rtems_task_argument argument ) { rtems_id qid; uint32_t index; uint32_t count; rtems_status_code status; size_t size; size_t queue_size; unsigned char *cp; status = rtems_message_queue_ident( Queue_name[ 1 ], RTEMS_SEARCH_...
includes
#include <crypto/scatterwalk.h>
includes
#include <crypto/skcipher.h>
includes
#include <crypto/if_alg.h>
includes
#include <linux/init.h>
includes
#include <linux/list.h>
includes
#include <linux/kernel.h>
includes
#include <linux/mm.h>
includes
#include <linux/module.h>
includes
#include <linux/net.h>
includes
#include <net/sock.h>
defines
#define GET_SREQ(areq, ctx) (struct skcipher_async_req *)((char *)areq + \
defines
#define GET_REQ_SIZE(ctx) \
defines
#define GET_IV_SIZE(ctx) \