| /linux/drivers/media/dvb-frontends/ |
| H A D | nxt200x.c | 58 static int i2c_writebytes (struct nxt200x_state* state, u8 addr, u8 *buf, u8 len) in i2c_writebytes() argument 61 struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = len }; in i2c_writebytes() 71 static int i2c_readbytes(struct nxt200x_state *state, u8 addr, u8 *buf, u8 len) in i2c_readbytes() argument 74 struct i2c_msg msg = { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len }; in i2c_readbytes() 85 const u8 *buf, u8 len) in nxt200x_writebytes() argument 89 …struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len +… in nxt200x_writebytes() 98 memcpy(&buf2[1], buf, len); in nxt200x_writebytes() 108 static int nxt200x_readbytes(struct nxt200x_state *state, u8 reg, u8 *buf, u8 len) in nxt200x_readbytes() argument 112 …struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = … in nxt200x_readbytes() 113 { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } }; in nxt200x_readbytes() [all …]
|
| /linux/kernel/ |
| H A D | relay.c | 36 struct rchan_buf *buf = vmf->vma->vm_private_data; in relay_buf_fault() local 39 if (!buf) in relay_buf_fault() 42 page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT)); in relay_buf_fault() 83 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) in relay_mmap_buf() argument 87 if (!buf) in relay_mmap_buf() 90 if (length != (unsigned long)buf->chan->alloc_size) in relay_mmap_buf() 95 vma->vm_private_data = buf; in relay_mmap_buf() 108 static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size) in relay_alloc_buf() argument 116 buf->page_array = relay_alloc_page_array(n_pages); in relay_alloc_buf() 117 if (!buf->page_array) in relay_alloc_buf() [all …]
|
| /linux/sound/firewire/bebob/ |
| H A D | bebob_command.c | 13 u8 *buf; in avc_audio_set_selector() local 16 buf = kzalloc(12, GFP_KERNEL); in avc_audio_set_selector() 17 if (buf == NULL) in avc_audio_set_selector() 20 buf[0] = 0x00; /* AV/C CONTROL */ in avc_audio_set_selector() 21 buf[1] = 0x08 | (0x07 & subunit_id); /* AUDIO SUBUNIT ID */ in avc_audio_set_selector() 22 buf[2] = 0xb8; /* FUNCTION BLOCK */ in avc_audio_set_selector() 23 buf[3] = 0x80; /* type is 'selector'*/ in avc_audio_set_selector() 24 buf[4] = 0xff & fb_id; /* function block id */ in avc_audio_set_selector() 25 buf[5] = 0x10; /* control attribute is CURRENT */ in avc_audio_set_selector() 26 buf[6] = 0x02; /* selector length is 2 */ in avc_audio_set_selector() [all …]
|
| /linux/drivers/md/dm-vdo/ |
| H A D | message-stats.c | 15 static void write_u64(char *prefix, u64 value, char *suffix, char **buf, in write_u64() argument 20 count = scnprintf(*buf, *maxlen, "%s%llu%s", prefix == NULL ? "" : prefix, in write_u64() 22 *buf += count; in write_u64() 26 static void write_u32(char *prefix, u32 value, char *suffix, char **buf, in write_u32() argument 31 count = scnprintf(*buf, *maxlen, "%s%u%s", prefix == NULL ? "" : prefix, in write_u32() 33 *buf += count; in write_u32() 38 char **buf, unsigned int *maxlen) in write_block_count_t() argument 42 count = scnprintf(*buf, *maxlen, "%s%llu%s", prefix == NULL ? "" : prefix, in write_block_count_t() 44 *buf += count; in write_block_count_t() 48 static void write_string(char *prefix, char *value, char *suffix, char **buf, in write_string() argument [all …]
|
| /linux/drivers/media/common/videobuf2/ |
| H A D | videobuf2-dma-contig.c | 75 struct vb2_dc_buf *buf = buf_priv; in vb2_dc_cookie() local 77 return &buf->dma_addr; in vb2_dc_cookie() 96 struct vb2_dc_buf *buf = buf_priv; in vb2_dc_vaddr() local 98 if (buf->vaddr) in vb2_dc_vaddr() 99 return buf->vaddr; in vb2_dc_vaddr() 101 if (buf->db_attach) { in vb2_dc_vaddr() 104 if (!dma_buf_vmap_unlocked(buf->db_attach->dmabuf, &map)) in vb2_dc_vaddr() 105 buf->vaddr = map.vaddr; in vb2_dc_vaddr() 107 return buf->vaddr; in vb2_dc_vaddr() 110 if (buf->non_coherent_mem) in vb2_dc_vaddr() [all …]
|
| H A D | videobuf2-dma-sg.c | 60 static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, in vb2_dma_sg_alloc_compacted() argument 64 unsigned long size = buf->size; in vb2_dma_sg_alloc_compacted() 85 __free_page(buf->pages[last_page]); in vb2_dma_sg_alloc_compacted() 93 buf->pages[last_page++] = &pages[i]; in vb2_dma_sg_alloc_compacted() 104 struct vb2_dma_sg_buf *buf; in vb2_dma_sg_alloc() local 112 buf = kzalloc(sizeof *buf, GFP_KERNEL); in vb2_dma_sg_alloc() 113 if (!buf) in vb2_dma_sg_alloc() 116 buf->vaddr = NULL; in vb2_dma_sg_alloc() 117 buf->dma_dir = vb->vb2_queue->dma_dir; in vb2_dma_sg_alloc() 118 buf->offset = 0; in vb2_dma_sg_alloc() [all …]
|
| H A D | videobuf2-vmalloc.c | 40 struct vb2_vmalloc_buf *buf; in vb2_vmalloc_alloc() local 42 buf = kzalloc(sizeof(*buf), GFP_KERNEL | vb->vb2_queue->gfp_flags); in vb2_vmalloc_alloc() 43 if (!buf) in vb2_vmalloc_alloc() 46 buf->size = size; in vb2_vmalloc_alloc() 47 buf->vaddr = vmalloc_user(buf->size); in vb2_vmalloc_alloc() 48 if (!buf->vaddr) { in vb2_vmalloc_alloc() 49 pr_debug("vmalloc of size %ld failed\n", buf->size); in vb2_vmalloc_alloc() 50 kfree(buf); in vb2_vmalloc_alloc() 54 buf->dma_dir = vb->vb2_queue->dma_dir; in vb2_vmalloc_alloc() 55 buf->handler.refcount = &buf->refcount; in vb2_vmalloc_alloc() [all …]
|
| /linux/tools/testing/selftests/hid/ |
| H A D | hid_bpf.c | 160 __u8 buf[10] = {0}; in TEST_F() local 170 buf[0] = 1; in TEST_F() 171 buf[1] = 42; in TEST_F() 172 uhid_send_event(_metadata, &self->hid, buf, 6); in TEST_F() 178 memset(buf, 0, sizeof(buf)); in TEST_F() 179 err = read(self->hidraw_fd, buf, sizeof(buf)); in TEST_F() 181 ASSERT_EQ(buf[0], 1); in TEST_F() 182 ASSERT_EQ(buf[2], 47); in TEST_F() 185 memset(buf, 0, sizeof(buf)); in TEST_F() 186 buf[0] = 1; in TEST_F() [all …]
|
| H A D | hidraw.c | 63 __u8 buf[10] = {0}; in TEST_F() local 67 buf[0] = 1; in TEST_F() 68 buf[1] = 42; in TEST_F() 69 uhid_send_event(_metadata, &self->hid, buf, 6); in TEST_F() 72 memset(buf, 0, sizeof(buf)); in TEST_F() 73 err = read(self->hidraw_fd, buf, sizeof(buf)); in TEST_F() 75 ASSERT_EQ(buf[0], 1); in TEST_F() 76 ASSERT_EQ(buf[1], 42); in TEST_F() 85 __u8 buf[10] = {0}; in TEST_F() local 89 buf[0] = 1; in TEST_F() [all …]
|
| /linux/drivers/xen/ |
| H A D | xen-front-pgdir-shbuf.c | 48 void (*calc_num_grefs)(struct xen_front_pgdir_shbuf *buf); 51 void (*fill_page_dir)(struct xen_front_pgdir_shbuf *buf); 54 int (*grant_refs_for_buffer)(struct xen_front_pgdir_shbuf *buf, 58 int (*map)(struct xen_front_pgdir_shbuf *buf); 61 int (*unmap)(struct xen_front_pgdir_shbuf *buf); 75 xen_front_pgdir_shbuf_get_dir_start(struct xen_front_pgdir_shbuf *buf) in xen_front_pgdir_shbuf_get_dir_start() argument 77 if (!buf->grefs) in xen_front_pgdir_shbuf_get_dir_start() 80 return buf->grefs[0]; in xen_front_pgdir_shbuf_get_dir_start() 95 int xen_front_pgdir_shbuf_map(struct xen_front_pgdir_shbuf *buf) in xen_front_pgdir_shbuf_map() argument 97 if (buf->ops && buf->ops->map) in xen_front_pgdir_shbuf_map() [all …]
|
| /linux/sound/firewire/oxfw/ |
| H A D | oxfw-command.c | 13 u8 *buf; in avc_stream_set_format() local 16 buf = kmalloc(len + 10, GFP_KERNEL); in avc_stream_set_format() 17 if (buf == NULL) in avc_stream_set_format() 20 buf[0] = 0x00; /* CONTROL */ in avc_stream_set_format() 21 buf[1] = 0xff; /* UNIT */ in avc_stream_set_format() 22 buf[2] = 0xbf; /* EXTENDED STREAM FORMAT INFORMATION */ in avc_stream_set_format() 23 buf[3] = 0xc0; /* SINGLE subfunction */ in avc_stream_set_format() 24 buf[4] = dir; /* Plug Direction */ in avc_stream_set_format() 25 buf[5] = 0x00; /* UNIT */ in avc_stream_set_format() 26 buf[6] = 0x00; /* PCR (Isochronous Plug) */ in avc_stream_set_format() [all …]
|
| /linux/arch/mips/mm/ |
| H A D | page.c | 91 pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) in pg_addiu() argument 97 uasm_i_lui(buf, GPR_T9, uasm_rel_hi(off)); in pg_addiu() 98 uasm_i_addiu(buf, GPR_T9, GPR_T9, uasm_rel_lo(off)); in pg_addiu() 100 uasm_i_addiu(buf, GPR_T9, GPR_ZERO, off); in pg_addiu() 101 uasm_i_daddu(buf, reg1, reg2, GPR_T9); in pg_addiu() 104 uasm_i_lui(buf, GPR_T9, uasm_rel_hi(off)); in pg_addiu() 105 uasm_i_addiu(buf, GPR_T9, GPR_T9, uasm_rel_lo(off)); in pg_addiu() 106 UASM_i_ADDU(buf, reg1, reg2, GPR_T9); in pg_addiu() 108 UASM_i_ADDIU(buf, reg1, reg2, off); in pg_addiu() 221 static void build_clear_store(u32 **buf, int off) in build_clear_store() argument [all …]
|
| /linux/drivers/media/pci/saa7164/ |
| H A D | saa7164-buffer.c | 62 struct saa7164_buffer *buf = NULL; in saa7164_buffer_alloc() local 71 buf = kzalloc(sizeof(*buf), GFP_KERNEL); in saa7164_buffer_alloc() 72 if (!buf) in saa7164_buffer_alloc() 75 buf->idx = -1; in saa7164_buffer_alloc() 76 buf->port = port; in saa7164_buffer_alloc() 77 buf->flags = SAA7164_BUFFER_FREE; in saa7164_buffer_alloc() 78 buf->pos = 0; in saa7164_buffer_alloc() 79 buf->actual_size = params->pitch * params->numberoflines; in saa7164_buffer_alloc() 80 buf->crc = 0; in saa7164_buffer_alloc() 82 buf->pci_size = SAA7164_PT_ENTRIES * 0x1000; in saa7164_buffer_alloc() [all …]
|
| /linux/drivers/media/usb/dvb-usb-v2/ |
| H A D | mxl111sf-i2c.c | 247 &msg->buf[i]); in mxl111sf_i2c_sw_xfer_msg() 278 msg->buf[i]); in mxl111sf_i2c_sw_xfer_msg() 330 u8 buf[26]; in mxl111sf_i2c_check_status() local 334 buf[0] = USB_READ_I2C_CMD; in mxl111sf_i2c_check_status() 335 buf[1] = 0x00; in mxl111sf_i2c_check_status() 337 buf[2] = I2C_INT_STATUS_REG; in mxl111sf_i2c_check_status() 338 buf[3] = 0x00; in mxl111sf_i2c_check_status() 339 buf[4] = 0x00; in mxl111sf_i2c_check_status() 341 buf[5] = USB_END_I2C_CMD; in mxl111sf_i2c_check_status() 343 mxl111sf_i2c_get_data(state, 0, buf, buf); in mxl111sf_i2c_check_status() [all …]
|
| /linux/drivers/net/wireless/ath/ath11k/ |
| H A D | debugfs_htt_stats.c | 44 u8 *buf = stats_req->buf; in htt_print_stats_string_tlv() local 51 len += scnprintf(buf + len, buf_len - len, "HTT_STATS_STRING_TLV:\n"); in htt_print_stats_string_tlv() 53 len += scnprintf(buf + len, buf_len - len, in htt_print_stats_string_tlv() 56 len += scnprintf(buf + len, in htt_print_stats_string_tlv() 61 len += scnprintf(buf + len, buf_len - len, "\n\n"); in htt_print_stats_string_tlv() 64 buf[buf_len - 1] = 0; in htt_print_stats_string_tlv() 66 buf[len] = 0; in htt_print_stats_string_tlv() 75 u8 *buf = stats_req->buf; in htt_print_tx_pdev_stats_cmn_tlv() local 79 len += scnprintf(buf + len, buf_len - len, "HTT_TX_PDEV_STATS_CMN_TLV:\n"); in htt_print_tx_pdev_stats_cmn_tlv() 80 len += scnprintf(buf + len, buf_len - len, "mac_id = %lu\n", in htt_print_tx_pdev_stats_cmn_tlv() [all …]
|
| /linux/drivers/net/wireless/ath/ath5k/ |
| H A D | debug.c | 179 char buf[500]; in read_file_beacon() local 185 len += scnprintf(buf + len, sizeof(buf) - len, in read_file_beacon() 190 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\n", in read_file_beacon() 193 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\n\n", in read_file_beacon() 197 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", in read_file_beacon() 201 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", in read_file_beacon() 205 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", in read_file_beacon() 209 len += scnprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", in read_file_beacon() 213 len += scnprintf(buf + len, sizeof(buf) - len, in read_file_beacon() 217 if (len > sizeof(buf)) in read_file_beacon() [all …]
|
| /linux/drivers/iio/test/ |
| H A D | iio-test-format.c | 17 char *buf; in iio_test_iio_format_value_integer() local 21 buf = kunit_kmalloc(test, PAGE_SIZE, GFP_KERNEL); in iio_test_iio_format_value_integer() 22 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buf); in iio_test_iio_format_value_integer() 25 ret = iio_format_value(buf, IIO_VAL_INT, 1, &val); in iio_test_iio_format_value_integer() 26 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "42\n"); in iio_test_iio_format_value_integer() 29 ret = iio_format_value(buf, IIO_VAL_INT, 1, &val); in iio_test_iio_format_value_integer() 30 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "-23\n"); in iio_test_iio_format_value_integer() 33 ret = iio_format_value(buf, IIO_VAL_INT, 1, &val); in iio_test_iio_format_value_integer() 34 IIO_TEST_FORMAT_EXPECT_EQ(test, buf, ret, "0\n"); in iio_test_iio_format_value_integer() 37 ret = iio_format_value(buf, IIO_VAL_INT, 1, &val); in iio_test_iio_format_value_integer() [all …]
|
| /linux/net/bridge/ |
| H A D | br_stp_bpdu.c | 81 unsigned char buf[35]; in br_send_config_bpdu() local 86 buf[0] = 0; in br_send_config_bpdu() 87 buf[1] = 0; in br_send_config_bpdu() 88 buf[2] = 0; in br_send_config_bpdu() 89 buf[3] = BPDU_TYPE_CONFIG; in br_send_config_bpdu() 90 buf[4] = (bpdu->topology_change ? 0x01 : 0) | in br_send_config_bpdu() 92 buf[5] = bpdu->root.prio[0]; in br_send_config_bpdu() 93 buf[6] = bpdu->root.prio[1]; in br_send_config_bpdu() 94 buf[7] = bpdu->root.addr[0]; in br_send_config_bpdu() 95 buf[8] = bpdu->root.addr[1]; in br_send_config_bpdu() [all …]
|
| /linux/drivers/infiniband/hw/ionic/ |
| H A D | ionic_pgtbl.c | 10 __le64 ionic_pgtbl_dma(struct ionic_tbl_buf *buf, u64 va) in ionic_pgtbl_dma() argument 12 u64 pg_mask = BIT_ULL(buf->page_size_log2) - 1; in ionic_pgtbl_dma() 15 if (!buf->tbl_pages) in ionic_pgtbl_dma() 18 if (buf->tbl_pages > 1) in ionic_pgtbl_dma() 19 return cpu_to_le64(buf->tbl_dma); in ionic_pgtbl_dma() 21 if (buf->tbl_buf) in ionic_pgtbl_dma() 22 dma = le64_to_cpu(buf->tbl_buf[0]); in ionic_pgtbl_dma() 24 dma = buf->tbl_dma; in ionic_pgtbl_dma() 29 __be64 ionic_pgtbl_off(struct ionic_tbl_buf *buf, u64 va) in ionic_pgtbl_off() argument 31 if (buf->tbl_pages > 1) { in ionic_pgtbl_off() [all …]
|
| /linux/tools/perf/util/arm-spe-decoder/ |
| H A D | arm-spe-pkt-decoder.c | 47 static int arm_spe_get_payload(const unsigned char *buf, size_t len, in arm_spe_get_payload() argument 51 size_t payload_len = arm_spe_payload_len(buf[ext_hdr]); in arm_spe_get_payload() 56 buf += 1 + ext_hdr; in arm_spe_get_payload() 59 case 1: packet->payload = *(uint8_t *)buf; break; in arm_spe_get_payload() 60 case 2: packet->payload = get_unaligned_le16(buf); break; in arm_spe_get_payload() 61 case 4: packet->payload = get_unaligned_le32(buf); break; in arm_spe_get_payload() 62 case 8: packet->payload = get_unaligned_le64(buf); break; in arm_spe_get_payload() 75 static int arm_spe_get_alignment(const unsigned char *buf, size_t len, in arm_spe_get_alignment() argument 78 unsigned int alignment = 1 << ((buf[0] & 0xf) + 1); in arm_spe_get_alignment() 84 return alignment - (((uintptr_t)buf) & (alignment - 1)); in arm_spe_get_alignment() [all …]
|
| /linux/drivers/tty/ |
| H A D | tty_audit.c | 27 struct tty_audit_buf *buf; in tty_audit_buf_ref() local 29 buf = current->signal->tty_audit_buf; in tty_audit_buf_ref() 30 WARN_ON(buf == ERR_PTR(-ESRCH)); in tty_audit_buf_ref() 31 return buf; in tty_audit_buf_ref() 36 struct tty_audit_buf *buf; in tty_audit_buf_alloc() local 38 buf = kzalloc(sizeof(*buf), GFP_KERNEL); in tty_audit_buf_alloc() 39 if (!buf) in tty_audit_buf_alloc() 42 buf->data = kmalloc(TTY_AUDIT_BUF_SIZE, GFP_KERNEL); in tty_audit_buf_alloc() 43 if (!buf->data) in tty_audit_buf_alloc() 46 mutex_init(&buf->mutex); in tty_audit_buf_alloc() [all …]
|
| /linux/drivers/char/tpm/ |
| H A D | tpm-buf.c | 18 int tpm_buf_init(struct tpm_buf *buf, u16 tag, u32 ordinal) in tpm_buf_init() argument 20 buf->data = (u8 *)__get_free_page(GFP_KERNEL); in tpm_buf_init() 21 if (!buf->data) in tpm_buf_init() 24 tpm_buf_reset(buf, tag, ordinal); in tpm_buf_init() 35 void tpm_buf_reset(struct tpm_buf *buf, u16 tag, u32 ordinal) in tpm_buf_reset() argument 37 struct tpm_header *head = (struct tpm_header *)buf->data; in tpm_buf_reset() 42 buf->flags = 0; in tpm_buf_reset() 43 buf->length = sizeof(*head); in tpm_buf_reset() 47 buf->handles = 0; in tpm_buf_reset() 57 int tpm_buf_init_sized(struct tpm_buf *buf) in tpm_buf_init_sized() argument [all …]
|
| /linux/drivers/net/wireless/st/cw1200/ |
| H A D | wsm.c | 27 #define WSM_SKIP(buf, size) \ argument 29 if ((buf)->data + size > (buf)->end) \ 31 (buf)->data += size; \ 34 #define WSM_GET(buf, ptr, size) \ argument 36 if ((buf)->data + size > (buf)->end) \ 38 memcpy(ptr, (buf)->data, size); \ 39 (buf)->data += size; \ 42 #define __WSM_GET(buf, type, type2, cvt) \ argument 45 if ((buf)->data + sizeof(type) > (buf)->end) \ 47 val = cvt(*(type2 *)(buf)->data); \ [all …]
|
| /linux/drivers/media/tuners/ |
| H A D | mt20xx.c | 103 unsigned char *buf, in mt2032_compute_freq() argument 162 buf[0]=lo1n-1; in mt2032_compute_freq() 163 buf[1]=lo1a | (sel<<4); in mt2032_compute_freq() 164 buf[2]=0x86; // LOGC in mt2032_compute_freq() 165 buf[3]=0x0f; //reserved in mt2032_compute_freq() 166 buf[4]=0x1f; in mt2032_compute_freq() 167 buf[5]=(lo2n-1) | (lo2a<<5); in mt2032_compute_freq() 169 buf[6]=0xe4; in mt2032_compute_freq() 171 buf[6]=0xf4; // set PKEN per rev 1.2 in mt2032_compute_freq() 172 buf[7]=8+xogc; in mt2032_compute_freq() [all …]
|
| /linux/drivers/net/wireless/ath/ath12k/ |
| H A D | debugfs_htt_stats.c | 15 print_array_to_buf_index(u8 *buf, u32 offset, const char *header, u32 stats_index, in print_array_to_buf_index() argument 22 index += scnprintf(buf + offset, in print_array_to_buf_index() 27 index += scnprintf(buf + offset + index, in print_array_to_buf_index() 33 *(buf + offset + index) = '\0'; in print_array_to_buf_index() 36 index += scnprintf(buf + offset + index, in print_array_to_buf_index() 44 print_array_to_buf(u8 *buf, u32 offset, const char *header, in print_array_to_buf() argument 47 return print_array_to_buf_index(buf, offset, header, 0, array, array_len, in print_array_to_buf() 52 print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, in print_array_to_buf_s8() argument 60 index += scnprintf(buf + offset, buf_len - offset, "%s = ", header); in print_array_to_buf_s8() 63 index += scnprintf(buf + offset + index, (buf_len - offset) - index, in print_array_to_buf_s8() [all …]
|