Skip to content

Commit

Permalink
better way to convert UINT32 to PCHAR
Browse files Browse the repository at this point in the history
  • Loading branch information
maage committed Sep 21, 2015
1 parent aff99e6 commit 745c774
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions common/rtusb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,21 +472,21 @@ NTSTATUS RTUSBWriteMACRegister(
IN BOOLEAN bWriteHigh)
{
NTSTATUS Status;
UINT32 localVal;
UCHAR localValue[4];

localVal = Value;
memcpy(localValue, &Value, sizeof(UINT32));

/* MT76xx HW has 4 byte alignment constrained */
if (IS_MT76xx(pAd)) {
Status = RTUSBMultiWrite_nBytes(
pAd,
Offset,
&Value,
(PUCHAR)&localValue,
4,
4);
} else {
Status = RTUSBSingleWrite(pAd, Offset, (USHORT)(localVal & 0xffff), bWriteHigh);
Status = RTUSBSingleWrite(pAd, Offset + 2, (USHORT)((localVal & 0xffff0000) >> 16), bWriteHigh);
Status = RTUSBSingleWrite(pAd, Offset, (USHORT)(Value & 0xffff), bWriteHigh);
Status = RTUSBSingleWrite(pAd, Offset + 2, (USHORT)((Value & 0xffff0000) >> 16), bWriteHigh);
}

return Status;
Expand Down

0 comments on commit 745c774

Please sign in to comment.