windows - Equivalent API to MmGetPhysicalAddress in WEC7 -
i porting windows 7 network driver code wec7. got stuck api mmgetphysicaladdress. didn't find equivalent api in wec7. can proceed further..
pnet_buffer os_buf = net_buffer_list_first_nb((pnet_buffer_list)skb->wb_os_buf); pmdl pmdl = net_buffer_first_mdl(os_buf); ulong length = 0; int8_t *data = null; physical_address addr; ndisquerymdl(pmdl, &data, &length, normalpagepriority); addr = mmgetphysicaladdress(data); skb->wb_mapped_paddr_lo[0] = addr.lowpart + net_buffer_data_offset(os_buf); how can port last line of above code wec7?
thanks.
mmgetphysicaladdress not available in windows ce, don't need anyway.
somewhere in initializehandlerex callback, driver should calling ndismallocatesharedmemory allocate rx/tx buffers.
ndismallocatesharedmemory returns both virtual , physical address of allocated buffer, can keep physical address around, , there won't need request os.
normally physical address kept in driver-specific, per-buffer structure along virtual buffer address.
you can find sample implementation of in c:\wince700\public\common\oak\drivers\netcard\e100bex\60. in mp_init.c, notice how nicallocadaptermemory calls ndismallocatesharedmemory , stores physical address of each buffer in pmptxbuf->bufferpa.
Comments
Post a Comment