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
1817 * break up a window because we're greater than maxxfer, we might as
1819 * worry about triming the window later on for this case.
2237 /* if the first window uses the copy buffer, sync it for the device */
2248 * cookies we return is the number of cookies in the first window.
2319 /* sync the current window before unbinding the buffer */
2327 * cleanup and copy buffer or window state. if we didn't use the copy
2404 rootnex_window_t *window;
2407 window = &dma->dp_window[dma->dp_current_win];
2408 hp->dmai_cookie = window->wd_first_cookie;
2424 rootnex_window_t *window;
2432 window = &dma->dp_window[dma->dp_current_win];
2433 cp = window->wd_first_cookie;
2434 *ccountp = window->wd_cookie_cnt;
2465 rootnex_window_t *window;
2473 window = &dma->dp_window[dma->dp_current_win];
2474 dma->dp_saved_cookies = window->wd_first_cookie;
2475 window->wd_first_cookie = cookiep;
2476 ASSERT(ccount == window->wd_cookie_cnt);
2478 + window->wd_first_cookie;
2499 rootnex_window_t *window;
2511 window = &dma->dp_window[dma->dp_current_win];
2512 cookie_array = window->wd_first_cookie;
2513 window->wd_first_cookie = dma->dp_saved_cookies;
2515 ccount = window->wd_cookie_cnt;
2517 + window->wd_first_cookie;
3254 rootnex_window_t *window;
3325 * code path, we will have at least one window.
3333 window = &dma->dp_window[0];
3336 rootnex_init_win(hp, dma, window, cookie, cur_offset);
3346 * copy buffer, make sure we sync this window during dma_sync.
3352 window->wd_dosync = B_TRUE;
3366 e = rootnex_copybuf_window_boundary(hp, dma, &window,
3376 * new window we just moved to is set to sync.
3379 window->wd_dosync = B_TRUE;
3384 /* if the cookie cnt == max sgllen, move to the next window */
3385 } else if (window->wd_cookie_cnt >=
3388 ASSERT(window->wd_cookie_cnt == attr->dma_attr_sgllen);
3389 e = rootnex_sgllen_window_boundary(hp, dma, &window,
3399 * new window we just moved to is set to sync.
3402 window->wd_dosync = B_TRUE;
3408 } else if ((window->wd_size + dmac_size) >
3411 e = rootnex_maxxfer_window_boundary(hp, dma, &window,
3421 * new window we just moved to is set to sync.
3424 window->wd_dosync = B_TRUE;
3429 /* else this cookie fits in the current window */
3431 window->wd_cookie_cnt++;
3432 window->wd_size += dmac_size;
3442 /* if we ended up with a zero sized window in the end, clean it up */
3443 if (window->wd_size == 0) {
3445 window--;
3448 ASSERT(window->wd_trim.tr_trim_last == B_FALSE);
3559 * Called in bind slowpath to setup the window state. We always have windows
3560 * in the slowpath. Even if the window count = 1.
3583 /* If we don't need to do a partial, we only have one window */
3598 * buffer (a page is the minimum window size so under the right
3599 * attr settings, you could have a window for each page).
3645 * Get space for window and potential copy buffer state. Before we
3711 * we allocate copy buffer state and window state at the same time.
3777 * if we had to allocate window state on the last bind (because we
3788 * Called in bind slow path during creation of a new window. Initializes
3789 * window state to default values.
3794 rootnex_window_t *window, ddi_dma_cookie_t *cookie, off_t cur_offset)
3797 window->wd_dosync = B_FALSE;
3798 window->wd_offset = cur_offset;
3799 window->wd_size = 0;
3800 window->wd_first_cookie = cookie;
3801 window->wd_cookie_cnt = 0;
3802 window->wd_trim.tr_trim_first = B_FALSE;
3803 window->wd_trim.tr_trim_last = B_FALSE;
3804 window->wd_trim.tr_first_copybuf_win = B_FALSE;
3805 window->wd_trim.tr_last_copybuf_win = B_FALSE;
3807 window->wd_remap_copybuf = dma->dp_cb_remaping;
3938 * new window which requires us to re-map the copy
4004 * we switch to a new window which requires a re-map
4078 * the next window and init it. We're done.
4088 /* figure out how much we need to trim from the window */
4096 /* The window's a whole multiple of granularity. We're done */
4106 * The window's not a whole multiple of granularity, since we know this
4109 * window, and then add in the new cookie into the new window.
4121 * first, setup the current window to account for the trim. Need to go
4132 /* save the buffer offsets for the next window */
4137 * set this now in case this is the first window. all other cases are
4143 * initialize the next window using what's left over in the previous
4157 * now go back to the current cookie and add it to the new window. set
4158 * the new window size to the what was left over from the previous
4183 /* save the buffer offsets for the next window */
4187 /* setup the next window */
4203 * Called in bind slowpath when we get to a window boundary because we used
4242 * next window and add the current cookie to it. We know the current
4249 /* Add this cookie to the new window */
4260 /* figure out how much we need to trim from the window */
4269 * if the window's a whole multiple of granularity, go to the next
4270 * window, init it, then add in the current cookie. We know the current
4277 /* Add this cookie to the new window */
4297 * first, setup the current window to account for the trim. Need to go
4299 * the current window, and some of the last cookie will be in the new
4300 * window. All of the current cookie will be in the new window.
4318 * last page in the current window and the first page in the next
4319 * window. Since we are reusing the copy buffer (and KVA space on the
4321 * current window, and the start of the copy buffer in the next window.
4338 /* save the buffer offsets for the next window */
4343 * set this now in case this is the first window. all other cases are
4349 * initialize the next window using what's left over in the previous
4364 * For the first cookie in the new window, we need reset the physical
4383 /* account for the cookie copybuf usage in the new window */
4391 * copybuf window boundary. The complexity had to be in either
4392 * the maxxfer window, or the copybuf window, and I chose the
4425 * add the current cookie to the new window. set the new window size to
4445 * Called in bind slowpath when we get to a window boundary because we will
4471 * if we're not trimming the entire cookie, setup the current window to
4484 * window. All other windows are taken care of in get win
4496 /* initialize the next window */
4538 * will cause us to have at least one window.
4544 /* This window may not need to be sync'd */
4681 * within the window.
4689 * passed in is within the window.
4725 rootnex_window_t *window;
4746 /* If we try and get a window which doesn't exist, return failure */
4756 * window, setup the cookie pointer to the first cookie in the bind.
4775 /* sync the old window before moving on to the new one */
4776 window = &dma->dp_window[dma->dp_current_win];
4777 if ((window->wd_dosync) && (hp->dmai_rflags & DDI_DMA_READ)) {
4784 * before we move to the next window, if we need to re-map, unmap all
4785 * the pages in this window.
4789 * If we switch to this window again, we'll need to map in
4792 window->wd_remap_copybuf = B_TRUE;
4795 * calculate the page index into the buffer where this window
4796 * starts, and the number of pages this window takes up.
4798 pidx = (sinfo->si_buf_offset + window->wd_offset) >>
4800 poff = (sinfo->si_buf_offset + window->wd_offset) &
4802 pcnt = mmu_btopr(window->wd_size + poff);
4805 /* unmap pages which are currently mapped in this window */
4819 * Move to the new window.
4823 window = &dma->dp_window[win];
4826 trim = &window->wd_trim;
4828 window->wd_first_cookie->dmac_laddress = trim->tr_first_paddr;
4829 window->wd_first_cookie->dmac_size = trim->tr_first_size;
4831 window->wd_first_cookie->dmac_type =
4832 (window->wd_first_cookie->dmac_type &
4833 ROOTNEX_USES_COPYBUF) + window->wd_offset;
4858 * setup the cookie pointer to the first cookie in the window. setup
4862 hp->dmai_cookie = window->wd_first_cookie;
4863 *offp = window->wd_offset;
4864 *lenp = window->wd_size;
4865 *ccountp = window->wd_cookie_cnt;
4870 /* re-map copybuf if required for this window */
4874 * window starts.
4876 pidx = (sinfo->si_buf_offset + window->wd_offset) >>
4882 * previous window. Even if the rest of this window is already
4899 if (window->wd_remap_copybuf) {
4900 window->wd_remap_copybuf = B_FALSE;
4902 /* figure out many pages this window takes up */
4903 poff = (sinfo->si_buf_offset + window->wd_offset) &
4905 pcnt = mmu_btopr(window->wd_size + poff);
4930 /* if the new window uses the copy buffer, sync it for the device */
4931 if ((window->wd_dosync) && (hp->dmai_rflags & DDI_DMA_WRITE)) {
5046 rootnex_window_t *window;
5088 /* we have mutiple windows, walk through each window */
5090 window = &dma->dp_window[i];
5092 /* Go through all the cookies in the window */
5093 for (j = 0; j < window->wd_cookie_cnt; j++) {
5095 start_addr = window->wd_first_cookie[j].dmac_laddress;
5096 csize = window->wd_first_cookie[j].dmac_size;
5099 * if we are trimming the first cookie in the window,
5104 if (window->wd_trim.tr_trim_first && (j == 0)) {
5105 start_addr = window->wd_trim.tr_first_paddr;
5106 csize = window->wd_trim.tr_first_size;
5110 * if we are trimming the last cookie in the window,
5115 if (window->wd_trim.tr_trim_last &&
5116 (j == (window->wd_cookie_cnt - 1))) {
5117 start_addr = window->wd_trim.tr_last_paddr;
5118 csize = window->wd_trim.tr_last_size;