Lines Matching defs:window

397     rootnex_window_t *window, ddi_dma_cookie_t *cookie, off_t cur_offset);
562 * size of our cookie/window/copybuf state needed in dma bind that we
1822 * break up a window because we're greater than maxxfer, we might as
1824 * worry about triming the window later on for this case.
2242 /* if the first window uses the copy buffer, sync it for the device */
2253 * cookies we return is the number of cookies in the first window.
2324 /* sync the current window before unbinding the buffer */
2332 * cleanup and copy buffer or window state. if we didn't use the copy
2409 rootnex_window_t *window;
2412 window = &dma->dp_window[dma->dp_current_win];
2413 hp->dmai_cookie = window->wd_first_cookie;
2429 rootnex_window_t *window;
2437 window = &dma->dp_window[dma->dp_current_win];
2438 cp = window->wd_first_cookie;
2439 *ccountp = window->wd_cookie_cnt;
2470 rootnex_window_t *window;
2478 window = &dma->dp_window[dma->dp_current_win];
2479 dma->dp_saved_cookies = window->wd_first_cookie;
2480 window->wd_first_cookie = cookiep;
2481 ASSERT(ccount == window->wd_cookie_cnt);
2483 + window->wd_first_cookie;
2504 rootnex_window_t *window;
2516 window = &dma->dp_window[dma->dp_current_win];
2517 cookie_array = window->wd_first_cookie;
2518 window->wd_first_cookie = dma->dp_saved_cookies;
2520 ccount = window->wd_cookie_cnt;
2522 + window->wd_first_cookie;
3259 rootnex_window_t *window;
3330 * code path, we will have at least one window.
3338 window = &dma->dp_window[0];
3341 rootnex_init_win(hp, dma, window, cookie, cur_offset);
3351 * copy buffer, make sure we sync this window during dma_sync.
3357 window->wd_dosync = B_TRUE;
3371 e = rootnex_copybuf_window_boundary(hp, dma, &window,
3381 * new window we just moved to is set to sync.
3384 window->wd_dosync = B_TRUE;
3389 /* if the cookie cnt == max sgllen, move to the next window */
3390 } else if (window->wd_cookie_cnt >=
3393 ASSERT(window->wd_cookie_cnt == attr->dma_attr_sgllen);
3394 e = rootnex_sgllen_window_boundary(hp, dma, &window,
3404 * new window we just moved to is set to sync.
3407 window->wd_dosync = B_TRUE;
3413 } else if ((window->wd_size + dmac_size) >
3416 e = rootnex_maxxfer_window_boundary(hp, dma, &window,
3426 * new window we just moved to is set to sync.
3429 window->wd_dosync = B_TRUE;
3434 /* else this cookie fits in the current window */
3436 window->wd_cookie_cnt++;
3437 window->wd_size += dmac_size;
3447 /* if we ended up with a zero sized window in the end, clean it up */
3448 if (window->wd_size == 0) {
3450 window--;
3453 ASSERT(window->wd_trim.tr_trim_last == B_FALSE);
3564 * Called in bind slowpath to setup the window state. We always have windows
3565 * in the slowpath. Even if the window count = 1.
3588 /* If we don't need to do a partial, we only have one window */
3603 * buffer (a page is the minimum window size so under the right
3604 * attr settings, you could have a window for each page).
3650 * Get space for window and potential copy buffer state. Before we
3716 * we allocate copy buffer state and window state at the same time.
3782 * if we had to allocate window state on the last bind (because we
3793 * Called in bind slow path during creation of a new window. Initializes
3794 * window state to default values.
3799 rootnex_window_t *window, ddi_dma_cookie_t *cookie, off_t cur_offset)
3802 window->wd_dosync = B_FALSE;
3803 window->wd_offset = cur_offset;
3804 window->wd_size = 0;
3805 window->wd_first_cookie = cookie;
3806 window->wd_cookie_cnt = 0;
3807 window->wd_trim.tr_trim_first = B_FALSE;
3808 window->wd_trim.tr_trim_last = B_FALSE;
3809 window->wd_trim.tr_first_copybuf_win = B_FALSE;
3810 window->wd_trim.tr_last_copybuf_win = B_FALSE;
3812 window->wd_remap_copybuf = dma->dp_cb_remaping;
3943 * new window which requires us to re-map the copy
4009 * we switch to a new window which requires a re-map
4083 * the next window and init it. We're done.
4093 /* figure out how much we need to trim from the window */
4101 /* The window's a whole multiple of granularity. We're done */
4111 * The window's not a whole multiple of granularity, since we know this
4114 * window, and then add in the new cookie into the new window.
4126 * first, setup the current window to account for the trim. Need to go
4137 /* save the buffer offsets for the next window */
4142 * set this now in case this is the first window. all other cases are
4148 * initialize the next window using what's left over in the previous
4162 * now go back to the current cookie and add it to the new window. set
4163 * the new window size to the what was left over from the previous
4188 /* save the buffer offsets for the next window */
4192 /* setup the next window */
4208 * Called in bind slowpath when we get to a window boundary because we used
4247 * next window and add the current cookie to it. We know the current
4254 /* Add this cookie to the new window */
4265 /* figure out how much we need to trim from the window */
4274 * if the window's a whole multiple of granularity, go to the next
4275 * window, init it, then add in the current cookie. We know the current
4282 /* Add this cookie to the new window */
4302 * first, setup the current window to account for the trim. Need to go
4304 * the current window, and some of the last cookie will be in the new
4305 * window. All of the current cookie will be in the new window.
4323 * last page in the current window and the first page in the next
4324 * window. Since we are reusing the copy buffer (and KVA space on the
4326 * current window, and the start of the copy buffer in the next window.
4343 /* save the buffer offsets for the next window */
4348 * set this now in case this is the first window. all other cases are
4354 * initialize the next window using what's left over in the previous
4369 * For the first cookie in the new window, we need reset the physical
4388 /* account for the cookie copybuf usage in the new window */
4396 * copybuf window boundary. The complexity had to be in either
4397 * the maxxfer window, or the copybuf window, and I chose the
4430 * add the current cookie to the new window. set the new window size to
4450 * Called in bind slowpath when we get to a window boundary because we will
4476 * if we're not trimming the entire cookie, setup the current window to
4489 * window. All other windows are taken care of in get win
4501 /* initialize the next window */
4543 * will cause us to have at least one window.
4549 /* This window may not need to be sync'd */
4686 * within the window.
4694 * passed in is within the window.
4730 rootnex_window_t *window;
4751 /* If we try and get a window which doesn't exist, return failure */
4761 * window, setup the cookie pointer to the first cookie in the bind.
4780 /* sync the old window before moving on to the new one */
4781 window = &dma->dp_window[dma->dp_current_win];
4782 if ((window->wd_dosync) && (hp->dmai_rflags & DDI_DMA_READ)) {
4789 * before we move to the next window, if we need to re-map, unmap all
4790 * the pages in this window.
4794 * If we switch to this window again, we'll need to map in
4797 window->wd_remap_copybuf = B_TRUE;
4800 * calculate the page index into the buffer where this window
4801 * starts, and the number of pages this window takes up.
4803 pidx = (sinfo->si_buf_offset + window->wd_offset) >>
4805 poff = (sinfo->si_buf_offset + window->wd_offset) &
4807 pcnt = mmu_btopr(window->wd_size + poff);
4810 /* unmap pages which are currently mapped in this window */
4824 * Move to the new window.
4828 window = &dma->dp_window[win];
4831 trim = &window->wd_trim;
4833 window->wd_first_cookie->dmac_laddress = trim->tr_first_paddr;
4834 window->wd_first_cookie->dmac_size = trim->tr_first_size;
4836 window->wd_first_cookie->dmac_type =
4837 (window->wd_first_cookie->dmac_type &
4838 ROOTNEX_USES_COPYBUF) + window->wd_offset;
4863 * setup the cookie pointer to the first cookie in the window. setup
4867 hp->dmai_cookie = window->wd_first_cookie;
4868 *offp = window->wd_offset;
4869 *lenp = window->wd_size;
4870 *ccountp = window->wd_cookie_cnt;
4875 /* re-map copybuf if required for this window */
4879 * window starts.
4881 pidx = (sinfo->si_buf_offset + window->wd_offset) >>
4887 * previous window. Even if the rest of this window is already
4904 if (window->wd_remap_copybuf) {
4905 window->wd_remap_copybuf = B_FALSE;
4907 /* figure out many pages this window takes up */
4908 poff = (sinfo->si_buf_offset + window->wd_offset) &
4910 pcnt = mmu_btopr(window->wd_size + poff);
4935 /* if the new window uses the copy buffer, sync it for the device */
4936 if ((window->wd_dosync) && (hp->dmai_rflags & DDI_DMA_WRITE)) {
5051 rootnex_window_t *window;
5093 /* we have mutiple windows, walk through each window */
5095 window = &dma->dp_window[i];
5097 /* Go through all the cookies in the window */
5098 for (j = 0; j < window->wd_cookie_cnt; j++) {
5100 start_addr = window->wd_first_cookie[j].dmac_laddress;
5101 csize = window->wd_first_cookie[j].dmac_size;
5104 * if we are trimming the first cookie in the window,
5109 if (window->wd_trim.tr_trim_first && (j == 0)) {
5110 start_addr = window->wd_trim.tr_first_paddr;
5111 csize = window->wd_trim.tr_first_size;
5115 * if we are trimming the last cookie in the window,
5120 if (window->wd_trim.tr_trim_last &&
5121 (j == (window->wd_cookie_cnt - 1))) {
5122 start_addr = window->wd_trim.tr_last_paddr;
5123 csize = window->wd_trim.tr_last_size;