none
NDIS miniport driver, adding a MAC/Ethernet header ? RRS feed

  • Question

  • Following the inputs given by Brian Catlin, I have managed to get the datapath right along with scatter gather (SG) dma allocation and SG list generation. Now, does the net buffer list(NBL) contain the frame header (MAC/Ethernet) when I access the NBL and the net buffer(NB) inside it ? Does the lower levels of the IP layer (ARP,ICMP) creates the header along with the frame ? If I have to append the header then can I just slap the header onto the NBL before I allocate a SG list ? 

    I am a bit confused because when the ARP is sent as a broadcast frame at the beginning, the MAC address is ff:ff:ff:ff:ff:ff:ff. So the ARP resolves the MAC address and the destination MAC address is obtained. So does it mean, the miniport driver has to handle(Add for TX and strip for RX) the MAC header ?


    With regards, Jenson Alex Pais

    Monday, August 1, 2016 9:29 AM

Answers

  • Yes upper layers create the frames, the miniport is there to deal with the hardware.   If you need to move up the stack look at either a protocol driver or a Windows filtering platform driver to modify the packets.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    • Marked as answer by JENSON PAIS Monday, August 1, 2016 10:55 AM
    Monday, August 1, 2016 10:53 AM

All replies

  • The miniport driver does not do this, there is an NDIS protocol driver above the miniport that handles things like this.  The miniport deals in raw packets that already have everything in them.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, August 1, 2016 10:23 AM
  • Hi Don,

    Cheers for the quick reply. So I don't need to write this protocol driver and that NDIS already has it covered ? Explains why there is not much information about on MSDN pages related to pure NDIS miniport driver.



    With regards, Jenson Alex Pais

    Monday, August 1, 2016 10:28 AM
  • Actually, given how small the driver community is, there is a decent amount of documentation, the problem is finding it.  For NDIS start with https://msdn.microsoft.com/en-us/library/windows/hardware/ff565453(v=vs.85).aspx  this is sort of the "top of the tree" as far as the relationship of drivers to one another.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, August 1, 2016 10:36 AM
  • Thanks for the link to the driver stack. Needed it for get the binding right. So that NDIS creates the ethernet frames that miniport driver need to push into the NIC. I only need to deal with the NBL without modifying it ?

    If I need to in the future then I'll to move up the stack to the protocol layer and write a protocol driver ?

    Please correct me if I'm wrong. 


    With regards, Jenson Alex Pais

    Monday, August 1, 2016 10:47 AM
  • Yes upper layers create the frames, the miniport is there to deal with the hardware.   If you need to move up the stack look at either a protocol driver or a Windows filtering platform driver to modify the packets.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    • Marked as answer by JENSON PAIS Monday, August 1, 2016 10:55 AM
    Monday, August 1, 2016 10:53 AM
  • Thanks once again, Don. For now I'll deal with the raw frames and verify if the datapath is right. Then if necessary, I'll look into writing a protocol driver or a filter driver depending on the requirement. 

    With regards, Jenson Alex Pais


    • Edited by JENSON PAIS Tuesday, August 2, 2016 9:53 AM
    Monday, August 1, 2016 10:59 AM