Home
last modified time | relevance | path

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

1234567

/freebsd/sys/compat/linuxkpi/common/include/linux/
H A Dscatterlist.h65 struct scatterlist *sg;
86 #define sg_is_chain(sg) ((sg)->page_link & SG_PAGE_LINK_CHAIN)
87 #define sg_is_last(sg) ((sg)->page_link & SG_PAGE_LINK_LAST)
88 #define sg_chain_ptr(sg) \ argument
89 ((struct scatterlist *) ((sg)->page_link & ~SG_PAGE_LINK_MASK)) argument
91 #define sg_dma_address(sg) (sg)->dma_address
92 #define sg_dma_len(sg) (s
62 struct scatterlist *sg; global() member
83 sg_is_chain(sg) global() argument
84 sg_is_last(sg) global() argument
85 sg_chain_ptr(sg) global() argument
97 for_each_sg(sglist,sg,sgmax,iter) global() argument
100 for_each_sgtable_sg(sgt,sg,i) global() argument
106 for_each_sgtable_dma_sg(sgt,sg,iter) global() argument
116 sg_assign_page(struct scatterlist * sg,struct page * page) sg_assign_page() argument
124 sg_set_page(struct scatterlist * sg,struct page * page,unsigned int len,unsigned int offset) sg_set_page() argument
133 sg_page(struct scatterlist * sg) sg_page() argument
139 sg_set_buf(struct scatterlist * sg,const void * buf,unsigned int buflen) sg_set_buf() argument
146 sg_next(struct scatterlist * sg) sg_next() argument
157 sg_phys(struct scatterlist * sg) sg_phys() argument
163 sg_virt(struct scatterlist * sg) sg_virt() argument
173 struct scatterlist *sg = &prv[prv_nents - 1]; sg_chain() local
182 sg_mark_end(struct scatterlist * sg) sg_mark_end() argument
189 sg_init_table(struct scatterlist * sg,unsigned int nents) sg_init_table() argument
196 sg_init_one(struct scatterlist * sg,const void * buf,unsigned int buflen) sg_init_one() argument
212 sg_kfree(struct scatterlist * sg,unsigned int nents) sg_kfree() argument
265 struct scatterlist *sg, *prv; __sg_alloc_table() local
449 sg_nents(struct scatterlist * sg) sg_nents() argument
473 struct scatterlist *sg; _sg_iter_next() local
492 sg_page_count(struct scatterlist * sg) sg_page_count() argument
496 sg_dma_page_count(sg) global() argument
629 struct scatterlist *sg; sg_pcopy_to_buffer() local
[all...]
/freebsd/sys/kern/
H A Dsubr_sglist.c63 #define SGLIST_SAVE(sg, sgsave) do { \ argument
64 (sgsave).sg_nseg = (sg)->sg_nseg; \
66 (sgsave).ss_len = (sg)->sg_segs[(sgsave).sg_nseg - 1].ss_len; \
71 #define SGLIST_RESTORE(sg, sgsave) do { \ argument
72 (sg)->sg_nseg = (sgsave).sg_nseg; \
74 (sg)->sg_segs[(sgsave).sg_nseg - 1].ss_len = (sgsave).ss_len; \
83 _sglist_append_range(struct sglist *sg, struct sglist_seg **ssp, in _sglist_append_range() argument
92 if (sg->sg_nseg == sg->sg_maxseg) in _sglist_append_range()
97 sg->sg_nseg++; in _sglist_append_range()
108 _sglist_append_buf(struct sglist *sg, void *buf, size_t len, pmap_t pmap, in _sglist_append_buf() argument
[all …]
H A Dtty_compat.c101 struct sgttyb *sg = (struct sgttyb *)data; in ttsetcompat() local
104 if ((speed = sg->sg_ispeed) > MAX_SPEED || speed < 0) in ttsetcompat()
111 if ((speed = sg->sg_ospeed) > MAX_SPEED || speed < 0) in ttsetcompat()
118 term->c_cc[VERASE] = sg->sg_erase; in ttsetcompat()
119 term->c_cc[VKILL] = sg->sg_kill; in ttsetcompat()
121 (sg->sg_flags&0xffff); in ttsetcompat()
199 struct sgttyb *sg = (struct sgttyb *)data; in tty_ioctl_compat() local
202 sg->sg_ospeed = ttcompatspeedtab(tp->t_termios.c_ospeed, in tty_ioctl_compat()
205 sg->sg_ispeed = sg->sg_ospeed; in tty_ioctl_compat()
207 sg->sg_ispeed = ttcompatspeedtab(tp->t_termios.c_ispeed, in tty_ioctl_compat()
[all …]
/freebsd/sys/sys/
H A Dsglist.h62 sglist_init(struct sglist *sg, u_short maxsegs, struct sglist_seg *segs) in sglist_init() argument
65 sg->sg_segs = segs; in sglist_init()
66 sg->sg_nseg = 0; in sglist_init()
67 sg->sg_maxseg = maxsegs; in sglist_init()
68 refcount_init(&sg->sg_refs, 1); in sglist_init()
72 sglist_reset(struct sglist *sg) in sglist_reset() argument
75 sg->sg_nseg = 0; in sglist_reset()
79 sglist_hold(struct sglist *sg) in sglist_hold() argument
82 refcount_acquire(&sg->sg_refs); in sglist_hold()
83 return (sg); in sglist_hold()
[all …]
/freebsd/sys/dev/xdma/
H A Dxdma_sglist.c52 xchan->sg = malloc(sz, M_XDMA, M_WAITOK | M_ZERO); in xchan_sglist_alloc()
63 free(xchan->sg, M_XDMA); in xchan_sglist_free()
69 xdma_sglist_add(struct xdma_sglist *sg, struct bus_dma_segment *seg, in xdma_sglist_add() argument
78 sg[i].src_width = xr->src_width; in xdma_sglist_add()
79 sg[i].dst_width = xr->dst_width; in xdma_sglist_add()
82 sg[i].src_addr = seg[i].ds_addr; in xdma_sglist_add()
83 sg[i].dst_addr = xr->dst_addr; in xdma_sglist_add()
85 sg[i].src_addr = xr->src_addr; in xdma_sglist_add()
86 sg[i].dst_addr = seg[i].ds_addr; in xdma_sglist_add()
88 sg[i].len = seg[i].ds_len; in xdma_sglist_add()
[all …]
/freebsd/lib/libnetgraph/
H A Dsock.c95 struct sockaddr_ng *const sg = (struct sockaddr_ng *) sbuf; in NgMkSockNode() local
98 strlcpy(sg->sg_data, name, NG_NODESIZ); in NgMkSockNode()
99 sg->sg_family = AF_NETGRAPH; in NgMkSockNode()
100 sg->sg_len = strlen(sg->sg_data) + 1 + NGSA_OVERHEAD; in NgMkSockNode()
101 if (bind(cs, (struct sockaddr *) sg, sg->sg_len) < 0) { in NgMkSockNode()
104 NGLOG("bind(%s)", sg->sg_data); in NgMkSockNode()
140 struct sockaddr_ng *const sg = (struct sockaddr_ng *) sbuf; in NgMkSockNode() local
151 snprintf(sg->sg_data, NG_NODESIZ + 1, "%s:", namebuf); in NgMkSockNode()
152 sg->sg_family = AF_NETGRAPH; in NgMkSockNode()
153 sg->sg_len = strlen(sg->sg_data) + 1 + NGSA_OVERHEAD; in NgMkSockNode()
[all …]
H A Dmsg.c181 struct sockaddr_ng *const sg = (struct sockaddr_ng *) sgbuf; in NgDeliverMsg() local
207 sg->sg_family = AF_NETGRAPH; in NgDeliverMsg()
209 strlcpy(sg->sg_data, path, NG_PATHSIZ); in NgDeliverMsg()
210 sg->sg_len = strlen(sg->sg_data) + 1 + NGSA_OVERHEAD; in NgDeliverMsg()
216 _NgDebugSockaddr(sg); in NgDeliverMsg()
217 _NgDebugMsg(msg, sg->sg_data); in NgDeliverMsg()
222 0, (struct sockaddr *) sg, sg->sg_len) < 0) { in NgDeliverMsg()
225 NGLOG("sendto(%s)", sg->sg_data); in NgDeliverMsg()
264 struct sockaddr_ng *const sg = (struct sockaddr_ng *) sgbuf; in NgRecvMsg() local
269 len = recvfrom(cs, rep, replen, 0, (struct sockaddr *) sg, &sglen); in NgRecvMsg()
[all …]
/freebsd/sys/vm/
H A Dsg_pager.c74 struct sglist *sg; in sg_pager_alloc() local
90 sg = handle; in sg_pager_alloc()
91 for (i = 0; i < sg->sg_nseg; i++) { in sg_pager_alloc()
92 if ((sg->sg_segs[i].ss_paddr % PAGE_SIZE) != 0 || in sg_pager_alloc()
93 (sg->sg_segs[i].ss_len % PAGE_SIZE) != 0) in sg_pager_alloc()
95 npages += sg->sg_segs[i].ss_len / PAGE_SIZE; in sg_pager_alloc()
117 object->handle = sglist_hold(sg); in sg_pager_alloc()
125 struct sglist *sg; in sg_pager_dealloc() local
138 sg = object->handle; in sg_pager_dealloc()
139 sglist_free(sg); in sg_pager_dealloc()
[all …]
/freebsd/sys/geom/linux_lvm/
H A Dg_linux_lvm.c198 struct g_llvm_segment *sg; in g_llvm_start() local
251 sg = lv->lv_firstsg; in g_llvm_start()
252 pv = sg->sg_pv; in g_llvm_start()
253 cb->bio_offset = offset + sg->sg_pvoffset; in g_llvm_start()
261 LIST_FOREACH(sg, &lv->lv_segs, sg_next) { in g_llvm_start()
262 if (chunk_index >= sg->sg_start && in g_llvm_start()
263 chunk_index <= sg->sg_end) { in g_llvm_start()
265 chunk_index -= sg->sg_start; in g_llvm_start()
266 pv = sg->sg_pv; in g_llvm_start()
272 + in_chunk_offset + sg->sg_pvoffset; in g_llvm_start()
[all …]
/freebsd/tests/sys/netgraph/
H A Dsocket.c39 struct sockaddr_ng sg; in ATF_TC_BODY() local
47 ATF_REQUIRE(getsockname(cs, (struct sockaddr *)&sg, &len) == 0); in ATF_TC_BODY()
48 ATF_REQUIRE(strspn(sg.sg_data, "[0123456789abcdef]") >= 3 && in ATF_TC_BODY()
49 sg.sg_data[strspn(sg.sg_data, "[0123456789abcdef]")] == '\0'); in ATF_TC_BODY()
54 ATF_REQUIRE(getsockname(cs, (struct sockaddr *)&sg, &len) == 0); in ATF_TC_BODY()
55 ATF_REQUIRE(strcmp(sg.sg_data, NAME) == 0); in ATF_TC_BODY()
/freebsd/sys/net80211/
H A Dieee80211_superg.h115 struct ieee80211_superg *sg = ic->ic_superg; in ieee80211_ff_age_all() local
117 if (sg != NULL) { in ieee80211_ff_age_all()
118 ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_VO], quanta); in ieee80211_ff_age_all()
119 ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_VI], quanta); in ieee80211_ff_age_all()
120 ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_BE], quanta); in ieee80211_ff_age_all()
121 ieee80211_ff_age(ic, &sg->ff_stageq[WME_AC_BK], quanta); in ieee80211_ff_age_all()
128 struct ieee80211_superg *sg = ic->ic_superg; in ieee80211_ff_flush() local
130 if (sg != NULL) in ieee80211_ff_flush()
131 ieee80211_ff_age(ic, &sg->ff_stageq[ac], 0x7fffffff); in ieee80211_ff_flush()
/freebsd/sys/dev/mlx5/mlx5_ib/
H A Dmlx5_ib_mem.c52 struct scatterlist *sg; in mlx5_ib_cont_pages() local
61 for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) { in mlx5_ib_cont_pages()
62 len = sg_dma_len(sg) >> PAGE_SHIFT; in mlx5_ib_cont_pages()
63 pfn = sg_dma_address(sg) >> PAGE_SHIFT; in mlx5_ib_cont_pages()
137 struct scatterlist *sg; in __mlx5_ib_populate_pas() local
156 for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) { in __mlx5_ib_populate_pas()
157 len = sg_dma_len(sg) >> umem_page_shift; in __mlx5_ib_populate_pas()
158 base = sg_dma_address(sg); in __mlx5_ib_populate_pas()
/freebsd/sys/dev/mlx5/mlx5_fpga/
H A Dmlx5fpga_trans.c217 trans_priv->buf.sg[0].data = header; in mlx5_fpga_trans_exec()
218 trans_priv->buf.sg[0].size = sizeof(trans_priv->header); in mlx5_fpga_trans_exec()
220 trans_priv->buf.sg[1].data = trans->data; in mlx5_fpga_trans_exec()
221 trans_priv->buf.sg[1].size = trans->size; in mlx5_fpga_trans_exec()
252 buf->sg[0].size); in mlx5_fpga_trans_recv()
254 if (buf->sg[0].size < MLX5_ST_SZ_BYTES(fpga_shell_qp_packet)) { in mlx5_fpga_trans_recv()
256 buf->sg[0].size); in mlx5_fpga_trans_recv()
259 payload_len = buf->sg[0].size - MLX5_ST_SZ_BYTES(fpga_shell_qp_packet); in mlx5_fpga_trans_recv()
261 tid = MLX5_GET(fpga_shell_qp_packet, buf->sg[0].data, tid); in mlx5_fpga_trans_recv()
266 type = MLX5_GET(fpga_shell_qp_packet, buf->sg[0].data, type); in mlx5_fpga_trans_recv()
[all …]
H A Dmlx5fpga_conn.c52 if (unlikely(!buf->sg[0].data)) in mlx5_fpga_conn_map_buf()
56 buf->sg[0].dma_addr = dma_map_single(dma_device, buf->sg[0].data, in mlx5_fpga_conn_map_buf()
57 buf->sg[0].size, buf->dma_dir); in mlx5_fpga_conn_map_buf()
58 err = dma_mapping_error(dma_device, buf->sg[0].dma_addr); in mlx5_fpga_conn_map_buf()
65 if (!buf->sg[1].data) in mlx5_fpga_conn_map_buf()
68 buf->sg[1].dma_addr = dma_map_single(dma_device, buf->sg[1].data, in mlx5_fpga_conn_map_buf()
69 buf->sg[1].size, buf->dma_dir); in mlx5_fpga_conn_map_buf()
70 err = dma_mapping_error(dma_device, buf->sg[1].dma_addr); in mlx5_fpga_conn_map_buf()
73 dma_unmap_single(dma_device, buf->sg[0].dma_addr, in mlx5_fpga_conn_map_buf()
74 buf->sg[0].size, buf->dma_dir); in mlx5_fpga_conn_map_buf()
[all …]
/freebsd/sys/contrib/openzfs/module/os/linux/zfs/
H A Dabd_os.c154 #define abd_for_each_sg(abd, sg, n, i) \ argument
155 for_each_sg(ABD_SCATTER(abd).abd_sgl, sg, n, i)
274 struct scatterlist *sg; in abd_alloc_chunks() local
326 sg = table.sgl; in abd_alloc_chunks()
331 sg_set_page(sg, page, sg_size, 0); in abd_alloc_chunks()
335 sg = sg_next(sg); in abd_alloc_chunks()
395 struct scatterlist *sg = NULL; in abd_alloc_chunks() local
411 abd_for_each_sg(abd, sg, nr_pages, i) { in abd_alloc_chunks()
418 sg_set_page(sg, page, PAGESIZE, 0); in abd_alloc_chunks()
446 struct scatterlist *sg = NULL; in abd_free_chunks() local
[all …]
/freebsd/sys/amd64/vmm/
H A Dvmm_mem.c61 struct sglist *sg; in vmm_mmio_alloc() local
63 sg = sglist_alloc(1, M_WAITOK); in vmm_mmio_alloc()
64 error = sglist_append_phys(sg, hpa, len); in vmm_mmio_alloc()
67 obj = vm_pager_allocate(OBJT_SG, sg, len, VM_PROT_RW, 0, NULL); in vmm_mmio_alloc()
102 sglist_free(sg); in vmm_mmio_alloc()
/freebsd/sys/ofed/drivers/infiniband/core/
H A Dib_umem.c53 struct scatterlist *sg; in __ib_umem_release() local
62 for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) { in __ib_umem_release()
64 page = sg_page(sg); in __ib_umem_release()
97 struct scatterlist *sg, *sg_list_start; in ib_umem_get() local
193 for_each_sg(sg_list_start, sg, ret, i) { in ib_umem_get()
194 sg_set_page(sg, page_list[i], PAGE_SIZE, 0); in ib_umem_get()
198 sg_list_start = sg; in ib_umem_get()
307 struct scatterlist *sg; in ib_umem_page_count() local
315 for_each_sg(umem->sg_head.sgl, sg, umem->nmap, i) in ib_umem_page_count()
316 n += sg_dma_len(sg) >> shift; in ib_umem_page_count()
/freebsd/sys/dev/netmap/
H A Dif_vtnet_netmap.h81 struct sglist *sg = txq->vtntx_sg; in vtnet_netmap_txsync() local
98 sglist_reset(sg); // cheap in vtnet_netmap_txsync()
99 err = sglist_append(sg, &txq->vtntx_shrhdr, sc->vtnet_hdr_size); in vtnet_netmap_txsync()
100 err |= sglist_append_phys(sg, paddr + offset, len); in vtnet_netmap_txsync()
103 err = virtqueue_enqueue(vq, /*cookie=*/txq, sg, in vtnet_netmap_txsync()
104 /*readable=*/sg->sg_nseg, in vtnet_netmap_txsync()
169 struct sglist sg = { ss, 0, 0, 2 }; in vtnet_netmap_kring_refill() local
185 sglist_reset(&sg); in vtnet_netmap_kring_refill()
186 err = sglist_append(&sg, &rxq->vtnrx_shrhdr, sc->vtnet_hdr_size); in vtnet_netmap_kring_refill()
187 err |= sglist_append_phys(&sg, paddr + offset, in vtnet_netmap_kring_refill()
[all …]
/freebsd/sys/dev/aac/
H A Daac_disk.c183 struct aac_sg_table *sg; in aac_dump_map_sg() local
188 sg = &bw->SgMap; in aac_dump_map_sg()
190 if (sg != NULL) { in aac_dump_map_sg()
191 sg->SgCount = nsegs; in aac_dump_map_sg()
195 sg->SgEntry[i].SgAddress = segs[i].ds_addr; in aac_dump_map_sg()
196 sg->SgEntry[i].SgByteCount = segs[i].ds_len; in aac_dump_map_sg()
210 struct aac_sg_table64 *sg; in aac_dump_map_sg64() local
215 sg = &bw->SgMap64; in aac_dump_map_sg64()
217 if (sg != NULL) { in aac_dump_map_sg64()
218 sg->SgCount = nsegs; in aac_dump_map_sg64()
[all …]
/freebsd/sys/dev/virtio/scsi/
H A Dvirtio_scsi.c997 vtscsi_sg_append_scsi_buf(struct vtscsi_softc *sc, struct sglist *sg, in vtscsi_sg_append_scsi_buf() argument
1009 error = sglist_append(sg, csio->data_ptr, csio->dxfer_len); in vtscsi_sg_append_scsi_buf()
1012 error = sglist_append_phys(sg, in vtscsi_sg_append_scsi_buf()
1018 error = sglist_append(sg, in vtscsi_sg_append_scsi_buf()
1025 error = sglist_append_phys(sg, in vtscsi_sg_append_scsi_buf()
1030 error = sglist_append_bio(sg, (struct bio *) csio->data_ptr); in vtscsi_sg_append_scsi_buf()
1044 struct sglist *sg; in vtscsi_fill_scsi_cmd_sglist() local
1051 sg = sc->vtscsi_sglist; in vtscsi_fill_scsi_cmd_sglist()
1057 sglist_reset(sg); in vtscsi_fill_scsi_cmd_sglist()
1059 sglist_append(sg, cmd_req, sizeof(struct virtio_scsi_cmd_req)); in vtscsi_fill_scsi_cmd_sglist()
[all …]
/freebsd/sys/dev/iser/
H A Diser_memory.c62 struct scatterlist *sg, *sgl, *next_sg = NULL; in iser_data_buf_aligned_len() local
72 for_each_sg(sgl, sg, data->dma_nents, i) { in iser_data_buf_aligned_len()
76 next_sg = sg_next(sg); in iser_data_buf_aligned_len()
80 end_addr = start_addr + ib_sg_dma_len(ibdev, sg); in iser_data_buf_aligned_len()
112 struct scatterlist *sg = mem->sgl; in iser_reg_dma() local
116 reg->sge.length = ib_sg_dma_len(device->ib_device, &sg[0]); in iser_reg_dma()
117 reg->sge.addr = ib_sg_dma_address(device->ib_device, &sg[0]); in iser_reg_dma()
174 n = ib_map_mr_sg(mr, mem->sg, mem->size, NULL, SIZE_4K); in iser_fast_reg_mr()
/freebsd/sys/dev/aic7xxx/
H A Daic79xx_inline.h250 struct ahd_dma64_seg *sg; in ahd_sg_setup() local
252 sg = (struct ahd_dma64_seg *)sgptr; in ahd_sg_setup()
253 sg->addr = aic_htole64(addr); in ahd_sg_setup()
254 sg->len = aic_htole32(len | (last ? AHD_DMA_LAST_SEG : 0)); in ahd_sg_setup()
255 return (sg + 1); in ahd_sg_setup()
257 struct ahd_dma_seg *sg; in ahd_sg_setup() local
259 sg = (struct ahd_dma_seg *)sgptr; in ahd_sg_setup()
260 sg->addr = aic_htole32(addr & 0xFFFFFFFF); in ahd_sg_setup()
261 sg->len = aic_htole32(len | ((addr >> 8) & 0x7F000000) in ahd_sg_setup()
263 return (sg + 1); in ahd_sg_setup()
[all …]
/freebsd/sys/dev/xdma/controller/
H A Dpl330.c426 pl330_ccr_port_width(struct xdma_sglist *sg, uint32_t *addr) in pl330_ccr_port_width() argument
432 switch (sg->src_width) { in pl330_ccr_port_width()
446 switch (sg->dst_width) { in pl330_ccr_port_width()
467 struct xdma_sglist *sg, uint32_t sg_n) in pl330_channel_submit_sg() argument
498 if (sg[i].direction == XDMA_DEV_TO_MEM) in pl330_channel_submit_sg()
505 err = pl330_ccr_port_width(&sg[i], &reg); in pl330_channel_submit_sg()
511 src_addr_lo = (uint32_t)sg[i].src_addr; in pl330_channel_submit_sg()
512 dst_addr_lo = (uint32_t)sg[i].dst_addr; in pl330_channel_submit_sg()
513 len = (uint32_t)sg[i].len; in pl330_channel_submit_sg()
521 if (sg[i].src_width != sg[i].dst_width) in pl330_channel_submit_sg()
[all …]
/freebsd/sys/dev/mthca/
H A Dmthca_wqe.h117 struct ib_sge *sg) in mthca_set_data_seg() argument
119 dseg->byte_count = cpu_to_be32(sg->length); in mthca_set_data_seg()
120 dseg->lkey = cpu_to_be32(sg->lkey); in mthca_set_data_seg()
121 dseg->addr = cpu_to_be64(sg->addr); in mthca_set_data_seg()
/freebsd/sys/dev/virtio/p9fs/
H A Dvirtio_p9fs.c144 struct sglist *sg; in vt9p_request() local
148 sg = chan->vt9p_sglist; in vt9p_request()
156 sglist_reset(sg); in vt9p_request()
158 error = sglist_append(sg, req->tc->sdata, req->tc->size); in vt9p_request()
164 readable = sg->sg_nseg; in vt9p_request()
166 error = sglist_append(sg, req->rc->sdata, req->rc->capacity); in vt9p_request()
172 writable = sg->sg_nseg - readable; in vt9p_request()
174 error = virtqueue_enqueue(vq, req, sg, readable, writable); in vt9p_request()

1234567