bus_dmamap_load_mbuf change/fix

Andrew Atrens atrens at nortelnetworks.com
Tue Jan 18 00:41:07 PST 2005


All,

Modify bus_dmamap_load_mbuf() to not map zero-length mbuf segments.
This is an optimisation for some wireless drivers (wi) and is required
by others (iwi firmware in particular).

At the moment I'm working around it by adding an m_pullup() in iwi_tx_start,
but this is not optimal. Instead, Matt suggested I go after the root cause.

Cheers,

Andrew.
*** busdma_machdep.c.old	Tue Jan 18 03:25:16 2005
--- busdma_machdep.c	Tue Jan 18 03:27:48 2005
***************
*** 635,645 ****
  		struct mbuf *m;
  
  		for (m = m0; m != NULL && error == 0; m = m->m_next) {
! 			error = _bus_dmamap_load_buffer(dmat,
! 					m->m_data, m->m_len,
! 					curthread, flags, &lastaddr,
! 					&nsegs, first);
! 			first = 0;
  		}
  	} else {
  		error = EINVAL;
--- 635,647 ----
  		struct mbuf *m;
  
  		for (m = m0; m != NULL && error == 0; m = m->m_next) {
! 			if ( m->m_len > 0 ) {
! 				error = _bus_dmamap_load_buffer(dmat,
! 						m->m_data, m->m_len,
! 						curthread, flags, &lastaddr,
! 						&nsegs, first);
! 				first = 0;
! 			}
  		}
  	} else {
  		error = EINVAL;




More information about the Submit mailing list