Home
last modified time | relevance | path

Searched refs:sg (Results 1 – 25 of 881) sorted by relevance

12345678910>>...36

/kernel/linux/linux-5.10/tools/virtio/linux/
Dscatterlist.h15 #define sg_is_chain(sg) ((sg)->page_link & 0x01) argument
16 #define sg_is_last(sg) ((sg)->page_link & 0x02) argument
17 #define sg_chain_ptr(sg) \ argument
18 ((struct scatterlist *) ((sg)->page_link & ~0x03))
30 static inline void sg_assign_page(struct scatterlist *sg, struct page *page) in sg_assign_page() argument
32 unsigned long page_link = sg->page_link & 0x3; in sg_assign_page()
40 BUG_ON(sg_is_chain(sg)); in sg_assign_page()
42 sg->page_link = page_link | (unsigned long) page; in sg_assign_page()
59 static inline void sg_set_page(struct scatterlist *sg, struct page *page, in sg_set_page() argument
62 sg_assign_page(sg, page); in sg_set_page()
[all …]
/kernel/linux/linux-5.10/drivers/ata/
Dsata_gemini.c126 bool gemini_sata_bridge_enabled(struct sata_gemini *sg, bool is_ata1) in gemini_sata_bridge_enabled() argument
128 if (!sg->sata_bridge) in gemini_sata_bridge_enabled()
134 if ((sg->muxmode == GEMINI_MUXMODE_2) && in gemini_sata_bridge_enabled()
137 if ((sg->muxmode == GEMINI_MUXMODE_3) && in gemini_sata_bridge_enabled()
145 enum gemini_muxmode gemini_sata_get_muxmode(struct sata_gemini *sg) in gemini_sata_get_muxmode() argument
147 return sg->muxmode; in gemini_sata_get_muxmode()
151 static int gemini_sata_setup_bridge(struct sata_gemini *sg, in gemini_sata_setup_bridge() argument
161 if (sg->muxmode == GEMINI_MUXMODE_2) in gemini_sata_setup_bridge()
163 writel(val, sg->base + GEMINI_SATA0_CTRL); in gemini_sata_setup_bridge()
167 if (sg->muxmode == GEMINI_MUXMODE_3) in gemini_sata_setup_bridge()
[all …]
/kernel/linux/linux-5.10/drivers/clk/sprd/
Dgate.c13 static void clk_gate_toggle(const struct sprd_gate *sg, bool en) in clk_gate_toggle() argument
15 const struct sprd_clk_common *common = &sg->common; in clk_gate_toggle()
17 bool set = sg->flags & CLK_GATE_SET_TO_DISABLE ? true : false; in clk_gate_toggle()
24 reg |= sg->enable_mask; in clk_gate_toggle()
26 reg &= ~sg->enable_mask; in clk_gate_toggle()
31 static void clk_sc_gate_toggle(const struct sprd_gate *sg, bool en) in clk_sc_gate_toggle() argument
33 const struct sprd_clk_common *common = &sg->common; in clk_sc_gate_toggle()
34 bool set = sg->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; in clk_sc_gate_toggle()
45 offset = set ? sg->sc_offset : sg->sc_offset * 2; in clk_sc_gate_toggle()
48 sg->enable_mask); in clk_sc_gate_toggle()
[all …]
/kernel/linux/linux-5.10/include/linux/
Dscatterlist.h34 #define sg_dma_address(sg) ((sg)->dma_address) argument
37 #define sg_dma_len(sg) ((sg)->dma_length) argument
39 #define sg_dma_len(sg) ((sg)->length) argument
72 #define sg_is_chain(sg) ((sg)->page_link & SG_CHAIN) argument
73 #define sg_is_last(sg) ((sg)->page_link & SG_END) argument
74 #define sg_chain_ptr(sg) \ argument
75 ((struct scatterlist *) ((sg)->page_link & ~(SG_CHAIN | SG_END)))
87 static inline void sg_assign_page(struct scatterlist *sg, struct page *page) in sg_assign_page() argument
89 unsigned long page_link = sg->page_link & (SG_CHAIN | SG_END); in sg_assign_page()
97 BUG_ON(sg_is_chain(sg)); in sg_assign_page()
[all …]
/kernel/linux/linux-5.10/Documentation/scsi/
Dscsi-generic.rst4 Notes on Linux SCSI Generic (sg) driver
11 The SCSI Generic driver (sg) is one of the four "high level" SCSI device
15 Thus sg is used for scanners, CD writers and reading audio CDs digitally
23 Major versions of the sg driver
25 There are three major versions of sg found in the linux kernel (lk):
26 - sg version 1 (original) from 1992 to early 1999 (lk 2.2.5) .
28 - sg version 2 from lk 2.2.6 in the 2.2 series. It is based on
30 - sg version 3 found in the lk 2.4 series (and the lk 2.5 series).
36 The most recent documentation of the sg driver is kept at the Linux
41 This describes the sg version 3 driver found in the lk 2.4 series.
[all …]
/kernel/linux/linux-5.10/drivers/crypto/
Domap-crypto.c17 struct scatterlist **sg, in omap_crypto_copy_sg_lists() argument
20 int n = sg_nents(*sg); in omap_crypto_copy_sg_lists()
24 new_sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); in omap_crypto_copy_sg_lists()
33 while (*sg && total) { in omap_crypto_copy_sg_lists()
34 int len = (*sg)->length; in omap_crypto_copy_sg_lists()
41 sg_set_page(tmp, sg_page(*sg), len, (*sg)->offset); in omap_crypto_copy_sg_lists()
47 *sg = sg_next(*sg); in omap_crypto_copy_sg_lists()
50 *sg = new_sg; in omap_crypto_copy_sg_lists()
55 static int omap_crypto_copy_sgs(int total, int bs, struct scatterlist **sg, in omap_crypto_copy_sgs() argument
73 scatterwalk_map_and_copy(buf, *sg, 0, total, 0); in omap_crypto_copy_sgs()
[all …]
/kernel/linux/linux-5.10/lib/
Dscatterlist.c23 struct scatterlist *sg_next(struct scatterlist *sg) in sg_next() argument
25 if (sg_is_last(sg)) in sg_next()
28 sg++; in sg_next()
29 if (unlikely(sg_is_chain(sg))) in sg_next()
30 sg = sg_chain_ptr(sg); in sg_next()
32 return sg; in sg_next()
45 int sg_nents(struct scatterlist *sg) in sg_nents() argument
48 for (nents = 0; sg; sg = sg_next(sg)) in sg_nents()
68 int sg_nents_for_len(struct scatterlist *sg, u64 len) in sg_nents_for_len() argument
76 for (nents = 0, total = 0; sg; sg = sg_next(sg)) { in sg_nents_for_len()
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/i915/
Di915_scatterlist.h42 static inline int __sg_page_count(const struct scatterlist *sg) in __sg_page_count() argument
44 return sg->length >> PAGE_SHIFT; in __sg_page_count()
47 static inline struct scatterlist *____sg_next(struct scatterlist *sg) in ____sg_next() argument
49 ++sg; in ____sg_next()
50 if (unlikely(sg_is_chain(sg))) in ____sg_next()
51 sg = sg_chain_ptr(sg); in ____sg_next()
52 return sg; in ____sg_next()
64 static inline struct scatterlist *__sg_next(struct scatterlist *sg) in __sg_next() argument
66 return sg_is_last(sg) ? NULL : ____sg_next(sg); in __sg_next()
95 static inline unsigned int i915_sg_page_sizes(struct scatterlist *sg) in i915_sg_page_sizes() argument
[all …]
/kernel/linux/linux-5.10/arch/s390/mm/
Dgmap.c241 struct gmap *sg, *next; in gmap_remove() local
247 list_for_each_entry_safe(sg, next, &gmap->children, list) { in gmap_remove()
248 list_del(&sg->list); in gmap_remove()
249 gmap_put(sg); in gmap_remove()
1178 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, in gmap_insert_rmap() argument
1183 BUG_ON(!gmap_is_shadow(sg)); in gmap_insert_rmap()
1184 slot = radix_tree_lookup_slot(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT); in gmap_insert_rmap()
1187 &sg->guest_table_lock); in gmap_insert_rmap()
1188 radix_tree_replace_slot(&sg->host_to_rmap, slot, rmap); in gmap_insert_rmap()
1191 radix_tree_insert(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT, in gmap_insert_rmap()
[all …]
/kernel/linux/linux-5.10/include/crypto/
Dscatterwalk.h20 struct scatterlist *sg, int num) in scatterwalk_crypto_chain() argument
22 if (sg) in scatterwalk_crypto_chain()
23 sg_chain(head, num, sg); in scatterwalk_crypto_chain()
30 unsigned int len = walk->sg->offset + walk->sg->length - walk->offset; in scatterwalk_pagelen()
56 return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); in scatterwalk_page()
65 struct scatterlist *sg) in scatterwalk_start() argument
67 walk->sg = sg; in scatterwalk_start()
68 walk->offset = sg->offset; in scatterwalk_start()
83 page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT); in scatterwalk_pagedone()
92 if (more && walk->offset >= walk->sg->offset + walk->sg->length) in scatterwalk_pagedone()
[all …]
/kernel/linux/linux-5.10/samples/kfifo/
Ddma-example.c26 struct scatterlist sg[10]; in example_init() local
62 sg_init_table(sg, ARRAY_SIZE(sg)); in example_init()
63 nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); in example_init()
77 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init()
79 if (sg_is_last(&sg[i])) in example_init()
93 nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); in example_init()
106 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init()
108 if (sg_is_last(&sg[i])) in example_init()
/kernel/linux/linux-5.10/include/soc/fsl/
Ddpaa2-fd.h309 static inline dma_addr_t dpaa2_sg_get_addr(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_addr() argument
311 return (dma_addr_t)le64_to_cpu(sg->addr); in dpaa2_sg_get_addr()
319 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) in dpaa2_sg_set_addr() argument
321 sg->addr = cpu_to_le64(addr); in dpaa2_sg_set_addr()
324 static inline bool dpaa2_sg_short_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_short_len() argument
326 return !!((le16_to_cpu(sg->format_offset) >> SG_SHORT_LEN_FLAG_SHIFT) in dpaa2_sg_short_len()
336 static inline u32 dpaa2_sg_get_len(const struct dpaa2_sg_entry *sg) in dpaa2_sg_get_len() argument
338 if (dpaa2_sg_short_len(sg)) in dpaa2_sg_get_len()
339 return le32_to_cpu(sg->len) & SG_SHORT_LEN_MASK; in dpaa2_sg_get_len()
341 return le32_to_cpu(sg->len); in dpaa2_sg_get_len()
[all …]
/kernel/linux/linux-5.10/drivers/media/pci/tw68/
Dtw68-risc.c38 struct scatterlist *sg; in tw68_risc_field() local
54 sg = sglist; in tw68_risc_field()
57 while (offset && offset >= sg_dma_len(sg)) { in tw68_risc_field()
58 offset -= sg_dma_len(sg); in tw68_risc_field()
59 sg = sg_next(sg); in tw68_risc_field()
61 if (bpl <= sg_dma_len(sg) - offset) { in tw68_risc_field()
65 *(rp++) = cpu_to_le32(sg_dma_address(sg) + offset); in tw68_risc_field()
76 done = (sg_dma_len(sg) - offset); in tw68_risc_field()
80 *(rp++) = cpu_to_le32(sg_dma_address(sg) + offset); in tw68_risc_field()
82 sg = sg_next(sg); in tw68_risc_field()
[all …]
/kernel/linux/linux-5.10/drivers/net/ethernet/marvell/octeontx2/nic/
Dotx2_txrx.c67 static void otx2_dma_unmap_skb_frags(struct otx2_nic *pfvf, struct sg_list *sg) in otx2_dma_unmap_skb_frags() argument
71 for (seg = 0; seg < sg->num_segs; seg++) { in otx2_dma_unmap_skb_frags()
72 otx2_dma_unmap_page(pfvf, sg->dma_addr[seg], in otx2_dma_unmap_skb_frags()
73 sg->size[seg], DMA_TO_DEVICE); in otx2_dma_unmap_skb_frags()
75 sg->num_segs = 0; in otx2_dma_unmap_skb_frags()
88 struct sg_list *sg; in otx2_snd_pkt_handler() local
96 sg = &sq->sg[snd_comp->sqe_id]; in otx2_snd_pkt_handler()
97 skb = (struct sk_buff *)sg->skb; in otx2_snd_pkt_handler()
115 otx2_dma_unmap_skb_frags(pfvf, sg); in otx2_snd_pkt_handler()
117 sg->skb = (u64)NULL; in otx2_snd_pkt_handler()
[all …]
/kernel/linux/linux-5.10/net/mac80211/
Daead_api.c22 struct scatterlist sg[3]; in aead_encrypt() local
35 sg_init_table(sg, 3); in aead_encrypt()
36 sg_set_buf(&sg[0], __aad, aad_len); in aead_encrypt()
37 sg_set_buf(&sg[1], data, data_len); in aead_encrypt()
38 sg_set_buf(&sg[2], mic, mic_len); in aead_encrypt()
41 aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); in aead_encrypt()
42 aead_request_set_ad(aead_req, sg[0].length); in aead_encrypt()
54 struct scatterlist sg[3]; in aead_decrypt() local
70 sg_init_table(sg, 3); in aead_decrypt()
71 sg_set_buf(&sg[0], __aad, aad_len); in aead_decrypt()
[all …]
Daes_gmac.c20 struct scatterlist sg[5]; in ieee80211_aes_gmac() local
41 sg_init_table(sg, 5); in ieee80211_aes_gmac()
42 sg_set_buf(&sg[0], __aad, GMAC_AAD_LEN); in ieee80211_aes_gmac()
43 sg_set_buf(&sg[1], zero, 8); in ieee80211_aes_gmac()
44 sg_set_buf(&sg[2], data + 8, data_len - 8 - GMAC_MIC_LEN); in ieee80211_aes_gmac()
45 sg_set_buf(&sg[3], zero, GMAC_MIC_LEN); in ieee80211_aes_gmac()
46 sg_set_buf(&sg[4], mic, GMAC_MIC_LEN); in ieee80211_aes_gmac()
48 sg_init_table(sg, 4); in ieee80211_aes_gmac()
49 sg_set_buf(&sg[0], __aad, GMAC_AAD_LEN); in ieee80211_aes_gmac()
50 sg_set_buf(&sg[1], data, data_len - GMAC_MIC_LEN); in ieee80211_aes_gmac()
[all …]
/kernel/linux/linux-5.10/net/core/
Dskmsg.c14 if (msg->sg.end > msg->sg.start && in sk_msg_try_coalesce_ok()
15 elem_first_coalesce < msg->sg.end) in sk_msg_try_coalesce_ok()
18 if (msg->sg.end < msg->sg.start && in sk_msg_try_coalesce_ok()
19 (elem_first_coalesce > msg->sg.start || in sk_msg_try_coalesce_ok()
20 elem_first_coalesce < msg->sg.end)) in sk_msg_try_coalesce_ok()
30 u32 osize = msg->sg.size; in sk_msg_alloc()
33 len -= msg->sg.size; in sk_msg_alloc()
51 i = msg->sg.end; in sk_msg_alloc()
53 sge = &msg->sg.data[i]; in sk_msg_alloc()
65 sge = &msg->sg.data[msg->sg.end]; in sk_msg_alloc()
[all …]
/kernel/linux/linux-5.10/arch/arm/mm/
Ddma-mapping-nommu.c123 struct scatterlist *sg; in arm_nommu_dma_map_sg() local
125 for_each_sg(sgl, sg, nents, i) { in arm_nommu_dma_map_sg()
126 sg_dma_address(sg) = sg_phys(sg); in arm_nommu_dma_map_sg()
127 sg_dma_len(sg) = sg->length; in arm_nommu_dma_map_sg()
128 __dma_page_cpu_to_dev(sg_dma_address(sg), sg_dma_len(sg), dir); in arm_nommu_dma_map_sg()
138 struct scatterlist *sg; in arm_nommu_dma_unmap_sg() local
141 for_each_sg(sgl, sg, nents, i) in arm_nommu_dma_unmap_sg()
142 __dma_page_dev_to_cpu(sg_dma_address(sg), sg_dma_len(sg), dir); in arm_nommu_dma_unmap_sg()
160 struct scatterlist *sg; in arm_nommu_dma_sync_sg_for_device() local
163 for_each_sg(sgl, sg, nents, i) in arm_nommu_dma_sync_sg_for_device()
[all …]
/kernel/linux/linux-5.10/drivers/dma/
Ddma-axi-dmac.c116 struct axi_dmac_sg sg[]; member
208 struct axi_dmac_sg *sg; in axi_dmac_start_transfer() local
225 sg = &desc->sg[desc->num_submitted]; in axi_dmac_start_transfer()
228 if (sg->id != AXI_DMAC_SG_UNUSED) { in axi_dmac_start_transfer()
229 sg->schedule_when_free = true; in axi_dmac_start_transfer()
245 sg->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID); in axi_dmac_start_transfer()
248 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS, sg->dest_addr); in axi_dmac_start_transfer()
249 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_STRIDE, sg->dest_stride); in axi_dmac_start_transfer()
253 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS, sg->src_addr); in axi_dmac_start_transfer()
254 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_STRIDE, sg->src_stride); in axi_dmac_start_transfer()
[all …]
/kernel/linux/linux-5.10/drivers/gpu/drm/i915/gem/
Di915_gem_internal.c22 struct scatterlist *sg; in internal_free_pages() local
24 for (sg = st->sgl; sg; sg = __sg_next(sg)) { in internal_free_pages()
25 if (sg_page(sg)) in internal_free_pages()
26 __free_pages(sg_page(sg), get_order(sg->length)); in internal_free_pages()
37 struct scatterlist *sg; in i915_gem_object_get_pages_internal() local
75 sg = st->sgl; in i915_gem_object_get_pages_internal()
95 sg_set_page(sg, page, PAGE_SIZE << order, 0); in i915_gem_object_get_pages_internal()
101 sg_mark_end(sg); in i915_gem_object_get_pages_internal()
105 sg = __sg_next(sg); in i915_gem_object_get_pages_internal()
123 sg_set_page(sg, NULL, 0, 0); in i915_gem_object_get_pages_internal()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/allwinner/sun8i-ss/
Dsun8i-ss-cipher.c27 struct scatterlist *sg; in sun8i_ss_need_fallback() local
35 sg = areq->src; in sun8i_ss_need_fallback()
36 while (sg) { in sun8i_ss_need_fallback()
37 if ((sg->length % 16) != 0) in sun8i_ss_need_fallback()
39 if ((sg_dma_len(sg) % 16) != 0) in sun8i_ss_need_fallback()
41 if (!IS_ALIGNED(sg->offset, 16)) in sun8i_ss_need_fallback()
43 sg = sg_next(sg); in sun8i_ss_need_fallback()
45 sg = areq->dst; in sun8i_ss_need_fallback()
46 while (sg) { in sun8i_ss_need_fallback()
47 if ((sg->length % 16) != 0) in sun8i_ss_need_fallback()
[all …]
/kernel/linux/linux-5.10/drivers/dma-buf/
Dudmabuf.c21 struct sg_table *sg; member
58 struct sg_table *sg; in get_sg_table() local
61 sg = kzalloc(sizeof(*sg), GFP_KERNEL); in get_sg_table()
62 if (!sg) in get_sg_table()
64 ret = sg_alloc_table_from_pages(sg, ubuf->pages, ubuf->pagecount, in get_sg_table()
69 ret = dma_map_sgtable(dev, sg, direction, 0); in get_sg_table()
72 return sg; in get_sg_table()
75 sg_free_table(sg); in get_sg_table()
76 kfree(sg); in get_sg_table()
80 static void put_sg_table(struct device *dev, struct sg_table *sg, in put_sg_table() argument
[all …]
/kernel/linux/linux-5.10/drivers/target/iscsi/cxgbit/
Dcxgbit_ddp.c13 struct scatterlist *sg = sg_pp ? *sg_pp : NULL; in cxgbit_set_one_ppod() local
21 if (sg) { in cxgbit_set_one_ppod()
22 addr = sg_dma_address(sg); in cxgbit_set_one_ppod()
23 len = sg_dma_len(sg); in cxgbit_set_one_ppod()
27 if (sg) { in cxgbit_set_one_ppod()
30 if (offset == (len + sg->offset)) { in cxgbit_set_one_ppod()
32 sg = sg_next(sg); in cxgbit_set_one_ppod()
33 if (sg) { in cxgbit_set_one_ppod()
34 addr = sg_dma_address(sg); in cxgbit_set_one_ppod()
35 len = sg_dma_len(sg); in cxgbit_set_one_ppod()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/qce/
Ddma.c53 struct scatterlist *sg = sgt->sgl, *sg_last = NULL; in qce_sgtable_add() local
56 while (sg) { in qce_sgtable_add()
57 if (!sg_page(sg)) in qce_sgtable_add()
59 sg = sg_next(sg); in qce_sgtable_add()
62 if (!sg) in qce_sgtable_add()
65 while (new_sgl && sg && max_len) { in qce_sgtable_add()
67 sg_set_page(sg, sg_page(new_sgl), new_len, new_sgl->offset); in qce_sgtable_add()
68 sg_last = sg; in qce_sgtable_add()
69 sg = sg_next(sg); in qce_sgtable_add()
77 static int qce_dma_prep_sg(struct dma_chan *chan, struct scatterlist *sg, in qce_dma_prep_sg() argument
[all …]
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/
Dopal-sensor-groups.c27 struct attribute_group sg; member
129 static int add_attr_group(const __be32 *ops, int len, struct sensor_group *sg, in add_attr_group() argument
138 add_attr(handle, &sg->sgattrs[count], j); in add_attr_group()
139 sg->sg.attrs[count] = in add_attr_group()
140 &sg->sgattrs[count].attr.attr; in add_attr_group()
144 return sysfs_create_group(sg_kobj, &sg->sg); in add_attr_group()
162 struct device_node *sg, *node; in opal_sensor_groups_init() local
165 sg = of_find_compatible_node(NULL, NULL, "ibm,opal-sensor-group"); in opal_sensor_groups_init()
166 if (!sg) { in opal_sensor_groups_init()
171 sgs = kcalloc(of_get_child_count(sg), sizeof(*sgs), GFP_KERNEL); in opal_sensor_groups_init()
[all …]

12345678910>>...36