Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228021
b: refs/heads/master
c: d2b0745
h: refs/heads/master
i:
  228019: 6ad6634
v: v3
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Nov 10, 2010
1 parent b6351e5 commit fa2468b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 019bd3f825a7fc438b1e9ce7d145b03f13102aee
refs/heads/master: d2b07455b85d20c72e4182fe7d53d8c70838f984
35 changes: 17 additions & 18 deletions trunk/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,10 +1017,9 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
struct ft1000_device *pFt1000Dev = pInfo->pFt1000Dev;


int i, count, ret;
USHORT *pTemp;
USHORT checksum;
int count, ret;
u8 *t;
struct pseudo_hdr hdr;

if (!pInfo->CardReady)
{
Expand All @@ -1044,21 +1043,21 @@ static int ft1000_copy_down_pkt (struct net_device *netdev, u8 *packet, u16 len)
if ( count % 4)
count = count + (4- (count %4) );

pTemp = (PUSHORT)&(pFt1000Dev->tx_buf[0]);
*pTemp ++ = ntohs(count);
*pTemp ++ = 0x1020;
*pTemp ++ = 0x2010;
*pTemp ++ = 0x9100;
*pTemp ++ = 0;
*pTemp ++ = 0;
*pTemp ++ = 0;
pTemp = (PUSHORT)&(pFt1000Dev->tx_buf[0]);
checksum = *pTemp ++;
for (i=1; i<7; i++)
{
checksum ^= *pTemp ++;
}
*pTemp++ = checksum;
memset(&hdr, 0, sizeof(struct pseudo_hdr));

hdr.length = ntohs(count);
hdr.source = 0x10;
hdr.destination = 0x20;
hdr.portdest = 0x20;
hdr.portsrc = 0x10;
hdr.sh_str_id = 0x91;
hdr.control = 0x00;

hdr.checksum = hdr.length ^ hdr.source ^ hdr.destination ^
hdr.portdest ^ hdr.portsrc ^ hdr.sh_str_id ^
hdr.control;

memcpy(&pFt1000Dev->tx_buf[0], &hdr, sizeof(hdr));
memcpy(&(pFt1000Dev->tx_buf[sizeof(struct pseudo_hdr)]), packet, len);

netif_stop_queue(netdev);
Expand Down

0 comments on commit fa2468b

Please sign in to comment.