| /kernel/linux/linux-5.10/tools/virtio/linux/ |
| D | scatterlist.h | 15 #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)) 21 * sg_assign_page - Assign a given page to an SG entry 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) 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() [all …]
|
| /kernel/linux/linux-6.6/tools/virtio/linux/ |
| D | scatterlist.h | 15 #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)) 21 * sg_assign_page - Assign a given page to an SG entry 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) 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() [all …]
|
| /kernel/linux/linux-6.6/include/linux/ |
| D | scatterlist.h | 26 * to get bus addresses of each of the SG entries and their lengths. 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) argument 34 #define sg_dma_len(sg) ((sg)->dma_length) argument 36 #define sg_dma_len(sg) ((sg)->length) argument 52 * Notes on SG table design. 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 59 * table list. Otherwise the next entry is at sg + 1. [all …]
|
| /kernel/linux/linux-5.10/include/linux/ |
| D | scatterlist.h | 29 * to get bus addresses of each of the SG entries and their lengths. 30 * You should only work with the number of sg entries dma_map_sg 31 * returns, or alternatively stop on the first sg_dma_len(sg) which 34 #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 49 * Notes on SG table design. 52 * the page pointer AND encode information about the sg table as well. The two 55 * If bit 0 is set, then the page_link contains a pointer to the next sg 56 * table list. Otherwise the next entry is at sg + 1. [all …]
|
| /kernel/linux/linux-5.10/Documentation/scsi/ |
| D | scsi-generic.rst | 4 Notes on Linux SCSI Generic (sg) driver 11 The SCSI Generic driver (sg) is one of the four "high level" SCSI device 12 drivers along with sd, st and sr (disk, tape and CDROM respectively). Sg 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). 34 Sg driver documentation [all …]
|
| /kernel/linux/linux-5.10/drivers/ata/ |
| D | sata_gemini.c | 126 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-6.6/drivers/ata/ |
| D | sata_gemini.c | 125 bool gemini_sata_bridge_enabled(struct sata_gemini *sg, bool is_ata1) in gemini_sata_bridge_enabled() argument 127 if (!sg->sata_bridge) in gemini_sata_bridge_enabled() 133 if ((sg->muxmode == GEMINI_MUXMODE_2) && in gemini_sata_bridge_enabled() 136 if ((sg->muxmode == GEMINI_MUXMODE_3) && in gemini_sata_bridge_enabled() 144 enum gemini_muxmode gemini_sata_get_muxmode(struct sata_gemini *sg) in gemini_sata_get_muxmode() argument 146 return sg->muxmode; in gemini_sata_get_muxmode() 150 static int gemini_sata_setup_bridge(struct sata_gemini *sg, in gemini_sata_setup_bridge() argument 160 if (sg->muxmode == GEMINI_MUXMODE_2) in gemini_sata_setup_bridge() 162 writel(val, sg->base + GEMINI_SATA0_CTRL); in gemini_sata_setup_bridge() 166 if (sg->muxmode == GEMINI_MUXMODE_3) in gemini_sata_setup_bridge() [all …]
|
| /kernel/linux/linux-6.6/Documentation/scsi/ |
| D | scsi-generic.rst | 4 SCSI Generic (sg) driver 11 The SCSI Generic driver (sg) is one of the four "high level" SCSI device 12 drivers along with sd, st and sr (disk, tape and CD-ROM respectively). Sg 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). 34 Sg driver documentation [all …]
|
| /kernel/linux/linux-5.10/lib/ |
| D | scatterlist.c | 15 * @sg: The current sg entry 18 * Usually the next entry will be @sg@ + 1, but if this sg element is part 23 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() 38 * @sg: The scatterlist 41 * Allows to know how many entries are in sg, taking into acount [all …]
|
| /kernel/linux/linux-6.6/drivers/clk/sprd/ |
| D | gate.c | 13 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/drivers/clk/sprd/ |
| D | gate.c | 13 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-6.6/lib/ |
| D | scatterlist.c | 17 * @sg: The current sg entry 20 * Usually the next entry will be @sg@ + 1, but if this sg element is part 25 struct scatterlist *sg_next(struct scatterlist *sg) in sg_next() argument 27 if (sg_is_last(sg)) in sg_next() 30 sg++; in sg_next() 31 if (unlikely(sg_is_chain(sg))) in sg_next() 32 sg = sg_chain_ptr(sg); in sg_next() 34 return sg; in sg_next() 40 * @sg: The scatterlist 43 * Allows to know how many entries are in sg, taking into account [all …]
|
| /kernel/linux/linux-6.6/drivers/gpu/drm/i915/ |
| D | i915_scatterlist.c | 18 struct scatterlist *sg, *new_sg; in i915_sg_trim() local 28 for_each_sg(orig_st->sgl, sg, orig_st->nents, i) { in i915_sg_trim() 29 sg_set_page(new_sg, sg_page(sg), sg->length, 0); in i915_sg_trim() 30 sg_dma_address(new_sg) = sg_dma_address(sg); in i915_sg_trim() 31 sg_dma_len(new_sg) = sg_dma_len(sg); in i915_sg_trim() 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; in i915_rsgt_from_mm_node() local 112 sg = st->sgl; in i915_rsgt_from_mm_node() 121 if (offset != prev_end || sg->length >= max_segment) { in i915_rsgt_from_mm_node() [all …]
|
| D | i915_scatterlist.h | 50 static inline int __sg_page_count(const struct scatterlist *sg) in __sg_page_count() argument 52 return sg->length >> PAGE_SHIFT; in __sg_page_count() 55 static inline int __sg_dma_page_count(const struct scatterlist *sg) in __sg_dma_page_count() argument 57 return sg_dma_len(sg) >> PAGE_SHIFT; in __sg_dma_page_count() 60 static inline struct scatterlist *____sg_next(struct scatterlist *sg) in ____sg_next() argument 62 ++sg; in ____sg_next() 63 if (unlikely(sg_is_chain(sg))) in ____sg_next() 64 sg = sg_chain_ptr(sg); in ____sg_next() 65 return sg; in ____sg_next() 70 * @sg: The current sg entry [all …]
|
| /kernel/linux/linux-6.6/drivers/crypto/ |
| D | omap-crypto.c | 17 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/drivers/crypto/ |
| D | omap-crypto.c | 17 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-6.6/include/soc/fsl/ |
| D | dpaa2-fd.h | 284 * @addr: address of the sg entry 285 * @len: length in this sg entry 302 /* Accessors for SG entry fields */ 305 * dpaa2_sg_get_addr() - Get the address from 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) in dpaa2_sg_get_addr() argument 312 return (dma_addr_t)le64_to_cpu(sg->addr); in dpaa2_sg_get_addr() 316 * dpaa2_sg_set_addr() - Set the address in SG entry 317 * @sg: the given scatter-gathering object 320 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) in dpaa2_sg_set_addr() argument [all …]
|
| /kernel/linux/linux-5.10/include/soc/fsl/ |
| D | dpaa2-fd.h | 283 * @addr: address of the sg entry 284 * @len: length in this sg entry 301 /* Accessors for SG entry fields */ 304 * dpaa2_sg_get_addr() - Get the address from SG entry 305 * @sg: the given scatter-gathering object 309 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() 315 * dpaa2_sg_set_addr() - Set the address in SG entry 316 * @sg: the given scatter-gathering object 319 static inline void dpaa2_sg_set_addr(struct dpaa2_sg_entry *sg, dma_addr_t addr) in dpaa2_sg_set_addr() argument [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/i915/ |
| D | i915_scatterlist.h | 42 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() 57 * @sg: The current sg entry 61 * element in the array (@sg@+1). If that's a chain pointer, follow it; 64 static inline struct scatterlist *__sg_next(struct scatterlist *sg) in __sg_next() argument [all …]
|
| /kernel/linux/linux-5.10/net/core/ |
| D | skmsg.c | 14 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/s390/mm/ |
| D | gmap.c | 241 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() 957 * Expected to be called with sg->mm->mmap_lock in read and 1003 * Expected to be called with sg->mm->mmap_lock in read 1039 * Called with sg->mm->mmap_lock in read. 1172 * @sg: pointer to the shadow guest address space structure 1176 * Called with the sg->guest_table_lock 1178 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, in gmap_insert_rmap() argument [all …]
|
| /kernel/linux/linux-6.6/arch/s390/mm/ |
| D | gmap.c | 252 struct gmap *sg, *next; in gmap_remove() local 258 list_for_each_entry_safe(sg, next, &gmap->children, list) { in gmap_remove() 259 list_del(&sg->list); in gmap_remove() 260 gmap_put(sg); in gmap_remove() 973 * Expected to be called with sg->mm->mmap_lock in read and 1019 * Expected to be called with sg->mm->mmap_lock in read 1055 * Called with sg->mm->mmap_lock in read. 1188 * @sg: pointer to the shadow guest address space structure 1192 * Called with the sg->guest_table_lock 1194 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, in gmap_insert_rmap() argument [all …]
|
| /kernel/linux/linux-5.10/drivers/crypto/allwinner/sun8i-ss/ |
| D | sun8i-ss-cipher.c | 27 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/net/ethernet/marvell/octeontx2/nic/ |
| D | otx2_txrx.c | 67 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-6.6/include/crypto/ |
| D | scatterwalk.h | 21 struct scatterlist *sg, int num) in scatterwalk_crypto_chain() argument 23 if (sg) in scatterwalk_crypto_chain() 24 sg_chain(head, num, sg); in scatterwalk_crypto_chain() 31 unsigned int len = walk->sg->offset + walk->sg->length - walk->offset; in scatterwalk_pagelen() 51 return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); in scatterwalk_page() 60 struct scatterlist *sg) in scatterwalk_start() argument 62 walk->sg = sg; in scatterwalk_start() 63 walk->offset = sg->offset; in scatterwalk_start() 78 page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT); in scatterwalk_pagedone() 82 if (more && walk->offset >= walk->sg->offset + walk->sg->length) in scatterwalk_pagedone() [all …]
|