/linux/drivers/spi/ |
H A D | spi-rockchip.c | 1 // SPDX-License-Identifier: GPL-2.0-only 4 * Author: Addy Ke <addy.ke@rock-chips.com> 18 #define DRIVER_NAME "rockchip-spi" 158 * SPI_CTRLR1 is 16-bits, so we should support lengths of 0xffff + 1. However, 196 bool cs_high_supported; /* native CS supports active-high polarity */ 201 static inline void spi_enable_chip(struct rockchip_spi *rs, bool enable) in spi_enable_chip() argument 203 writel_relaxed((enable ? 1U : 0U), rs->regs + ROCKCHIP_SPI_SSIENR); in spi_enable_chip() 206 static inline void wait_for_tx_idle(struct rockchip_spi *rs, bool target_mode) in wait_for_tx_idle() argument 212 if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_TARGET_TX_BUSY) && in wait_for_tx_idle() 213 !((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY))) in wait_for_tx_idle() [all …]
|
H A D | spi-mt7621.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // spi-mt7621.c -- MediaTek MT7621 SPI controller driver 6 // Copyright (C) 2011-2013 Gabor Juhos <juhosg@openwrt.org> 7 // Copyright (C) 2014-2015 Felix Fietkau <nbd@nbd.name> 9 // Some parts are based on spi-orion.c: 11 // Copyright (C) 2007-2008 Marvell Ltd. 23 #define DRIVER_NAME "spi-mt7621" 67 return spi_controller_get_devdata(spi->controller); in spidev_to_mt7621_spi() 70 static inline u32 mt7621_spi_read(struct mt7621_spi *rs, u32 reg) in mt7621_spi_read() argument 72 return ioread32(rs->base + reg); in mt7621_spi_read() [all …]
|
/linux/drivers/md/ |
H A D | dm-raid.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (C) 2010-2011 Neil Brown 4 * Copyright (C) 2010-2018 Red Hat, Inc. All rights reserved. 16 #include "md-bitmap.h" 18 #include <linux/device-mapper.h> 21 #define MAX_RAID_DEVICES 253 /* md-raid kernel limit */ 36 * The following flags are used by dm-raid to set up the array state. 45 * ti->len and give more flexibility in altering size and 51 * |--------- Physical Device ---------| 52 * |- meta_dev -|------ data_dev ------| [all …]
|
/linux/net/rds/ |
H A D | af_rds.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 61 struct sock *sk = sock->sk; in rds_release() 62 struct rds_sock *rs; in rds_release() local 67 rs = rds_sk_to_rs(sk); in rds_release() 70 /* Note - rds_clear_recv_queue grabs rs_recv_lock, so in rds_release() 73 rds_clear_recv_queue(rs); in rds_release() 74 rds_cong_remove_socket(rs); in rds_release() 76 rds_remove_bound(rs); in rds_release() 78 rds_send_drop_to(rs, NULL); in rds_release() [all …]
|
H A D | bind.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 70 * marked this socket and don't return a rs ref to the rx path. 76 struct rds_sock *rs; in rds_find_bound() local 80 rs = rhashtable_lookup(&bind_hash_table, key, ht_parms); in rds_find_bound() 81 if (rs && (sock_flag(rds_rs_to_sk(rs), SOCK_DEAD) || in rds_find_bound() 82 !refcount_inc_not_zero(&rds_rs_to_sk(rs)->sk_refcnt))) in rds_find_bound() 83 rs = NULL; in rds_find_bound() 87 rdsdebug("returning rs %p for %pI6c:%u\n", rs, addr, in rds_find_bound() 90 return rs; in rds_find_bound() [all …]
|
H A D | recv.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 47 refcount_set(&inc->i_refcount, 1); in rds_inc_init() 48 INIT_LIST_HEAD(&inc->i_item); in rds_inc_init() 49 inc->i_conn = conn; in rds_inc_init() 50 inc->i_saddr = *saddr; in rds_inc_init() 51 inc->i_usercopy.rdma_cookie = 0; in rds_inc_init() 52 inc->i_usercopy.rx_tstamp = ktime_set(0, 0); in rds_inc_init() 54 memset(inc->i_rx_lat_trace, 0, sizeof(inc->i_rx_lat_trace)); in rds_inc_init() 61 refcount_set(&inc->i_refcount, 1); in rds_inc_path_init() [all …]
|
H A D | send.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 70 if (cp->cp_xmit_rm) { in rds_send_path_reset() 71 rm = cp->cp_xmit_rm; in rds_send_path_reset() 72 cp->cp_xmit_rm = NULL; in rds_send_path_reset() 81 cp->cp_xmit_sg = 0; in rds_send_path_reset() 82 cp->cp_xmit_hdr_off = 0; in rds_send_path_reset() 83 cp->cp_xmit_data_off = 0; in rds_send_path_reset() 84 cp->cp_xmit_atomic_sent = 0; in rds_send_path_reset() 85 cp->cp_xmit_rdma_sent = 0; in rds_send_path_reset() [all …]
|
H A D | rdma.c | 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 36 #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */ 42 * - build with sparse 43 * - should we detect duplicate keys on a socket? hmm. 44 * - an rdma is an mlock, apply rlimit? 57 if ((vec->addr + vec->bytes <= vec->addr) || in rds_pages_in_vec() 58 (vec->bytes > (u64)UINT_MAX)) in rds_pages_in_vec() 61 return ((vec->addr + vec->bytes + PAGE_SIZE - 1) >> PAGE_SHIFT) - in rds_pages_in_vec() 62 (vec->addr >> PAGE_SHIFT); in rds_pages_in_vec() [all …]
|
/linux/lib/reed_solomon/ |
H A D | reed_solomon.c | 1 // SPDX-License-Identifier: GPL-2.0 13 * encoding / decoding of RS codes. 16 * for the given rs parameters. The control struct is unique per instance. 52 /* This list holds all currently allocated rs codec structures */ 58 * codec_init - Initialize a Reed-Solomon codec 59 * @symsize: symbol size, bits (1-8) 62 * @fcr: first root of RS code generator polynomial, index form 64 * @nroots: RS code generator polynomial degree (number of roots) 74 struct rs_codec *rs; in codec_init() local 76 rs = kzalloc(sizeof(*rs), gfp); in codec_init() [all …]
|
H A D | test_rslib.c | 1 // SPDX-License-Identifier: GPL-2.0 103 kfree(ws->errlocs); in free_ws() 104 kfree(ws->c); in free_ws() 108 static struct wspace *alloc_ws(struct rs_codec *rs) in alloc_ws() argument 110 int nroots = rs->nroots; in alloc_ws() 112 int nn = rs->nn; in alloc_ws() 118 ws->c = kmalloc_array(2 * (nn + nroots), in alloc_ws() 120 if (!ws->c) in alloc_ws() 123 ws->r = ws->c + nn; in alloc_ws() 124 ws->s = ws->r + nn; in alloc_ws() [all …]
|
/linux/fs/jffs2/ |
H A D | compr_rubin.c | 2 * JFFS2 -- Journalling Flash File System, Version 2. 4 * Copyright © 2001-2007 Red Hat, Inc. 5 * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org> 23 #define UPPER_BIT_RUBIN (((long) 1)<<(RUBIN_REG_SIZE-1)) 24 #define LOWER_BITS_RUBIN ((((long) 1)<<(RUBIN_REG_SIZE-1))-1) 51 pp->buf = buf; in init_pushpull() 52 pp->buflen = buflen; in init_pushpull() 53 pp->ofs = ofs; in init_pushpull() 54 pp->reserve = reserve; in init_pushpull() 59 if (pp->ofs >= pp->buflen - (use_reserved?0:pp->reserve)) in pushbit() [all …]
|
/linux/arch/mips/mm/ |
H A D | uasm-mips.c | 6 * A small micro-assembler. It is intentionally kept simple, does only 12 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 31 /* This macro sets the non-variable bits of an instruction. */ 40 /* This macro sets the non-variable bits of an R6 instruction. */ 51 [insn_addiu] = {M(addiu_op, 0, 0, 0, 0, 0), RS | RT | SIMM}, 52 [insn_addu] = {M(spec_op, 0, 0, 0, 0, addu_op), RS | RT | RD}, 53 [insn_and] = {M(spec_op, 0, 0, 0, 0, and_op), RS | RT | RD}, 54 [insn_andi] = {M(andi_op, 0, 0, 0, 0, 0), RS | RT | UIMM}, 55 [insn_bbit0] = {M(lwc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM}, 56 [insn_bbit1] = {M(swc2_op, 0, 0, 0, 0, 0), RS | RT | BIMM}, [all …]
|
H A D | uasm-micromips.c | 6 * A small micro-assembler. It is intentionally kept simple, does only 12 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 31 /* This macro sets the non-variable bits of an instruction. */ 43 [insn_addu] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_addu32_op), RT | RS | RD}, 44 [insn_addiu] = {M(mm_addiu32_op, 0, 0, 0, 0, 0), RT | RS | SIMM}, 45 [insn_and] = {M(mm_pool32a_op, 0, 0, 0, 0, mm_and_op), RT | RS | RD}, 46 [insn_andi] = {M(mm_andi32_op, 0, 0, 0, 0, 0), RT | RS | UIMM}, 47 [insn_beq] = {M(mm_beq32_op, 0, 0, 0, 0, 0), RS | RT | BIMM}, 49 [insn_bgez] = {M(mm_pool32i_op, mm_bgez_op, 0, 0, 0, 0), RS | BIMM}, 51 [insn_bltz] = {M(mm_pool32i_op, mm_bltz_op, 0, 0, 0, 0), RS | BIMM}, [all …]
|
/linux/fs/isofs/ |
H A D | rock.c | 1 // SPDX-License-Identifier: GPL-2.0 45 if (rr->u.SP.magic[0] != 0xbe) in check_sp() 46 return -1; in check_sp() 47 if (rr->u.SP.magic[1] != 0xef) in check_sp() 48 return -1; in check_sp() 49 ISOFS_SB(inode->i_sb)->s_rock_offset = rr->u.SP.skip; in check_sp() 54 struct inode *inode, struct rock_state *rs) in setup_rock_ridge() argument 56 rs->len = sizeof(struct iso_directory_record) + de->name_len[0]; in setup_rock_ridge() 57 if (rs->len & 1) in setup_rock_ridge() 58 (rs->len)++; in setup_rock_ridge() [all …]
|
/linux/arch/mips/include/asm/ |
H A D | uasm.h | 8 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 199 void UASM_i_LA_mostly(u32 **buf, unsigned int rs, long addr); 200 void UASM_i_LA(u32 **buf, unsigned int rs, long addr); 210 # define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_daddiu(buf, rs, rt, val) argument 211 # define UASM_i_ADDU(buf, rs, rt, rd) uasm_i_daddu(buf, rs, rt, rd) argument 212 # define UASM_i_LL(buf, rs, rt, off) uasm_i_lld(buf, rs, rt, off) argument 213 # define UASM_i_LW(buf, rs, rt, off) uasm_i_ld(buf, rs, rt, off) argument 214 # define UASM_i_LWX(buf, rs, rt, rd) uasm_i_ldx(buf, rs, rt, rd) argument 217 # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh) argument 218 # define UASM_i_SC(buf, rs, rt, off) uasm_i_scd(buf, rs, rt, off) argument [all …]
|
/linux/include/linux/ |
H A D | rslib.h | 1 // SPDX-License-Identifier: GPL-2.0 7 * RS code lifted from reed solomon library written by Phil Karn 17 * struct rs_codec - rs codec data 20 * @nn: Symbols per block (= (1<<mm)-1) 27 * @iprim: prim-th root of 1, index form 29 * @gffunc: Function to generate the field, if non-canonical representation 31 * @list: List entry for the rs codec list 50 * struct rs_control - rs control structure per instance 59 /* General purpose RS codec, 8-bit data width, symbol width 1-15 bit */ 61 int encode_rs8(struct rs_control *rs, uint8_t *data, int len, uint16_t *par, [all …]
|
H A D | ratelimit.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 9 static inline void ratelimit_state_init(struct ratelimit_state *rs, in ratelimit_state_init() argument 12 memset(rs, 0, sizeof(*rs)); in ratelimit_state_init() 14 raw_spin_lock_init(&rs->lock); in ratelimit_state_init() 15 rs->interval = interval; in ratelimit_state_init() 16 rs->burst = burst; in ratelimit_state_init() 19 static inline void ratelimit_default_init(struct ratelimit_state *rs) in ratelimit_default_init() argument 21 return ratelimit_state_init(rs, DEFAULT_RATELIMIT_INTERVAL, in ratelimit_default_init() 25 static inline void ratelimit_state_exit(struct ratelimit_state *rs) in ratelimit_state_exit() argument 27 if (!(rs->flags & RATELIMIT_MSG_ON_RELEASE)) in ratelimit_state_exit() [all …]
|
/linux/lib/ |
H A D | ratelimit.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * ratelimit.c - Do something with rate limit. 7 * 2008-05-01 rewrite the function and use a ratelimit_state data struct as 16 * __ratelimit - rate limiting 17 * @rs: ratelimit_state data 20 * This enforces a rate limit: not more than @rs->burst callbacks 21 * in every @rs->interval 27 int ___ratelimit(struct ratelimit_state *rs, const char *func) in ___ratelimit() argument 33 int interval = READ_ONCE(rs->interval); in ___ratelimit() 34 int burst = READ_ONCE(rs->burst); in ___ratelimit() [all …]
|
/linux/net/ipv4/ |
H A D | tcp_rate.c | 1 // SPDX-License-Identifier: GPL-2.0-only 21 * send_rate = #pkts_delivered/(last_snd_time - first_snd_time) 22 * ack_rate = #pkts_delivered/(last_ack_time - first_ack_time) 28 * deliberately avoids using the inter-packet spacing approach because that 31 * TCP flows can often be application-limited in request/response workloads. 32 * The estimator marks a bandwidth sample as application-limited if there 46 * the full time the network needs to deliver all in-flight in tcp_rate_skb_sent() 53 * because the latter is a guess based on RTO and loss-marking in tcp_rate_skb_sent() 58 if (!tp->packets_out) { in tcp_rate_skb_sent() 61 tp->first_tx_mstamp = tstamp_us; in tcp_rate_skb_sent() [all …]
|
/linux/fs/xfs/scrub/ |
H A D | reap.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright (C) 2022-2023 Oracle. All Rights Reserved. 126 error = xfs_rmap_alloc(sc->tp, sc->sa.agf_bp, sc->sa.pag, agbno, 1, in xreap_put_freelist() 132 error = xfs_alloc_read_agfl(sc->sa.pag, sc->tp, &agfl_bp); in xreap_put_freelist() 136 error = xfs_alloc_put_freelist(sc->sa.pag, sc->tp, sc->sa.agf_bp, in xreap_put_freelist() 140 xfs_extent_busy_insert(sc->tp, sc->sa.pag, agbno, 1, in xreap_put_freelist() 147 static inline bool xreap_dirty(const struct xreap_state *rs) in xreap_dirty() argument 149 if (rs->force_roll) in xreap_dirty() 151 if (rs->deferred) in xreap_dirty() 153 if (rs->invalidated) in xreap_dirty() [all …]
|
/linux/fs/reiserfs/ |
H A D | objectid.c | 11 #define objectid_map(s,rs) (old_format_only (s) ? \ argument 12 (__le32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\ 13 (__le32 *)((rs) + 1)) 20 reiserfs_panic(s, "vs-15010", "map corrupted: %lx", in check_objectid_map() 42 * non-sequential objectids, and even then it will become compact 51 struct super_block *s = th->t_super; in reiserfs_get_unused_objectid() 52 struct reiserfs_super_block *rs = SB_DISK_SUPER_BLOCK(s); in reiserfs_get_unused_objectid() local 53 __le32 *map = objectid_map(s, rs); in reiserfs_get_unused_objectid() 56 BUG_ON(!th->t_trans_id); in reiserfs_get_unused_objectid() 61 /* comment needed -Hans */ in reiserfs_get_unused_objectid() [all …]
|
/linux/lib/crypto/ |
H A D | des.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 65 static const u8 rs[256] = { variable 360 /* S-box lookup tables */ 598 * the 4 interleaved tables correspond to four 7-bit subsets of C_i or D_i. 601 * or D_i in bits 7-1 (bit 0 being the least significant). 619 * alternating zero-one patterns in the C and D registers after Permuted 634 pe[15 * 2 + 0] = DES_PC2(a, b, c, d); d = rs[d]; in des_ekey() 635 pe[14 * 2 + 0] = DES_PC2(d, a, b, c); c = rs[c]; b = rs[b]; in des_ekey() 636 pe[13 * 2 + 0] = DES_PC2(b, c, d, a); a = rs[a]; d = rs[d]; in des_ekey() 637 pe[12 * 2 + 0] = DES_PC2(d, a, b, c); c = rs[c]; b = rs[b]; in des_ekey() [all …]
|
/linux/drivers/platform/chrome/wilco_ec/ |
H A D | properties.c | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <linux/platform_data/wilco-ec.h> 36 struct ec_property_response *rs) in send_property_msg() argument 45 ec_msg.response_data = rs; in send_property_msg() 46 ec_msg.response_size = sizeof(*rs); in send_property_msg() 51 if (rs->op != rq->op) in send_property_msg() 52 return -EBADMSG; in send_property_msg() 53 if (memcmp(rq->property_id, rs->property_id, sizeof(rs->property_id))) in send_property_msg() 54 return -EBADMSG; in send_property_msg() 63 struct ec_property_response rs; in wilco_ec_get_property() local [all …]
|
/linux/arch/riscv/net/ |
H A D | bpf_jit_comp64.c | 1 // SPDX-License-Identifier: GPL-2.0 81 __set_bit(reg, &ctx->flags); in bpf_to_rv_reg() 96 return test_bit(reg, &ctx->flags); in seen_reg() 103 __set_bit(RV_CTX_F_SEEN_S5, &ctx->flags); in mark_fp() 108 __set_bit(RV_CTX_F_SEEN_CALL, &ctx->flags); in mark_call() 113 return test_bit(RV_CTX_F_SEEN_CALL, &ctx->flags); in seen_call() 118 __set_bit(RV_CTX_F_SEEN_TAIL_CALL, &ctx->flags); in mark_tail_call() 123 return test_bit(RV_CTX_F_SEEN_TAIL_CALL, &ctx->flags); in seen_tail_call() 131 __set_bit(RV_CTX_F_SEEN_S6, &ctx->flags); in rv_tail_call_reg() 139 return -(1L << 31) <= val && val < (1L << 31); in is_32b_int() [all …]
|
/linux/arch/arm64/net/ |
H A D | bpf_jit.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 5 * Copyright (C) 2014-2016 Zi Shen Lim <zlim.lnx@gmail.com> 12 /* 5-bit Register Operand */ 100 /* Rn -= 16; Rn[0] = Rt; Rn[8] = Rt2; */ 101 #define A64_PUSH(Rt, Rt2, Rn) A64_LS_PAIR(Rt, Rt2, Rn, -16, STORE, PRE_INDEX) 108 #define A64_LSX(sf, Rt, Rn, Rs, type) \ argument 109 aarch64_insn_gen_load_store_ex(Rt, Rn, Rs, A64_SIZE(sf), \ 114 /* [Rn] = Rt; (atomic) Rs = [state] */ 115 #define A64_STXR(sf, Rt, Rn, Rs) \ argument 116 A64_LSX(sf, Rt, Rn, Rs, STORE_EX) [all …]
|