DragonFly BSD
DragonFly submit List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

bus_dmamap_load_mbuf change/fix


From: Andrew Atrens <atrens@xxxxxxxxxxxxxxxxxx>
Date: Tue, 18 Jan 2005 03:41:07 -0500

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;


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]