/linux/include/linux/ |
H A 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 …]
|
/linux/tools/virtio/linux/ |
H A 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 …]
|
/linux/Documentation/scsi/ |
H A 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 …]
|
/linux/drivers/clk/sprd/ |
H A 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 …]
|
/linux/drivers/crypto/ |
H A 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 …]
|
/linux/lib/ |
H A D | scatterlist.c | 18 * @sg: The scatterlist 21 * Allows to know how many entries are in sg, taking into account 25 int sg_nents(struct scatterlist *sg) in sg_nents() argument 28 for (nents = 0; sg; sg = sg_next(sg)) in sg_nents() 37 * @sg: The scatterlist 41 * Determines the number of entries in sg that are required to meet 45 * the number of sg entries needed, negative error on failure 48 int sg_nents_for_len(struct scatterlist *sg, u64 len) in sg_nents_for_len() argument 56 for (nents = 0, total = 0; sg; sg = sg_next(sg)) { in sg_nents_for_len() 58 total += sg->length; in sg_nents_for_len() [all …]
|
/linux/include/crypto/ |
H A D | scatterwalk.h | 28 struct scatterlist *sg; member 74 struct scatterlist *sg, int num) in scatterwalk_crypto_chain() argument 76 if (sg) in scatterwalk_crypto_chain() 77 sg_chain(head, num, sg); in scatterwalk_crypto_chain() 83 struct scatterlist *sg) in scatterwalk_start() argument 85 walk->sg = sg; in scatterwalk_start() 86 walk->offset = sg->offset; in scatterwalk_start() 90 * This is equivalent to scatterwalk_start(walk, sg) followed by 94 struct scatterlist *sg, in scatterwalk_start_at_pos() argument 97 while (pos > sg->length) { in scatterwalk_start_at_pos() [all …]
|
/linux/include/soc/fsl/ |
H A 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 …]
|
/linux/arch/s390/mm/ |
H A D | gmap.c | 279 struct gmap *sg, *next; in gmap_remove() local 285 list_for_each_entry_safe(sg, next, &gmap->children, list) { in gmap_remove() 286 list_del(&sg->list); in gmap_remove() 287 gmap_put(sg); in gmap_remove() 868 * Expected to be called with sg->mm->mmap_lock in read and 914 * Expected to be called with sg->mm->mmap_lock in read 954 * Context: Called with sg->mm->mmap_lock in read. 1037 * @sg: pointer to the shadow guest address space structure 1041 * Called with the sg->guest_table_lock 1043 static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, in gmap_insert_rmap() argument [all …]
|
/linux/drivers/dma/ |
H A D | dma-axi-dmac.c | 139 struct axi_dmac_sg sg[] __counted_by(num_sgs); 232 struct axi_dmac_sg *sg; in axi_dmac_start_transfer() local 251 sg = &desc->sg[desc->num_submitted]; in axi_dmac_start_transfer() 254 if (sg->hw->id != AXI_DMAC_SG_UNUSED) { in axi_dmac_start_transfer() 255 sg->schedule_when_free = true; in axi_dmac_start_transfer() 272 sg->hw->id = axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID); in axi_dmac_start_transfer() 276 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS, sg->hw->dest_addr); in axi_dmac_start_transfer() 277 axi_dmac_write(dmac, AXI_DMAC_REG_DEST_STRIDE, sg->hw->dst_stride); in axi_dmac_start_transfer() 281 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS, sg->hw->src_addr); in axi_dmac_start_transfer() 282 axi_dmac_write(dmac, AXI_DMAC_REG_SRC_STRIDE, sg->hw->src_stride); in axi_dmac_start_transfer() [all …]
|
/linux/net/mac80211/ |
H A D | aead_api.c | 22 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 …]
|
H A D | aes_gmac.c | 20 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 …]
|
/linux/net/core/ |
H A D | skmsg.c | 15 if (msg->sg.end > msg->sg.start && in sk_msg_try_coalesce_ok() 16 elem_first_coalesce < msg->sg.end) in sk_msg_try_coalesce_ok() 19 if (msg->sg.end < msg->sg.start && in sk_msg_try_coalesce_ok() 20 (elem_first_coalesce > msg->sg.start || in sk_msg_try_coalesce_ok() 21 elem_first_coalesce < msg->sg.end)) in sk_msg_try_coalesce_ok() 31 u32 osize = msg->sg.size; in sk_msg_alloc() 34 len -= msg->sg.size; in sk_msg_alloc() 52 i = msg->sg.end; in sk_msg_alloc() 54 sge = &msg->sg.data[i]; in sk_msg_alloc() 66 sge = &msg->sg.data[msg->sg.end]; in sk_msg_alloc() [all …]
|
/linux/drivers/crypto/gemini/ |
H A D | sl3516-ce-cipher.c | 32 struct scatterlist *sg; in sl3516_ce_need_fallback() local 41 * Note: TX need one control desc for each SG in sl3516_ce_need_fallback() 53 sg = areq->src; in sl3516_ce_need_fallback() 54 while (sg) { in sl3516_ce_need_fallback() 55 if ((sg->length % 16) != 0) { in sl3516_ce_need_fallback() 59 if ((sg_dma_len(sg) % 16) != 0) { in sl3516_ce_need_fallback() 63 if (!IS_ALIGNED(sg->offset, 16)) { in sl3516_ce_need_fallback() 67 sg = sg_next(sg); in sl3516_ce_need_fallback() 69 sg = areq->dst; in sl3516_ce_need_fallback() 70 while (sg) { in sl3516_ce_need_fallback() [all …]
|
/linux/arch/s390/kvm/ |
H A D | gmap-vsie.c | 40 struct gmap *sg; in gmap_find_shadow() local 43 list_for_each_entry(sg, &parent->children, list) { in gmap_find_shadow() 44 if (!gmap_shadow_valid(sg, asce, edat_level)) in gmap_find_shadow() 46 if (!sg->initialized) in gmap_find_shadow() 48 refcount_inc(&sg->ref_count); in gmap_find_shadow() 49 return sg; in gmap_find_shadow() 71 struct gmap *sg, *new; in gmap_shadow() local 79 sg = gmap_find_shadow(parent, asce, edat_level); in gmap_shadow() 81 if (sg) in gmap_shadow() 82 return sg; in gmap_shadow() [all …]
|
/linux/drivers/net/ethernet/marvell/octeontx2/nic/ |
H A D | otx2_txrx.c | 111 struct sg_list *sg; in otx2_xdp_snd_pkt_handler() local 113 sg = &sq->sg[snd_comp->sqe_id]; in otx2_xdp_snd_pkt_handler() 114 if (sg->flags & OTX2_AF_XDP_FRAME) { in otx2_xdp_snd_pkt_handler() 119 if (sg->flags & OTX2_XDP_REDIRECT) in otx2_xdp_snd_pkt_handler() 120 otx2_dma_unmap_page(pfvf, sg->dma_addr[0], sg->size[0], DMA_TO_DEVICE); in otx2_xdp_snd_pkt_handler() 121 xdp_return_frame((struct xdp_frame *)sg->skb); in otx2_xdp_snd_pkt_handler() 122 sg->skb = (u64)NULL; in otx2_xdp_snd_pkt_handler() 135 struct sg_list *sg; in otx2_snd_pkt_handler() local 143 sg = &sq->sg[snd_comp->sqe_id]; in otx2_snd_pkt_handler() 144 skb = (struct sk_buff *)sg->skb; in otx2_snd_pkt_handler() [all …]
|
/linux/drivers/target/iscsi/cxgbit/ |
H A D | cxgbit_ddp.c | 13 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 …]
|
/linux/drivers/net/ovpn/ |
H A D | crypto_aead.c | 45 struct scatterlist *sg; in ovpn_aead_encrypt() local 74 /* sg may be required by async crypto */ in ovpn_aead_encrypt() 75 ovpn_skb_cb(skb)->sg = kmalloc(sizeof(*ovpn_skb_cb(skb)->sg) * in ovpn_aead_encrypt() 77 if (unlikely(!ovpn_skb_cb(skb)->sg)) in ovpn_aead_encrypt() 80 sg = ovpn_skb_cb(skb)->sg; in ovpn_aead_encrypt() 82 /* sg table: in ovpn_aead_encrypt() 87 sg_init_table(sg, nfrags + 2); in ovpn_aead_encrypt() 90 ret = skb_to_sgvec_nomark(skb, sg + 1, 0, skb->len); in ovpn_aead_encrypt() 93 "encrypt: cannot map skb to sg: %d\n", ret); in ovpn_aead_encrypt() 99 sg_set_buf(sg + ret + 1, skb->data, tag_size); in ovpn_aead_encrypt() [all …]
|
/linux/samples/kfifo/ |
H A D | dma-example.c | 28 struct scatterlist sg[10]; in example_init() local 60 * We need two different SG entries: one for the free space area at the in example_init() 64 sg_init_table(sg, ARRAY_SIZE(sg)); in example_init() 65 nents = kfifo_dma_in_prepare(&fifo, sg, ARRAY_SIZE(sg), FIFO_SIZE); in example_init() 77 "sg[%d] -> " in example_init() 79 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init() 81 if (sg_is_last(&sg[i])) in example_init() 95 nents = kfifo_dma_out_prepare(&fifo, sg, ARRAY_SIZE(sg), 8); in example_init() 106 "sg[%d] -> " in example_init() 108 i, sg_page(&sg[i]), sg[i].offset, sg[i].length); in example_init() [all …]
|
/linux/arch/powerpc/platforms/powernv/ |
H A D | opal-sensor-groups.c | 27 struct attribute_group sg; member 129 static int __init 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 …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | loop6.c | 35 #define sg_is_chain(sg) ((sg)->page_link & SG_CHAIN) argument 36 #define sg_is_last(sg) ((sg)->page_link & SG_END) argument 37 #define sg_chain_ptr(sg) \ argument 38 ((struct scatterlist *) ((sg)->page_link & ~(SG_CHAIN | SG_END))) 42 struct scatterlist sg; in __sg_next() local 44 bpf_probe_read_kernel(&sg, sizeof(sg), sgp); in __sg_next() 45 if (sg_is_last(&sg)) in __sg_next() 50 bpf_probe_read_kernel(&sg, sizeof(sg), sgp); in __sg_next() 51 if (sg_is_chain(&sg)) in __sg_next() 52 sgp = sg_chain_ptr(&sg); in __sg_next()
|
/linux/arch/alpha/kernel/ |
H A D | pci_iommu.c | 265 assume it doesn't support sg mapping, and, since we tried to in pci_map_single_1() 268 printk_once(KERN_WARNING "pci_map_single: no HW sg\n"); in pci_map_single_1() 295 DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %ps\n", in pci_map_single_1() 401 DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %ps\n", in alpha_pci_unmap_page() 427 with vmalloc and sg if we can't find contiguous memory. */ in alpha_pci_alloc_coherent() 476 #define SG_ENT_VIRT_ADDRESS(SG) (sg_virt((SG))) argument 477 #define SG_ENT_PHYS_ADDRESS(SG) __pa(SG_ENT_VIRT_ADDRESS(SG)) argument 480 sg_classify(struct device *dev, struct scatterlist *sg, struct scatterlist *end, in sg_classify() argument 488 leader = sg; in sg_classify() 493 /* we will not marge sg without device. */ in sg_classify() [all …]
|
/linux/drivers/crypto/qce/ |
H A D | dma.c | 57 struct scatterlist *sg = sgt->sgl, *sg_last = NULL; in qce_sgtable_add() local 60 while (sg) { in qce_sgtable_add() 61 if (!sg_page(sg)) in qce_sgtable_add() 63 sg = sg_next(sg); in qce_sgtable_add() 66 if (!sg) in qce_sgtable_add() 69 while (new_sgl && sg && max_len) { in qce_sgtable_add() 71 sg_set_page(sg, sg_page(new_sgl), new_len, new_sgl->offset); in qce_sgtable_add() 72 sg_last = sg; in qce_sgtable_add() 73 sg = sg_next(sg); in qce_sgtable_add() 81 static int qce_dma_prep_sg(struct dma_chan *chan, struct scatterlist *sg, in qce_dma_prep_sg() argument [all …]
|
/linux/drivers/crypto/cavium/nitrox/ |
H A D | nitrox_req.h | 453 * struct sglist_component - SG list component format 469 * strutct nitrox_sgtable - SG list information 474 * @sg: crypto request buffer. 482 struct scatterlist *sg; member 506 * @in: SG table for input 507 * @out SG table for output 566 * create_single_sg - Point SG entry to the data 567 * @sg: Destination SG list 571 * Returns next free entry in the destination SG list 573 static inline struct scatterlist *create_single_sg(struct scatterlist *sg, in create_single_sg() argument [all …]
|
/linux/drivers/gpu/drm/i915/gem/ |
H A D | i915_gem_internal.c | 21 struct scatterlist *sg; in internal_free_pages() local 23 for (sg = st->sgl; sg; sg = __sg_next(sg)) { in internal_free_pages() 24 if (sg_page(sg)) in internal_free_pages() 25 __free_pages(sg_page(sg), get_order(sg->length)); in internal_free_pages() 36 struct scatterlist *sg; in i915_gem_object_get_pages_internal() local 66 sg = st->sgl; in i915_gem_object_get_pages_internal() 85 sg_set_page(sg, page, PAGE_SIZE << order, 0); in i915_gem_object_get_pages_internal() 90 sg_mark_end(sg); in i915_gem_object_get_pages_internal() 94 sg = __sg_next(sg); in i915_gem_object_get_pages_internal() 98 /* Failed to dma-map try again with single page sg segments */ in i915_gem_object_get_pages_internal() [all …]
|