ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

VOID NICWriteData ( PNIC_ADAPTER  Adapter,
ULONG_PTR  Target,
PUCHAR  Source,
USHORT  Length 
)

Definition at line 832 of file 8390.c.

Referenced by NICWritePacket().

{
    USHORT Tmp;

    /* Avoid transfers to odd addresses */
    if (Target & 0x01) {
        /* Read one word */
        NICReadDataAlign(Adapter, &Tmp, Target - 1, 0x02);

        /* Merge LSB with the new byte which become the new MSB */
        Tmp = (Tmp & 0x00FF) | (*Source << 8);

        /* Finally write the value back */
        NICWriteDataAlign(Adapter, Target - 1, &Tmp, 0x02);

        /* Update pointers */
        Source = (PUCHAR) ((ULONG_PTR) Source + 1);
        Target += 1;
        Length--;
    }

    if (Length & 0x01) {
        /* Transfer as many words as we can without exceeding the transfer length */
        Tmp = Length & 0xFFFE;
        NICWriteDataAlign(Adapter, Target, (PUSHORT)Source, Tmp);
        Source += Tmp;
        Target += Tmp;

        /* Read one word */
        NICReadDataAlign(Adapter, &Tmp, Target, 0x02);

        /* Merge MSB with the new byte which become the new LSB */
        Tmp = (Tmp & 0xFF00) | (*Source);

        /* Finally write the value back */
        NICWriteDataAlign(Adapter, Target, &Tmp, 0x02);
    } else
        /* Transfer the rest of the data */
        NICWriteDataAlign(Adapter, Target, (PUSHORT)Source, Length);
}

Generated on Sat May 26 2012 05:23:33 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.