/linux-master/tools/virtio/linux/ |
H A D | scatterlist.h | 15 #define sg_is_chain(sg) ((sg)->page_link & 0x01) 16 #define sg_is_last(sg) ((sg)->page_link & 0x02) 17 #define sg_chain_ptr(sg) \ 18 ((struct scatterlist *) ((sg)->page_link & ~0x03)) 22 * @sg: SG entry 26 * Assign page to sg entry. Also see sg_set_page(), the most commonly used 30 static inline void sg_assign_page(struct scatterlist *sg, struct page *page) argument 32 unsigned long page_link = sg 59 sg_set_page(struct scatterlist *sg, struct page *page, unsigned int len, unsigned int offset) argument 67 sg_page(struct scatterlist *sg) argument 116 sg_mark_end(struct scatterlist *sg) argument 133 sg_unmark_end(struct scatterlist *sg) argument 138 sg_next(struct scatterlist *sg) argument 156 sg_phys(struct scatterlist *sg) argument 161 sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen) argument 167 sg_init_one(struct scatterlist *sg, const void *buf, unsigned int buflen) argument [all...] |
/linux-master/drivers/ata/ |
H A D | sata_gemini.h | 16 bool gemini_sata_bridge_enabled(struct sata_gemini *sg, bool is_ata1); 17 enum gemini_muxmode gemini_sata_get_muxmode(struct sata_gemini *sg); 18 int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge); 19 void gemini_sata_stop_bridge(struct sata_gemini *sg, unsigned int bridge); 20 int gemini_sata_reset_bridge(struct sata_gemini *sg, unsigned int bridge);
|
H A D | sata_gemini.c | 125 bool gemini_sata_bridge_enabled(struct sata_gemini *sg, bool is_ata1) argument 127 if (!sg->sata_bridge) 133 if ((sg->muxmode == GEMINI_MUXMODE_2) && 136 if ((sg->muxmode == GEMINI_MUXMODE_3) && 144 enum gemini_muxmode gemini_sata_get_muxmode(struct sata_gemini *sg) argument 146 return sg->muxmode; 150 static int gemini_sata_setup_bridge(struct sata_gemini *sg, argument 160 if (sg->muxmode == GEMINI_MUXMODE_2) 162 writel(val, sg->base + GEMINI_SATA0_CTRL); 166 if (sg 194 gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge) argument 218 gemini_sata_stop_bridge(struct sata_gemini *sg, unsigned int bridge) argument 227 gemini_sata_reset_bridge(struct sata_gemini *sg, unsigned int bridge) argument 239 gemini_sata_bridge_init(struct sata_gemini *sg) argument 321 struct sata_gemini *sg; local 407 struct sata_gemini *sg = platform_get_drvdata(pdev); local [all...] |
/linux-master/drivers/clk/sprd/ |
H A D | gate.c | 13 static void clk_gate_toggle(const struct sprd_gate *sg, bool en) argument 15 const struct sprd_clk_common *common = &sg->common; 17 bool set = sg->flags & CLK_GATE_SET_TO_DISABLE ? true : false; 24 reg |= sg->enable_mask; 26 reg &= ~sg->enable_mask; 31 static void clk_sc_gate_toggle(const struct sprd_gate *sg, bool en) argument 33 const struct sprd_clk_common *common = &sg->common; 34 bool set = sg->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0; 45 offset = set ? sg->sc_offset : sg 53 struct sprd_gate *sg = hw_to_sprd_gate(hw); local 60 struct sprd_gate *sg = hw_to_sprd_gate(hw); local 69 struct sprd_gate *sg = hw_to_sprd_gate(hw); local 76 struct sprd_gate *sg = hw_to_sprd_gate(hw); local 85 struct sprd_gate *sg = hw_to_sprd_gate(hw); local 95 struct sprd_gate *sg = hw_to_sprd_gate(hw); local [all...] |
/linux-master/drivers/scsi/qla2xxx/ |
H A D | qla_dsd.h | 12 static inline void append_dsd32(struct dsd32 **dsd, struct scatterlist *sg) argument 14 put_unaligned_le32(sg_dma_address(sg), &(*dsd)->address); 15 put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length); 25 static inline void append_dsd64(struct dsd64 **dsd, struct scatterlist *sg) argument 27 put_unaligned_le64(sg_dma_address(sg), &(*dsd)->address); 28 put_unaligned_le32(sg_dma_len(sg), &(*dsd)->length);
|
/linux-master/include/linux/ |
H A D | scatterlist.h | 27 * You should only work with the number of sg entries dma_map_sg 28 * returns, or alternatively stop on the first sg_dma_len(sg) which 31 #define sg_dma_address(sg) ((sg)->dma_address) 34 #define sg_dma_len(sg) ((sg)->dma_length) 36 #define sg_dma_len(sg) ((sg)->length) 55 * the page pointer AND encode information about the sg table as well. The two 58 * If bit 0 is set, then the page_link contains a pointer to the next sg 77 __sg_flags(struct scatterlist *sg) argument 82 sg_chain_ptr(struct scatterlist *sg) argument 87 sg_is_chain(struct scatterlist *sg) argument 92 sg_is_last(struct scatterlist *sg) argument 107 sg_assign_page(struct scatterlist *sg, struct page *page) argument 136 sg_set_page(struct scatterlist *sg, struct page *page, unsigned int len, unsigned int offset) argument 158 sg_set_folio(struct scatterlist *sg, struct folio *folio, size_t len, size_t offset) argument 168 sg_page(struct scatterlist *sg) argument 183 sg_set_buf(struct scatterlist *sg, const void *buf, unsigned int buflen) argument 253 sg_mark_end(struct scatterlist *sg) argument 270 sg_unmark_end(struct scatterlist *sg) argument 295 sg_dma_is_bus_address(struct scatterlist *sg) argument 310 sg_dma_mark_bus_address(struct scatterlist *sg) argument 322 sg_dma_unmark_bus_address(struct scatterlist *sg) argument 337 sg_dma_is_swiotlb(struct scatterlist *sg) argument 350 sg_dma_mark_swiotlb(struct scatterlist *sg) argument 357 sg_dma_is_bus_address(struct scatterlist *sg) argument 361 sg_dma_mark_bus_address(struct scatterlist *sg) argument 364 sg_dma_unmark_bus_address(struct scatterlist *sg) argument 367 sg_dma_is_swiotlb(struct scatterlist *sg) argument 371 sg_dma_mark_swiotlb(struct scatterlist *sg) argument 387 sg_phys(struct scatterlist *sg) argument 402 sg_virt(struct scatterlist *sg) argument 551 struct scatterlist *sg; /* sg holding the page */ member in struct:sg_page_iter [all...] |
/linux-master/samples/kfifo/ |
H A D | dma-example.c | 26 struct scatterlist sg[10]; local 62 sg_init_table(sg, ARRAY_SIZE(sg)); 63 nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); 75 "sg[%d] -> " 77 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); 79 if (sg_is_last(&sg[ [all...] |
/linux-master/drivers/crypto/caam/ |
H A D | sg_sw_qm2.h | 28 sg_to_qm_sg(struct scatterlist *sg, int len, argument 34 ent_len = min_t(int, sg_dma_len(sg), len); 36 dma_to_qm_sg_one(qm_sg_ptr, sg_dma_address(sg), ent_len, 39 sg = sg_next(sg); 49 static inline void sg_to_qm_sg_last(struct scatterlist *sg, int len, argument 53 qm_sg_ptr = sg_to_qm_sg(sg, len, qm_sg_ptr, offset);
|
H A D | sg_sw_sec4.h | 48 sg_to_sec4_sg(struct scatterlist *sg, int len, argument 54 ent_len = min_t(int, sg_dma_len(sg), len); 56 dma_to_sec4_sg_one(sec4_sg_ptr, sg_dma_address(sg), ent_len, 59 sg = sg_next(sg); 77 static inline void sg_to_sec4_sg_last(struct scatterlist *sg, int len, argument 81 sec4_sg_ptr = sg_to_sec4_sg(sg, len, sec4_sg_ptr, offset);
|
H A D | sg_sw_qm.h | 57 sg_to_qm_sg(struct scatterlist *sg, int len, argument 63 ent_len = min_t(int, sg_dma_len(sg), len); 65 dma_to_qm_sg_one(qm_sg_ptr, sg_dma_address(sg), ent_len, 68 sg = sg_next(sg); 78 static inline void sg_to_qm_sg_last(struct scatterlist *sg, int len, argument 81 qm_sg_ptr = sg_to_qm_sg(sg, len, qm_sg_ptr, offset);
|
/linux-master/tools/testing/selftests/bpf/progs/ |
H A D | loop6.c | 35 #define sg_is_chain(sg) ((sg)->page_link & SG_CHAIN) 36 #define sg_is_last(sg) ((sg)->page_link & SG_END) 37 #define sg_chain_ptr(sg) \ 38 ((struct scatterlist *) ((sg)->page_link & ~(SG_CHAIN | SG_END))) 42 struct scatterlist sg; local 44 bpf_probe_read_kernel(&sg, sizeof(sg), sgp); 45 if (sg_is_last(&sg)) [all...] |
/linux-master/include/crypto/ |
H A D | scatterwalk.h | 21 struct scatterlist *sg, int num) 23 if (sg) 24 sg_chain(head, num, sg); 31 unsigned int len = walk->sg->offset + walk->sg->length - walk->offset; 51 return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); 60 struct scatterlist *sg) 62 walk->sg = sg; 63 walk->offset = sg 20 scatterwalk_crypto_chain(struct scatterlist *head, struct scatterlist *sg, int num) argument 59 scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg) argument [all...] |
/linux-master/net/mac80211/ |
H A D | aead_api.c | 22 struct scatterlist sg[3]; local 35 sg_init_table(sg, 3); 36 sg_set_buf(&sg[0], __aad, aad_len); 37 sg_set_buf(&sg[1], data, data_len); 38 sg_set_buf(&sg[2], mic, mic_len); 41 aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); 42 aead_request_set_ad(aead_req, sg[0].length); 54 struct scatterlist sg[3]; local 70 sg_init_table(sg, [all...] |
H A D | aes_gmac.c | 20 struct scatterlist sg[5]; local 41 sg_init_table(sg, 5); 42 sg_set_buf(&sg[0], __aad, GMAC_AAD_LEN); 43 sg_set_buf(&sg[1], zero, 8); 44 sg_set_buf(&sg[2], data + 8, data_len - 8 - GMAC_MIC_LEN); 45 sg_set_buf(&sg[3], zero, GMAC_MIC_LEN); 46 sg_set_buf(&sg[4], mic, GMAC_MIC_LEN); 48 sg_init_table(sg, 4); 49 sg_set_buf(&sg[0], __aad, GMAC_AAD_LEN); 50 sg_set_buf(&sg[ [all...] |
/linux-master/drivers/gpu/drm/i915/ |
H A D | i915_scatterlist.h | 50 static inline int __sg_page_count(const struct scatterlist *sg) argument 52 return sg->length >> PAGE_SHIFT; 55 static inline int __sg_dma_page_count(const struct scatterlist *sg) argument 57 return sg_dma_len(sg) >> PAGE_SHIFT; 60 static inline struct scatterlist *____sg_next(struct scatterlist *sg) argument 62 ++sg; 63 if (unlikely(sg_is_chain(sg))) 64 sg = sg_chain_ptr(sg); 65 return sg; 77 __sg_next(struct scatterlist *sg) argument 126 i915_sg_dma_sizes(struct scatterlist *sg) argument [all...] |
H A D | i915_scatterlist.c | 18 struct scatterlist *sg, *new_sg; local 28 for_each_sg(orig_st->sgl, sg, orig_st->nents, i) { 29 sg_set_page(new_sg, sg_page(sg), sg->length, 0); 30 sg_dma_address(new_sg) = sg_dma_address(sg); 31 sg_dma_len(new_sg) = sg_dma_len(sg); 70 * @region_start: An offset to add to the dma addresses of the sg list. 71 * @page_alignment: Required page alignment for each sg entry. Power of two. 89 struct scatterlist *sg; local 112 sg 174 struct scatterlist *sg; local [all...] |
/linux-master/drivers/crypto/qce/ |
H A D | dma.c | 53 struct scatterlist *sg = sgt->sgl, *sg_last = NULL; local 56 while (sg) { 57 if (!sg_page(sg)) 59 sg = sg_next(sg); 62 if (!sg) 65 while (new_sgl && sg && max_len) { 67 sg_set_page(sg, sg_page(new_sgl), new_len, new_sgl->offset); 68 sg_last = sg; 69 sg 77 qce_dma_prep_sg(struct dma_chan *chan, struct scatterlist *sg, int nents, unsigned long flags, enum dma_transfer_direction dir, dma_async_tx_callback cb, void *cb_param) argument [all...] |
/linux-master/drivers/media/pci/tw68/ |
H A D | tw68-risc.c | 38 struct scatterlist *sg; local 54 sg = sglist; 57 while (offset && offset >= sg_dma_len(sg)) { 58 offset -= sg_dma_len(sg); 59 sg = sg_next(sg); 61 if (bpl <= sg_dma_len(sg) - offset) { 65 *(rp++) = cpu_to_le32(sg_dma_address(sg) + offset); 76 done = (sg_dma_len(sg) - offset); 80 *(rp++) = cpu_to_le32(sg_dma_address(sg) [all...] |
/linux-master/drivers/crypto/ |
H A D | omap-crypto.c | 17 struct scatterlist **sg, 20 int n = sg_nents(*sg); 24 new_sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); 33 while (*sg && total) { 34 int len = (*sg)->length; 41 sg_set_page(tmp, sg_page(*sg), len, (*sg)->offset); 47 *sg = sg_next(*sg); 50 *sg 16 omap_crypto_copy_sg_lists(int total, int bs, struct scatterlist **sg, struct scatterlist *new_sg, u16 flags) argument 55 omap_crypto_copy_sgs(int total, int bs, struct scatterlist **sg, struct scatterlist *new_sg, u16 flags) argument 88 omap_crypto_check_sg(struct scatterlist *sg, int total, int bs, u16 flags) argument 125 omap_crypto_align_sg(struct scatterlist **sg, int total, int bs, struct scatterlist *new_sg, u16 flags, u8 flags_shift, unsigned long *dd_flags) argument 197 omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig, int offset, int len, u8 flags_shift, unsigned long flags) argument [all...] |
H A D | omap-crypto.h | 27 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs, 30 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
|
/linux-master/drivers/gpu/drm/i915/gem/ |
H A D | i915_gem_internal.c | 22 struct scatterlist *sg; local 24 for (sg = st->sgl; sg; sg = __sg_next(sg)) { 25 if (sg_page(sg)) 26 __free_pages(sg_page(sg), get_order(sg->length)); 37 struct scatterlist *sg; local 67 sg [all...] |
/linux-master/drivers/gpu/drm/i915/gem/selftests/ |
H A D | huge_gem_object.c | 33 struct scatterlist *sg, *src, *end; local 50 sg = pages->sgl; 56 sg_mark_end(sg); 60 sg_set_page(sg, page, PAGE_SIZE, 0); 61 sg = __sg_next(sg); 64 for (end = sg, src = pages->sgl; sg; sg = __sg_next(sg)) { [all...] |
/linux-master/include/soc/fsl/ |
H A D | dpaa2-fd.h | 284 * @addr: address of the sg entry 285 * @len: length in this sg entry 306 * @sg: the given scatter-gathering object 310 static inline dma_addr_t dpaa2_sg_get_addr(const struct dpaa2_sg_entry *sg) argument 312 return (dma_addr_t)le64_to_cpu(sg->addr); 317 * @sg: the given scatter-gathering object 320 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) argument 322 sg->addr = cpu_to_le64(addr); 325 static inline bool dpaa2_sg_short_len(const struct dpaa2_sg_entry *sg) argument 327 return !!((le16_to_cpu(sg 337 dpaa2_sg_get_len(const struct dpaa2_sg_entry *sg) argument 350 dpaa2_sg_set_len(struct dpaa2_sg_entry *sg, u32 len) argument 361 dpaa2_sg_get_offset(const struct dpaa2_sg_entry *sg) argument 371 dpaa2_sg_set_offset(struct dpaa2_sg_entry *sg, u16 offset) argument 385 dpaa2_sg_get_format(const struct dpaa2_sg_entry *sg) argument 396 dpaa2_sg_set_format(struct dpaa2_sg_entry *sg, enum dpaa2_sg_format format) argument 409 dpaa2_sg_get_bpid(const struct dpaa2_sg_entry *sg) argument 419 dpaa2_sg_set_bpid(struct dpaa2_sg_entry *sg, u16 bpid) argument 431 dpaa2_sg_is_final(const struct dpaa2_sg_entry *sg) argument 441 dpaa2_sg_set_final(struct dpaa2_sg_entry *sg, bool final) argument [all...] |
/linux-master/drivers/usb/storage/ |
H A D | protocol.c | 126 struct scatterlist *sg = *sgptr; local 130 if (sg) 131 nents = sg_nents(sg); 133 sg = scsi_sglist(srb); 135 sg_miter_start(&miter, sg, nents, dir == FROM_XFER_BUF ? 150 if (*offset + len < miter.piter.sg->length) { 152 *sgptr = miter.piter.sg; 155 *sgptr = sg_next(miter.piter.sg); 173 struct scatterlist *sg = NULL; local 176 buflen = usb_stor_access_xfer_buf(buffer, buflen, srb, &sg, [all...] |
/linux-master/drivers/target/iscsi/cxgbit/ |
H A D | cxgbit_ddp.c | 13 struct scatterlist *sg = sg_pp ? *sg_pp : NULL; local 21 if (sg) { 22 addr = sg_dma_address(sg); 23 len = sg_dma_len(sg); 27 if (sg) { 30 if (offset == (len + sg->offset)) { 32 sg = sg_next(sg); 33 if (sg) { 34 addr = sg_dma_address(sg); 133 struct scatterlist *sg = ttinfo->sgl; local 152 cxgbit_ddp_sgl_check(struct scatterlist *sg, unsigned int nents) argument [all...] |